1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/navidrome_ynh.git synced 2024-09-03 19:46:30 +02:00
* Add log file in /var/log/navidrome folder (fix #5)
 * Add data folder path to navidrome.toml
This commit is contained in:
Éric Gaspar 2020-08-17 22:00:52 +02:00 committed by GitHub
parent 3a90243be3
commit 2f8406f991
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 55 additions and 10 deletions

View file

@ -23,9 +23,9 @@ Navidrome is an open source web-based music collection server and streamer. It g
## Configuration
You can configure Navidrome by editing this file `/var/lib/navidrome/navidrome.toml` using the [documentation](https://www.navidrome.org/docs/usage/configuration-options/);
You can configure Navidrome by editing this file `/var/lib/navidrome/navidrome.toml` using the [documentation](https://www.navidrome.org/docs/usage/configuration-options/).
The music is to be stored in the folder `/home/yunohost.navidrome/Music`.
The media storage folder is by default set to `/home/yunohost.navidrome/Music`. You can customize it by editing the `MusicFolder` option in the `/var/lib/navidrome/navidrome.toml` file.
## Documentation

View file

@ -25,7 +25,7 @@ Navidrome est un serveur et un streamer de collection de musique en ligne open s
Vous pouvez configurer Navidrome en modifiant le fichier `/var/lib/navidrome/navidrome.toml` et en vous aidant de la [documentation](https://www.navidrome.org/docs/usage/configuration-options/).
La musique est à stocker dans le dossier `/home/yunohost.navidrome/Music`.
Le dossier de stockage des médias est par défaut `/home/yunohost.navidrome/Music`. Vous pouvez le personnaliser en éditant l'option `MusicFolder` dans le fichier `/var/lib/navidrome/navidrome.toml`.
## Documentation

View file

@ -4,4 +4,5 @@ Port = "__PORT__"
BaseURL = "__PATH_URL__"
ScanInterval = "90s"
TranscodingCacheSize = "150MiB"
DataFolder = "__CONFIG_PATH__"
MusicFolder = "/home/yunohost.navidrome/Music"

View file

@ -15,6 +15,8 @@ WorkingDirectory=__CONFIG_PATH__
TimeoutStopSec=20
KillMode=process
Restart=on-failure
StandardOutput=append:/var/log/__APP__/__APP__.log
StandardError=inherit
# See https://www.freedesktop.org/software/systemd/man/systemd.exec.html
DevicePolicy=closed

View file

@ -54,6 +54,12 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# SPECIFIC BACKUP
#=================================================
# BACKUP LOGROTATE
#=================================================
ynh_backup --src_path="/etc/logrotate.d/$app"
#=================================================
# BACKUP SYSTEMD
#=================================================

View file

@ -109,7 +109,7 @@ fi
ynh_script_progression --message="Starting a systemd service..." --weight=1
# Start a systemd service
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Version:"
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" --line_match="Version:"
#=================================================
# RELOAD NGINX

View file

@ -119,6 +119,7 @@ cp ../conf/navidrome.toml "$config_path/navidrome.toml"
# Main config File
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$config_path/navidrome.toml"
ynh_replace_string --match_string="__PATH_URL__" --replace_string="$path_url" --target_file="$config_path/navidrome.toml"
ynh_replace_string --match_string="__CONFIG_PATH__" --replace_string="$config_path" --target_file="$config_path/navidrome.toml"
ynh_store_file_checksum --file="$config_path/navidrome.toml"
@ -148,12 +149,23 @@ chown -R $app:$app "$config_path"
chown -R $app:www-data /home/yunohost.$app/
chmod -R 764 /home/yunohost.$app
#=================================================
# HANDLE LOG FILES AND SETUP LOGROTATE
#=================================================
ynh_script_progression --message="Configuring log rotation..." --weight=1
mkdir -p /var/log/$app
touch /var/log/$app/$app.log
chown $app -R /var/log/$app
ynh_use_logrotate
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add $app --description "Web-based music collection server and streamer"
yunohost service add $app --description "Web-based music collection server and streamer" --log "/var/log/$app/$app.log"
#=================================================
# START SYSTEMD SERVICE
@ -161,7 +173,7 @@ yunohost service add $app --description "Web-based music collection server and s
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:"
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" --line_match="Version:"
#=================================================
# SETUP SSOWAT

View file

@ -73,6 +73,15 @@ ynh_script_progression --message="Removing NGINX web server configuration..." --
# Remove the dedicated nginx config
ynh_remove_nginx_config
#=================================================
# REMOVE LOGROTATE CONFIGURATION
#=================================================
ynh_script_progression --message="Removing logs and logrotate configuration..." --weight=1
ynh_secure_remove --file="/var/log/$app"
ynh_remove_logrotate
#=================================================
# GENERIC FINALIZATION
#=================================================

View file

@ -103,14 +103,20 @@ systemctl enable $app.service
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..."
yunohost service add $app --description "Web-based music collection server and streamer"
yunohost service add $app --description "Web-based music collection server and streamer" --log_path="/var/log/$app/$app.log"
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Version:"
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" --line_match="Version:"
#=================================================
# RESTORE THE LOGROTATE CONFIGURATION
#=================================================
ynh_restore_file --origin_path="/etc/logrotate.d/$app"
#=================================================
# GENERIC FINALIZATION

View file

@ -116,6 +116,7 @@ cp ../conf/navidrome.toml "$config_path/navidrome.toml"
# Main config File
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$config_path/navidrome.toml"
ynh_replace_string --match_string="__PATH_URL__" --replace_string="$path_url" --target_file="$config_path/navidrome.toml"
ynh_replace_string --match_string="__CONFIG_PATH__" --replace_string="$config_path" --target_file="$config_path/navidrome.toml"
ynh_store_file_checksum --file="$config_path/navidrome.toml"
@ -146,19 +147,27 @@ chown -R $app:$app $config_path
chown -R $app:www-data /home/yunohost.$app/
chmod -R 764 /home/yunohost.$app
#=================================================
# SETUP LOGROTATE
#=================================================
ynh_script_progression --message="Upgrading logrotate configuration..." --time --weight=1
# Use logrotate to manage app-specific logfile(s)
ynh_use_logrotate --non-append
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..."
yunohost service add $app --description "Web-based music collection server and streamer"
yunohost service add $app --description "Web-based music collection server and streamer" --log_path="/var/log/$app/$app.log"
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Version:"
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" --line_match="Version:"
#=================================================
# RELOAD NGINX