mirror of
https://github.com/YunoHost-Apps/nextcloud_ynh.git
synced 2024-09-03 19:55:57 +02:00
add a button in the config panel to run chown/chmod on data_dir
This commit is contained in:
parent
706d5071c6
commit
d240d552b4
2 changed files with 26 additions and 3 deletions
|
@ -3,14 +3,19 @@ version = "1.0"
|
|||
[main]
|
||||
name = "Nextcloud configuration"
|
||||
|
||||
[main.maintenance_mode]
|
||||
name = "Maintenance mode"
|
||||
[main.maintenance]
|
||||
name = "Maintenance"
|
||||
|
||||
[main.maintenance_mode.maintenance_mode]
|
||||
[main.maintenance.maintenance_mode]
|
||||
ask = "Enable maintenance mode"
|
||||
type = "boolean"
|
||||
default = "0"
|
||||
|
||||
[main.maintenance.set_permissions_button]
|
||||
ask.en = "Set permissions for all data (Can take up to several hours if users have a lot of data)"
|
||||
type = "button"
|
||||
style = "success"
|
||||
|
||||
[main.addressbook]
|
||||
name = "Address book configuration"
|
||||
|
||||
|
|
|
@ -105,6 +105,24 @@ set__fpm_free_footprint() {
|
|||
fi
|
||||
}
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC RUNNERS FOR TOML SHORT KEYS
|
||||
#=================================================
|
||||
|
||||
function run__set_permissions_button() {
|
||||
local data_dir=$(ynh_app_setting_get --app=$app --key=data_dir)
|
||||
ynh_print_info "Set permissions, it may take some time..."
|
||||
chown -R $app:www-data "$install_dir"
|
||||
chown -R $app: "$data_dir"
|
||||
find $install_dir/ -type f -print0 | xargs -r0 chmod 0644
|
||||
find $install_dir/ -type d -print0 | xargs -r0 chmod 0755
|
||||
find $data_dir/data/ -type f -print0 | xargs -r0 chmod 0640
|
||||
find $data_dir/data/ -type d -print0 | xargs -r0 chmod 0750
|
||||
chmod 640 "$install_dir/config/config.php"
|
||||
chmod 755 /home/yunohost.app
|
||||
chmod 750 $install_dir
|
||||
}
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
#=================================================
|
||||
|
|
Loading…
Add table
Reference in a new issue