diff --git a/.gitignore b/.gitignore deleted file mode 100644 index f248394..0000000 --- a/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -*~ -*.sw[po] diff --git a/README.md b/README.md index 3bc5133..463591d 100644 --- a/README.md +++ b/README.md @@ -18,14 +18,14 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in [AgenDAV](http://agendav.org/) is a CalDAV web client which features an AJAX interface to allow users to manage their own calendars and shared ones. -**Shipped version:** 2.2.0~ynh3 +**Shipped version:** 2.5.0~ynh1 **Demo:** https://demo.yunohost.org/agendav/ ## Documentation and resources * Official app website: -* Official admin documentation: +* Official admin documentation: * Upstream app code repository: * YunoHost documentation for this app: * Report a bug: diff --git a/README_fr.md b/README_fr.md index 69d1071..60a62bf 100644 --- a/README_fr.md +++ b/README_fr.md @@ -18,14 +18,14 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour [AgenDAV](http://agendav.org/) is a CalDAV web client which features an AJAX interface to allow users to manage their own calendars and shared ones. -**Version incluse :** 2.2.0~ynh3 +**Version incluse :** 2.5.0~ynh1 **Démo :** https://demo.yunohost.org/agendav/ ## Documentations et ressources * Site officiel de l'app : -* Documentation officielle de l'admin : +* Documentation officielle de l'admin : * Dépôt de code officiel de l'app : * Documentation YunoHost pour cette app : * Signaler un bug : diff --git a/conf/app.src b/conf/app.src index 7cde575..40ec512 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/adobo/agendav/releases/download/2.2.0/agendav-2.2.0.tar.gz -SOURCE_SUM=0056154ae0a7aa3401f4f24c51f0f2de3d1e97eaa83e74a2129714b67013129f +SOURCE_URL=https://github.com/agendav/agendav/releases/download/2.5.0/agendav-2.5.0.tar.gz +SOURCE_SUM=b0c4c12fdc4272de3e0296403eeea0e5b22af1e83ab6becf7a1eb0eea9e9f48e SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/conf/settings.php b/conf/settings.php index 9173926..9fceca9 100644 --- a/conf/settings.php +++ b/conf/settings.php @@ -2,8 +2,8 @@ /** * Site configuration * - * IMPORTANT: These are YunoHost defaults. Do not change this file, apply your - * changes to local.php. + * IMPORTANT: These are AgenDAV defaults. Do not change this file, apply your + * changes to settings.php */ // Site title @@ -12,6 +12,9 @@ $app['site.title'] = 'YunoHost Calendar'; // Site logo (should be placed in public/img). Optional $app['site.logo'] = 'agendav_100transp.png'; +// Site favicon (should be placed in public/img). Optional +$app['site.favicon'] = 'favicon.ico'; + // Site footer. Optional $app['site.footer'] = 'AgenDAV ' . \AgenDAV\Version::V; @@ -20,9 +23,9 @@ $app['proxies'] = []; // Database settings $app['db.options'] = [ - 'dbname' => '__DBNAME__', - 'user' => '__DBUSER__', - 'password' => '__DBPASS__', + 'dbname' => '__DB_NAME__', + 'user' => '__DB_USER__', + 'password' => '__DB_PWD__', 'host' => 'localhost', 'driver' => 'pdo_mysql' ]; @@ -31,7 +34,10 @@ $app['db.options'] = [ $app['csrf.secret'] = '__ENCRYPTKEY__'; // Log path -$app['log.path'] = '__LOGDIR__/'; +$app['log.path'] = '/var/log/__APP__/'; + +// Logging level +$app['log.level'] = 'INFO'; // Base URL $app['caldav.baseurl'] = '__CALDAV_BASEURL__'; @@ -39,15 +45,21 @@ $app['caldav.baseurl'] = '__CALDAV_BASEURL__'; // Authentication method required by CalDAV server (basic or digest) $app['caldav.authmethod'] = 'basic'; -// Do not verify SSL certificate, it is self signed -$app['caldav.certificate.verify'] = false; - // Whether to show public CalDAV urls $app['caldav.publicurls'] = true; // Whether to show public CalDAV urls $app['caldav.baseurl.public'] = 'https://__CALDAV_DOMAIN__'; +// Connection timeout for CalDAV requests (default: wait forever) +$app['caldav.connect.timeout'] = 0; +// +// Response timeout for CalDAV requests (default: wait forever) +$app['caldav.response.timeout'] = 0; + +// Whether to verify the SSL certificate (default: true) +$app['caldav.certificate.verify'] = false; + // Email attribute name $app['principal.email.attribute'] = '{DAV:}email'; @@ -57,10 +69,23 @@ $app['calendar.sharing'] = false; // Calendar sharing permissions. In case of doubt, do not modify them // These defaults are only useful for DAViCal (http://wiki.davical.org/index.php/Permissions) $app['calendar.sharing.permissions'] = [ - 'owner' => ['{DAV:}all'], - 'read-only' => ['{DAV:}read', '{urn:ietf:params:xml:ns:caldav}read-free-busy'], - 'read-write' => ['{DAV:}read', '{DAV:}write', '{urn:ietf:params:xml:ns:caldav}read-free-busy'], - 'default' => ['{urn:ietf:params:xml:ns:caldav}read-free-busy'] + 'owner' => [ + '{DAV:}all', + '{DAV:}read', + '{DAV:}unlock', + '{DAV:}read-acl', + '{DAV:}read-current-user-privilege-set', + '{DAV:}write-acl', + '{urn:ietf:params:xml:ns:caldav}read-free-busy', + '{DAV:}write', + '{DAV:}write-properties', + '{DAV:}write-content', + '{DAV:}bind', + '{DAV:}unbind' + ], + 'read-only' => [ '{DAV:}read', '{urn:ietf:params:xml:ns:caldav}read-free-busy'], + 'read-write' => [ '{DAV:}read', '{DAV:}write', '{urn:ietf:params:xml:ns:caldav}read-free-busy' ], + 'default' => [ '{urn:ietf:params:xml:ns:caldav}read-free-busy' ] ]; // Default timezone @@ -84,6 +109,18 @@ $app['defaults.date_format'] = 'ymd'; // Default first day of week. Options: 0 (Sunday), 1 (Monday) $app['defaults.weekstart'] = 0; +// Default for showing the week numbers. Options: true/false +$app['defaults.show_week_nb'] = false; + +// Default for showing the "now" indicator, a line on current time. Options: true/false +$app['defaults.show_now_indicator'] = true; +// +// Default number of days covered by the "list" (agenda) view. Allowed values: 7, 14 or 31 +$app['defaults.list_days'] = 7; + +// Default view (month, week, day or list) +$app['defaults.default_view'] = 'month'; + // Logout redirection. Optional $main_domain = exec('cat /etc/yunohost/current_host'); $app['logout.redirection'] = 'https://' . $main_domain . '/yunohost/sso/?action=logout'; @@ -123,7 +160,7 @@ $app['calendar.colors'] = [ * Local configuration */ -$local_config = __DIR__ . '/local.php'; +$local_config = '__FINALPATH__/web/config/local.php'; if (file_exists($local_config)) { require $local_config; } diff --git a/manifest.json b/manifest.json index 7215dfd..abe3701 100644 --- a/manifest.json +++ b/manifest.json @@ -6,13 +6,13 @@ "en": "CalDAV web client", "fr": "Client web pour CalDAV" }, - "version": "2.2.0~ynh3", + "version": "2.5.0~ynh1", "url": "http://agendav.org", "upstream": { "license": "GPL-3.0", "website": "http://agendav.org", "demo": "https://demo.yunohost.org/agendav/", - "admindoc": "http://docs.agendav.org", + "admindoc": "https://agendav.readthedocs.io/", "code": "https://github.com/agendav/agendav" }, "license": "GPL-3.0", diff --git a/scripts/_common.sh b/scripts/_common.sh index 23c6a7b..92977e3 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,10 +4,10 @@ # COMMON VARIABLES #================================================= -YNH_PHP_VERSION="7.3" +php_dependencies="php$YNH_DEFAULT_PHP_VERSION-ctype php$YNH_DEFAULT_PHP_VERSION-curl php$YNH_DEFAULT_PHP_VERSION-mbstring php$YNH_DEFAULT_PHP_VERSION-mcrypt php$YNH_DEFAULT_PHP_VERSION-tokenizer php$YNH_DEFAULT_PHP_VERSION-xml php$YNH_DEFAULT_PHP_VERSION-xmlreader php$YNH_DEFAULT_PHP_VERSION-xmlwriter php$YNH_DEFAULT_PHP_VERSION-mysql" -# dependencies used by the app -pkg_dependencies="php${YNH_PHP_VERSION}-cli" +# dependencies used by the app (must be on a single line) +pkg_dependencies="$php_dependencies" #================================================= # PERSONAL HELPERS diff --git a/scripts/backup b/scripts/backup index 31711d4..f231b75 100644 --- a/scripts/backup +++ b/scripts/backup @@ -14,6 +14,9 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= +ynh_clean_setup () { + true +} # Exit if an error occurs during the execution of the script ynh_abort_if_errors diff --git a/scripts/change_url b/scripts/change_url index 58c7fa5..1160e7e 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -24,7 +24,7 @@ app=$YNH_APP_INSTANCE_NAME #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." +ynh_script_progression --message="Loading installation settings..." --weight=1 # Needed for helper "ynh_add_nginx_config" final_path=$(ynh_app_setting_get --app=$app --key=final_path) @@ -81,7 +81,7 @@ fi #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." +ynh_script_progression --message="Reloading NGINX web server..." --weight=1 ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/install b/scripts/install index 657d863..ee469cf 100644 --- a/scripts/install +++ b/scripts/install @@ -13,6 +13,9 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= +ynh_clean_setup () { + true +} # Exit if an error occurs during the execution of the script ynh_abort_if_errors @@ -29,7 +32,7 @@ app=$YNH_APP_INSTANCE_NAME #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= -ynh_script_progression --message="Validating installation parameters..." +ynh_script_progression --message="Validating installation parameters..." --weight=1 final_path=/var/www/$app test ! -e "$final_path" || ynh_die --message="This path already contains a folder" @@ -74,7 +77,7 @@ ynh_app_setting_set --app=$app --key=language --value=$language #================================================= # INSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Installing dependencies..." +ynh_script_progression --message="Installing dependencies..." --weight=1 ynh_install_app_dependencies $pkg_dependencies @@ -89,7 +92,7 @@ ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= # CREATE A MYSQL DATABASE #================================================= -ynh_script_progression --message="Creating a MySQL database..." +ynh_script_progression --message="Creating a MySQL database..." --weight=1 db_name=$(ynh_sanitize_dbid --db_name=$app) db_user=$db_name @@ -112,7 +115,7 @@ chown -R $app:www-data "$final_path" #================================================= # PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Configuring PHP-FPM..." +ynh_script_progression --message="Configuring PHP-FPM..." --weight=1 # Create a dedicated PHP-FPM config ynh_add_fpm_config @@ -144,23 +147,9 @@ timezone=$(cat /etc/timezone) caldav_domain=$(ynh_app_setting_get --app=$caldav_app --key=domain) caldav_path=$(ynh_app_setting_get --app=$caldav_app --key=path) caldav_url="https://${caldav_domain}${caldav_path%/}" +caldav_baseurl="${caldav_url}${caldav_baseurl}" -conf_path="${final_path}/web/config/settings.php" -cp ../conf/settings.php "$conf_path" - -logdir=/var/log/$app - -ynh_replace_string --match_string="__DBUSER__" --replace_string="$db_name" --target_file="$conf_path" -ynh_replace_string --match_string="__DBPASS__" --replace_string="$db_pwd" --target_file="$conf_path" -ynh_replace_string --match_string="__DBNAME__" --replace_string="$db_name" --target_file="$conf_path" -ynh_replace_string --match_string="__ENCRYPTKEY__" --replace_string="$encryptkey" --target_file="$conf_path" -ynh_replace_string --match_string="__LOGDIR__" --replace_string="$logdir" --target_file="$conf_path" -ynh_replace_string --match_string="__TIMEZONE__" --replace_string="$timezone" --target_file="$conf_path" -ynh_replace_string --match_string="__LANGUAGE__" --replace_string="$language" --target_file="$conf_path" -ynh_replace_string --match_string="__CALDAV_BASEURL__" --replace_string="${caldav_url}${caldav_baseurl}" --target_file="$conf_path" -ynh_replace_string --match_string="__CALDAV_DOMAIN__" --replace_string="$caldav_domain" --target_file="$conf_path" - -ynh_store_file_checksum --file="$conf_path" +ynh_add_config --template="../conf/settings.php" --destination="${final_path}/web/config/settings.php" #================================================= # RUN DATABASE MIGRATIONS (INCLUDES INITIALIZATION) @@ -172,10 +161,6 @@ ynh_script_progression --message="Initialising AgenDAV..." --weight=3 php${phpversion} agendavcli migrations:migrate --no-interaction ) -#================================================= -# SECURE FILES AND DIRECTORIES -#================================================= - chown -R $app:www-data $final_path # Only agendav user should write here @@ -191,10 +176,10 @@ chmod -R 750 ${final_path}/web/config/ #================================================= # SETUP LOGROTATE #================================================= -ynh_script_progression --message="Configuring log rotation..." +ynh_script_progression --message="Configuring log rotation..." --weight=1 -mkdir -p $logdir -chown -R $app: $logdir +mkdir -p /var/log/$app +chown -R $app: /var/log/$app # Use logrotate to manage application logfile(s) ynh_use_logrotate @@ -202,7 +187,7 @@ ynh_use_logrotate #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." +ynh_script_progression --message="Reloading NGINX web server..." --weight=1 ynh_systemd_action --service_name=nginx --action=reload @@ -210,4 +195,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Installation of AgenDAV completed" --last +ynh_script_progression --message="Installation of $app completed" --last diff --git a/scripts/remove b/scripts/remove index 4d9af1e..ad052e3 100644 --- a/scripts/remove +++ b/scripts/remove @@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." +ynh_script_progression --message="Loading installation settings..." --weight=1 app=$YNH_APP_INSTANCE_NAME @@ -24,7 +24,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= # REMOVE LOGROTATE CONFIGURATION #================================================= -ynh_script_progression --message="Removing logrotate configuration..." +ynh_script_progression --message="Removing logrotate configuration..." --weight=1 # Remove the app-specific logrotate config ynh_remove_logrotate @@ -32,7 +32,7 @@ ynh_remove_logrotate #================================================= # REMOVE THE MYSQL DATABASE #================================================= -ynh_script_progression --message="Removing the MySQL database..." +ynh_script_progression --message="Removing the MySQL database..." --weight=1 # Remove a database if it exists, along with the associated user ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name @@ -48,7 +48,7 @@ ynh_secure_remove --file="$final_path" #================================================= # REMOVE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Removing NGINX web server configuration..." +ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 # Remove the dedicated NGINX config ynh_remove_nginx_config @@ -64,7 +64,7 @@ ynh_remove_fpm_config #================================================= # REMOVE DEPENDENCIES #================================================= -ynh_script_progression --message="Removing dependencies..." +ynh_script_progression --message="Removing dependencies..." --weight=1 # Remove metapackage and its dependencies ynh_remove_app_dependencies @@ -74,7 +74,7 @@ ynh_remove_app_dependencies #================================================= # REMOVE VARIOUS FILES #================================================= -ynh_script_progression --message="Removing various files..." +ynh_script_progression --message="Removing various files..." --weight=1 ynh_secure_remove --file="/var/log/$app" @@ -83,7 +83,7 @@ ynh_secure_remove --file="/var/log/$app" #================================================= # REMOVE DEDICATED USER #================================================= -ynh_script_progression --message="Removing the dedicated system user..." +ynh_script_progression --message="Removing the dedicated system user..." --weight=1 # Delete a system user ynh_system_user_delete --username=$app diff --git a/scripts/restore b/scripts/restore index 364f7a4..9de5c66 100644 --- a/scripts/restore +++ b/scripts/restore @@ -14,6 +14,9 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= +ynh_clean_setup () { + true +} # Exit if an error occurs during the execution of the script ynh_abort_if_errors @@ -34,7 +37,7 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # CHECK IF THE APP CAN BE RESTORED #================================================= -ynh_script_progression --message="Validating restoration parameters..." +ynh_script_progression --message="Validating restoration parameters..." --weight=1 test ! -d $final_path \ || ynh_die --message="There is already a directory: $final_path " @@ -52,7 +55,7 @@ ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= # RESTORE THE APP MAIN DIR #================================================= -ynh_script_progression --message="Restoring the app main directory..." +ynh_script_progression --message="Restoring the app main directory..." --weight=1 ynh_restore_file --origin_path="$final_path" @@ -75,7 +78,7 @@ chmod -R 750 ${final_path}/web/config/ #================================================= # REINSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Reinstalling dependencies..." +ynh_script_progression --message="Reinstalling dependencies..." --weight=1 # Define and install dependencies ynh_install_app_dependencies $pkg_dependencies @@ -90,7 +93,7 @@ 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_script_progression --message="Restoring the NGINX web server configuration..." --weight=1 ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" @@ -106,7 +109,7 @@ ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./ #================================================= # RESTORE THE LOGROTATE CONFIGURATION #================================================= -ynh_script_progression --message="Restoring the logrotate configuration..." +ynh_script_progression --message="Restoring the logrotate configuration..." --weight=1 mkdir -p /var/log/$app chown -R $app: /var/log/$app diff --git a/scripts/upgrade b/scripts/upgrade index 78c102a..2e68986 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." +ynh_script_progression --message="Loading installation settings..." --weight=1 app=$YNH_APP_INSTANCE_NAME @@ -21,12 +21,14 @@ path_url=$(ynh_app_setting_get --app=$app --key=path) language=$(ynh_app_setting_get --app=$app --key=language) 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) phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # CHECK VERSION #================================================= -ynh_script_progression --message="Checking version..." +ynh_script_progression --message="Checking version..." --weight=1 upgrade_type=$(ynh_check_app_version_changed) @@ -49,7 +51,7 @@ ynh_abort_if_errors #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= -ynh_script_progression --message="Ensuring downward compatibility..." +ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 # If db_name doesn't exist, create it if [ -z "$db_name" ]; then @@ -70,14 +72,6 @@ if ynh_legacy_permissions_exists; then ynh_app_setting_delete --app=$app --key=is_public fi -#================================================= -# CREATE DEDICATED USER -#================================================= -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" - #================================================= # GET THE CALDAV APP #================================================= @@ -101,16 +95,24 @@ else ynh_die --message="Please install Baïkal or Radicale before AgenDAV." fi +#================================================= +# CREATE DEDICATED USER +#================================================= +ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 + +# Create a dedicated user (if not existing) +ynh_system_user_create --username=$app --home_dir="$final_path" + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= if [ "$upgrade_type" == "UPGRADE_APP" ] then - ynh_script_progression --message="Upgrading source files..." + ynh_script_progression --message="Upgrading source files..." --weight=1 # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path" + ynh_setup_source --dest_dir="$final_path"--keep="web/config/settings.php" fi chmod 750 "$final_path" @@ -120,14 +122,14 @@ chown -R $app:www-data "$final_path" #================================================= # UPGRADE DEPENDENCIES #================================================= -ynh_script_progression --message="Upgrading dependencies..." +ynh_script_progression --message="Upgrading dependencies..." --weight=1 ynh_install_app_dependencies $pkg_dependencies #================================================= # PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading PHP-FPM configuration..." +ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=1 # Create a dedicated PHP-FPM config ynh_add_fpm_config @@ -135,7 +137,7 @@ ynh_add_fpm_config #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading NGINX web server configuration..." +ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1 # Create a dedicated NGINX config ynh_add_nginx_config @@ -157,42 +159,20 @@ timezone=$(cat /etc/timezone) caldav_domain=$(ynh_app_setting_get --app=$caldav_app --key=domain) caldav_path=$(ynh_app_setting_get --app=$caldav_app --key=path) caldav_url="https://${caldav_domain}${caldav_path%/}" +caldav_baseurl="${caldav_url}${caldav_baseurl}" -conf_path="${final_path}/web/config/settings.php" - -ynh_backup_if_checksum_is_different --file="$conf_path" - -cp ../conf/settings.php "$conf_path" - -logdir=/var/log/$app - -ynh_replace_string --match_string="__DBUSER__" --replace_string="$db_name" --target_file="$conf_path" -db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) -ynh_replace_string --match_string="__DBPASS__" --replace_string="$db_pwd" --target_file="$conf_path" -ynh_replace_string --match_string="__DBNAME__" --replace_string="$db_name" --target_file="$conf_path" -ynh_replace_string --match_string="__ENCRYPTKEY__" --replace_string="$encryptkey" --target_file="$conf_path" -ynh_replace_string --match_string="__LOGDIR__" --replace_string="$logdir" --target_file="$conf_path" -ynh_replace_string --match_string="__TIMEZONE__" --replace_string="$timezone" --target_file="$conf_path" -ynh_replace_string --match_string="__LANGUAGE__" --replace_string="$language" --target_file="$conf_path" -ynh_replace_string --match_string="__CALDAV_BASEURL__" --replace_string="${caldav_url}${caldav_baseurl}" --target_file="$conf_path" -ynh_replace_string --match_string="__CALDAV_DOMAIN__" --replace_string="$caldav_domain" --target_file="$conf_path" - -ynh_store_file_checksum --file="$conf_path" +ynh_add_config --template="../conf/settings.php" --destination="${final_path}/web/config/settings.php" #================================================= # RUN DATABASE MIGRATIONS (INCLUDES INITIALIZATION) #================================================= -ynh_script_progression --message="Upgrading AgenDAV..." +ynh_script_progression --message="Upgrading AgenDAV..." --weight=1 ( cd $final_path php${phpversion} agendavcli migrations:migrate --no-interaction ) -#================================================= -# SECURE FILES AND DIRECTORIES -#================================================= - chown -R $app:www-data $final_path # Only agendav user should write here @@ -210,8 +190,8 @@ chmod -R 750 ${final_path}/web/config/ #================================================= ynh_script_progression --message="Upgrading logrotate configuration..." --weight=2 -mkdir -p $logdir -chown -R $app: $logdir +mkdir -p /var/log/$app +chown -R $app: /var/log/$app # Use logrotate to manage application logfile(s) ynh_use_logrotate --non-append @@ -219,7 +199,7 @@ ynh_use_logrotate --non-append #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." +ynh_script_progression --message="Reloading NGINX web server..." --weight=1 ynh_systemd_action --service_name=nginx --action=reload