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/check_process b/check_process index 4591f29..46791c2 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& + manifest_arg=domain=DOMAIN&path=PATH&admin=USER&password=password&is_public=1& 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 34d11e4..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~ynh1", + "version": "2021-04-06-2~ynh1", "url": "https://yeswiki.net/", "license": "AGPL-3.0-only", "maintainer": { @@ -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/_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 b19b791..65b37f7 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 @@ -143,6 +145,33 @@ then ynh_permission_update --permission main --remove visitors --add all_users fi +#================================================= +# DOWNLOAD AND CONFIGURE LDAP PLUGIN +#================================================= +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 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 + +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=");"\ + --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 #================================================= 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 diff --git a/scripts/upgrade b/scripts/upgrade index 5c1e49c..c83fea1 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -83,6 +83,40 @@ 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 ]] +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 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 + + 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 #=================================================