diff --git a/check_process b/check_process index abac979..ac2ef6b 100644 --- a/check_process +++ b/check_process @@ -2,10 +2,10 @@ ; Manifest domain="domain.tld" path="/path" - is_public=1 + is_public=1 language="fr" admin="john" - service_autodiscovery=1 + service_autodiscovery=1 whups_install=1 sesha_install=1 ansel_install=1 diff --git a/conf/nginx.conf b/conf/nginx.conf index 36efec1..f505be8 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -2,7 +2,7 @@ location __PATH__/ { # Path to source - alias __FINALPATH__/horde/ ; + alias __FINALPATH__/horde/; index index.php; diff --git a/conf/php-fpm.conf b/conf/php-fpm.conf index 2ca53b8..38fbc33 100644 --- a/conf/php-fpm.conf +++ b/conf/php-fpm.conf @@ -41,7 +41,7 @@ listen = /var/run/php/php__PHPVERSION__-fpm-__NAMETOCHANGE__.sock ; Set permissions for unix socket, if one is used. In Linux, read/write ; permissions must be set in order to allow connections from a web server. Many -; BSD-derived systems allow connections regardless of permissions. +; BSD-derived systems allow connections regardless of permissions. ; Default Values: user and group are set as the running user ; mode is set to 0660 listen.owner = www-data @@ -52,7 +52,7 @@ listen.group = www-data ; When set, listen.owner and listen.group are ignored ;listen.acl_users = ;listen.acl_groups = - + ; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect. ; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original ; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address @@ -131,7 +131,7 @@ pm.max_spare_servers = 3 ; Note: Used only when pm is set to 'ondemand' ; Default Value: 10s ;pm.process_idle_timeout = 10s; - + ; The number of requests each child process should execute before respawning. ; This can be useful to work around memory leaks in 3rd party libraries. For ; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. @@ -184,7 +184,7 @@ pm.max_requests = 500 ; ; By default the status page only outputs short status. Passing 'full' in the ; query string will also return status for each pool process. -; Example: +; Example: ; http://www.foo.bar/status?full ; http://www.foo.bar/status?json&full ; http://www.foo.bar/status?html&full @@ -297,7 +297,7 @@ pm.max_requests = 500 ; - .... ; %p: PID of the child that serviced the request ; %P: PID of the parent of the child that serviced the request -; %q: the query string +; %q: the query string ; %Q: the '?' character if query string exists ; %r: the request URI (without the query string, see %q and %Q) ; %R: remote IP address @@ -316,40 +316,40 @@ pm.max_requests = 500 ; ; 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 - + ; 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 - + ; 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 @@ -383,7 +383,7 @@ catch_workers_output = yes ; Note: set an empty value to allow all extensions. ; Default Value: .php ;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 @@ -397,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. diff --git a/manifest.json b/manifest.json index 0f689fe..84023ef 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "A groupware (webmail, adressbook, calendar) that uses PHP", "fr": "Un groupware (webmail, carnet adresses, agenda), utilisant PHP." }, - "version": "5.2.22~ynh4", + "version": "5.2.22~ynh5", "url": "https://www.horde.org/", "upstream": { "license": "LGPL-2.0", @@ -30,7 +30,7 @@ "mysql" ], "arguments": { - "install" : [ + "install": [ { "name": "domain", "type": "domain" @@ -62,12 +62,7 @@ }, { "name": "admin", - "type": "user", - "ask": { - "en": "Choose an admin user", - "fr": "Choisissez l’administrateur" - }, - "example": "johndoe" + "type": "user" }, { "name": "service_autodiscovery", diff --git a/scripts/_common.sh b/scripts/_common.sh index 15f2ff5..10c6a36 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -1,19 +1,16 @@ #!/bin/bash #================================================= -# SET ALL CONSTANTS +# COMMON VARIABLES #================================================= - +# dependencies used by the app +pkg_dependencies="php-pear expect php5-imagick|php-imagick php5-tidy|php-tidy php-bcmath" #================================================= -# DEFINE ALL COMMON FONCTIONS +# PERSONAL HELPERS #================================================= -install_dependance() { - ynh_install_app_dependencies php-pear expect 'php5-imagick|php-imagick' 'php5-tidy|php-tidy' php-bcmath -} - patch_app() { local old_dir=$(pwd) (cd "$final_path/horde" && patch -p1 < $YNH_CWD/../sources/sso_auth.patch) || echo "Unable to apply patches" @@ -95,3 +92,11 @@ set_permission() { chmod u=rwX,g=rwX,o= -R $final_path chmod u=rwX,g=rwX,o= -R $gollem_data_dir } + +#================================================= +# EXPERIMENTAL HELPERS +#================================================= + +#================================================= +# FUTURE OFFICIAL HELPERS +#================================================= diff --git a/scripts/change_url b/scripts/change_url index 3b0fbb9..a4c3c13 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -17,7 +17,7 @@ old_domain=$YNH_APP_OLD_DOMAIN old_path=$YNH_APP_OLD_PATH new_domain=$YNH_APP_NEW_DOMAIN -new_path=$(ynh_normalize_url_path --path_url ${YNH_APP_NEW_PATH:-'/'}) +new_path=$YNH_APP_NEW_PATH app=$YNH_APP_INSTANCE_NAME @@ -35,7 +35,7 @@ port=$(ynh_app_setting_get --app=$app --key=port) secret_key=$(ynh_app_setting_get --app=$app --key=secret_key) service_autodiscovery=$(ynh_app_setting_get --app=$app --key=service_autodiscovery) db_name=$(ynh_app_setting_get --app=$app --key=db_name) -db_user=$(ynh_app_setting_get --app=$app --key=db_user) +db_user=$db_name db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) gollem_data_dir=$(ynh_app_setting_get --app=$app --key=gollem_data_dir) diff --git a/scripts/install b/scripts/install index 140ed0b..172c5c1 100755 --- a/scripts/install +++ b/scripts/install @@ -24,7 +24,7 @@ ynh_abort_if_errors #================================================= domain=$YNH_APP_ARG_DOMAIN -path_url=$(ynh_normalize_url_path --path_url $YNH_APP_ARG_PATH) +path_url=$YNH_APP_ARG_PATH is_public=$YNH_APP_ARG_IS_PUBLIC language=$YNH_APP_ARG_LANGUAGE admin=$YNH_APP_ARG_ADMIN @@ -103,7 +103,7 @@ fi #================================================= ynh_script_progression --message="Installing dependencies..." --weight=7 -install_dependance +ynh_install_app_dependencies $pkg_dependencies #================================================= # CREATE DEDICATED USER @@ -121,7 +121,6 @@ ynh_script_progression --message="Creating a MySQL database..." db_name=$(ynh_sanitize_dbid --db_name=$app) db_user=$db_name ynh_app_setting_set --app=$app --key=db_name --value=$db_name -ynh_app_setting_set --app=$app --key=db_user --value=$db_user ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name #================================================= @@ -138,14 +137,6 @@ 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..." - -# Create a dedicated NGINX config -config_nginx - #================================================= # PHP-FPM CONFIGURATION #================================================= @@ -154,6 +145,14 @@ ynh_script_progression --message="Configuring PHP-FPM..." # Create a dedicated PHP-FPM config ynh_add_fpm_config +#================================================= +# NGINX CONFIGURATION +#================================================= +ynh_script_progression --message="Configuring NGINX web server..." + +# Create a dedicated NGINX config +config_nginx + #================================================= # SPECIFIC SETUP #================================================= diff --git a/scripts/remove b/scripts/remove index 842a6aa..70291b5 100755 --- a/scripts/remove +++ b/scripts/remove @@ -19,7 +19,7 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) port=$(ynh_app_setting_get --app=$app --key=port) db_name=$(ynh_app_setting_get --app=$app --key=db_name) -db_user=$(ynh_app_setting_get --app=$app --key=db_user) +db_user=$db_name final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= diff --git a/scripts/restore b/scripts/restore index 19bdbdd..8512a78 100755 --- a/scripts/restore +++ b/scripts/restore @@ -31,7 +31,7 @@ domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) db_name=$(ynh_app_setting_get --app=$app --key=db_name) -db_user=$(ynh_app_setting_get --app=$app --key=db_user) +db_user=$db_name phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) gollem_data_dir=$(ynh_app_setting_get --app=$app --key=gollem_data_dir) @@ -45,13 +45,6 @@ test ! -d $final_path \ #================================================= # STANDARD RESTORATION STEPS -#================================================= -# RESTORE THE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the NGINX web server configuration..." - -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" - #================================================= # RECREATE THE DEDICATED USER #================================================= @@ -76,14 +69,6 @@ ynh_restore_file --origin_path="$gollem_data_dir" mkdir -p $gollem_data_dir -#================================================= -# RESTORE THE PHP-FPM CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the PHP-FPM configuration..." - -ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" - - #================================================= # SPECIFIC RESTORATION #================================================= @@ -91,8 +76,21 @@ ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" #================================================= ynh_script_progression --message="Reinstalling dependencies..." --weight=5 -install_dependance +ynh_install_app_dependencies $pkg_dependencies +#================================================= +# RESTORE THE PHP-FPM CONFIGURATION +#================================================= +ynh_script_progression --message="Restoring the PHP-FPM configuration..." + +ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" + +#================================================= +# RESTORE THE NGINX CONFIGURATION +#================================================= +ynh_script_progression --message="Restoring the NGINX web server configuration..." + +ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # RESTORE THE MYSQL DATABASE diff --git a/scripts/upgrade b/scripts/upgrade index 6ee3b41..4818ed3 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -19,13 +19,13 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) admin=$(ynh_app_setting_get --app=$app --key=admin) -service_autodiscovery=$(ynh_app_setting_get --app=$app --key=service_autodiscovery) final_path=$(ynh_app_setting_get --app=$app --key=final_path) +db_name=$(ynh_app_setting_get --app=$app --key=db_name) +db_user=$db_name +db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) +service_autodiscovery=$(ynh_app_setting_get --app=$app --key=service_autodiscovery) port=$(ynh_app_setting_get --app=$app --key=port) secret_key=$(ynh_app_setting_get --app=$app --key=secret_key) -db_name=$(ynh_app_setting_get --app=$app --key=db_name) -db_user=$(ynh_app_setting_get --app=$app --key=db_user) -db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) gollem_data_dir=$(ynh_app_setting_get --app=$app --key=gollem_data_dir) #================================================= @@ -64,7 +64,7 @@ if ynh_legacy_permissions_exists; then ynh_app_setting_delete --app=$app --key=is_public fi -# If final_path doesn't exist, create it +# If gollem_data_dir doesn't exist, create it if [ -z "$gollem_data_dir" ]; then gollem_data_dir=/home/yunohost.app/$app ynh_app_setting_set --app=$app --key=gollem_data_dir --value=$gollem_data_dir @@ -77,20 +77,12 @@ ynh_script_progression --message="Making sure dedicated system user exists..." # Create a dedicated user (if not existing) ynh_system_user_create --username=$app --home_dir="$final_path" -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Upgrading NGINX web server configuration..." - -# Create a dedicated NGINX config -config_nginx - #================================================= # UPGRADE DEPENDENCIES #================================================= ynh_script_progression --message="Upgrading dependencies..." -install_dependance +ynh_install_app_dependencies $pkg_dependencies #================================================= # PHP-FPM CONFIGURATION @@ -100,6 +92,14 @@ ynh_script_progression --message="Upgrading PHP-FPM configuration..." # Create a dedicated PHP-FPM config ynh_add_fpm_config +#================================================= +# NGINX CONFIGURATION +#================================================= +ynh_script_progression --message="Upgrading NGINX web server configuration..." + +# Create a dedicated NGINX config +config_nginx + #================================================= # SPECIFIC UPGRADE #=================================================