From d77671cb01dd57353d576d96323dcb9a4e06f966 Mon Sep 17 00:00:00 2001 From: Nils VAN ZUIJLEN Date: Thu, 18 Feb 2021 18:22:14 +0100 Subject: [PATCH 01/12] Add install script for login LDAP plugin --- scripts/install | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/scripts/install b/scripts/install index b19b791..b2b3ae5 100755 --- a/scripts/install +++ b/scripts/install @@ -143,6 +143,26 @@ then ynh_permission_update --permission main --remove visitors --add all_users fi +#================================================= +# DOWNLOAD AND CONFIGURE LDAP PLUGIN +#================================================= + +# Download as git repository +git clone https://github.com/YesWiki/yeswiki-extension-loginldap $final_path/tools/loginldap + +# Add config at the end of wakka.config.php +ynh_replace_string --match_string=");"\ + --replace_string=" 'ldap_host' => '127.0.0.1',\n);"\ + --target_file="$final_path/wakka.config.php" + +ynh_replace_string --match_string=");"\ + --replace_string=" 'ldap_port' => '389',\n);"\ + --target_file="$final_path/wakka.config.php" + +ynh_replace_string --match_string=");"\ + --replace_string=" 'ldap_base' => 'ou=users,dc=yunohost,dc=org'\n);"\ + --target_file="$final_path/wakka.config.php" + #================================================= # GENERIC FINALIZATION #================================================= From 5de5ee4dbbbdd51eb3dfdf1b470d2a5e728cefcc Mon Sep 17 00:00:00 2001 From: Nils VAN ZUIJLEN Date: Thu, 18 Feb 2021 18:22:43 +0100 Subject: [PATCH 02/12] Add upgrade script for LDAP login plugin --- scripts/upgrade | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 5c1e49c..7ba299c 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -83,6 +83,10 @@ then # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" + + cd $final_path/tools/loginldap + git pull + cd - fi #================================================= From dafb9cc8f65cd83e383a9e589f793e76a723013c Mon Sep 17 00:00:00 2001 From: Nils VAN ZUIJLEN Date: Mon, 1 Mar 2021 17:02:55 +0100 Subject: [PATCH 03/12] Use stable version instead of git repository --- scripts/_common.sh | 2 ++ scripts/install | 11 +++++++++-- scripts/upgrade | 33 ++++++++++++++++++++++++++++++--- 3 files changed, 41 insertions(+), 5 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index bb74828..6aa5058 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -9,6 +9,8 @@ YNH_PHP_VERSION="7.3" # dependencies used by the app extra_php_dependencies="php${YNH_PHP_VERSION}-zip" +loginldap_version="2021-03-01-2" + #================================================= # PERSONAL HELPERS #================================================= diff --git a/scripts/install b/scripts/install index b2b3ae5..70fb88a 100755 --- a/scripts/install +++ b/scripts/install @@ -146,9 +146,16 @@ fi #================================================= # DOWNLOAD AND CONFIGURE LDAP PLUGIN #================================================= +ynh_script_progression --message="Dowloading and configuring LDAP plugin" --weight=2 -# Download as git repository -git clone https://github.com/YesWiki/yeswiki-extension-loginldap $final_path/tools/loginldap +# Download from yeswiki repository +wget https://repository.yeswiki.net/doryphore/extension-loginldap-$loginldap_version.zip +wget https://repository.yeswiki.net/doryphore/extension-loginldap-$loginldap_version.zip.md5 +md5sum -c extension-loginldap-$loginldap_version.zip.md5 || ynh_die "Checksum for LDAP plugin does not match" + +unzip extension-loginldap-$loginldap_version.zip -d $final_path/tools + +ynh_app_setting_set --app=$app --key=loginldap_version --value=$loginldap_version # Add config at the end of wakka.config.php ynh_replace_string --match_string=");"\ diff --git a/scripts/upgrade b/scripts/upgrade index 7ba299c..cb05181 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -84,9 +84,36 @@ then # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" - cd $final_path/tools/loginldap - git pull - cd - +fi + +if [ $(ynh_app_setting_get --app=$app --key=loginldap_version) != $loginldap_version ] +then + ynh_script_progression --message="Upgrading LDAP plugin..." --weight=3 + + # Download LDAP plugin from yeswiki repository + wget https://repository.yeswiki.net/doryphore/extension-loginldap-$loginldap_version.zip + wget https://repository.yeswiki.net/doryphore/extension-loginldap-$loginldap_version.zip.md5 + md5sum -c extension-loginldap-$loginldap_version.zip.md5 || ynh_die "Checksum for LDAP plugin does not match" + + unzip -o extension-loginldap-$loginldap_version.zip -d $final_path/tools + + ynh_app_setting_set --app=$app --key=loginldap_version --value=$loginldap_version + + if ! grep -q "ldap_host" "$final_path/wakka.config.php" + then + # Add LDAP config at the end of wakka.config.php + ynh_replace_string --match_string=");"\ + --replace_string=" 'ldap_host' => '127.0.0.1',\n);"\ + --target_file="$final_path/wakka.config.php" + + ynh_replace_string --match_string=");"\ + --replace_string=" 'ldap_port' => '389',\n);"\ + --target_file="$final_path/wakka.config.php" + + ynh_replace_string --match_string=");"\ + --replace_string=" 'ldap_base' => 'ou=users,dc=yunohost,dc=org'\n);"\ + --target_file="$final_path/wakka.config.php" + fi fi #================================================= From 1ef3638e003dfdec3bcd68e329b883b23fa65ae7 Mon Sep 17 00:00:00 2001 From: Nils VAN ZUIJLEN Date: Wed, 3 Mar 2021 10:13:21 +0100 Subject: [PATCH 04/12] Admin password is not needed anymore, uses LDAP --- manifest.json | 9 --------- scripts/install | 6 ++++-- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/manifest.json b/manifest.json index 34d11e4..c41679e 100644 --- a/manifest.json +++ b/manifest.json @@ -88,15 +88,6 @@ }, "choices": ["fr", "en", "ca", "es", "nl", "pt"], "default": "fr" - }, - { - "name": "password", - "type": "password", - "ask": { - "en": "Set the administrator password", - "fr": "Définissez le mot de passe administrateur" - } - } ] } diff --git a/scripts/install b/scripts/install index 70fb88a..1c13639 100755 --- a/scripts/install +++ b/scripts/install @@ -30,7 +30,6 @@ admin=$YNH_APP_ARG_ADMIN is_public=$YNH_APP_ARG_IS_PUBLIC wiki_name=$YNH_APP_ARG_WIKI_NAME language=$YNH_APP_ARG_LANGUAGE -password=$YNH_APP_ARG_PASSWORD app=$YNH_APP_INSTANCE_NAME @@ -128,10 +127,13 @@ ynh_systemd_action --service_name=nginx --action=reload ynh_script_progression --message="Finalizing installation..." --weight=2 + +admin_temp_pass=$(ynh_string_random 6) + ynh_local_curl "/?PagePrincipale&installAction=install" "config[default_language]=$language" "config[wakka_name]=$wiki_name" \ "config[root_page]=PagePrincipale" "config[mysql_host]=localhost" \ "config[mysql_database]=$app" "config[mysql_user]=$db_user" "config[mysql_password]=$db_pwd" "config[table_prefix]=yeswiki_" \ - "admin_name=$admin" "admin_password=$password" "admin_password_conf=$password" \ + "admin_name=$admin" "admin_password=$admin_temp_pass" "admin_password_conf=$admin_temp_pass" \ "admin_email=$admin@$domain" "submit=Continue" # authorization of html From e3bb7ec10db971c1ac946b0b6f62991219a39539 Mon Sep 17 00:00:00 2001 From: Nils VAN ZUIJLEN Date: Thu, 25 Mar 2021 09:51:24 +0100 Subject: [PATCH 05/12] Redirect wget stderr to stdout --- scripts/install | 4 ++-- scripts/upgrade | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index 1c13639..65b37f7 100755 --- a/scripts/install +++ b/scripts/install @@ -151,8 +151,8 @@ fi ynh_script_progression --message="Dowloading and configuring LDAP plugin" --weight=2 # Download from yeswiki repository -wget https://repository.yeswiki.net/doryphore/extension-loginldap-$loginldap_version.zip -wget https://repository.yeswiki.net/doryphore/extension-loginldap-$loginldap_version.zip.md5 +wget https://repository.yeswiki.net/doryphore/extension-loginldap-$loginldap_version.zip 2>&1 +wget https://repository.yeswiki.net/doryphore/extension-loginldap-$loginldap_version.zip.md5 2>&1 md5sum -c extension-loginldap-$loginldap_version.zip.md5 || ynh_die "Checksum for LDAP plugin does not match" unzip extension-loginldap-$loginldap_version.zip -d $final_path/tools diff --git a/scripts/upgrade b/scripts/upgrade index cb05181..58a75e1 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -91,8 +91,8 @@ then ynh_script_progression --message="Upgrading LDAP plugin..." --weight=3 # Download LDAP plugin from yeswiki repository - wget https://repository.yeswiki.net/doryphore/extension-loginldap-$loginldap_version.zip - wget https://repository.yeswiki.net/doryphore/extension-loginldap-$loginldap_version.zip.md5 + wget https://repository.yeswiki.net/doryphore/extension-loginldap-$loginldap_version.zip 2>&1 + wget https://repository.yeswiki.net/doryphore/extension-loginldap-$loginldap_version.zip.md5 2>&1 md5sum -c extension-loginldap-$loginldap_version.zip.md5 || ynh_die "Checksum for LDAP plugin does not match" unzip -o extension-loginldap-$loginldap_version.zip -d $final_path/tools From 3998f4abbf6634e2cd0afe3dd5a308adeca58b87 Mon Sep 17 00:00:00 2001 From: Nils VAN ZUIJLEN Date: Thu, 25 Mar 2021 09:51:39 +0100 Subject: [PATCH 06/12] Set commit to upgrade from --- check_process | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/check_process b/check_process index 4591f29..be8af0a 100644 --- a/check_process +++ b/check_process @@ -24,7 +24,7 @@ setup_private=1 setup_public=1 upgrade=1 - upgrade=1 from_commit=5f8249eef7d237106aad858ea91ed566d60c4019 + upgrade=1 from_commit=e530bfcf7508e42be1b73ff0dcac8ed72428381b backup_restore=1 multi_instance=1 port_already_use=1 (66) @@ -38,6 +38,6 @@ Email= Notification=change ;;; Upgrade options - ; commit=5f8249eef7d237106aad858ea91ed566d60c4019 + ; commit=e530bfcf7508e42be1b73ff0dcac8ed72428381b name=Name of this previous version manifest_arg=domain=DOMAIN&path=PATH&admin=USER&password=pass&is_public=1& From 6b2e116850423bb3be1f9aabdd52c8f438b7f6ea Mon Sep 17 00:00:00 2001 From: Nils VAN ZUIJLEN Date: Thu, 25 Mar 2021 11:14:38 +0100 Subject: [PATCH 07/12] Make the test password longer --- check_process | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check_process b/check_process index be8af0a..46791c2 100644 --- a/check_process +++ b/check_process @@ -40,4 +40,4 @@ Notification=change ;;; Upgrade options ; commit=e530bfcf7508e42be1b73ff0dcac8ed72428381b name=Name of this previous version - manifest_arg=domain=DOMAIN&path=PATH&admin=USER&password=pass&is_public=1& + manifest_arg=domain=DOMAIN&path=PATH&admin=USER&password=password&is_public=1& From 457e4c3dc8244b6157bfe5009531b6c9ae9ab22e Mon Sep 17 00:00:00 2001 From: Nils VAN ZUIJLEN Date: Wed, 14 Apr 2021 16:39:17 +0200 Subject: [PATCH 08/12] Update version --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index c41679e..81f4d61 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Wiki that is quick and easy to use.", "fr": "Wiki facile et rapide à prendre en main." }, - "version": "2020-11-30-4~ynh1", + "version": "2020-11-30-4~ynh2", "url": "https://yeswiki.net/", "license": "AGPL-3.0-only", "maintainer": { From 6348740d1492278fe743e3d656490c9e0b5f157f Mon Sep 17 00:00:00 2001 From: Nils VAN ZUIJLEN Date: Wed, 14 Apr 2021 16:49:19 +0200 Subject: [PATCH 09/12] Fix upgrade from no loginldap installed --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 58a75e1..764d0c7 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -86,7 +86,7 @@ then fi -if [ $(ynh_app_setting_get --app=$app --key=loginldap_version) != $loginldap_version ] +if [[ $(ynh_app_setting_get --app=$app --key=loginldap_version) != $loginldap_version ]] then ynh_script_progression --message="Upgrading LDAP plugin..." --weight=3 From 8fcfc49e46ec161ddb308aba9df8ffe99ba5fcf7 Mon Sep 17 00:00:00 2001 From: Nils VAN ZUIJLEN Date: Tue, 6 Apr 2021 17:41:15 +0200 Subject: [PATCH 10/12] Update to Doryphore 2021-04-06-2 Use a md5sum hash because it's provided in the YesWiki repository --- README.md | 2 +- README_fr.md | 2 +- conf/app.src | 6 +++--- manifest.json | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 611cfd8..6c92802 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ However, with a YesWiki we can build a website with multiple uses: - Communicate information flows - Cultivate a bit of freedom... -**Shipped version:** Doryphore 2020-11-30-4 +**Shipped version:** Doryphore 2021-04-06-2 ## Screenshots diff --git a/README_fr.md b/README_fr.md index 83e06c6..058b3b6 100644 --- a/README_fr.md +++ b/README_fr.md @@ -19,7 +19,7 @@ Néanmoins, avec un YesWiki on peut fabriquer un site internet aux usages multip - Faire communiquer des flux d'informations - Cultiver un bout de liberté... -**Version incluse :** Doryphore 2020-11-30-4 +**Version incluse :** Doryphore 2021-04-06-2 ## Captures d'écran diff --git a/conf/app.src b/conf/app.src index b3279b9..cce5410 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,6 +1,6 @@ -SOURCE_URL=https://repository.yeswiki.net/doryphore/yeswiki-doryphore-2020-11-30-4.zip -SOURCE_SUM=acf3b133dd547440fde99c5a7c031181a7806586781986bbb37637a4cce6d758 -SOURCE_SUM_PRG=sha256sum +SOURCE_URL=https://repository.yeswiki.net/doryphore/yeswiki-doryphore-2021-04-06-2.zip +SOURCE_SUM=44b225e9dff99a415ff72e1d02225ac8 +SOURCE_SUM_PRG=md5sum SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=true SOURCE_FILENAME=doryphore diff --git a/manifest.json b/manifest.json index 81f4d61..8228627 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Wiki that is quick and easy to use.", "fr": "Wiki facile et rapide à prendre en main." }, - "version": "2020-11-30-4~ynh2", + "version": "2021-04-06-2~ynh1", "url": "https://yeswiki.net/", "license": "AGPL-3.0-only", "maintainer": { From 2de8f0b821da1dbce1945eb7aacd920a9d8aad09 Mon Sep 17 00:00:00 2001 From: Nils VAN ZUIJLEN Date: Fri, 16 Apr 2021 11:22:17 +0200 Subject: [PATCH 11/12] Replace the version number in wakka.config.php --- scripts/upgrade | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 764d0c7..c83fea1 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -84,6 +84,9 @@ then # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" + ynh_replace_string --match_string="yeswiki_release' \?=> \?'.*',$"\ + --replace_string="yeswiki_release' => '$(ynh_app_upstream_version)',"\ + --target_file="$final_path/wakka.config.php" fi if [[ $(ynh_app_setting_get --app=$app --key=loginldap_version) != $loginldap_version ]] From da9deb6fff575125cefc4ad844077972e84585c0 Mon Sep 17 00:00:00 2001 From: Nils VAN ZUIJLEN Date: Fri, 16 Apr 2021 11:58:38 +0200 Subject: [PATCH 12/12] Fix permissions on restore --- scripts/restore | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/restore b/scripts/restore index e4144ae..5116ebe 100755 --- a/scripts/restore +++ b/scripts/restore @@ -73,6 +73,7 @@ ynh_system_user_create --username=$app # Restore permissions on app files chown -R root: $final_path +chown -R $app $final_path/{cache,files,themes,tools,wakka.config.php} #================================================= # RESTORE THE PHP-FPM CONFIGURATION