2022-11-23 10:08:54 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
2023-09-18 18:10:55 +02:00
|
|
|
# APP "BUILD" (DEPLOYING SOURCES, VENV, COMPILING ETC)
|
2022-11-23 10:08:54 +01:00
|
|
|
#=================================================
|
2023-09-18 18:10:55 +02:00
|
|
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
2022-11-23 10:08:54 +01:00
|
|
|
#=================================================
|
2024-08-31 02:59:28 +02:00
|
|
|
ynh_script_progression "Setting up source files..."
|
2024-07-22 16:17:56 +02:00
|
|
|
myynh_source_searxng
|
2022-11-23 10:08:54 +01:00
|
|
|
|
2024-08-31 02:59:28 +02:00
|
|
|
ynh_script_progression "Installing SearXNG..."
|
2024-07-22 16:17:56 +02:00
|
|
|
myynh_install_searxng
|
2022-11-23 10:08:54 +01:00
|
|
|
|
|
|
|
#=================================================
|
2023-09-18 18:10:55 +02:00
|
|
|
# SYSTEM CONFIGURATION
|
2022-11-23 10:08:54 +01:00
|
|
|
#=================================================
|
2024-08-31 02:59:28 +02:00
|
|
|
ynh_script_progression "Adding system configurations related to $app..."
|
2022-11-23 10:08:54 +01:00
|
|
|
|
2024-08-31 02:59:28 +02:00
|
|
|
ynh_config_add_nginx
|
2022-11-23 10:08:54 +01:00
|
|
|
|
2023-09-27 22:08:09 +02:00
|
|
|
ynh_add_uwsgi_service
|
|
|
|
|
2022-11-23 10:08:54 +01:00
|
|
|
#=================================================
|
2023-09-18 18:10:55 +02:00
|
|
|
# APP INITIAL CONFIGURATION
|
2022-11-23 10:08:54 +01:00
|
|
|
#=================================================
|
|
|
|
# ADD A CONFIGURATION
|
|
|
|
#=================================================
|
2024-08-31 02:59:28 +02:00
|
|
|
ynh_script_progression "Adding $app's configuration..."
|
2022-11-23 10:08:54 +01:00
|
|
|
|
2022-11-23 12:46:39 +01:00
|
|
|
secret_key=$(ynh_string_random)
|
2024-08-31 02:59:28 +02:00
|
|
|
ynh_config_add --template="settings.yml" --destination="$install_dir/settings.yml"
|
2023-02-08 00:06:00 +01:00
|
|
|
|
2024-07-22 16:17:56 +02:00
|
|
|
myynh_set_permissions
|
2022-11-23 10:08:54 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# START SYSTEMD SERVICE
|
|
|
|
#=================================================
|
2024-08-31 02:59:28 +02:00
|
|
|
ynh_script_progression "Starting $app's systemd service..."
|
2022-11-23 10:08:54 +01:00
|
|
|
|
2024-08-31 02:59:28 +02:00
|
|
|
ynh_systemctl --service="uwsgi-app@$app.service" --action="start" --wait_until="WSGI app 0 \(mountpoint='[/[:alnum:]_-]*'\) ready in [[:digit:]]* seconds on interpreter" --log_path="/var/log/uwsgi/$app/$app.log"
|
2022-11-23 10:08:54 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2024-08-31 02:59:28 +02:00
|
|
|
ynh_script_progression "Installation of $app completed"
|