mirror of
https://github.com/YunoHost-Apps/silverbullet_ynh.git
synced 2024-09-03 20:26:18 +02:00
64 lines
2.1 KiB
Bash
Executable file
64 lines
2.1 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
#=================================================
|
|
# IMPORT GENERIC HELPERS
|
|
#=================================================
|
|
|
|
source _common.sh
|
|
source /usr/share/yunohost/helpers
|
|
|
|
#=================================================
|
|
# INITIALIZE AND STORE SETTINGS
|
|
#=================================================
|
|
|
|
#=================================================
|
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
|
#=================================================
|
|
ynh_script_progression --message="Setting up source files..." --weight=1
|
|
|
|
ynh_setup_source --dest_dir="$install_dir"
|
|
|
|
chown -R "$app:www-data" "$install_dir"
|
|
|
|
#=================================================
|
|
# APP INITIAL CONFIGURATION
|
|
#=================================================
|
|
ynh_script_progression --message="Adding $app's configuration files..." --weight=1
|
|
|
|
ynh_add_config --template="default.env" --destination="$install_dir/default.env"
|
|
|
|
chmod 400 "$install_dir/default.env"
|
|
chown "$app:$app" "$install_dir/default.env"
|
|
|
|
ynh_add_config --template="custom.env" --destination="$data_dir/custom.env"
|
|
|
|
chmod 600 "$data_dir/custom.env"
|
|
chown "$app:$app" "$data_dir/custom.env"
|
|
|
|
#=================================================
|
|
# SET PERMISSION FOR THE USER
|
|
#=================================================
|
|
ynh_permission_update --permission="main" --add="$admin"
|
|
|
|
#=================================================
|
|
# SYSTEM CONFIGURATION
|
|
#=================================================
|
|
ynh_script_progression --message="Adding system configurations related to $app..." --weight=1
|
|
|
|
ynh_add_nginx_config
|
|
|
|
ynh_add_systemd_config
|
|
|
|
yunohost service add "$app" --description="The hacker's notebook"
|
|
|
|
#=================================================
|
|
# START SYSTEMD SERVICE
|
|
#=================================================
|
|
ynh_script_progression --message="Starting $app's systemd service..." --weight=1
|
|
|
|
ynh_systemd_action --service_name="$app" --action="start"
|
|
|
|
#=================================================
|
|
# END OF SCRIPT
|
|
#=================================================
|
|
ynh_script_progression --message="Installation of $app completed" --last
|