This commit is contained in:
ericgaspar
2021-12-22 08:30:36 +01:00
parent 1d240652b2
commit b18def9c2e
8 changed files with 18 additions and 40 deletions
+1 -2
View File
@@ -8,9 +8,8 @@ YNH_PHP_VERSION="7.4"
# dependencies used by the app
#pkg_dependencies="phantomjs gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget"
pkg_dependencies="phantomjs"
extra_php_dependencies="php${YNH_PHP_VERSION}-bcmath php${YNH_PHP_VERSION}-gmp php${YNH_PHP_VERSION}-fileinfo php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-pdo php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-gmp php${YNH_PHP_VERSION}-mysql"
pkg_dependencies="phantomjs php${YNH_PHP_VERSION}-bcmath php${YNH_PHP_VERSION}-gmp php${YNH_PHP_VERSION}-fileinfo php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-pdo php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-gmp php${YNH_PHP_VERSION}-mysql"
#=================================================
# PERSONAL HELPERS
+2 -3
View File
@@ -21,7 +21,7 @@ ynh_abort_if_errors
#=================================================
domain=$YNH_APP_ARG_DOMAIN
path_url=$YNH_APP_ARG_PATH
path_url="/"
admin=$YNH_APP_ARG_ADMIN
language=$YNH_APP_ARG_LANGUAGE
is_public=$YNH_APP_ARG_IS_PUBLIC
@@ -115,7 +115,7 @@ ynh_add_nginx_config
ynh_script_progression --message="Configuring PHP-FPM..."
# Create a dedicated php-fpm config
ynh_add_fpm_config --package="$extra_php_dependencies"
ynh_add_fpm_config
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#=================================================
@@ -133,7 +133,6 @@ pushd "$final_path"
popd
ynh_app_setting_set --app=$app --key=app_key --value=$app_key
chmod 400 "$final_path/.env"
chown $app:$app "$final_path/.env"
+9 -9
View File
@@ -32,14 +32,6 @@ ynh_script_progression --message="Removing the MySQL database..."
# Remove a database if it exists, along with the associated user
ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name
#=================================================
# REMOVE DEPENDENCIES
#=================================================
ynh_script_progression --message="Removing dependencies..."
# Remove metapackage and its dependencies
#ynh_remove_app_dependencies
#=================================================
# REMOVE APP MAIN DIR
#=================================================
@@ -61,9 +53,17 @@ ynh_remove_nginx_config
#=================================================
ynh_script_progression --message="Removing PHP-FPM configuration..."
# Remove the dedicated php-fpm config
# Remove the dedicated PHP-FPM config
ynh_remove_fpm_config
#=================================================
# REMOVE DEPENDENCIES
#=================================================
ynh_script_progression --message="Removing dependencies..."
# Remove metapackage and its dependencies
ynh_remove_app_dependencies
#=================================================
# SPECIFIC REMOVE
#=================================================
-7
View File
@@ -33,11 +33,6 @@ db_name=$(ynh_app_setting_get --app=$app --key=db_name)
db_user=$db_name
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#=================================================
# CHECK IF THE APP CAN BE RESTORED
#=================================================
ynh_script_progression --message="Validating restoration parameters..."
#=================================================
# STANDARD RESTORATION STEPS
#=================================================
@@ -73,8 +68,6 @@ ynh_script_progression --message="Restoring the PHP-FPM configuration..."
ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
ynh_add_fpm_config --package="$extra_php_dependencies"
#=================================================
# RESTORE THE MYSQL DATABASE
#=================================================
+3 -10
View File
@@ -21,6 +21,7 @@ path_url=$(ynh_app_setting_get --app=$app --key=path)
admin=$(ynh_app_setting_get --app=$app --key=admin)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
language=$(ynh_app_setting_get --app=$app --key=language)
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
@@ -33,7 +34,6 @@ email_firstname=$(ynh_app_setting_get --app=$app --key=email_firstname)
email_lastname=$(ynh_app_setting_get --app=$app --key=email_lastname)
email=$(ynh_app_setting_get --app=$app --key=email)
#=================================================
# CHECK VERSION
#=================================================
@@ -74,12 +74,6 @@ then
ynh_setup_source --dest_dir="$final_path" --keep=".env"
fi
# FIXME: this should be managed by the core in the future
# Here, as a packager, you may have to tweak the ownerhsip/permissions
# such that the appropriate users (e.g. maybe www-data) can access
# files in some cases.
# But FOR THE LOVE OF GOD, do not allow r/x for "others" on the entire folder -
# this will be treated as a security issue.
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
@@ -107,15 +101,14 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..."
# Create a dedicated nginx config
ynh_add_nginx_config
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#=================================================
# PHP-FPM CONFIGURATION
#=================================================
ynh_script_progression --message="Upgrading PHP-FPM configuration..."
# Create a dedicated php-fpm config
ynh_add_fpm_config --package="$extra_php_dependencies"
# Create a dedicated PHP-FPM config
ynh_add_fpm_config
#=================================================
# UPDATE A CONFIG FILE