diff --git a/manifest.toml b/manifest.toml index 69312d5..3528c87 100644 --- a/manifest.toml +++ b/manifest.toml @@ -13,7 +13,6 @@ maintainers = ["OniriCorpe"] admindoc = "https://docs.gotosocial.org/en/latest/" code = "https://github.com/superseriousbusiness/gotosocial" cpe = "???" # FIXME: optional but recommended if relevant, this is meant to contain the Common Platform Enumeration, which is sort of a standard id for applications defined by the NIST. In particular, Yunohost may use this is in the future to easily track CVE (=security reports) related to apps. The CPE may be obtained by searching here: https://nvd.nist.gov/products/cpe/search. For example, for Nextcloud, the CPE is 'cpe:2.3:a:nextcloud:nextcloud' (no need to include the version number) -demo = "" fund = "https://github.com/superseriousbusiness/gotosocial#sponsorship--funding" license = "AGPL-3.0-only" userdoc = "https://docs.gotosocial.org/en/latest/" @@ -28,12 +27,12 @@ architectures = [ "armv7", ] disk = "100M" -ldap = "false" +ldap = false multi_instance = true ram.build = "50M" ram.runtime = "200M" -sso = "false" -yunohost = ">= 11.1.2" +sso = false +yunohost = ">= 11.1.6" [install] [install.alpha_software] @@ -42,12 +41,10 @@ ask.fr = "Veuillez noter que GoToSocial est au tout début de son développment. type = "display_text" [install.domain] -# this is a generic question - ask strings are automatically handled by Yunohost's core full_domain = true type = "domain" [install.admin] -# this is a generic question - ask strings are automatically handled by Yunohost's core example = "johndoe" help.en = "Must be in lower case and without special characters." help.fr = "Doit être en minuscule et sans caractère special." @@ -60,7 +57,6 @@ example = "johndoe@example.com" type = "string" [install.password] -# this is a generic question - ask strings are automatically handled by Yunohost's core help.en = "Must contain: upper case, lower case, number and special character." help.fr = "Il doit contenir : majuscule, minuscule, chiffre et caractère spécial." type = "password" @@ -100,7 +96,6 @@ type = "boolean" main.url = "/" [resources.ports] -main.default = 8095 [resources.apt] packages = "postgresql, postgresql-contrib" diff --git a/scripts/_common.sh b/scripts/_common.sh index 6cf1f26..7661ed3 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,9 +4,6 @@ # COMMON VARIABLES #================================================= -# dependencies used by the app -#REMOVEME? pkg_dependencies="postgresql postgresql-contrib" - #================================================= # PERSONAL HELPERS #================================================= diff --git a/scripts/backup b/scripts/backup index c87dde3..31ad0ab 100755 --- a/scripts/backup +++ b/scripts/backup @@ -14,27 +14,27 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -#REMOVEME? ynh_clean_setup () { +#REMOVEME? #REMOVEME? ynh_clean_setup () { ### Remove this function if there's nothing to clean before calling the remove script. true } # Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors +#REMOVEME? #REMOVEME? ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -#REMOVEME? ynh_print_info --message="Loading installation settings..." +#REMOVEME? #REMOVEME? ynh_print_info --message="Loading installation settings..." -#REMOVEME? app="$YNH_APP_INSTANCE_NAME" +#REMOVEME? #REMOVEME? app="$YNH_APP_INSTANCE_NAME" -#REMOVEME? domain=$(ynh_app_setting_get --app="$app" --key=domain) +#REMOVEME? #REMOVEME? domain=$(ynh_app_setting_get --app="$app" --key=domain) -#REMOVEME? db_name=$(ynh_app_setting_get --app="$app" --key=db_name) +#REMOVEME? #REMOVEME? db_name=$(ynh_app_setting_get --app="$app" --key=db_name) -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app="$app" --key=install_dir) +#REMOVEME? #REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app="$app" --key=install_dir) -#REMOVEME? data_dir=$(ynh_app_setting_get --app="$app" --key=data_dir) +#REMOVEME? #REMOVEME? data_dir=$(ynh_app_setting_get --app="$app" --key=data_dir) #================================================= # DECLARE DATA AND CONF FILES TO BACKUP diff --git a/scripts/install b/scripts/install index 83afab0..41893fb 100755 --- a/scripts/install +++ b/scripts/install @@ -13,33 +13,33 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -#REMOVEME? ynh_clean_setup () { +#REMOVEME? #REMOVEME? ynh_clean_setup () { ### Remove this function if there's nothing to clean before calling the remove script. true } # Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors +#REMOVEME? #REMOVEME? ynh_abort_if_errors #================================================= # RETRIEVE ARGUMENTS FROM THE MANIFEST #================================================= -#REMOVEME? app="$YNH_APP_INSTANCE_NAME" +#REMOVEME? #REMOVEME? app="$YNH_APP_INSTANCE_NAME" -#REMOVEME? domain="$YNH_APP_ARG_DOMAIN" +#REMOVEME? #REMOVEME? domain="$YNH_APP_ARG_DOMAIN" path="/" client_max_body_size="100M" -#REMOVEME? admin="$YNH_APP_ARG_ADMIN" -#REMOVEME? email="$YNH_APP_ARG_EMAIL" -#REMOVEME? password="$YNH_APP_ARG_PASSWORD" +#REMOVEME? #REMOVEME? admin="$YNH_APP_ARG_ADMIN" +#REMOVEME? #REMOVEME? email="$YNH_APP_ARG_EMAIL" +#REMOVEME? #REMOVEME? password="$YNH_APP_ARG_PASSWORD" # Config stuff: -#REMOVEME? accounts_registration_open=$(convert_bool "$YNH_APP_ARG_ACCOUNTS_REGISTRATION_OPEN") -#REMOVEME? accounts_approval_required=$(convert_bool "$YNH_APP_ARG_ACCOUNTS_APPROVAL_REQUIRED") -#REMOVEME? accounts_reason_required=$(convert_bool "$YNH_APP_ARG_ACCOUNTS_REASON_REQUIRED") +#REMOVEME? #REMOVEME? accounts_registration_open=$(convert_bool "$YNH_APP_ARG_ACCOUNTS_REGISTRATION_OPEN") +#REMOVEME? #REMOVEME? accounts_approval_required=$(convert_bool "$YNH_APP_ARG_ACCOUNTS_APPROVAL_REQUIRED") +#REMOVEME? #REMOVEME? accounts_reason_required=$(convert_bool "$YNH_APP_ARG_ACCOUNTS_REASON_REQUIRED") accounts_allow_custom_css="false" instance_expose_peers="false" @@ -64,28 +64,28 @@ statuses_media_max_files="6" # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= -#REMOVEME? ynh_script_progression --message="Validating installation parameters..." --weight=1 +#REMOVEME? #REMOVEME? ynh_script_progression --message="Validating installation parameters..." --weight=1 #REMOVEME? install_dir="/var/www/$app" #REMOVEME? test ! -e "$install_dir" || ynh_die --message="This path already contains a folder" -#REMOVEME? ynh_webpath_register --app="$app" --domain="$domain" --path="$path" +#REMOVEME? #REMOVEME? ynh_webpath_register --app="$app" --domain="$domain" --path="$path" #================================================= # STORE SETTINGS FROM MANIFEST #================================================= -#REMOVEME? ynh_script_progression --message="Storing installation settings..." --weight=1 +#REMOVEME? #REMOVEME? ynh_script_progression --message="Storing installation settings..." --weight=1 #REMOVEME? ynh_app_setting_set --app="$app" --key=install_dir --value="$install_dir" -#REMOVEME? ynh_app_setting_set --app="$app" --key=domain --value="$domain" -#REMOVEME? ynh_app_setting_set --app="$app" --key=path --value="$path" +#REMOVEME? #REMOVEME? ynh_app_setting_set --app="$app" --key=domain --value="$domain" +#REMOVEME? #REMOVEME? ynh_app_setting_set --app="$app" --key=path --value="$path" ynh_app_setting_set --app="$app" --key=client_max_body_size --value="$client_max_body_size" -#REMOVEME? ynh_app_setting_set --app="$app" --key=admin --value="$admin" +#REMOVEME? #REMOVEME? ynh_app_setting_set --app="$app" --key=admin --value="$admin" ynh_app_setting_set --app="$app" --key=email --value="$email" -#REMOVEME? ynh_app_setting_set --app="$app" --key=password --value="$password" +#REMOVEME? #REMOVEME? ynh_app_setting_set --app="$app" --key=password --value="$password" ynh_app_setting_set --app="$app" --key=accounts_registration_open --value="$accounts_registration_open" ynh_app_setting_set --app="$app" --key=accounts_approval_required --value="$accounts_approval_required" @@ -115,40 +115,40 @@ ynh_app_setting_set --app="$app" --key=statuses_media_max_files --value="$status #================================================= # FIND AND OPEN A PORT #================================================= -#REMOVEME? ynh_script_progression --message="Finding an available port..." --weight=1 +#REMOVEME? #REMOVEME? ynh_script_progression --message="Finding an available port..." --weight=1 # Find an available port -#REMOVEME? port=$(ynh_find_port --port=8095) -#REMOVEME? ynh_app_setting_set --app="$app" --key=port --value="$port" +#REMOVEME? #REMOVEME? port=$(ynh_find_port --port=8095) +#REMOVEME? #REMOVEME? ynh_app_setting_set --app="$app" --key=port --value="$port" #================================================= # INSTALL DEPENDENCIES #================================================= -#REMOVEME? ynh_script_progression --message="Installing dependencies..." --weight=5 +#REMOVEME? #REMOVEME? ynh_script_progression --message="Installing dependencies..." --weight=5 -#REMOVEME? ynh_exec_warn_less ynh_install_app_dependencies "$pkg_dependencies" +#REMOVEME? #REMOVEME? ynh_exec_warn_less ynh_install_app_dependencies "$pkg_dependencies" #================================================= # CREATE DEDICATED USER #================================================= -#REMOVEME? ynh_script_progression --message="Configuring system user..." --weight=1 +#REMOVEME? #REMOVEME? ynh_script_progression --message="Configuring system user..." --weight=1 # Create a system user -#REMOVEME? ynh_system_user_create --username="$app" --home_dir="$install_dir" +#REMOVEME? #REMOVEME? ynh_system_user_create --username="$app" --home_dir="$install_dir" #================================================= # CREATE A POSTGRESQL DATABASE #================================================= -#REMOVEME? ynh_script_progression --message="Creating a PostgreSQL database..." --weight=5 +#REMOVEME? #REMOVEME? ynh_script_progression --message="Creating a PostgreSQL database..." --weight=5 #REMOVEME? db_name=$(ynh_sanitize_dbid --db_name="$app") #REMOVEME? db_user="$db_name" #REMOVEME? db_pwd=$(ynh_string_random --length=30) -#REMOVEME? ynh_app_setting_set --app="$app" --key=db_name --value="$db_name" -#REMOVEME? ynh_app_setting_set --app="$app" --key=db_user --value="$db_user" -#REMOVEME? ynh_app_setting_set --app="$app" --key=db_pwd --value="$db_pwd" -#REMOVEME? ynh_psql_test_if_first_run -#REMOVEME? ynh_psql_setup_db --db_user="$db_user" --db_name="$db_name" --db_pwd="$db_pwd" +#REMOVEME? #REMOVEME? ynh_app_setting_set --app="$app" --key=db_name --value="$db_name" +#REMOVEME? #REMOVEME? ynh_app_setting_set --app="$app" --key=db_user --value="$db_user" +#REMOVEME? #REMOVEME? ynh_app_setting_set --app="$app" --key=db_pwd --value="$db_pwd" +#REMOVEME? #REMOVEME? ynh_psql_test_if_first_run +#REMOVEME? #REMOVEME? ynh_psql_setup_db --db_user="$db_user" --db_name="$db_name" --db_pwd="$db_pwd" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -263,10 +263,10 @@ ynh_systemd_action --service_name="$app" --action="start" --log_path="/var/log/$ #================================================= # SETUP SSOWAT #================================================= -#REMOVEME? ynh_script_progression --message="Configuring permissions..." --weight=1 +#REMOVEME? #REMOVEME? ynh_script_progression --message="Configuring permissions..." --weight=1 # Everyone can access the app. -#REMOVEME? ynh_permission_update --permission="main" --add="visitors" +#REMOVEME? #REMOVEME? ynh_permission_update --permission="main" --add="visitors" #================================================= # RELOAD NGINX diff --git a/scripts/remove b/scripts/remove index 6d3525a..81f410d 100755 --- a/scripts/remove +++ b/scripts/remove @@ -12,16 +12,16 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 +#REMOVEME? #REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 -#REMOVEME? app="$YNH_APP_INSTANCE_NAME" +#REMOVEME? #REMOVEME? app="$YNH_APP_INSTANCE_NAME" -#REMOVEME? domain=$(ynh_app_setting_get --app="$app" --key=domain) -#REMOVEME? port=$(ynh_app_setting_get --app="$app" --key=port) -#REMOVEME? db_name=$(ynh_app_setting_get --app="$app" --key=db_name) -#REMOVEME? db_user=$(ynh_app_setting_get --app="$app" --key=db_user) -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app="$app" --key=install_dir) -#REMOVEME? data_dir=$(ynh_app_setting_get --app="$app" --key=data_dir) +#REMOVEME? #REMOVEME? domain=$(ynh_app_setting_get --app="$app" --key=domain) +#REMOVEME? #REMOVEME? port=$(ynh_app_setting_get --app="$app" --key=port) +#REMOVEME? #REMOVEME? db_name=$(ynh_app_setting_get --app="$app" --key=db_name) +#REMOVEME? #REMOVEME? db_user=$(ynh_app_setting_get --app="$app" --key=db_user) +#REMOVEME? #REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app="$app" --key=install_dir) +#REMOVEME? #REMOVEME? data_dir=$(ynh_app_setting_get --app="$app" --key=data_dir) #================================================= # STANDARD REMOVE @@ -47,23 +47,23 @@ ynh_remove_systemd_config #================================================= # REMOVE THE POSTGRESQL DATABASE #================================================= -#REMOVEME? ynh_script_progression --message="Removing the PostgreSQL database..." --weight=5 +#REMOVEME? #REMOVEME? ynh_script_progression --message="Removing the PostgreSQL database..." --weight=5 # Remove a database if it exists, along with the associated user -#REMOVEME? ynh_psql_remove_db --db_user="$db_user" --db_name="$db_name" +#REMOVEME? #REMOVEME? ynh_psql_remove_db --db_user="$db_user" --db_name="$db_name" #================================================= # REMOVE DEPENDENCIES #================================================= -#REMOVEME? ynh_script_progression --message="Removing dependencies..." --weight=5 +#REMOVEME? #REMOVEME? ynh_script_progression --message="Removing dependencies..." --weight=5 # Remove metapackage and its dependencies -#REMOVEME? ynh_remove_app_dependencies +#REMOVEME? #REMOVEME? ynh_remove_app_dependencies #================================================= # REMOVE APP MAIN DIR #================================================= -#REMOVEME? ynh_script_progression --message="Removing app main directory..." --weight=1 +#REMOVEME? #REMOVEME? ynh_script_progression --message="Removing app main directory..." --weight=1 # Remove the app directory securely #REMOVEME? ynh_secure_remove --file="$install_dir" @@ -117,10 +117,10 @@ ynh_secure_remove --file="/var/log/$app" #================================================= # REMOVE DEDICATED USER #================================================= -#REMOVEME? ynh_script_progression --message="Removing the dedicated system user..." --weight=1 +#REMOVEME? #REMOVEME? ynh_script_progression --message="Removing the dedicated system user..." --weight=1 # Delete a system user -#REMOVEME? ynh_system_user_delete --username="$app" +#REMOVEME? #REMOVEME? ynh_system_user_delete --username="$app" #================================================= # END OF SCRIPT diff --git a/scripts/restore b/scripts/restore index 78aa8a0..98a29c3 100755 --- a/scripts/restore +++ b/scripts/restore @@ -14,54 +14,54 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -#REMOVEME? ynh_clean_setup () { +#REMOVEME? #REMOVEME? ynh_clean_setup () { #### Remove this function if there's nothing to clean before calling the remove script. true } # Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors +#REMOVEME? #REMOVEME? ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 +#REMOVEME? #REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 -#REMOVEME? app="$YNH_APP_INSTANCE_NAME" +#REMOVEME? #REMOVEME? app="$YNH_APP_INSTANCE_NAME" -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app="$app" --key=install_dir) +#REMOVEME? #REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app="$app" --key=install_dir) -#REMOVEME? domain=$(ynh_app_setting_get --app="$app" --key=domain) -#REMOVEME? port=$(ynh_app_setting_get --app="$app" --key=port) -#REMOVEME? path=$(ynh_app_setting_get --app="$app" --key=path) +#REMOVEME? #REMOVEME? domain=$(ynh_app_setting_get --app="$app" --key=domain) +#REMOVEME? #REMOVEME? port=$(ynh_app_setting_get --app="$app" --key=port) +#REMOVEME? #REMOVEME? path=$(ynh_app_setting_get --app="$app" --key=path) -#REMOVEME? client_max_body_size=$(ynh_app_setting_get --app="$app" --key=client_max_body_size) +#REMOVEME? #REMOVEME? client_max_body_size=$(ynh_app_setting_get --app="$app" --key=client_max_body_size) -#REMOVEME? db_name=$(ynh_app_setting_get --app="$app" --key=db_name) +#REMOVEME? #REMOVEME? db_name=$(ynh_app_setting_get --app="$app" --key=db_name) #REMOVEME? db_user=$db_name -#REMOVEME? db_pwd=$(ynh_app_setting_get --app="$app" --key=db_pwd) +#REMOVEME? #REMOVEME? db_pwd=$(ynh_app_setting_get --app="$app" --key=db_pwd) -#REMOVEME? data_dir=$(ynh_app_setting_get --app="$app" --key=data_dir) +#REMOVEME? #REMOVEME? data_dir=$(ynh_app_setting_get --app="$app" --key=data_dir) -#REMOVEME? registration_open=$(ynh_app_setting_get --app="$app" --key=registration_open) -#REMOVEME? registration_approval=$(ynh_app_setting_get --app="$app" --key=registration_approval) -#REMOVEME? registration_reason=$(ynh_app_setting_get --app="$app" --key=registration_reason) +#REMOVEME? #REMOVEME? registration_open=$(ynh_app_setting_get --app="$app" --key=registration_open) +#REMOVEME? #REMOVEME? registration_approval=$(ynh_app_setting_get --app="$app" --key=registration_approval) +#REMOVEME? #REMOVEME? registration_reason=$(ynh_app_setting_get --app="$app" --key=registration_reason) -#REMOVEME? media_image_max_size=$(ynh_app_setting_get --app="$app" --key=media_image_max_size) -#REMOVEME? media_video_max_size=$(ynh_app_setting_get --app="$app" --key=media_video_max_size) -#REMOVEME? media_description_min_chars=$(ynh_app_setting_get --app="$app" --key=media_description_min_chars) -#REMOVEME? media_description_max_chars=$(ynh_app_setting_get --app="$app" --key=media_description_max_chars) -#REMOVEME? media_remote_cache_days=$(ynh_app_setting_get --app="$app" --key=media_remote_cache_days) +#REMOVEME? #REMOVEME? media_image_max_size=$(ynh_app_setting_get --app="$app" --key=media_image_max_size) +#REMOVEME? #REMOVEME? media_video_max_size=$(ynh_app_setting_get --app="$app" --key=media_video_max_size) +#REMOVEME? #REMOVEME? media_description_min_chars=$(ynh_app_setting_get --app="$app" --key=media_description_min_chars) +#REMOVEME? #REMOVEME? media_description_max_chars=$(ynh_app_setting_get --app="$app" --key=media_description_max_chars) +#REMOVEME? #REMOVEME? media_remote_cache_days=$(ynh_app_setting_get --app="$app" --key=media_remote_cache_days) -#REMOVEME? statuses_max_chars=$(ynh_app_setting_get --app="$app" --key=statuses_max_chars) -#REMOVEME? statuses_cw_max_chars=$(ynh_app_setting_get --app="$app" --key=statuses_cw_max_chars) -#REMOVEME? statuses_poll_max_options=$(ynh_app_setting_get --app="$app" --key=statuses_poll_max_options) -#REMOVEME? statuses_poll_option_max_chars=$(ynh_app_setting_get --app="$app" --key=statuses_poll_option_max_chars) -#REMOVEME? statuses_media_max_files=$(ynh_app_setting_get --app="$app" --key=statuses_media_max_files) +#REMOVEME? #REMOVEME? statuses_max_chars=$(ynh_app_setting_get --app="$app" --key=statuses_max_chars) +#REMOVEME? #REMOVEME? statuses_cw_max_chars=$(ynh_app_setting_get --app="$app" --key=statuses_cw_max_chars) +#REMOVEME? #REMOVEME? statuses_poll_max_options=$(ynh_app_setting_get --app="$app" --key=statuses_poll_max_options) +#REMOVEME? #REMOVEME? statuses_poll_option_max_chars=$(ynh_app_setting_get --app="$app" --key=statuses_poll_option_max_chars) +#REMOVEME? #REMOVEME? statuses_media_max_files=$(ynh_app_setting_get --app="$app" --key=statuses_media_max_files) #================================================= # CHECK IF THE APP CAN BE RESTORED #================================================= -#REMOVEME? ynh_script_progression --message="Validating restoration parameters..." --weight=1 +#REMOVEME? #REMOVEME? ynh_script_progression --message="Validating restoration parameters..." --weight=1 #REMOVEME? test ! -d "$install_dir" \ || ynh_die --message="There is already a directory: $install_dir " @@ -78,10 +78,10 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # RECREATE THE DEDICATED USER #================================================= -#REMOVEME? ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 +#REMOVEME? #REMOVEME? ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 # Create the dedicated user (if not existing) -#REMOVEME? ynh_system_user_create --username="$app" --home_dir="$install_dir" +#REMOVEME? #REMOVEME? ynh_system_user_create --username="$app" --home_dir="$install_dir" #================================================= # RESTORE THE APP MAIN DIR @@ -124,18 +124,18 @@ chown -R "$app:www-data" "$data_dir" #================================================= # REINSTALL DEPENDENCIES #================================================= -#REMOVEME? ynh_script_progression --message="Reinstalling dependencies..." --weight=5 +#REMOVEME? #REMOVEME? ynh_script_progression --message="Reinstalling dependencies..." --weight=5 # Define and install dependencies -#REMOVEME? ynh_exec_warn_less ynh_install_app_dependencies "$pkg_dependencies" +#REMOVEME? #REMOVEME? ynh_exec_warn_less ynh_install_app_dependencies "$pkg_dependencies" #================================================= # RESTORE THE POSTGRESQL DATABASE #================================================= -#REMOVEME? ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=5 +#REMOVEME? #REMOVEME? ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=5 -#REMOVEME? ynh_psql_test_if_first_run -#REMOVEME? ynh_psql_setup_db --db_user="$db_user" --db_name="$db_name" --db_pwd="$db_pwd" +#REMOVEME? #REMOVEME? ynh_psql_test_if_first_run +#REMOVEME? #REMOVEME? ynh_psql_setup_db --db_user="$db_user" --db_name="$db_name" --db_pwd="$db_pwd" ynh_psql_execute_as_root --sql="CREATE EXTENSION IF NOT EXISTS unaccent;" --database="$db_name" ynh_psql_execute_as_root --sql="CREATE EXTENSION IF NOT EXISTS pg_trgm;" --database="$db_name" ynh_psql_execute_as_root --sql="CREATE EXTENSION IF NOT EXISTS citext;" --database="$db_name" diff --git a/scripts/upgrade b/scripts/upgrade index c906bd5..d2e815b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -12,46 +12,46 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." +#REMOVEME? #REMOVEME? ynh_script_progression --message="Loading installation settings..." -#REMOVEME? app="$YNH_APP_INSTANCE_NAME" +#REMOVEME? #REMOVEME? app="$YNH_APP_INSTANCE_NAME" -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app="$app" --key=install_dir) +#REMOVEME? #REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app="$app" --key=install_dir) -#REMOVEME? domain=$(ynh_app_setting_get --app="$app" --key=domain) -#REMOVEME? port=$(ynh_app_setting_get --app="$app" --key=port) -#REMOVEME? path=$(ynh_app_setting_get --app="$app" --key=path) +#REMOVEME? #REMOVEME? domain=$(ynh_app_setting_get --app="$app" --key=domain) +#REMOVEME? #REMOVEME? port=$(ynh_app_setting_get --app="$app" --key=port) +#REMOVEME? #REMOVEME? path=$(ynh_app_setting_get --app="$app" --key=path) -#REMOVEME? client_max_body_size=$(ynh_app_setting_get --app="$app" --key=client_max_body_size) +#REMOVEME? #REMOVEME? client_max_body_size=$(ynh_app_setting_get --app="$app" --key=client_max_body_size) -#REMOVEME? db_name=$(ynh_app_setting_get --app="$app" --key=db_name) -#REMOVEME? db_user=$(ynh_app_setting_get --app="$app" --key=db_user) -#REMOVEME? db_pwd=$(ynh_app_setting_get --app="$app" --key=db_pwd) +#REMOVEME? #REMOVEME? db_name=$(ynh_app_setting_get --app="$app" --key=db_name) +#REMOVEME? #REMOVEME? db_user=$(ynh_app_setting_get --app="$app" --key=db_user) +#REMOVEME? #REMOVEME? db_pwd=$(ynh_app_setting_get --app="$app" --key=db_pwd) -#REMOVEME? data_dir=$(ynh_app_setting_get --app="$app" --key=data_dir) +#REMOVEME? #REMOVEME? data_dir=$(ynh_app_setting_get --app="$app" --key=data_dir) -#REMOVEME? instance_expose_peers=$(ynh_app_setting_get --app="$app" --key=instance_expose_peers) -#REMOVEME? instance_expose_suspended=$(ynh_app_setting_get --app="$app" --key=instance_expose_suspended) -#REMOVEME? instance_deliver_to_shared_inboxes=$(ynh_app_setting_get --app="$app" --key=instance_deliver_to_shared_inboxes) +#REMOVEME? #REMOVEME? instance_expose_peers=$(ynh_app_setting_get --app="$app" --key=instance_expose_peers) +#REMOVEME? #REMOVEME? instance_expose_suspended=$(ynh_app_setting_get --app="$app" --key=instance_expose_suspended) +#REMOVEME? #REMOVEME? instance_deliver_to_shared_inboxes=$(ynh_app_setting_get --app="$app" --key=instance_deliver_to_shared_inboxes) -#REMOVEME? accounts_registration_open=$(ynh_app_setting_get --app="$app" --key=accounts_registration_open) -#REMOVEME? accounts_approval_required=$(ynh_app_setting_get --app="$app" --key=accounts_approval_required) -#REMOVEME? accounts_reason_required=$(ynh_app_setting_get --app="$app" --key=accounts_reason_required) -#REMOVEME? accounts_allow_custom_css=$(ynh_app_setting_get --app="$app" --key=accounts_allow_custom_css) +#REMOVEME? #REMOVEME? accounts_registration_open=$(ynh_app_setting_get --app="$app" --key=accounts_registration_open) +#REMOVEME? #REMOVEME? accounts_approval_required=$(ynh_app_setting_get --app="$app" --key=accounts_approval_required) +#REMOVEME? #REMOVEME? accounts_reason_required=$(ynh_app_setting_get --app="$app" --key=accounts_reason_required) +#REMOVEME? #REMOVEME? accounts_allow_custom_css=$(ynh_app_setting_get --app="$app" --key=accounts_allow_custom_css) -#REMOVEME? media_image_max_size=$(ynh_app_setting_get --app="$app" --key=media_image_max_size) -#REMOVEME? media_video_max_size=$(ynh_app_setting_get --app="$app" --key=media_video_max_size) -#REMOVEME? media_description_min_chars=$(ynh_app_setting_get --app="$app" --key=media_description_min_chars) -#REMOVEME? media_description_max_chars=$(ynh_app_setting_get --app="$app" --key=media_description_max_chars) -#REMOVEME? media_remote_cache_days=$(ynh_app_setting_get --app="$app" --key=media_remote_cache_days) -#REMOVEME? media_emoji_local_max_size=$(ynh_app_setting_get --app="$app" --key=media_emoji_local_max_size) -#REMOVEME? media_emoji_remote_max_size=$(ynh_app_setting_get --app="$app" --key=media_emoji_remote_max_size) +#REMOVEME? #REMOVEME? media_image_max_size=$(ynh_app_setting_get --app="$app" --key=media_image_max_size) +#REMOVEME? #REMOVEME? media_video_max_size=$(ynh_app_setting_get --app="$app" --key=media_video_max_size) +#REMOVEME? #REMOVEME? media_description_min_chars=$(ynh_app_setting_get --app="$app" --key=media_description_min_chars) +#REMOVEME? #REMOVEME? media_description_max_chars=$(ynh_app_setting_get --app="$app" --key=media_description_max_chars) +#REMOVEME? #REMOVEME? media_remote_cache_days=$(ynh_app_setting_get --app="$app" --key=media_remote_cache_days) +#REMOVEME? #REMOVEME? media_emoji_local_max_size=$(ynh_app_setting_get --app="$app" --key=media_emoji_local_max_size) +#REMOVEME? #REMOVEME? media_emoji_remote_max_size=$(ynh_app_setting_get --app="$app" --key=media_emoji_remote_max_size) -#REMOVEME? statuses_max_chars=$(ynh_app_setting_get --app="$app" --key=statuses_max_chars) -#REMOVEME? statuses_cw_max_chars=$(ynh_app_setting_get --app="$app" --key=statuses_cw_max_chars) -#REMOVEME? statuses_poll_max_options=$(ynh_app_setting_get --app="$app" --key=statuses_poll_max_options) -#REMOVEME? statuses_poll_option_max_chars=$(ynh_app_setting_get --app="$app" --key=statuses_poll_option_max_chars) -#REMOVEME? statuses_media_max_files=$(ynh_app_setting_get --app="$app" --key=statuses_media_max_files) +#REMOVEME? #REMOVEME? statuses_max_chars=$(ynh_app_setting_get --app="$app" --key=statuses_max_chars) +#REMOVEME? #REMOVEME? statuses_cw_max_chars=$(ynh_app_setting_get --app="$app" --key=statuses_cw_max_chars) +#REMOVEME? #REMOVEME? statuses_poll_max_options=$(ynh_app_setting_get --app="$app" --key=statuses_poll_max_options) +#REMOVEME? #REMOVEME? statuses_poll_option_max_chars=$(ynh_app_setting_get --app="$app" --key=statuses_poll_option_max_chars) +#REMOVEME? #REMOVEME? statuses_media_max_files=$(ynh_app_setting_get --app="$app" --key=statuses_media_max_files) #================================================= # CHECK VERSION @@ -68,16 +68,16 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -#REMOVEME? ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." +#REMOVEME? #REMOVEME? ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." # Backup the current version of the app -#REMOVEME? ynh_backup_before_upgrade -#REMOVEME? ynh_clean_setup () { +#REMOVEME? #REMOVEME? ynh_backup_before_upgrade +#REMOVEME? #REMOVEME? ynh_clean_setup () { # Restore it if the upgrade fails -#REMOVEME? ynh_restore_upgradebackup +#REMOVEME? #REMOVEME? ynh_restore_upgradebackup } # Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors +#REMOVEME? #REMOVEME? ynh_abort_if_errors #================================================= # STANDARD UPGRADE STEPS @@ -97,9 +97,9 @@ ynh_script_progression --message="Ensuring downward compatibility..." if ynh_compare_current_package_version --comparison lt --version 0.2.1~ynh4 || [ -z "$db_user" ] then # import old parameters -#REMOVEME? registration_open=$(ynh_app_setting_get --app="$app" --key=registration_open) -#REMOVEME? registration_approval=$(ynh_app_setting_get --app="$app" --key=registration_approval) -#REMOVEME? registration_reason=$(ynh_app_setting_get --app="$app" --key=registration_reason) +#REMOVEME? #REMOVEME? registration_open=$(ynh_app_setting_get --app="$app" --key=registration_open) +#REMOVEME? #REMOVEME? registration_approval=$(ynh_app_setting_get --app="$app" --key=registration_approval) +#REMOVEME? #REMOVEME? registration_reason=$(ynh_app_setting_get --app="$app" --key=registration_reason) # declaration of new parameters client_max_body_size="100M" media_image_max_size="2097152" @@ -118,7 +118,7 @@ then registration_reason=$(convert_bool "$registration_reason") # fix db_user existence db_user=$db_name -#REMOVEME? ynh_app_setting_set --app="$app" --key=db_user --value="$db_user" +#REMOVEME? #REMOVEME? ynh_app_setting_set --app="$app" --key=db_user --value="$db_user" # registration of new parameters ynh_app_setting_set --app="$app" --key=client_max_body_size --value="$client_max_body_size" ynh_app_setting_set --app="$app" --key=media_image_max_size --value="$media_image_max_size" @@ -141,9 +141,9 @@ fi if ynh_compare_current_package_version --comparison lt --version 0.3.7~ynh1 || [ -z "$instance_expose_peers" ] then # import old parameters -#REMOVEME? registration_open=$(ynh_app_setting_get --app="$app" --key=registration_open) -#REMOVEME? registration_approval=$(ynh_app_setting_get --app="$app" --key=registration_approval) -#REMOVEME? registration_reason=$(ynh_app_setting_get --app="$app" --key=registration_reason) +#REMOVEME? #REMOVEME? registration_open=$(ynh_app_setting_get --app="$app" --key=registration_open) +#REMOVEME? #REMOVEME? registration_approval=$(ynh_app_setting_get --app="$app" --key=registration_approval) +#REMOVEME? #REMOVEME? registration_reason=$(ynh_app_setting_get --app="$app" --key=registration_reason) # declaration of new parameters instance_expose_peers="false" instance_expose_suspended="false" @@ -188,10 +188,10 @@ fi #================================================= # CREATE DEDICATED USER #================================================= -#REMOVEME? ynh_script_progression --message="Making sure dedicated system user exists..." +#REMOVEME? #REMOVEME? ynh_script_progression --message="Making sure dedicated system user exists..." # Create a dedicated user (if not existing) -#REMOVEME? ynh_system_user_create --username="$app" --home_dir="$install_dir" +#REMOVEME? #REMOVEME? ynh_system_user_create --username="$app" --home_dir="$install_dir" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -229,9 +229,9 @@ ynh_add_nginx_config #================================================= # UPGRADE DEPENDENCIES #================================================= -#REMOVEME? ynh_script_progression --message="Upgrading dependencies..." +#REMOVEME? #REMOVEME? ynh_script_progression --message="Upgrading dependencies..." -#REMOVEME? ynh_exec_warn_less ynh_install_app_dependencies "$pkg_dependencies" +#REMOVEME? #REMOVEME? ynh_exec_warn_less ynh_install_app_dependencies "$pkg_dependencies" #================================================= # UPDATE A CONFIG FILE