diff --git a/conf/uwsgi.ini b/conf/uwsgi.ini index 72b60cc..cf726f3 100644 --- a/conf/uwsgi.ini +++ b/conf/uwsgi.ini @@ -1,7 +1,7 @@ [uwsgi] # Who will run the code -uid = __APP__ -gid = __APP__ +uid = searxng +gid = searxng # Number of workers workers = 4 @@ -17,18 +17,18 @@ lazy-apps = true enable-threads = true # Application base folder -base = __FINALPATH__ +base = /opt/yunohost/searxng # Support running the module from a webserver subdirectory. route-run = fixpathinfo: # Module to import -module = __APP__.webapp +module = searxng.webapp # Virtualenv and python path -virtualenv = __FINALPATH__ -pythonpath = __FINALPATH__ -chdir = __FINALPATH__/searx/ +virtualenv = /opt/yunohost/searxng +pythonpath = /opt/yunohost/searxng +chdir = /opt/yunohost/searxng/searx/ # The variable holding flask application callable = app diff --git a/scripts/install b/scripts/install index 7ec3bcc..ad92cdb 100755 --- a/scripts/install +++ b/scripts/install @@ -149,11 +149,14 @@ ynh_script_progression --message="Adding a configuration file..." --weight=1 secret_key=$(ynh_string_random) ynh_add_config --template="../conf/settings.yml" --destination="$final_path/searx/settings.yml" +ynh_add_config --template="../conf/uwsgi.ini" --destination="/etc/uwsgi/apps-available/$app.ini" # FIXME: this should be handled by the core in the future # You may need to use chmod 600 instead of 400, # for example if the app is expected to be able to modify its own config chmod 400 "$final_path/searx/settings.yml" chown $app:$app "$final_path/searx/settings.yml" +chmod 400 "/etc/uwsgi/apps-available/$app.ini" +chown $app:$app "/etc/uwsgi/apps-available/$app.ini" ### For more complex cases where you want to replace stuff using regexes, ### you shoud rely on ynh_replace_string (which is basically a wrapper for sed)