diff --git a/check_process b/check_process index f2ac95c..7a046e7 100644 --- a/check_process +++ b/check_process @@ -4,13 +4,13 @@ domain="domain.tld" (DOMAIN) path="/path" (PATH) ; Checks - pkg_linter=0 - setup_sub_dir=0 - setup_root=0 + pkg_linter=1 + setup_sub_dir=1 + setup_root=1 setup_nourl=0 setup_private=0 - setup_public=0 - upgrade=0 + setup_public=1 + upgrade=1 # test upgrade from latest published version upgrade=1 from_commit=fd6350495d5a1d864ae30e1a61e18939fdb6a428 # test upgrade from latest git commit before Jibec's rewriting diff --git a/conf/nginx.conf b/conf/nginx.conf index 8ed3aa8..ba3059b 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -11,5 +11,5 @@ location __PATH__ { uwsgi_read_timeout 3600; uwsgi_param SCRIPT_NAME __PATH__; uwsgi_modifier1 30; - uwsgi_pass unix://__FINALPATH__/socket; + uwsgi_pass unix:///tmp/__NAME__.socket; } diff --git a/conf/syncserver.ini b/conf/syncserver.ini index 97336fd..f57ab8d 100644 --- a/conf/syncserver.ini +++ b/conf/syncserver.ini @@ -2,7 +2,7 @@ plugins = python master = true protocol = uwsgi -socket = __FINALPATH__/socket +socket = /tmp/__APP__.socket virtualenv = __FINALPATH__/local wsgi-file = __FINALPATH__/syncserver.wsgi python-path = __FINALPATH__/local diff --git a/conf/systemd.service b/conf/systemd.service index ac2754b..0c105b8 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -10,7 +10,7 @@ RemainAfterExit=yes WorkingDirectory=__FINALPATH__ ExecStart=/usr/bin/uwsgi \ --ini __FINALPATH__/syncserver.ini \ - --socket __FINALPATH__/socket + --socket /tmp/__APP__.socket Restart=always StandardError=syslog diff --git a/scripts/install b/scripts/install index 40a4bad..69267bf 100644 --- a/scripts/install +++ b/scripts/install @@ -126,6 +126,7 @@ ynh_app_setting_set "$app" secret "$secret" # Copy Files cp ../conf/syncserver.ini "$final_path/syncserver.ini" +ynh_replace_string "__APP__" "$app" "$final_path/syncserver.ini" ynh_replace_string "__DOMAIN__" "$domain" "$final_path/syncserver.ini" ynh_replace_string "__PATH__" "$path_url" "$final_path/syncserver.ini" ynh_replace_string "__NAME__" "$app" "$final_path/syncserver.ini" @@ -160,9 +161,7 @@ ynh_replace_string "__DB_NAME__" "$db_name" "$final_path/syncserver.ini" # SECURE FILES AND DIRECTORIES #================================================= -chown "$app":"$app" -R "$final_path" -find "$final_path"/ -type d -exec chmod 2755 {} \; -find "$final_path"/ -type f -exec chmod g+r,o+r {} \; +# no need, keep the default root:root #================================================= # SETUP LOGROTATE diff --git a/scripts/restore b/scripts/restore index 8a5251e..96bc1f3 100644 --- a/scripts/restore +++ b/scripts/restore @@ -74,9 +74,7 @@ ynh_system_user_create "$app" # RESTORE USER RIGHTS #================================================= -chown "$app":"$app" -R "$final_path" -find "$final_path"/ -type d -exec chmod 2755 {} \; -find "$final_path"/ -type f -exec chmod g+r,o+r {} \; +# no need, keep the default root:root #================================================= # SPECIFIC RESTORATION diff --git a/scripts/upgrade b/scripts/upgrade index 6a5c81e..1535d70 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -127,6 +127,7 @@ ynh_system_user_create "$app" # Copy Files cp ../conf/syncserver.ini "$final_path/syncserver.ini" +ynh_replace_string "__APP__" "$app" "$final_path/syncserver.ini" ynh_replace_string "__DOMAIN__" "$domain" "$final_path/syncserver.ini" ynh_replace_string "__PATH__" "$path_url" "$final_path/syncserver.ini" ynh_replace_string "__NAME__" "$app" "$final_path/syncserver.ini" @@ -143,9 +144,7 @@ ynh_replace_string "__DB_NAME__" "$db_name" "$final_path/syncserver.ini" # SECURE FILES AND DIRECTORIES #================================================= -chown "$app":"$app" -R "$final_path" -find "$final_path"/ -type d -exec chmod 2755 {} \; -find "$final_path"/ -type f -exec chmod g+r,o+r {} \; +# no need, keep the default root:root #================================================= # SETUP LOGROTATE