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

Merge pull request #89 from YunoHost-Apps/fix_cron_dont_ovewrite_settings

Fix cron config file rights and don't ovewrite all settings at upgrade
This commit is contained in:
frju365 2018-02-07 11:38:33 +01:00 committed by GitHub
commit 2c937c078f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 25 additions and 11 deletions

View file

@ -1,10 +1,5 @@
{ {
"system": { "system": {
"datadirectory": "#DATADIR#",
"trusted_domains": [
"localhost",
"#DOMAIN#"
],
"updatechecker": false, "updatechecker": false,
"memcache.local": "\\OC\\Memcache\\APCu", "memcache.local": "\\OC\\Memcache\\APCu",
"integrity.check.disabled": true, "integrity.check.disabled": true,

9
conf/config_install.json Normal file
View file

@ -0,0 +1,9 @@
{
"system": {
"datadirectory": "#DATADIR#",
"trusted_domains": [
"localhost",
"#DOMAIN#"
]
}
}

View file

@ -144,11 +144,6 @@ exec_occ maintenance:install \
# CONFIGURE NEXTCLOUD # CONFIGURE NEXTCLOUD
#================================================= #=================================================
nc_conf="${final_path}/config.json"
cp ../conf/config.json "$nc_conf"
ynh_replace_string "#DOMAIN#" "$domain" "$nc_conf"
ynh_replace_string "#DATADIR#" "$datadir" "$nc_conf"
# Ensure that UpdateNotification app is disabled # Ensure that UpdateNotification app is disabled
exec_occ app:disable updatenotification exec_occ app:disable updatenotification
@ -156,7 +151,18 @@ exec_occ app:disable updatenotification
exec_occ app:enable user_ldap exec_occ app:enable user_ldap
exec_occ ldap:create-empty-config exec_occ ldap:create-empty-config
# Load the config file in nextcloud # Load the installation config file in nextcloud
nc_conf="${final_path}/config_install.json"
cp ../conf/config_install.json "$nc_conf"
ynh_replace_string "#DOMAIN#" "$domain" "$nc_conf"
ynh_replace_string "#DATADIR#" "$datadir" "$nc_conf"
exec_occ config:import "$nc_conf"
# Then remove it
rm -f "$nc_conf"
# Load the additional config file (used also for upgrade)
nc_conf="${final_path}/config_install.json"
cp ../conf/config.json "$nc_conf"
exec_occ config:import "$nc_conf" exec_occ config:import "$nc_conf"
# Then remove it # Then remove it
rm -f "$nc_conf" rm -f "$nc_conf"
@ -216,6 +222,8 @@ ynh_store_file_checksum "${final_path}/config/config.php"
cron_path="/etc/cron.d/$app" cron_path="/etc/cron.d/$app"
cp -a ../conf/nextcloud.cron "$cron_path" cp -a ../conf/nextcloud.cron "$cron_path"
chown root: "$cron_path"
chmod 644 "$cron_path"
ynh_replace_string "#USER#" "$app" "$cron_path" ynh_replace_string "#USER#" "$app" "$cron_path"
ynh_replace_string "#DESTDIR#" "$final_path" "$cron_path" ynh_replace_string "#DESTDIR#" "$final_path" "$cron_path"

View file

@ -286,6 +286,8 @@ ynh_store_file_checksum "${final_path}/config/config.php"
cron_path="/etc/cron.d/$app" cron_path="/etc/cron.d/$app"
cp -a ../conf/nextcloud.cron "$cron_path" cp -a ../conf/nextcloud.cron "$cron_path"
chown root: "$cron_path"
chmod 644 "$cron_path"
ynh_replace_string "#USER#" "$app" "$cron_path" ynh_replace_string "#USER#" "$app" "$cron_path"
ynh_replace_string "#DESTDIR#" "$final_path" "$cron_path" ynh_replace_string "#DESTDIR#" "$final_path" "$cron_path"