1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/yeswiki_ynh.git synced 2024-09-03 18:05:56 +02:00

Merge pull request #27 from YunoHost-Apps/testing

Update to Doryphore 2021-04-06-2
Add LDAP integration

Closes #25, #2, #22
This commit is contained in:
Nils Van Zuijlen 2021-04-19 16:00:18 +02:00 committed by GitHub
commit 4f5c645bb6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 77 additions and 20 deletions

View file

@ -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

View file

@ -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

View file

@ -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&

View file

@ -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

View file

@ -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"
}
}
]
}

View file

@ -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
#=================================================

View file

@ -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
#=================================================

View file

@ -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

View file

@ -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
#=================================================