mirror of
https://github.com/YunoHost-Apps/airsonic_ynh.git
synced 2024-09-03 18:06:14 +02:00
Merge branch 'testing' into enh-testing
This commit is contained in:
commit
14be7b0a2c
5 changed files with 26 additions and 25 deletions
|
@ -39,7 +39,7 @@ How to configure this app: by an admin panel.
|
||||||
* YunoHost LDAP accounts supported: you can login with them
|
* YunoHost LDAP accounts supported: you can login with them
|
||||||
* [Multimedia](https://github.com/YunoHost-Apps/yunohost.multimedia) handled
|
* [Multimedia](https://github.com/YunoHost-Apps/yunohost.multimedia) handled
|
||||||
* Memory RAM limit set to 256 MB because Airsonic was often killed by lack of RAM (hello OOM killer)
|
* Memory RAM limit set to 256 MB because Airsonic was often killed by lack of RAM (hello OOM killer)
|
||||||
* See <https://www.reddit.com/r/airsonic/comments/doscco/jvm_memory_issues/>
|
* See https://www.reddit.com/r/airsonic/comments/doscco/jvm_memory_issues/
|
||||||
|
|
||||||
## Supported architectures
|
## Supported architectures
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,7 @@ ynh_backup --src_path="$service_config"
|
||||||
# BACKUP DATA
|
# BACKUP DATA
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_backup --src_path="/home/yunohost.airsonic" --is_big
|
ynh_backup --src_path="/home/yunohost.$app" --is_big
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
|
|
|
@ -100,14 +100,14 @@ ynh_system_user_create --username=$app
|
||||||
# CREATE DIRECTORIES
|
# CREATE DIRECTORIES
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
mkdir -p /home/yunohost.airsonic/{Podcasts,Playlists}
|
mkdir -p /home/yunohost.$app/{Podcasts,Playlists}
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SECURING FILES AND DIRECTORIES
|
# SECURING FILES AND DIRECTORIES
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
chown -R $app:www-data /home/yunohost.airsonic/
|
chown -R $app:www-data /home/yunohost.$app/
|
||||||
chmod -R 764 /home/yunohost.airsonic
|
chmod -R 764 /home/yunohost.$app
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# YUNOHOST MULTIMEDIA INTEGRATION
|
# YUNOHOST MULTIMEDIA INTEGRATION
|
||||||
|
@ -115,8 +115,8 @@ chmod -R 764 /home/yunohost.airsonic
|
||||||
ynh_script_progression --message="Adding multimedia directories..." --weight=3
|
ynh_script_progression --message="Adding multimedia directories..." --weight=3
|
||||||
|
|
||||||
ynh_multimedia_build_main_dir
|
ynh_multimedia_build_main_dir
|
||||||
ynh_multimedia_addfolder --source_dir="/home/yunohost.airsonic/Podcasts" --dest_dir="share/Podcasts"
|
ynh_multimedia_addfolder --source_dir="/home/yunohost.$app/Podcasts" --dest_dir="share/Podcasts"
|
||||||
ynh_multimedia_addfolder --source_dir="/home/yunohost.airsonic/Playlists" --dest_dir="share/Playlists"
|
ynh_multimedia_addfolder --source_dir="/home/yunohost.$app/Playlists" --dest_dir="share/Playlists"
|
||||||
# Allow airsonic to write into these directories
|
# Allow airsonic to write into these directories
|
||||||
ynh_multimedia_addaccess $app
|
ynh_multimedia_addaccess $app
|
||||||
|
|
||||||
|
@ -193,13 +193,13 @@ chown -R $app: $final_path
|
||||||
ynh_script_progression --message="Configuring log rotation..." --weight=1
|
ynh_script_progression --message="Configuring log rotation..." --weight=1
|
||||||
|
|
||||||
# Use logrotate to manage application logfile(s)
|
# Use logrotate to manage application logfile(s)
|
||||||
ynh_use_logrotate $final_path/airsonic.log
|
ynh_use_logrotate $final_path/$app.log
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# ADVERTISE SERVICE IN ADMIN PANEL
|
# ADVERTISE SERVICE IN ADMIN PANEL
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
yunohost service add $app --description="Airsonic daemon" --log="$final_path/airsonic.log"
|
yunohost service add $app --description="Airsonic daemon" --log="$final_path/$app.log"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# START SYSTEMD SERVICE
|
# START SYSTEMD SERVICE
|
||||||
|
@ -207,7 +207,7 @@ yunohost service add $app --description="Airsonic daemon" --log="$final_path/air
|
||||||
ynh_script_progression --message="Starting a systemd service..." --weight=12
|
ynh_script_progression --message="Starting a systemd service..." --weight=12
|
||||||
|
|
||||||
# Start a systemd service
|
# Start a systemd service
|
||||||
ynh_systemd_action --service_name=$app --action="start" --log_path="$final_path/airsonic.log" --line_match="Started Application in"
|
ynh_systemd_action --service_name=$app --action="start" --log_path="$final_path/$app.log" --line_match="Started Application in"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP APPLICATION WITH CURL
|
# SETUP APPLICATION WITH CURL
|
||||||
|
|
|
@ -115,14 +115,14 @@ systemctl enable $app.service --quiet
|
||||||
# ADVERTISE SERVICE IN ADMIN PANEL
|
# ADVERTISE SERVICE IN ADMIN PANEL
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
yunohost service add $app --description="Airsonic daemon" --log="$final_path/airsonic.log"
|
yunohost service add $app --description="Airsonic daemon" --log="$final_path/$app.log"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# START SYSTEMD SERVICE
|
# START SYSTEMD SERVICE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Starting a systemd service..." --weight=12
|
ynh_script_progression --message="Starting a systemd service..." --weight=12
|
||||||
|
|
||||||
ynh_systemd_action --service_name=$app --action="start" --log_path="$final_path/airsonic.log" --line_match="Started Application in"
|
ynh_systemd_action --service_name=$app --action="start" --log_path="$final_path/$app.log" --line_match="Started Application in"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE THE LOGROTATE CONFIGURATION
|
# RESTORE THE LOGROTATE CONFIGURATION
|
||||||
|
@ -135,15 +135,15 @@ ynh_restore_file --origin_path="/etc/logrotate.d/$app"
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Use --not_mandatory for the data directory, because if the backup has been made with BACKUP_CORE_ONLY, there's no data into the backup.
|
# Use --not_mandatory for the data directory, because if the backup has been made with BACKUP_CORE_ONLY, there's no data into the backup.
|
||||||
ynh_restore_file --origin_path="/home/yunohost.airsonic" --not_mandatory
|
ynh_restore_file --origin_path="/home/yunohost.$app" --not_mandatory
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE USER RIGHTS
|
# RESTORE USER RIGHTS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
mkdir -p /home/yunohost.airsonic/{Podcasts,Playlists}
|
mkdir -p /home/yunohost.$app/{Podcasts,Playlists}
|
||||||
chown -R $app:www-data /home/yunohost.airsonic/
|
chown -R $app:www-data /home/yunohost.$app/
|
||||||
chmod -R 764 /home/yunohost.airsonic
|
chmod -R 764 /home/yunohost.$app
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# YUNOHOST MULTIMEDIA INTEGRATION
|
# YUNOHOST MULTIMEDIA INTEGRATION
|
||||||
|
@ -151,8 +151,8 @@ chmod -R 764 /home/yunohost.airsonic
|
||||||
ynh_script_progression --message="Adding multimedia directories..." --weight=3
|
ynh_script_progression --message="Adding multimedia directories..." --weight=3
|
||||||
|
|
||||||
ynh_multimedia_build_main_dir
|
ynh_multimedia_build_main_dir
|
||||||
ynh_multimedia_addfolder --source_dir="/home/yunohost.airsonic/Podcasts" --dest_dir="share/Podcasts"
|
ynh_multimedia_addfolder --source_dir="/home/yunohost.$app/Podcasts" --dest_dir="share/Podcasts"
|
||||||
ynh_multimedia_addfolder --source_dir="/home/yunohost.airsonic/Playlists" --dest_dir="share/Playlists"
|
ynh_multimedia_addfolder --source_dir="/home/yunohost.$app/Playlists" --dest_dir="share/Playlists"
|
||||||
# Allow airsonic to write into these directories
|
# Allow airsonic to write into these directories
|
||||||
ynh_multimedia_addaccess $app
|
ynh_multimedia_addaccess $app
|
||||||
|
|
||||||
|
|
|
@ -80,6 +80,7 @@ ynh_abort_if_errors
|
||||||
ynh_script_progression --message="Stopping a systemd service..." --weight=1
|
ynh_script_progression --message="Stopping a systemd service..." --weight=1
|
||||||
|
|
||||||
ynh_systemd_action --service_name=$app --action="stop"
|
ynh_systemd_action --service_name=$app --action="stop"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -121,14 +122,14 @@ ynh_system_user_create --username=$app
|
||||||
# CREATE DIRECTORIES
|
# CREATE DIRECTORIES
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
mkdir -p /home/yunohost.airsonic/{Podcasts,Playlists}
|
mkdir -p /home/yunohost.$app/{Podcasts,Playlists}
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SECURING FILES AND DIRECTORIES
|
# SECURING FILES AND DIRECTORIES
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
chown -R $app:www-data /home/yunohost.airsonic/
|
chown -R $app:www-data /home/yunohost.$app/
|
||||||
chmod -R 764 /home/yunohost.airsonic
|
chmod -R 764 /home/yunohost.$app
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# YUNOHOST MULTIMEDIA INTEGRATION
|
# YUNOHOST MULTIMEDIA INTEGRATION
|
||||||
|
@ -136,8 +137,8 @@ chmod -R 764 /home/yunohost.airsonic
|
||||||
ynh_script_progression --message="Adding multimedia directories..." --weight=3
|
ynh_script_progression --message="Adding multimedia directories..." --weight=3
|
||||||
|
|
||||||
ynh_multimedia_build_main_dir
|
ynh_multimedia_build_main_dir
|
||||||
ynh_multimedia_addfolder --source_dir="/home/yunohost.airsonic/Podcasts" --dest_dir="share/Podcasts"
|
ynh_multimedia_addfolder --source_dir="/home/yunohost.$app/Podcasts" --dest_dir="share/Podcasts"
|
||||||
ynh_multimedia_addfolder --source_dir="/home/yunohost.airsonic/Playlists" --dest_dir="share/Playlists"
|
ynh_multimedia_addfolder --source_dir="/home/yunohost.$app/Playlists" --dest_dir="share/Playlists"
|
||||||
# Allow airsonic to write into these directories
|
# Allow airsonic to write into these directories
|
||||||
ynh_multimedia_addaccess $app
|
ynh_multimedia_addaccess $app
|
||||||
|
|
||||||
|
@ -189,7 +190,7 @@ ynh_store_file_checksum --file="$final_path/airsonic.properties"
|
||||||
ynh_script_progression --message="Upgrading logrotate configuration..." --weight=1
|
ynh_script_progression --message="Upgrading logrotate configuration..." --weight=1
|
||||||
|
|
||||||
# Use logrotate to manage app-specific logfile(s)
|
# Use logrotate to manage app-specific logfile(s)
|
||||||
ynh_use_logrotate --non-append --logfile="$final_path/airsonic.log"
|
ynh_use_logrotate --non-append --logfile="$final_path/$app.log"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP SYSTEMD
|
# SETUP SYSTEMD
|
||||||
|
@ -221,7 +222,7 @@ chown -R $app: $final_path
|
||||||
# ADVERTISE SERVICE IN ADMIN PANEL
|
# ADVERTISE SERVICE IN ADMIN PANEL
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
yunohost service add $app --description="Airsonic daemon" --log="$final_path/airsonic.log"
|
yunohost service add $app --description="Airsonic daemon" --log="$final_path/$app.log"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP SSOWAT
|
# SETUP SSOWAT
|
||||||
|
|
Loading…
Add table
Reference in a new issue