1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/komga_ynh.git synced 2024-09-03 19:36:07 +02:00
This commit is contained in:
Éric Gaspar 2024-08-31 22:06:01 +02:00
parent 796b268f33
commit e6f379bfdd
6 changed files with 3 additions and 30 deletions

View file

@ -17,7 +17,7 @@ admindoc = "https://komga.org/guides/"
code = "https://github.com/gotson/komga" code = "https://github.com/gotson/komga"
[integration] [integration]
yunohost = ">= 11.2.18" yunohost = ">= 11.2.29"
helpers_version = "2.1" helpers_version = "2.1"
architectures = "all" architectures = "all"
multi_instance = true multi_instance = true

View file

@ -1,6 +1,5 @@
#!/bin/bash #!/bin/bash
# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
source ../settings/scripts/_common.sh source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers

View file

@ -10,7 +10,6 @@ ynh_script_progression "Setting up source files..."
ynh_setup_source --dest_dir="$install_dir" ynh_setup_source --dest_dir="$install_dir"
#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app:www-data "$install_dir"
chmod +x $install_dir/komga.jar chmod +x $install_dir/komga.jar
#================================================= #=================================================
@ -20,25 +19,18 @@ ynh_script_progression "Adding $app's configuration files..."
ynh_config_add --template="application.yml" --destination="$data_dir/application.yml" ynh_config_add --template="application.yml" --destination="$data_dir/application.yml"
#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 400 "$data_dir/application.yml"
#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown "$app:$app" "$data_dir/application.yml"
#================================================= #=================================================
# SYSTEM CONFIGURATION # SYSTEM CONFIGURATION
#================================================= #=================================================
ynh_script_progression "Adding system configurations related to $app..." ynh_script_progression "Adding system configurations related to $app..."
# Create a dedicated NGINX config
ynh_config_add_nginx ynh_config_add_nginx
# Create a dedicated systemd config
ynh_config_add_systemd ynh_config_add_systemd
# Use logrotate to manage application logfile(s)
ynh_config_add_logrotate ynh_config_add_logrotate
mkdir -p "/var/log/$app" mkdir -p "/var/log/$app"
#REMOVEME? Assuming ynh_config_add_logrotate is called, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 640 "/var/log/$app"
yunohost service add $app --description="Media server for your comics, manga and magazines" --log="/var/log/$app/$app.log" yunohost service add $app --description="Media server for your comics, manga and magazines" --log="/var/log/$app/$app.log"
@ -47,7 +39,6 @@ yunohost service add $app --description="Media server for your comics, manga and
#================================================= #=================================================
ynh_script_progression "Starting $app's systemd service..." ynh_script_progression "Starting $app's systemd service..."
# Start a systemd service
ynh_systemctl --service=$app --action=start --log_path="systemd" --wait_until="Started ApplicationKt" ynh_systemctl --service=$app --action=start --log_path="systemd" --wait_until="Started ApplicationKt"
#================================================= #=================================================

View file

@ -4,25 +4,20 @@ source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#================================================= #=================================================
# STANDARD REMOVE # REMOVE SYSTEM CONFIGURATIONS
#=================================================
# REMOVE SERVICE INTEGRATION IN YUNOHOST
#================================================= #=================================================
ynh_script_progression "Removing system configurations related to $app..."
# Remove the service from the list of services known by YunoHost (added from `yunohost service add`)
if ynh_hide_warnings yunohost service status $app >/dev/null if ynh_hide_warnings yunohost service status $app >/dev/null
then then
ynh_script_progression "Removing $app service integration..." ynh_script_progression "Removing $app service integration..."
yunohost service remove $app yunohost service remove $app
fi fi
# Remove the dedicated systemd config
ynh_config_remove_systemd ynh_config_remove_systemd
# Remove the dedicated NGINX config
ynh_config_remove_nginx ynh_config_remove_nginx
# Remove the app-specific logrotate config
ynh_config_remove_logrotate ynh_config_remove_logrotate
#================================================= #=================================================

View file

@ -1,6 +1,5 @@
#!/bin/bash #!/bin/bash
# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
source ../settings/scripts/_common.sh source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
@ -11,7 +10,6 @@ ynh_script_progression "Restoring the app main directory..."
ynh_restore "$install_dir" ynh_restore "$install_dir"
#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app:www-data "$install_dir"
chmod +x $install_dir/komga.jar chmod +x $install_dir/komga.jar
#================================================= #=================================================
@ -38,7 +36,6 @@ yunohost service add $app --description="Media server for your comics, manga and
ynh_restore "/etc/logrotate.d/$app" ynh_restore "/etc/logrotate.d/$app"
mkdir -p "/var/log/$app" mkdir -p "/var/log/$app"
#REMOVEME? Assuming ynh_config_add_logrotate is called, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 640 "/var/log/$app"
#================================================= #=================================================
# RELOAD NGINX AND PHP-FPM # RELOAD NGINX AND PHP-FPM

View file

@ -17,7 +17,6 @@ ynh_script_progression "Upgrading source files..."
ynh_setup_source --dest_dir="$install_dir" ynh_setup_source --dest_dir="$install_dir"
#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app:www-data "$install_dir"
chmod +x $install_dir/komga.jar chmod +x $install_dir/komga.jar
#================================================= #=================================================
@ -27,25 +26,17 @@ ynh_script_progression "Updating $app's configuration files..."
ynh_config_add --template="application.yml" --destination="$data_dir/application.yml" ynh_config_add --template="application.yml" --destination="$data_dir/application.yml"
#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 400 "$data_dir/application.yml"
#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown "$app:$app" "$data_dir/application.yml"
#================================================= #=================================================
# REAPPLY SYSTEM CONFIGURATIONS # REAPPLY SYSTEM CONFIGURATIONS
#================================================= #=================================================
ynh_script_progression "Upgrading system configurations related to $app..." ynh_script_progression "Upgrading system configurations related to $app..."
# Create a dedicated NGINX config
ynh_config_add_nginx ynh_config_add_nginx
# Create a dedicated systemd config
ynh_config_add_systemd ynh_config_add_systemd
# Use logrotate to manage app-specific logfile(s)
ynh_config_add_logrotate ynh_config_add_logrotate
#REMOVEME? Assuming ynh_config_add_logrotate is called, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 640 "/var/log/$app"
#================================================= #=================================================
# INTEGRATE SERVICE IN YUNOHOST # INTEGRATE SERVICE IN YUNOHOST
#================================================= #=================================================