2022-11-02 10:16:52 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
2022-11-18 09:48:08 +01:00
|
|
|
ynh_script_progression --message="Setting up source files..." --weight=6
|
2023-02-24 14:01:24 +01:00
|
|
|
ntfy_setup_source
|
2022-11-02 10:16:52 +01:00
|
|
|
|
2023-02-24 14:01:24 +01:00
|
|
|
ynh_script_progression --message="Adding configuration file..." --weight=1
|
|
|
|
ynh_add_config -t "server.yml" -d "$install_dir/server.yml"
|
2022-11-02 10:16:52 +01:00
|
|
|
|
2023-02-24 14:01:24 +01:00
|
|
|
ynh_script_progression --message="Configuring systemd service..." --weight=1
|
2022-11-02 10:16:52 +01:00
|
|
|
ynh_add_systemd_config
|
|
|
|
|
2023-02-24 14:01:24 +01:00
|
|
|
ynh_script_progression --message="Starting systemd service..." --weight=1
|
|
|
|
ynh_systemd_action --action=start
|
2022-11-02 10:16:52 +01:00
|
|
|
|
2023-02-24 14:01:24 +01:00
|
|
|
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
|
2022-11-18 09:48:08 +01:00
|
|
|
yunohost service add $app
|
2022-11-02 10:16:52 +01:00
|
|
|
|
2023-02-24 14:01:24 +01:00
|
|
|
ynh_script_progression --message="Adding a command wrapper..." --weight=1
|
|
|
|
ynh_add_config -t "ntfy.sh" -d "$install_dir/ntfy.sh"
|
|
|
|
chown $app:$app "$install_dir/ntfy.sh"
|
|
|
|
chmod u+x "$install_dir/ntfy.sh"
|
2022-11-02 10:16:52 +01:00
|
|
|
|
2023-02-24 14:01:24 +01:00
|
|
|
ynh_script_progression --message="Configuring web server..." --weight=2
|
|
|
|
ynh_add_nginx_config
|
2022-11-02 10:16:52 +01:00
|
|
|
|
2022-11-18 09:48:08 +01:00
|
|
|
ynh_script_progression --message="Adding admin user..." --weight=1
|
2023-02-24 14:01:24 +01:00
|
|
|
ynh_exec_as $app NTFY_PASSWORD="$password" $install_dir/ntfy.sh user add --role=admin $admin
|
2022-11-18 09:48:08 +01:00
|
|
|
|
2023-02-24 14:01:24 +01:00
|
|
|
ynh_script_progression --message="Installation completed" --last
|