1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/navidrome_ynh.git synced 2024-09-03 19:46:30 +02:00
This commit is contained in:
Éric Gaspar 2023-10-29 14:58:18 +01:00
parent 9eb1bd4027
commit bd851fa591
6 changed files with 11 additions and 60 deletions

View file

@ -17,7 +17,7 @@ admindoc = "https://www.navidrome.org/docs"
code = "https://github.com/deluan/navidrome"
[integration]
yunohost = ">= 11.1.20"
yunohost = ">= 11.2"
architectures = ["amd64", "arm64", "armhf"]
multi_instance = false
ldap = false
@ -43,7 +43,7 @@ ram.runtime = "50M"
[install.language]
ask.en = "Choose the application language"
ask.fr = "Choisissez la langue de l'application"
type = "string"
type = "select"
choices = ["de", "en", "es", "fr", "it", "nl", "pt"]
default = "fr"

View file

@ -33,7 +33,7 @@ ynh_script_progression --message="Modifying a config file..." --weight=1
config_path="/var/lib/$app"
path_url="$new_path"
ynh_add_config --template="../conf/navidrome.toml" --destination="$config_path/navidrome.toml"
ynh_add_config --template="navidrome.toml" --destination="$config_path/navidrome.toml"
chmod 600 "$config_path/navidrome.toml"
chown -R $app:$app "$config_path"

View file

@ -40,7 +40,6 @@ 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"
chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir"
chown -R $app:$app "$install_dir"
@ -72,7 +71,7 @@ ynh_app_setting_set --app=$app --key=config_path --value=$config_path
mkdir -p "$config_path"
# Main config File
ynh_add_config --template="../conf/navidrome.toml" --destination="$config_path/navidrome.toml"
ynh_add_config --template="navidrome.toml" --destination="$config_path/navidrome.toml"
chmod 600 "$config_path/navidrome.toml"
chown -R $app:$app "$config_path"

View file

@ -22,29 +22,12 @@ then
yunohost service remove $app
fi
#=================================================
# STOP AND REMOVE SERVICE
#=================================================
ynh_script_progression --message="Stopping and removing the systemd service..." --weight=1
# Remove the dedicated systemd config
ynh_remove_systemd_config
#=================================================
# REMOVE NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Removing NGINX web server configuration..." --weight=5
# Remove the dedicated NGINX config
ynh_remove_nginx_config
#=================================================
# SPECIFIC REMOVE
#=================================================
# REMOVE VARIOUS FILES
#=================================================
ynh_script_progression --message="Removing various files..." --weight=6
# Remove the config directory securely
ynh_secure_remove --file="/var/lib/$app"

View file

@ -17,17 +17,9 @@ ynh_script_progression --message="Restoring the app main directory..." --weight=
ynh_restore_file --origin_path="$install_dir"
chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir"
chown -R $app:$app "$install_dir"
#=================================================
# RESTORE THE NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the NGINX web server configuration..."
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# RESTORE VARIOUS FILES
#=================================================
@ -46,10 +38,7 @@ ynh_script_progression --message="Restoring the systemd configuration..." --weig
ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
systemctl enable $app.service --quiet
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..."
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
yunohost service add $app --description="Web-based music collection server and streamer"
@ -60,13 +49,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --line_match="Version:"
#=================================================
# GENERIC FINALIZATION
#=================================================
# RELOAD NGINX
#=================================================
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
ynh_systemd_action --service_name=nginx --action=reload
#=================================================

View file

@ -79,7 +79,6 @@ then
ynh_setup_source --dest_dir="$install_dir"
fi
chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir"
chown -R $app:$app "$install_dir"
@ -91,6 +90,11 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." -
# 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"
#=================================================
# UPDATE A CONFIG FILE
#=================================================
@ -99,28 +103,11 @@ ynh_script_progression --message="Updating a configuration file..."
config_path="/var/lib/$app"
# Uncomment when there is new options added upstream
ynh_add_config --template="../conf/navidrome.toml" --destination="$config_path/navidrome.toml"
ynh_add_config --template="navidrome.toml" --destination="$config_path/navidrome.toml"
chmod 600 "$config_path/navidrome.toml"
chown -R $app:$app "$config_path"
#=================================================
# SETUP SYSTEMD
#=================================================
ynh_script_progression --message="Upgrading systemd configuration..." --weight=2
# Create a dedicated systemd config
ynh_add_systemd_config
#=================================================
# GENERIC FINALIZATION
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..."
yunohost service add $app --description="Web-based music collection server and streamer"
#=================================================
# START SYSTEMD SERVICE
#=================================================