diff --git a/check_process b/check_process index 432896c..ac78f5c 100644 --- a/check_process +++ b/check_process @@ -1,25 +1,27 @@ -# See here for more informations -# https://github.com/YunoHost/package_check#syntax-check_process-file - -# Move this file from check_process.default to check_process when you have filled it. - ;; Test complet ; Manifest - domain="domain.tld" (DOMAIN) - path="/path" (PATH) - admin="john" (USER) + domain="domain.tld" + path="/path" + admin="john" + language="fr" + is_public=1 + password="1Strong-Password" ; Checks pkg_linter=1 setup_sub_dir=1 setup_root=1 setup_nourl=0 - setup_private=0 + setup_private=1 setup_public=1 upgrade=1 + #upgrade=1 from_commit=CommitHash backup_restore=1 multi_instance=1 - port_already_use=0 - change_url=0 + change_url=1 ;;; Options -Email=anmol@datamol.org -Notification=change +Email= +Notification=none +;;; Upgrade options + ; commit=CommitHash + name=Name and date of the commit. + manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666& diff --git a/conf/app.src b/conf/app.src index 41cb246..8d2504e 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,6 +1,5 @@ -SOURCE_URL=https://github.com/YOURLS/YOURLS/archive/1.8.1.zip -SOURCE_SUM=c67eb7bf717de677d8a03d8be2cc0a505810252a75bcc00c3d6717c4d0ad7123 +SOURCE_URL=https://github.com/YOURLS/YOURLS/archive/1.8.2.zip +SOURCE_SUM=155e3e223b698bd3d0ab3f90d988b51c74f727fd46db144ca950a693d5dedba6 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=true -SOURCE_FILENAME= diff --git a/conf/config-sample.php b/conf/config-sample.php new file mode 100644 index 0000000..2d99f9f --- /dev/null +++ b/conf/config-sample.php @@ -0,0 +1,97 @@ + 'password', + // 'username2' => 'password2', + // You can have one or more 'login'=>'password' lines +]; + +/** URL shortening method: either 36 or 62 + ** 36: generates all lowercase keywords (ie: 13jkm) + ** 62: generates mixed case keywords (ie: 13jKm or 13JKm) + ** For more information, see https://yourls.org/urlconvert */ +define( 'YOURLS_URL_CONVERT', 36 ); + +/** Debug mode to output some internal information + ** Default is false for live site. Enable when coding or before submitting a new issue */ +define( 'YOURLS_DEBUG', false ); + +/** +* Reserved keywords (so that generated URLs won't match them) +* Define here negative, unwanted or potentially misleading keywords. +*/ +$yourls_reserved_URL = [ + 'porn', 'faggot', 'sex', 'nigger', 'fuck', 'cunt', 'dick', +]; + +/* + ** Personal settings would go after here. + */ + +//define( 'LDAPAUTH_HOST', 'localhost' ); +//define( 'LDAPAUTH_PORT', '389' ); +//define( 'LDAPAUTH_BASE', 'dc=yunohost,dc=org' ); +//define( 'LDAPAUTH_USERNAME_FIELD', 'uid'); +//require_once(dirname(__DIR__) . '/includes/functions-auth.php'); diff --git a/conf/config.php b/conf/config.php deleted file mode 100644 index 503af1a..0000000 --- a/conf/config.php +++ /dev/null @@ -1,93 +0,0 @@ -}t tag +; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t ; %T: time the log has been written (the request has finished) ; it can accept a strftime(3) format: ; %d/%b/%Y:%H:%M:%S %z (default) +; The strftime(3) format must be encapsuled in a %{}t tag +; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t ; %u: remote user ; ; Default: "%R - %u %t \"%m %r\" %s" ;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%" - + ; The log file for slow requests ; Default Value: not set ; Note: slowlog is mandatory if request_slowlog_timeout is set -slowlog = /var/log/nginx/__NAMETOCHANGE__.slow.log - +;slowlog = log/$pool.log.slow + ; The timeout for serving a single request after which a PHP backtrace will be ; dumped to the 'slowlog' file. A value of '0s' means 'off'. ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) ; Default Value: 0 -request_slowlog_timeout = 5s - +;request_slowlog_timeout = 0 + ; The timeout for serving a single request after which the worker process will ; be killed. This option should be used when the 'max_execution_time' ini option ; does not stop script execution for some reason. A value of '0' means 'off'. ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) ; Default Value: 0 request_terminate_timeout = 1d - + ; Set open file descriptor rlimit. ; Default Value: system defined value ;rlimit_files = 1024 - + ; Set max core size rlimit. ; Possible Values: 'unlimited' or an integer greater or equal to 0 ; Default Value: system defined value ;rlimit_core = 0 - + ; Chroot to this directory at the start. This value must be defined as an ; absolute path. When this value is not set, chroot is not used. ; Note: you can prefix with '$prefix' to chroot to the pool prefix or one ; of its subdirectories. If the pool prefix is not set, the global prefix ; will be used instead. -; Note: chrooting is a great security feature and should be used whenever +; Note: chrooting is a great security feature and should be used whenever ; possible. However, all PHP paths will be relative to the chroot ; (error_log, sessions.save_path, ...). ; Default Value: not set @@ -347,16 +365,25 @@ chdir = __FINALPATH__ ; Note: on highloaded environement, this can cause some delay in the page ; process time (several ms). ; Default Value: no -catch_workers_output = yes +;catch_workers_output = yes + +; Clear environment in FPM workers +; Prevents arbitrary environment variables from reaching FPM worker processes +; by clearing the environment in workers before env vars specified in this +; pool configuration are added. +; Setting to "no" will make all environment variables available to PHP code +; via getenv(), $_ENV and $_SERVER. +; Default Value: yes +;clear_env = no ; Limits the extensions of the main script FPM will allow to parse. This can ; prevent configuration mistakes on the web server side. You should only limit ; FPM to .php extensions to prevent malicious users to use other extensions to -; exectute php code. +; execute php code. ; Note: set an empty value to allow all extensions. ; Default Value: .php -;security.limit_extensions = .php .php3 .php4 .php5 - +;security.limit_extensions = .php .php3 .php4 .php5 .php7 + ; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from ; the current environment. ; Default Value: clean env @@ -370,7 +397,7 @@ catch_workers_output = yes ; overwrite the values previously defined in the php.ini. The directives are the ; same as the PHP SAPI: ; php_value/php_flag - you can set classic ini defines which can -; be overwritten from PHP call 'ini_set'. +; be overwritten from PHP call 'ini_set'. ; php_admin_value/php_admin_flag - these directives won't be overwritten by ; PHP call 'ini_set' ; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no. @@ -391,14 +418,13 @@ catch_workers_output = yes ;php_admin_flag[log_errors] = on ;php_admin_value[memory_limit] = 32M - ; Common values to change to increase file upload limit -; upload_max_filesize = 50M -; post_max_size = 50M -; mail.add_x_header = Off +; php_admin_value[upload_max_filesize] = 50M +; php_admin_value[post_max_size] = 50M +; php_admin_flag[mail.add_x_header] = Off ; Other common parameters -; max_execution_time = 600 -; max_input_time = 300 -; memory_limit = 256M -; short_open_tag = On +; php_admin_value[max_execution_time] = 600 +; php_admin_value[max_input_time] = 300 +; php_admin_value[memory_limit] = 256M +; php_admin_flag[short_open_tag] = On diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md new file mode 100644 index 0000000..0098504 --- /dev/null +++ b/doc/DESCRIPTION.md @@ -0,0 +1 @@ +YOURLS stands for Your Own URL Shortener. It is a small set of PHP scripts that will allow you to run your own URL shortening service (a la TinyURL or bitly). \ No newline at end of file diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md new file mode 100644 index 0000000..e69de29 diff --git a/manifest.json b/manifest.json index 409a9aa..aba71e0 100644 --- a/manifest.json +++ b/manifest.json @@ -6,22 +6,30 @@ "en": "URL shortening service", "fr": "Service de raccourcisseur d'URL" }, - "version": "1.8.1~ynh1", - "url": "https://github.com/YOURLS/YOURLS", + "version": "1.8.2~ynh1", + "url": "https://yourls.org/", "license": "MIT", + "upstream": { + "license": "MIT", + "website": "https://yourls.org/", + "demo": "https://yourls.org/cookie+", + "admindoc": "https://yunohost.org/packaging_apps", + "userdoc": "https://yunohost.org/apps", + "code": "ttps://github.com/YOURLS/YOURLS" + }, "maintainer": { "name": "Anmol Sharma", "email": "anmol@datamol.org", "url": "" }, - "requirements": { - "yunohost": ">= 4.1.7" - }, "previous_maintainers": { "name": "courgette", "email": "courgette@farcie.fr", "url": "http://thomaslebeau.fr" }, + "requirements": { + "yunohost": ">= 4.3.0" + }, "multi_instance": true, "services": [ "nginx", @@ -32,8 +40,7 @@ "install" : [ { "name": "domain", - "type": "domain", - "example": "domain.org" + "type": "domain" }, { "name": "path", @@ -43,8 +50,7 @@ }, { "name": "admin", - "type": "user", - "example": "johndoe" + "type": "user" } ] } diff --git a/scripts/_common.sh b/scripts/_common.sh index 168a47a..4905daf 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -7,7 +7,7 @@ YNH_PHP_VERSION="7.3" # dependencies used by the app -extra_php_dependencies="php${YNH_PHP_VERSION}-gmp php${YNH_PHP_VERSION}-bcmath php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-xml php-pear" +pkg_dependencies="php${YNH_PHP_VERSION}-gmp php${YNH_PHP_VERSION}-bcmath php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-xml php-pear" #================================================= # PERSONAL HELPERS diff --git a/scripts/backup b/scripts/backup index fe1f3d0..742dee5 100644 --- a/scripts/backup +++ b/scripts/backup @@ -63,4 +63,4 @@ ynh_mysql_dump_db --database="$db_name" > db.sql # END OF SCRIPT #================================================= -ynh_print_info --message="Backup script completed for YOURLS. (YunoHost will then actually copy those files to the archive)." +ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." diff --git a/scripts/install b/scripts/install index 5a3de2d..d123fa0 100644 --- a/scripts/install +++ b/scripts/install @@ -26,6 +26,7 @@ ynh_abort_if_errors domain=$YNH_APP_ARG_DOMAIN path_url=$YNH_APP_ARG_PATH admin=$YNH_APP_ARG_ADMIN +random=$(ynh_string_random 24) app=$YNH_APP_INSTANCE_NAME @@ -49,6 +50,21 @@ 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 +#================================================= +# INSTALL DEPENDENCIES +#================================================= +ynh_script_progression --message="Installing dependencies..." --weight=1 + +ynh_install_app_dependencies $pkg_dependencies + +#================================================= +# CREATE DEDICATED USER +#================================================= +ynh_script_progression --message="Configuring system user..." --weight=1 + +# Create a system user +ynh_system_user_create --username=$app --home_dir="$final_path" + #================================================= # CREATE A MYSQL DATABASE #================================================= @@ -68,21 +84,18 @@ 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" +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" + #================================================= # NGINX CONFIGURATION #================================================= ynh_script_progression --message="Configuring NGINX web server..." --weight=2 +# Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# CREATE DEDICATED USER -#================================================= -ynh_script_progression --message="Configuring system user..." --weight=1 - -# Create a system user -ynh_system_user_create --username=$app - #================================================= # PHP-FPM CONFIGURATION #================================================= @@ -96,31 +109,20 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) cp ../conf/index.php $final_path/ #================================================= -# MODIFY A CONFIG FILE #================================================= - -cp ../conf/config.php $final_path/user/config.php - -ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/user/config.php" -ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/user/config.php" -ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/user/config.php" -ynh_replace_string --match_string="__PATH__" --replace_string="${path_url%/}" --target_file="$final_path/user/config.php" -ynh_replace_string --match_string="__RANDOM__" --replace_string="$(ynh_string_random 24)" --target_file="$final_path/user/config.php" - -# Calculate and store the config file checksum into the app settings -ynh_store_file_checksum "$final_path/user/config.php" - -#================================================= -# SECURE FILES AND DIRECTORIES +# ADD A CONFIGURATION #================================================= +ynh_script_progression --message="Adding a configuration file..." --weight=1 -chown -R $app: $final_path -chmod 600 $final_path/user/config.php +ynh_add_config --template="../conf/config-sample.php" --destination="$final_path/user/config.php" + +chmod 600 "$final_path/user/config.php" +chown $app:$app "$final_path/user/config.php" #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Configuring permissions..." --time --weight=1 +ynh_script_progression --message="Configuring permissions..." --weight=1 # unprotected_uris allows SSO credentials to be passed anyway. ynh_permission_update --permission="main" --add="visitors" @@ -138,12 +140,13 @@ ynh_local_curl "admin/install.php" "install=dummy" sleep 10 #================================================= -# SETUP SSOWAT +# RELOAD NGINX #================================================= +ynh_script_progression --message="Reloading NGINX web server..." --weight=1 + ynh_systemd_action --service_name=nginx --action=reload #================================================= # END OF SCRIPT #================================================= - -ynh_script_progression --message="Installation of YOURLS completed" --last +$app completed" --last diff --git a/scripts/remove b/scripts/remove index 010c3f0..fa395fb 100644 --- a/scripts/remove +++ b/scripts/remove @@ -18,6 +18,7 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) db_name=$(ynh_app_setting_get --app=$app --key=db_name) +db_user=$db_name final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= @@ -31,14 +32,7 @@ ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name #================================================= # REMOVE APP MAIN DIR #================================================= - -# Remove the protected_urls -python3 $final_path/remove_sso_conf.py - -#================================================= -# REMOVE APP MAIN DIR -#================================================= -ynh_script_progression --message="Removing YOURLS main directory..." --weight=4 +ynh_script_progression --message="Removing app main directory..." --weight=4 # Remove the app directory securely ynh_secure_remove --file="$final_path" @@ -59,6 +53,14 @@ ynh_script_progression --message="Removing PHP-FPM configuration..." --weight=2 # Remove the dedicated PHP-FPM config ynh_remove_fpm_config +#================================================= +# REMOVE DEPENDENCIES +#================================================= +ynh_script_progression --message="Removing dependencies..." --weight=1 + +# Remove metapackage and its dependencies +ynh_remove_app_dependencies + #================================================= # GENERIC FINALIZATION #================================================= @@ -73,4 +75,4 @@ ynh_system_user_delete --username=$app # END OF SCRIPT #================================================= -ynh_script_progression --message="Removal of YOURLS completed" --last +ynh_script_progression --message="Removal of $app completed" --last diff --git a/scripts/restore b/scripts/restore index 0b3848f..58eae03 100644 --- a/scripts/restore +++ b/scripts/restore @@ -38,19 +38,25 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= ynh_script_progression --message="Validating restoration parameters..." --weight=1 -ynh_webpath_available --domain=$domain --path_url=$path_url \ - || ynh_die --message="Path not available: ${domain}${path_url}" -test ! -d $final_path \ - || ynh_die --message="There is already a directory: $final_path " +test ! -d $final_path || ynh_die --message="There is already a directory: $final_path " #================================================= # STANDARD RESTORATION STEPS #================================================= # RESTORE THE NGINX CONFIGURATION #================================================= +ynh_script_progression --message="Restoring the NGINX configuration..." --weight=1 ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" +#================================================= +# RECREATE THE DEDICATED USER +#================================================= +ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 + +# Create the dedicated user (if not existing) +ynh_system_user_create --username=$app --home_dir="$final_path" + #================================================= # RESTORE THE APP MAIN DIR #================================================= @@ -58,21 +64,9 @@ ynh_script_progression --message="Restoring YOURLS main directory..." --weight=3 ynh_restore_file --origin_path="$final_path" -#================================================= -# RECREATE THE DEDICATED USER -#================================================= -ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 - -# Create the dedicated user (if not existing) -ynh_system_user_create --username=$app - -#================================================= -# RESTORE USER RIGHTS -#================================================= - -# Restore permissions on app files -chown -R $app: $final_path -chmod 600 $final_path/user/config.php +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" #================================================= # RESTORE THE PHP-FPM CONFIGURATION @@ -81,6 +75,16 @@ ynh_script_progression --message="Reconfiguring PHP-FPM..." --weight=10 ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" +#================================================= +# SPECIFIC RESTORATION +#================================================= +# REINSTALL DEPENDENCIES +#================================================= +ynh_script_progression --message="Reinstalling dependencies..." --weight=1 + +# Define and install dependencies +ynh_install_app_dependencies $pkg_dependencies + #================================================= # RESTORE THE MYSQL DATABASE #================================================= @@ -104,4 +108,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Restoration completed for YOURLS" --last +ynh_script_progression --message="Restoration completed for $app" --last diff --git a/scripts/upgrade b/scripts/upgrade index 3c98e9b..aef78a7 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -29,6 +29,20 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) upgrade_type=$(ynh_check_app_version_changed) +#================================================= +# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP +#================================================= +ynh_script_progression --message="Backing up YOURLS before upgrading (may take a while)..." --weight=1 + +# Backup the current version of the app +ynh_backup_before_upgrade +ynh_clean_setup () { + # restore it if the upgrade fails + ynh_restore_upgradebackup +} +# Exit if an error occurs during the execution of the script +ynh_abort_if_errors + #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= @@ -53,97 +67,44 @@ if ynh_legacy_permissions_exists; then fi #================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP +# CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Backing up YOURLS before upgrading (may take a while)..." --weight=1 +ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 -# Backup the current version of the app -ynh_backup_before_upgrade -ynh_clean_setup () { - # restore it if the upgrade fails - ynh_restore_upgradebackup -} -# Exit if an error occurs during the execution of the script -ynh_abort_if_errors +# Create a dedicated user (if not existing) +ynh_system_user_create --username=$app --home_dir="$final_path" -#================================================= -# STANDARD UPGRADE STEPS #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -# Download, check integrity, uncompress and patch the source from app.src -# Create a temporary directory along with /user/plugin sub directory in it -tmpdir="$(mktemp -d)" -mkdir -p "$tmpdir/user/" -# Backup the app files in the temp dir -cp -a "$final_path/index.php" "$tmpdir" -cp -a "$final_path/.htaccess" "$tmpdir" -cp -a "$final_path/user/config.php" "$tmpdir/user" +if [ "$upgrade_type" == "UPGRADE_APP" ] +then + ynh_script_progression --message="Upgrading source files..." --weight=1 -# Remove the app directory securely -ynh_secure_remove --file="$final_path" + # Download, check integrity, uncompress and patch the source from app.src + ynh_setup_source --dest_dir="$final_path" --keep="$final_path/user/config.php" +fi -# Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$final_path" - -# Copy the app files from tmp to final_path -cp -a "$tmpdir/index.php" "$final_path" -cp -a "$tmpdir/.htaccess" "$final_path" -cp -a "$tmpdir/user/config.php" "$final_path/user" - -#remove tmp dir -ynh_secure_remove "$tmpdir" +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" #================================================= # NGINX CONFIGURATION #================================================= ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1 +# Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# CREATE DEDICATED USER -#================================================= -ynh_script_progression --message="Making sure dedicated system user exists..." --weight=3 - -# Create a dedicated user (if not existing) -ynh_system_user_create --username=$app - #================================================= # PHP-FPM CONFIGURATION #================================================= ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=4 # Create a dedicated PHP-FPM config -ynh_add_fpm_config --package="$extra_php_dependencies" - -#================================================= -# MODIFY A CONFIG FILE -#================================================= -ynh_script_progression --message="Modifying a config file..." --weight=2 - -# Verify the checksum and backup the file if it's different -ynh_backup_if_checksum_is_different --file="$final_path/user/config.php" - -cp ../conf/config.php $final_path/user/config.php - -ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/user/config.php" -ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/user/config.php" -ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/user/config.php" -ynh_replace_string --match_string="__PATH__" --replace_string="${path_url%/}" --target_file="$final_path/user/config.php" -ynh_replace_string --match_string="__RANDOM__" --replace_string="$(ynh_string_random 24)" --target_file="$final_path/user/config.php" - -# Recalculate and store the config file checksum into the app settings -ynh_store_file_checksum --file="$final_path/user/config.php" - -#================================================= -# SECURE FILES AND DIRECTORIES -#================================================= - -# Restore permissions on app files -chown -R $app: $final_path -chmod 600 $final_path/user/config.php +ynh_add_fpm_config #================================================= # RELOAD NGINX @@ -156,4 +117,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Upgrade of YOURLS completed" --last +ynh_script_progression --message="Upgrade of $app completed" --last