mirror of
https://github.com/YunoHost-Apps/navidrome_ynh.git
synced 2024-09-03 19:46:30 +02:00
03267129b5
This reverts commit 8e0075eb92
.
95 lines
3.3 KiB
Bash
95 lines
3.3 KiB
Bash
#!/bin/bash
|
|
|
|
#=================================================
|
|
# GENERIC START
|
|
#=================================================
|
|
# IMPORT GENERIC HELPERS
|
|
#=================================================
|
|
|
|
source _common.sh
|
|
source /usr/share/yunohost/helpers
|
|
|
|
#=================================================
|
|
# RETRIEVE ARGUMENTS FROM THE MANIFEST
|
|
#=================================================
|
|
|
|
scanner_extractor="taglib"
|
|
enable_downloads="true"
|
|
enable_animation="true"
|
|
enable_transcoding="false"
|
|
welcome_message=""
|
|
enable_sharing="false"
|
|
config_path="/var/lib/$app"
|
|
|
|
#=================================================
|
|
# STORE SETTINGS FROM MANIFEST
|
|
#=================================================
|
|
ynh_script_progression --message="Storing installation settings..." --weight=2
|
|
|
|
ynh_app_setting_set --app=$app --key=enable_downloads --value=$enable_downloads
|
|
ynh_app_setting_set --app=$app --key=scanner_extractor --value=$scanner_extractor
|
|
ynh_app_setting_set --app=$app --key=enable_animation --value=$enable_animation
|
|
ynh_app_setting_set --app=$app --key=enable_transcoding --value=$enable_transcoding
|
|
ynh_app_setting_set --app=$app --key=welcome_message --value=$welcome_message
|
|
ynh_app_setting_set --app=$app --key=enable_sharing --value=$enable_sharing
|
|
ynh_app_setting_set --app=$app --key=config_path --value=$config_path
|
|
|
|
#=================================================
|
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
|
#=================================================
|
|
ynh_script_progression --message="Setting up source files..." --weight=4
|
|
|
|
# Download, check integrity, uncompress and patch the source from app.src
|
|
ynh_setup_source --dest_dir="$install_dir"
|
|
|
|
mkdir -p "$config_path"
|
|
|
|
chmod -R o-rwx "$install_dir"
|
|
chown -R $app:$app "$install_dir"
|
|
|
|
#=================================================
|
|
# NGINX CONFIGURATION
|
|
#=================================================
|
|
ynh_script_progression --message="Configuring NGINX web server..." --weight=3
|
|
|
|
# Create a dedicated NGINX config
|
|
ynh_add_nginx_config
|
|
|
|
# Create a dedicated systemd config
|
|
ynh_add_systemd_config
|
|
|
|
yunohost service add $app --description="Web-based music collection server and streamer" --log="/var/log/$app/$app.log"
|
|
|
|
#=================================================
|
|
# SPECIFIC SETUP
|
|
#=================================================
|
|
# YUNOHOST MULTIMEDIA INTEGRATION
|
|
#=================================================
|
|
ynh_script_progression --message="Adding multimedia directories..." --weight=2
|
|
|
|
ynh_multimedia_build_main_dir
|
|
|
|
#=================================================
|
|
# ADD A CONFIGURATION
|
|
#=================================================
|
|
ynh_script_progression --message="Adding a configuration file..." --weight=1
|
|
|
|
# Main config File
|
|
ynh_add_config --template="navidrome.toml" --destination="$config_path/navidrome.toml"
|
|
|
|
chmod 600 "$config_path/navidrome.toml"
|
|
chown -R $app:$app "$config_path"
|
|
|
|
#=================================================
|
|
# START SYSTEMD SERVICE
|
|
#=================================================
|
|
ynh_script_progression --message="Starting a systemd service..." --weight=2
|
|
|
|
# Start a systemd service
|
|
ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --line_match="Version:"
|
|
|
|
#=================================================
|
|
# END OF SCRIPT
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Installation of $app completed" --last
|