|
|
@@ -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" \
|
|
|
@@ -769,11 +771,17 @@ flohmarkt_ynh_urlwatch_cron() {
|
|
|
--destination="/etc/cron.hourly/${flohmarkt_filename}"
|
|
|
chown root:root "/etc/cron.hourly/${flohmarkt_filename}"
|
|
|
chmod 755 "/etc/cron.hourly/${flohmarkt_filename}"
|
|
|
- # run it once to initialize
|
|
|
- sudo -u ${app} urlwatch \
|
|
|
- --config /var/www/${app}/urlwatch/config.yaml \
|
|
|
- --urls=/var/www/${app}/urlwatch/urls.yaml \
|
|
|
- --cache /var/www/${app}/urlwatch/cache.file
|
|
|
+ # run urlwatch once to initialize if cache file does not exist,
|
|
|
+ # but if sending email fails (like on CI) just warn. We do not want
|
|
|
+ # to show the output that might contain passwords
|
|
|
+ if ! [[ -s /var/www/${app}/urlwatch/cache.file ]] &&
|
|
|
+ ! ynh_exec_fully_quiet sudo -u ${app} urlwatch \
|
|
|
+ --config=/var/www/${app}/urlwatch/config.yaml \
|
|
|
+ --urls=/var/www/${app}/urlwatch/urls.yaml \
|
|
|
+ --cache=/var/www/${app}/urlwatch/cache.file
|
|
|
+ then
|
|
|
+ ynh_print_warn --message="initial call to urlwatch failed"
|
|
|
+ fi
|
|
|
}
|
|
|
|
|
|
flohmarkt_initialized() {
|