From 8a3f8ddecbe15526570c54f6aaa62bdec40bcb47 Mon Sep 17 00:00:00 2001 From: Chris Vogel Date: Tue, 18 Jun 2024 09:53:14 +0200 Subject: [PATCH] cleaning, correct setting of permissions --- config_panel.toml | 7 ------- scripts/_common.sh | 16 +++++++++------- scripts/upgrade | 4 ---- 3 files changed, 9 insertions(+), 18 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index fcd2243..7b4718b 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -24,10 +24,3 @@ version = "1.0" help.en = "open this url to finish your flohmarkt setup" help.de = "öffne die URL um flohmarkt fertig zu konfigurieren" -#[flohmarkt_setup] -# name = "setup" -# [flohmarkt_setup.flohmarkt_initial_setup_url] -# name = "initial setup url" -# type = "string" -# ask = "open this url to initially setup flohmarkt" -# help = "you can't change this value" diff --git a/scripts/_common.sh b/scripts/_common.sh index 75d9e77..fa64246 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -570,9 +570,11 @@ flohmarkt_ynh_create_symlinks() { # set file permissions and owner for installation flohmarkt_ynh_set_permission() { - # install dir - only root needs to write and $app reads - chown root:$app -R "$flohmarkt_install" - chmod g-w,o-rwx -R "$flohmarkt_install" + # venv and app - only root needs to write and $app reads + chown root:$app -R "$flohmarkt_venv_dir" + chmod g-w,o-rwx -R "$flohmarkt_venv_dir" + chown root:$app -R "$flohmarkt_app_dir" + chmod g-w,o-rwx -R "$flohmarkt_app_dir" } # start flohmarkt service @@ -759,8 +761,8 @@ flohmarkt_ynh_venv_requirements() { } flohmarkt_ynh_urlwatch_cron() { - mkdir -m 770 -p "${flohmarkt_install}/urlwatch" - chown root:${app} "${flohmarkt_install}/urlwatch" + mkdir -m 750 -p "${flohmarkt_install}/urlwatch" + chown ${app}:root "${flohmarkt_install}/urlwatch" ynh_add_config --template="../conf/urlwatch_config.yaml" \ --destination="${flohmarkt_install}/urlwatch/config.yaml" ynh_add_config --template="../conf/urlwatch_urls.yaml" \ @@ -771,9 +773,9 @@ flohmarkt_ynh_urlwatch_cron() { chmod 755 "/etc/cron.hourly/${flohmarkt_filename}" # run it once to initialize sudo -u ${app} urlwatch \ - --config /var/www/${app}/urlwatch/config.yaml \ + --config=/var/www/${app}/urlwatch/config.yaml \ --urls=/var/www/${app}/urlwatch/urls.yaml \ - --cache /var/www/${app}/urlwatch/cache.file + --cache=/var/www/${app}/urlwatch/cache.file } flohmarkt_initialized() { diff --git a/scripts/upgrade b/scripts/upgrade index 87537d7..d89db1b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -9,10 +9,6 @@ source /usr/share/yunohost/helpers # UPGRADE_SAME upgrade_type=$(ynh_check_app_version_changed) -# show variables - used from installed or from to be upgraded version? -# variables of the new upgrade version are used -# env - ynh_script_progression --message="Stopping flohmarkt and CouchDB..." --weight=5 # stop flohmarkt flohmarkt_ynh_stop_service