From c318c99e160914e0a18e6dd5127b0ab728835722 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 19 Feb 2021 23:59:15 +0100 Subject: [PATCH 1/7] Add permissions --- scripts/install | 3 +-- scripts/upgrade | 7 +++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index b2f7d08..866d1cf 100644 --- a/scripts/install +++ b/scripts/install @@ -55,7 +55,6 @@ ynh_script_progression --message="Creating a MySQL database..." --weight=2 db_name=$(ynh_sanitize_dbid $app) ynh_app_setting_set --app=$app --key=db_name --value=$db_name ynh_mysql_setup_db --db_user=$db_name --db_name=$db_name -db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -121,7 +120,7 @@ chmod -R 770 $final_path/files #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Configuring SSOwat..." --weight=1 +ynh_script_progression --message="Configuring permissions..." --weight=1 # Make app public if necessary or protect it if [ $is_public -eq 1 ] diff --git a/scripts/upgrade b/scripts/upgrade index 9694d55..812b98f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -47,6 +47,13 @@ if [ -z "$db_name" ]; then ynh_app_setting_set --app=$app --key=db_name --value=$db_name fi +# Cleaning legacy permissions +if ynh_legacy_permissions_exists; then + ynh_legacy_permissions_delete_all + + ynh_app_setting_delete --app=$app --key=is_public +fi + #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= From 173efe616208f64c9cde55fc26fc0f03834b25a1 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 7 Mar 2021 20:48:28 +0100 Subject: [PATCH 2/7] Cleaning up --- README.md | 1 - README_fr.md | 3 +-- conf/settings.example.php | 4 ++-- manifest.json | 2 +- scripts/install | 16 +++++++++------- scripts/upgrade | 1 - 6 files changed, 13 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index d1290cc..24ae748 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,6 @@ Backdrop CMS includes an update utility to handle any necessary changes to the d ## Documentation * Official documentation: https://backdropcms.org/user-guide - * YunoHost documentation: https://yunohost.org/#/app_backdrop ## YunoHost specific features diff --git a/README_fr.md b/README_fr.md index 15edb08..46a466c 100644 --- a/README_fr.md +++ b/README_fr.md @@ -20,7 +20,7 @@ Backdrop CMS is a simple, lightweight, and easy-to-use Content Management System ## Démo -* [Démo officielle](https://demo.yunohost.org/ttrss/) +* [Démo officielle](https://backdropcms.org/demo) ## Configuration @@ -29,7 +29,6 @@ Backdrop CMS inclus un utilitaire de mise à jour pour gérer toutes les modific ## Documentation * Documentation officielle : https://backdropcms.org/user-guide -* Documentation YunoHost : https://yunohost.org/#/app_backdrop_fr ## Caractéristiques spécifiques YunoHost diff --git a/conf/settings.example.php b/conf/settings.example.php index 1b8d70e..3d03de9 100644 --- a/conf/settings.example.php +++ b/conf/settings.example.php @@ -12,8 +12,8 @@ * advanced database documentation at * https://api.backdropcms.org/database-configuration */ -$database = 'mysql://__DBNAME__:__DBPWD__@localhost/__DBNAME__'; -$database_prefix = '__DBNAME___'; +$database = 'mysql://__DB_NAME__:__DB_PWD__@localhost/__DB_NAME__'; +$database_prefix = '__DB_NAME___'; /** * Site configuration files location. diff --git a/manifest.json b/manifest.json index e87eda0..a348507 100644 --- a/manifest.json +++ b/manifest.json @@ -14,7 +14,7 @@ "email": "" }, "requirements": { - "yunohost": ">= 4.0.0" + "yunohost": ">= 4.1.7" }, "multi_instance": true, "services": [ diff --git a/scripts/install b/scripts/install index 866d1cf..9561c08 100644 --- a/scripts/install +++ b/scripts/install @@ -43,7 +43,6 @@ ynh_script_progression --message="Storing installation settings..." --weight=1 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=is_public --value=$is_public #================================================= # STANDARD MODIFICATIONS @@ -97,14 +96,17 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= ynh_script_progression --message="Configuring Backdrop..." --weight=1 -cp ../conf/settings.example.php "$final_path/settings.php" +salt=$(ynh_string_random --length=30) -# Change variables in ttrss configuration -ynh_replace_string --match_string="__DBNAME__" --replace_string="$db_name" --target_file="$final_path/settings.php" -ynh_replace_string --match_string="__DBPWD__" --replace_string="$db_pwd" --target_file="$final_path/settings.php" -ynh_replace_string --match_string="__SALT__" --replace_string="$(ynh_string_random --length=30)" --target_file="$final_path/settings.php" -#ynh_replace_string --match_string="__DOMAIN__" --replace_string="https://$domain$path_url" --target_file="$final_path/config.php" +# cp ../conf/settings.example.php "$final_path/settings.php" +# # Change variables in ttrss configuration +# ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/settings.php" +# ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/settings.php" +# ynh_replace_string --match_string="__SALT__" --replace_string="$(ynh_string_random --length=30)" --target_file="$final_path/settings.php" +# #ynh_replace_string --match_string="__DOMAIN__" --replace_string="https://$domain$path_url" --target_file="$final_path/config.php" + +ynh_add_config --template="../conf/settings.example.php" --destination="$final_path/settings.php" # Recalculate and store the config file checksum into the app settings ynh_store_file_checksum --file="$final_path/settings.php" diff --git a/scripts/upgrade b/scripts/upgrade index 812b98f..7fc3a0f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -19,7 +19,6 @@ app=$YNH_APP_INSTANCE_NAME 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) -is_public=$(ynh_app_setting_get --app=$app --key=is_public) db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) From dc796b336f6c90a7b8345aeacf5413e3b5efc456 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 8 Mar 2021 22:14:17 +0100 Subject: [PATCH 3/7] Update settings.example.php --- conf/settings.example.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/settings.example.php b/conf/settings.example.php index 3d03de9..f739b8a 100644 --- a/conf/settings.example.php +++ b/conf/settings.example.php @@ -434,6 +434,6 @@ $settings['backdrop_drupal_compatibility'] = TRUE; * * Keep this code block at the end of this file to take full effect. */ -if (file_exists(__DIR__ . '/settings.local.php')) { - include __DIR__ . '/settings.local.php'; +if (file_exists(__FINALPATH__ . '/settings.local.php')) { + include __FINALPATH__ . '/settings.local.php'; } From 6df290deab649081ccbd1fd64c1715521125f11f Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 8 Mar 2021 22:18:09 +0100 Subject: [PATCH 4/7] Fix --- conf/settings.example.php | 4 ++-- scripts/install | 14 +++++--------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/conf/settings.example.php b/conf/settings.example.php index f739b8a..3d03de9 100644 --- a/conf/settings.example.php +++ b/conf/settings.example.php @@ -434,6 +434,6 @@ $settings['backdrop_drupal_compatibility'] = TRUE; * * Keep this code block at the end of this file to take full effect. */ -if (file_exists(__FINALPATH__ . '/settings.local.php')) { - include __FINALPATH__ . '/settings.local.php'; +if (file_exists(__DIR__ . '/settings.local.php')) { + include __DIR__ . '/settings.local.php'; } diff --git a/scripts/install b/scripts/install index 9561c08..c73facc 100644 --- a/scripts/install +++ b/scripts/install @@ -96,17 +96,13 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= ynh_script_progression --message="Configuring Backdrop..." --weight=1 -salt=$(ynh_string_random --length=30) +cp ../conf/settings.example.php "$final_path/settings.php" -# cp ../conf/settings.example.php "$final_path/settings.php" +# Change variables in ttrss configuration +ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/settings.php" +ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/settings.php" +ynh_replace_string --match_string="__SALT__" --replace_string="$(ynh_string_random --length=30)" --target_file="$final_path/settings.php" -# # Change variables in ttrss configuration -# ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/settings.php" -# ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/settings.php" -# ynh_replace_string --match_string="__SALT__" --replace_string="$(ynh_string_random --length=30)" --target_file="$final_path/settings.php" -# #ynh_replace_string --match_string="__DOMAIN__" --replace_string="https://$domain$path_url" --target_file="$final_path/config.php" - -ynh_add_config --template="../conf/settings.example.php" --destination="$final_path/settings.php" # Recalculate and store the config file checksum into the app settings ynh_store_file_checksum --file="$final_path/settings.php" From 1d25362425d87226e71131635d6ac359e6ac8155 Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Mon, 15 Mar 2021 00:21:10 +0100 Subject: [PATCH 5/7] [autopatch] Missing ynh_abort_if_errors in change_url scripts --- scripts/change_url | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/change_url b/scripts/change_url index 16fc4d1..d13d717 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -8,6 +8,7 @@ source _common.sh source /usr/share/yunohost/helpers +ynh_abort_if_errors #================================================= # RETRIEVE ARGUMENTS From e2aec612b0874e641ab743318330569d2215a59d Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 15 Mar 2021 08:54:52 +0100 Subject: [PATCH 6/7] Update manifest.json --- manifest.json | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/manifest.json b/manifest.json index a348507..e7e043c 100644 --- a/manifest.json +++ b/manifest.json @@ -27,29 +27,17 @@ { "name": "domain", "type": "domain", - "ask": { - "en": "Choose a domain for Backdrop", - "fr": "Choisissez un domaine pour Backdrop" - }, "example": "domain.org" }, { "name": "path", "type": "path", - "ask": { - "en": "Choose a path for Backdrop", - "fr": "Choisissez un chemin pour Backdrop" - }, "example": "/backdrop", "default": "/backdrop" }, { "name": "is_public", "type": "boolean", - "ask": { - "en": "Is it a public site?", - "fr": "Est-ce un site public ?" - }, "help": { "en": "If enabled, Backdrop will be accessible by people who do not have an account. This can be changed later via the webadmin.", "fr": "Si cette case est cochée, Backdrop sera accessible aux personnes n’ayant pas de compte. Vous pourrez changer ceci plus tard via la webadmin." From e379dc87bb00f8653119bc343a6764f6d1c66d70 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 16 Mar 2021 08:29:33 +0100 Subject: [PATCH 7/7] Update manifest.json --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index e7e043c..6becb58 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Easy-to-use CMS for building professional websites", "fr": "CMS facile à utiliser pour créer des sites Web professionnels" }, - "version": "1.18.1~ynh1", + "version": "1.18.1~ynh2", "url": "https://backdropcms.org/", "license": "GPL-2.0", "maintainer": {