1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/nextcloud_ynh.git synced 2024-09-03 19:55:57 +02:00

Make system address book access configurable

This commit is contained in:
tituspijean 2024-04-08 19:22:26 +02:00
parent ee3b9fd9fb
commit ee0a22caba
No known key found for this signature in database
GPG key ID: EF3B0D7CC0A94720
4 changed files with 32 additions and 0 deletions

View file

@ -11,6 +11,15 @@ name = "Nextcloud configuration"
type = "boolean"
default = "0"
[main.addressbook]
name = "Address book configuration"
[main.addressbook.system_addressbook_exposed]
ask = "Should there be a system address book listing all users, accessible by all users?"
type = "boolean"
yes = "yes"
no = "no"
[main.php_fpm_config]
name = "PHP-FPM configuration"

View file

@ -54,6 +54,12 @@ ram.runtime = "512M"
type = "boolean"
default = false
[install.system_addressbook_exposed]
ask.en = "Should there be a system address book listing all users, accessible by all users?"
ask.fr = "Devrait-il y avoir un carnet d'adresses système listant tous les comptes, accessible par tous les comptes ?"
type = "select"
choices = ["yes", "no"]
[resources]
[resources.sources]

View file

@ -38,6 +38,11 @@ get__maintenance_mode() {
fi
}
get__system_addressbook_exposed() {
echo $(cd "$install_dir" && ynh_exec_as "$app" \
php${phpversion} --define apc.enable_cli=1 occ config:app:get dav system_addressbook_exposed)
}
get__fpm_footprint() {
# Free footprint value for php-fpm
# Check if current_fpm_footprint is an integer
@ -80,6 +85,12 @@ set__maintenance_mode() {
ynh_app_setting_set --app=$app --key=maintenance_mode --value="$maintenance_mode"
}
set__system_addressbook_exposed() {
(cd "$install_dir" && ynh_exec_as "$app" \
php${phpversion} --define apc.enable_cli=1 occ config:app:set dav system_addressbook_exposed --value="$system_addressbook_exposed")
ynh_print_info "System addressbook is exposed: $system_addressbook_exposed"
}
set__fpm_footprint() {
if [ "$fpm_footprint" != "specific" ]
then

View file

@ -180,6 +180,12 @@ ynh_mysql_connect_as --user=$db_name --password="$db_pwd" --database=$db_name --
# And delete admin user
exec_occ user:delete admin
#=================================================
# ENABLE OR DISABLE SYSTEM ADDRESS BOOK
#=================================================
exec_occ config:app:set dav system_addressbook_exposed --value="$system_addressbook_exposed"
#=================================================
# STORE THE CHECKSUM OF THE CONFIG FILE
#=================================================