From 94421d5495013b19baa2682a064935715842140a Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 5 Apr 2022 20:40:30 +0200 Subject: [PATCH] Fix --- conf/{poller-cron => cron} | 0 conf/htconfig.sample.php | 2 +- conf/nginx.conf | 1 - scripts/_common.sh | 5 +---- scripts/install | 15 +++++++++------ 5 files changed, 11 insertions(+), 12 deletions(-) rename conf/{poller-cron => cron} (100%) diff --git a/conf/poller-cron b/conf/cron similarity index 100% rename from conf/poller-cron rename to conf/cron diff --git a/conf/htconfig.sample.php b/conf/htconfig.sample.php index 4a7e04f9..3516184b 100644 --- a/conf/htconfig.sample.php +++ b/conf/htconfig.sample.php @@ -14,7 +14,7 @@ $db_host = 'localhost'; // Use 'localhost' or ':/path/to/socket.file' if you aren't using a remote server $db_port = 0; // leave 0 for default or set your port -$db_user = '__DB_NAME__'; +$db_user = '__DB_USER__'; $db_pass = '__DB_PWD'; $db_data = '__DB_NAME__'; $db_type = 0; // use 1 for postgres, 0 for mysql diff --git a/conf/nginx.conf b/conf/nginx.conf index 38a05f9c..3f7a8f6e 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -10,7 +10,6 @@ location __PATH__/ { client_max_body_size 20m; client_body_buffer_size 128k; - # Default indexes and catch-all index index.php; charset utf-8; diff --git a/scripts/_common.sh b/scripts/_common.sh index 4b5e6787..094cab6f 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -7,10 +7,7 @@ # dependencies used by the app YNH_PHP_VERSION="8.0" -extra_php_dependencies="php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-imagick php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-pgsql php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-gd" - -# dependencies used by the app -pkg_dependencies="postgresql postgresql-contrib" +pkg_dependencies="postgresql php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-imagick php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-pgsql php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-gd" #================================================= # PERSONAL HELPERS diff --git a/scripts/install b/scripts/install index 68779d3d..c65e6e08 100755 --- a/scripts/install +++ b/scripts/install @@ -29,7 +29,7 @@ path_url="/" admin=$YNH_APP_ARG_ADMIN email=$(ynh_user_get_info --username=$admin --key=mail) upload="256M" -random_string="$(ynh_string_random)$(ynh_string_random)$(ynh_string_random)" +random_string=$(ynh_string_random --length=64) database=`expr $YNH_APP_ARG_DATABASE` app=$YNH_APP_INSTANCE_NAME @@ -73,9 +73,7 @@ ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= ynh_script_progression --message="Installing dependencies..." -if [ $database -eq 2 ]; then - ynh_install_app_dependencies $pkg_dependencies -fi +ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -217,10 +215,15 @@ 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) + +#================================================= +# CRON CONFIGURATION +#================================================= # Set up cron job -ynh_add_config --template="../conf/poller-cron" --destination="/etc/cron.d/$app" +ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app" chown root: "/etc/cron.d/$app" chmod 644 "/etc/cron.d/$app"