1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/searxng_ynh.git synced 2024-09-03 20:26:00 +02:00

New try to setup install script

This commit is contained in:
mh4ckt3mh4ckt1c4s 2023-02-08 00:06:00 +01:00
parent 770734acb6
commit 9131a3eeab
3 changed files with 1050 additions and 1614 deletions

File diff suppressed because it is too large Load diff

View file

@ -3,7 +3,9 @@
#=================================================
# COMMON VARIABLES
#=================================================
pkg_dependencies="python3-dev python3-babel python3-venv uwsgi uwsgi-plugin-python3 git build-essential libxslt-dev zlib1g-dev libffi-dev libssl-dev"
# dependencies used by the app
pkg_dependencies="git build-essential libxslt-dev python3-dev python3-venv python3-cffi python3-babel zlib1g-dev libffi-dev libssl-dev python3-lxml uwsgi uwsgi-plugin-python3 shellcheck"
#=================================================
# UWSGI HELPERS
@ -19,6 +21,7 @@ ynh_check_global_uwsgi_config () {
[Unit]
Description=%i uWSGI app
After=syslog.target
[Service]
RuntimeDirectory=%i
ExecStart=/usr/bin/uwsgi \
@ -32,6 +35,7 @@ KillSignal=SIGQUIT
Type=notify
StandardError=syslog
NotifyAccess=all
[Install]
WantedBy=multi-user.target
EOF
@ -128,14 +132,14 @@ ynh_remove_uwsgi_service () {
fi
if [ -e /etc/init.d/uwsgi ]
then
# Redémarre le service uwsgi si il n'est pas désinstallé.
ynh_systemd_action --service_name=uwsgi --action=start
# Redémarre le service uwsgi si il n'est pas désinstallé.
ynh_systemd_action --service_name=uwsgi --action=start
else
if yunohost service status | grep -q uwsgi
then
ynh_print_info --message="Remove uwsgi service"
yunohost service remove uwsgi
fi
if yunohost service status | grep -q uwsgi
then
ynh_print_info --message="Remove uwsgi service"
yunohost service remove uwsgi
fi
fi
}

View file

@ -127,7 +127,7 @@ ynh_script_progression --message="Configuring NGINX web server..." --weight=1
path_no_root=${path_url%/}
# Create a dedicated NGINX config
ynh_add_nginx_config
ynh_add_nginx_config "path_no_root"
#=================================================
# SPECIFIC SETUP
@ -147,6 +147,7 @@ pip3 install -e "$final_path"
ynh_script_progression --message="Adding a configuration file..." --weight=1
secret_key=$(ynh_string_random)
# TODO : secret_key ???
ynh_add_config --template="../conf/settings.yml" --destination="$final_path/searx/settings.yml"
# FIXME: this should be handled by the core in the future
@ -162,6 +163,11 @@ chown $app:$app "$final_path/searx/settings.yml"
### ynh_replace_string --match_string="match_string" --replace_string="replace_string" --target_file="$final_path/some_config_file"
### ynh_store_file_checksum --file="$final_path/some_config_file"
#### ADDED : SET PERMISSIONS ON SEARXNG DIRECTORY (CF SEARX SCRIPT)
chown -R $app: $final_path
#=================================================
# CONFIGURE UWSGI FOR SEARX
#=================================================