This commit is contained in:
ericgaspar 2021-12-04 14:08:17 +01:00
parent c6f5cc094d
commit e0d8e6b330
4 changed files with 20 additions and 18 deletions

View file

@ -19,12 +19,12 @@ HASHIDS_SALT=
HASHIDS_LENGTH=8
MAIL_DRIVER=smtp
MAIL_HOST=smtp.example.com
MAIL_HOST=localhost
MAIL_PORT=25
MAIL_USERNAME=
MAIL_PASSWORD=
MAIL_ENCRYPTION=tls
MAIL_FROM=no-reply@example.com
MAIL_FROM=no-reply@__DOMAIN__
QUEUE_HIGH=high
QUEUE_STANDARD=standard

View file

@ -6,7 +6,7 @@ After=redis-server.service
User=__APP__
Group=__APP__
Restart=always
ExecStart=/usr/bin/php __FINALPATH__/artisan queue:work --queue=high,standard,low --sleep=3 --tries=3
ExecStart=/usr/bin/php__PHPVERSION__ __FINALPATH__/artisan queue:work --queue=high,standard,low --sleep=3 --tries=3
[Install]
WantedBy=multi-user.target

View file

@ -7,11 +7,9 @@
# Composer version
YNH_COMPOSER_VERSION="2.1.3"
YNH_PHP_VERSION="7.3"
YNH_PHP_VERSION="8.0"
nodejs_version="14"
pkg_dependencies="libargon2-1 libsodium23 apt-transport-https unzip tar make gcc g++ php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-pdo php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-tokenizer php${YNH_PHP_VERSION}-bcmath php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-zip"
pkg_dependencies="libargon2-1 libsodium23 apt-transport-https unzip tar php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-pdo php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-tokenizer php${YNH_PHP_VERSION}-bcmath php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-zip"
#=================================================
# EXPERIMENTAL HELPERS

View file

@ -32,6 +32,7 @@ language=$YNH_APP_ARG_LANGUAGE
is_public=$YNH_APP_ARG_IS_PUBLIC
password=$YNH_APP_ARG_PASSWORD
email=$(ynh_user_get_info --username=$admin --key=mail)
phpversion=$YNH_PHP_VERSION
app=$YNH_APP_INSTANCE_NAME
@ -54,6 +55,7 @@ ynh_app_setting_set --app=$app --key=domain --value=$domain
ynh_app_setting_set --app=$app --key=path --value=$path_url
ynh_app_setting_set --app=$app --key=admin --value=$admin
ynh_app_setting_set --app=$app --key=language --value=$language
ynh_app_setting_set --app=$app --key=phpversion --value=$phpversion
#=================================================
# FIND AND OPEN A PORT
@ -101,11 +103,6 @@ ynh_app_setting_set --app=$app --key=final_path --value=$final_path
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$final_path"
# Set permissions to app files
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
#=================================================
# NGINX CONFIGURATION
#=================================================
@ -128,33 +125,40 @@ ynh_add_fpm_config
ynh_add_config --template="../conf/.env" --destination="$final_path/.env"
ynh_add_config --template="../conf/wings.service" --destination="/etc/systemd/system/wings.service"
#==============================================
# INSTALL Composer
#==============================================
ynh_script_progression --message="Installing $app with Composer..." --weight=15
ynh_install_composer
ynh_install_composer --install_args="--no-dev --optimize-autoloader"
#==============================================
# Install Pterodactyl
#==============================================
pushd $final_path
chmod -R 755 storage/* bootstrap/cache
#composer install --no-progress
composer install --no-dev --optimize-autoloader
php$phpversion artisan key:generate --force
php$phpversion artisan p:environment:setup
php$phpversion artisan p:environment:database
php$phpversion artisan migrate --seed --force
#php artisan migrate --force
#php artisan db:seed --force
php artisan p:user:make --name-first $admin --name-last $admin --username $admin --email $email --password $password --admin 1
#php artisan p:environment:setup --author=$email --url=https://$domain --timezone=America/New_York --cache=redis --session=database --queue=redis --disable-settings-ui --redis-host=127.0.0.1 --redis-pass= --redis-port=6379
#php artisan migrate --seed --force
popd
# Set permissions to app files
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
#==============================================
# Install Docker
#==============================================