From 47454eca9cc96a240e58f11a75e79be72b604b48 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 28 Feb 2021 18:06:43 +0100 Subject: [PATCH 01/30] small fixes --- README.md | 5 +- README_fr.md | 54 +++++++++++--------- conf/app.src | 2 +- conf/nginx.conf | 5 +- conf/systemd.service | 2 +- issue_template.md | 4 +- manifest.json | 4 +- scripts/_common.sh | 2 +- scripts/backup | 6 --- scripts/change_url | 11 ----- scripts/install | 114 ++----------------------------------------- scripts/remove | 10 ---- scripts/restore | 2 +- scripts/upgrade | 8 +-- 14 files changed, 47 insertions(+), 182 deletions(-) diff --git a/README.md b/README.md index 076e672..3827f6c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Komga +# Komga for YunoHost [![Integration level](https://dash.yunohost.org/integration/Komga.svg)](https://dash.yunohost.org/appci/app/Komga) ![](https://ci-apps.yunohost.org/ci/badges/Komga.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/Komga.maintain.svg) [![Install Komga with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=komga) @@ -30,6 +30,9 @@ Features include: * [Official demo](https://demo.komga.org) +- Login: `demo@komga.org` +- Password: `komga-demo` + ## Configuration For most configurations, you can use the Admin panel in Komga. diff --git a/README_fr.md b/README_fr.md index d7d410c..0b83af2 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,46 +1,56 @@ -# App exemple pour YunoHost +# Komga pour YunoHost -[![Niveau d'intégration](https://dash.yunohost.org/integration/REPLACEBYYOURAPP.svg)](https://dash.yunohost.org/appci/app/REPLACEBYYOURAPP) ![](https://ci-apps.yunohost.org/ci/badges/REPLACEBYYOURAPP.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/REPLACEBYYOURAPP.maintain.svg) -[![Installer REPLACEBYYOURAPP avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=REPLACEBYYOURAPP) +[![Niveau d'intégration](https://dash.yunohost.org/integration/komga.svg)](https://dash.yunohost.org/appci/app/komga) ![](https://ci-apps.yunohost.org/ci/badges/komga.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/komga.maintain.svg) +[![Installer Komga avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=komga) *[Read this readme in english.](./README.md)* -> *Ce package vous permet d'installer REPLACEBYYOURAPP rapidement et simplement sur un serveur YunoHost. +> *Ce package vous permet d'installer Komga rapidement et simplement sur un serveur YunoHost. Si vous n'avez pas YunoHost, consultez [le guide](https://yunohost.org/#/install) pour apprendre comment l'installer.* ## Vue d'ensemble -Description rapide de cette application. +Komga est un serveur multimédia pour vos bandes dessinées, mangas, BD et magazines. -**Version incluse :** 1.0 +Les fonctionnalités incluent : +* Parcourir les bibliothèques, séries et livres +* Barre de recherche +* Télécharger des livres +* Gérer plusieurs utilisateurs, avec le contrôle des accès par bibliothèque +* Lecteur Web + +**Version incluse :** 0.75.1 ## Captures d'écran -![](Lien vers une capture d'écran de cette application.) +![](./screenshots/home.png) ## Démo -* [Démo officielle](Lien vers un site de démonstration de cette application.) +* [Démo officielle](https://demo.komga.org) + +- Login : `demo@komga.org` +- Mot de passe : `komga-demo` ## Configuration -Comment configurer cette application : via le panneau d'administration, un fichier brut en SSH ou tout autre moyen. + * Comment configurer cette application : via le panneau d'administration ## Documentation - * Documentation officielle : Lien vers la documentation officielle de cette application. + * Documentation officielle : https://komga.org/guides/ * Documentation YunoHost : Si une documentation spécifique est nécessaire, n'hésitez pas à contribuer. ## Caractéristiques spécifiques YunoHost #### Support multi-utilisateur -* L'authentification LDAP et HTTP est-elle prise en charge ? -* L'application peut-elle être utilisée par plusieurs utilisateurs ? +* L'authentification LDAP et HTTP est-elle prise en charge ? **Non** +* L'application peut-elle être utilisée par plusieurs utilisateurs ? **Oui** #### Architectures supportées -* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/REPLACEBYYOURAPP%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/REPLACEBYYOURAPP/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/REPLACEBYYOURAPP%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/REPLACEBYYOURAPP/) +* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/komga%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/komga/) +* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/komga%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/komga/) ## Limitations @@ -50,26 +60,22 @@ Comment configurer cette application : via le panneau d'administration, un fichi * Autres informations que vous souhaitez ajouter sur cette application. -**Plus d'informations sur la page de documentation :** -https://yunohost.org/packaging_apps - ## Liens - * Signaler un bug : https://github.com/YunoHost-Apps/REPLACEBYYOURAPP_ynh/issues - * Site de l'application : Lien vers le site officiel de cette application. - * Dépôt de l'application principale : Lien vers le dépôt officiel de l'application principale. + * Signaler un bug : https://github.com/YunoHost-Apps/komga_ynh/issues + * Site de l'application : https://komga.org + * Dépôt de l'application principale : https://github.com/gotson/komga * Site web YunoHost : https://yunohost.org/ --- ## Informations pour les développeurs -**Seulement si vous voulez utiliser une branche de test pour le codage, au lieu de fusionner directement dans la banche principale.** -Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/REPLACEBYYOURAPP_ynh/tree/testing). +Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/komga_ynh/tree/testing). Pour essayer la branche testing, procédez comme suit. ``` -sudo yunohost app install https://github.com/YunoHost-Apps/REPLACEBYYOURAPP_ynh/tree/testing --debug +sudo yunohost app install https://github.com/YunoHost-Apps/komga_ynh/tree/testing --debug ou -sudo yunohost app upgrade REPLACEBYYOURAPP -u https://github.com/YunoHost-Apps/REPLACEBYYOURAPP_ynh/tree/testing --debug +sudo yunohost app upgrade komga -u https://github.com/YunoHost-Apps/komga_ynh/tree/testing --debug ``` diff --git a/conf/app.src b/conf/app.src index cf04753..d9db22b 100644 --- a/conf/app.src +++ b/conf/app.src @@ -3,4 +3,4 @@ SOURCE_SUM=3e39aefe18e48d9680e3590826b9f713ca22844c3c565982ab1d587e4ae6d7c3 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=jar SOURCE_IN_SUBDIR=true -SOURCE_EXTRACT=false +SOURCE_EXTRACT=komga.jar diff --git a/conf/nginx.conf b/conf/nginx.conf index 6017a98..64b5254 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,15 +1,12 @@ #sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; location __PATH__/ { - # Path to source - alias __FINALPATH__/ ; - # Force usage of https if ($scheme = http) { rewrite ^ https://$server_name$request_uri? permanent; } - proxy_pass http://127.0.0.1:__PORT____PATH__/; + proxy_pass http://127.0.0.1:__PORT__; proxy_pass_request_headers on; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; diff --git a/conf/systemd.service b/conf/systemd.service index 8056670..a40e335 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -7,7 +7,7 @@ Type=simple User=__APP__ Group=__APP__ WorkingDirectory=__FINALPATH__/ -ExecStart=java -jar __FINALPATH__/app.jar --server.port=__PORT__ --server.servlet.context-path="__PATH__" >> /var/log/__APP__/__APP__.log 2>&1 +ExecStart=java -jar __FINALPATH__/komga.jar --server.port=__PORT__ --server.servlet.context-path="__PATH__" >> /var/log/__APP__/__APP__.log 2>&1 [Install] WantedBy=multi-user.target diff --git a/issue_template.md b/issue_template.md index 4a290c4..2464f8d 100644 --- a/issue_template.md +++ b/issue_template.md @@ -8,7 +8,7 @@ about: When creating a bug report, please use the following template to provide 1. *Read this whole template first.* 2. *Determine if you are on the right place:* - *If you were performing an action on the app from the webadmin or the CLI (install, update, backup, restore, change_url...), you are on the right place!* - - *Otherwise, the issue may be due to REPLACEBYYOURAPP itself. Refer to its documentation or repository for help.* + - *Otherwise, the issue may be due to Komga itself. Refer to its documentation or repository for help.* - *When in doubt, post here and we will figure it out together.* 3. *Delete the italic comments as you write over them below, and remove this guide.* --- @@ -31,7 +31,7 @@ about: When creating a bug report, please use the following template to provide - *If you performed a command from the CLI, the command itself is enough. For example:* ```sh - sudo yunohost app install REPLACEBYYOURAPP + sudo yunohost app install komga ``` - *If you used the webadmin, please perform the equivalent command from the CLI first.* - *If the error occurs in your browser, explain what you did:* diff --git a/manifest.json b/manifest.json index 3c04dea..80d6e09 100644 --- a/manifest.json +++ b/manifest.json @@ -3,8 +3,8 @@ "id": "komga", "packaging_format": 1, "description": { - "en": "Komga is a free and open source comics/mangas/magazines server.", - "fr": "Expliquez en *quelques* (10~15) mots l'utilité de l'app ou ce qu'elle fait (l'objectif est de donner une idée grossière pour des utilisateurs qui naviguent dans un catalogue de 100+ apps)" + "en": "Media server for your comics, manga, comics and magazines. ", + "fr": "Serveur multimédia pour vos bandes dessinées, mangas, BD et magazines" }, "version": "0.75.1~ynh1", "url": "https://komga.org", diff --git a/scripts/_common.sh b/scripts/_common.sh index 87f72e0..474bc51 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,7 +5,7 @@ #================================================= # dependencies used by the app -pkg_dependencies="openjdk-8-jre-headless" +pkg_dependencies="openjdk-11-jre-headless" #================================================= # PERSONAL HELPERS diff --git a/scripts/backup b/scripts/backup index 24ca44d..b20c554 100755 --- a/scripts/backup +++ b/scripts/backup @@ -36,11 +36,6 @@ domain=$(ynh_app_setting_get --app=$app --key=domain) #================================================= ynh_print_info --message="Declaring files to be backed up..." -### N.B. : the following 'ynh_backup' calls are only a *declaration* of what needs -### to be backuped and not an actual copy of any file. The actual backup that -### creates and fill the archive with the files happens in the core after this -### script is called. Hence ynh_backups calls takes basically 0 seconds to run. - #================================================= # BACKUP THE APP MAIN DIR #================================================= @@ -73,7 +68,6 @@ ynh_backup --src_path="/etc/logrotate.d/$app" ynh_backup --src_path="/etc/systemd/system/$app.service" - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/change_url b/scripts/change_url index 126010e..4401818 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -29,11 +29,6 @@ ynh_script_progression --message="Loading installation settings..." --time --wei # Needed for helper "ynh_add_nginx_config" final_path=$(ynh_app_setting_get --app=$app --key=final_path) -# Add settings here as needed by your application -#db_name=$(ynh_app_setting_get --app=$app --key=db_name) -#db_user=$db_name -#db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd) - #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= @@ -105,12 +100,6 @@ then ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" fi -#================================================= -# SPECIFIC MODIFICATIONS -#================================================= -# ... -#================================================= - #================================================= # GENERIC FINALISATION #================================================= diff --git a/scripts/install b/scripts/install index 2e57960..82087d8 100755 --- a/scripts/install +++ b/scripts/install @@ -28,33 +28,13 @@ domain=$YNH_APP_ARG_DOMAIN path_url=$YNH_APP_ARG_PATH is_public=$YNH_APP_ARG_IS_PUBLIC -### If it's a multi-instance app, meaning it can be installed several times independently -### The id of the app as stated in the manifest is available as $YNH_APP_ID -### The instance number is available as $YNH_APP_INSTANCE_NUMBER (equals "1", "2"...) -### The app instance name is available as $YNH_APP_INSTANCE_NAME -### - the first time the app is installed, YNH_APP_INSTANCE_NAME = ynhexample -### - the second time the app is installed, YNH_APP_INSTANCE_NAME = ynhexample__2 -### - ynhexample__{N} for the subsequent installations, with N=3,4... -### The app instance name is probably what interests you most, since this is -### guaranteed to be unique. This is a good unique identifier to define installation path, -### db names... app=$YNH_APP_INSTANCE_NAME #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= -### About --weight and --time -### ynh_script_progression will show to your final users the progression of each scripts. -### In order to do that, --weight will represent the relative time of execution compared to the other steps in the script. -### --time is a packager option, it will show you the execution time since the previous call. -### This option should be removed before releasing your app. -### Use the execution time, given by --time, to estimate the weight of a step. -### A common way to do it is to set a weight equal to the execution time in second +1. -### The execution time is given for the duration since the previous call. So the weight should be applied to this previous call. ynh_script_progression --message="Validating installation parameters..." --time --weight=1 -### If the app uses NGINX as web server (written in HTML/PHP in most cases), the final path should be "/var/www/$app". -### If the app provides an internal web server (or uses another application server such as uWSGI), the final path should be "/opt/yunohost/$app" final_path=/opt/yunohost/$app test ! -e "$final_path" || ynh_die --message="This path already contains a folder" @@ -76,38 +56,15 @@ ynh_app_setting_set --app=$app --key=path --value=$path_url #================================================= ynh_script_progression --message="Finding an available port..." --time --weight=1 -### Use these lines if you have to open a port for the application -### `ynh_find_port` will find the first available port starting from the given port. -### If you're not using these lines: -### - Remove the section "CLOSE A PORT" in the remove script - # Find an available port port=$(ynh_find_port --port=8080) -ynh_replace_string --match_string=__PORT__ --replace_string="$port" --target_file="../conf/systemd.service" -ynh_replace_string --match_string=__PATH__ --replace_string="$path_url" --target_file="../conf/systemd.service" ynh_app_setting_set --app=$app --key=port --value=$port -# Optional: Expose this port publicly -# (N.B.: you only need to do this if the app actually needs to expose the port publicly. -# If you do this and the app doesn't actually need you are CREATING SECURITY HOLES IN THE SERVER !) - -# Open the port -# ynh_script_progression --message="Configuring firewall..." --time --weight=1 -# ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port - #================================================= # INSTALL DEPENDENCIES #================================================= ynh_script_progression --message="Installing dependencies..." --time --weight=1 -### `ynh_install_app_dependencies` allows you to add any "apt" dependencies to the package. -### Those deb packages will be installed as dependencies of this package. -### If you're not using this helper: -### - Remove the section "REMOVE DEPENDENCIES" in the remove script -### - Remove the variable "pkg_dependencies" in _common.sh -### - As well as the section "REINSTALL DEPENDENCIES" in the restore script -### - And the section "UPGRADE DEPENDENCIES" in the upgrade script - ynh_install_app_dependencies $pkg_dependencies #================================================= @@ -115,10 +72,6 @@ ynh_install_app_dependencies $pkg_dependencies #================================================= ynh_script_progression --message="Setting up source files..." --time --weight=1 -### `ynh_setup_source` is used to install an app from a zip or tar.gz file, -### downloaded from an upstream source, like a git repository. -### `ynh_setup_source` use the file conf/app.src - ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" @@ -128,8 +81,6 @@ ynh_setup_source --dest_dir="$final_path" #================================================= ynh_script_progression --message="Configuring NGINX web server..." --time --weight=1 -### `ynh_add_nginx_config` will use the file conf/nginx.conf - # Create a dedicated NGINX config ynh_add_nginx_config @@ -153,23 +104,15 @@ mkdir -p /home/$app/.komga/ # SECURING FILES AND DIRECTORIES #================================================= -chmod -R 777 /home/$app/.komga/ +chmod -R 755 /home/$app/.komga/ #================================================= # SETUP SYSTEMD #================================================= ynh_script_progression --message="Configuring a systemd service..." --time --weight=1 -### `ynh_systemd_config` is used to configure a systemd script for an app. -### It can be used for apps that use sysvinit (with adaptation) or systemd. -### Have a look at the app to be sure this app needs a systemd script. -### `ynh_systemd_config` will use the file conf/systemd.service -### If you're not using these lines: -### - You can remove those files in conf/. -### - Remove the section "BACKUP SYSTEMD" in the backup script -### - Remove also the section "STOP AND REMOVE SERVICE" in the remove script -### - As well as the section "RESTORE SYSTEMD" in the restore script -### - And the section "SETUP SYSTEMD" in the upgrade script +ynh_replace_string --match_string=__PORT__ --replace_string="$port" --target_file="../conf/systemd.service" +ynh_replace_string --match_string=__PATH__ --replace_string="$path_url" --target_file="../conf/systemd.service" # Create a dedicated systemd config ynh_add_systemd_config @@ -180,12 +123,7 @@ ynh_add_systemd_config # SECURE FILES AND DIRECTORIES #================================================= -### For security reason, any app should set the permissions to root: before anything else. -### Then, if write authorization is needed, any access should be given only to directories -### that really need such authorization. - # Set permissions to app files -#chown -R root: $final_path chown -R $app: $final_path #================================================= @@ -193,14 +131,6 @@ chown -R $app: $final_path #================================================= ynh_script_progression --message="Configuring log rotation..." --time --weight=1 -### `ynh_use_logrotate` is used to configure a logrotate configuration for the logs of this app. -### Use this helper only if there is effectively a log file for this app. -### If you're not using this helper: -### - Remove the section "BACKUP LOGROTATE" in the backup script -### - Remove also the section "REMOVE LOGROTATE CONFIGURATION" in the remove script -### - As well as the section "RESTORE THE LOGROTATE CONFIGURATION" in the restore script -### - And the section "SETUP LOGROTATE" in the upgrade script - # Use logrotate to manage application logfile(s) ynh_use_logrotate @@ -209,46 +139,13 @@ ynh_use_logrotate #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --time --weight=1 -### `yunohost service add` integrates a service in YunoHost. It then gets -### displayed in the admin interface and through the others `yunohost service` commands. -### (N.B.: this line only makes sense if the app adds a service to the system!) -### If you're not using these lines: -### - You can remove these files in conf/. -### - Remove the section "REMOVE SERVICE INTEGRATION IN YUNOHOST" in the remove script -### - As well as the section "INTEGRATE SERVICE IN YUNOHOST" in the restore script -### - And the section "INTEGRATE SERVICE IN YUNOHOST" in the upgrade script - yunohost service add $app --description="A short description of the app" --log="/var/log/$app/$app.log" -### Additional options starting with 3.8: -### -### --needs_exposed_ports "$port" a list of ports that needs to be publicly exposed -### which will then be checked by YunoHost's diagnosis system -### (N.B. DO NOT USE THIS is the port is only internal!!!) -### -### --test_status "some command" a custom command to check the status of the service -### (only relevant if 'systemctl status' doesn't do a good job) -### -### --test_conf "some command" some command similar to "nginx -t" that validates the conf of the service -### -### Re-calling 'yunohost service add' during the upgrade script is the right way -### to proceed if you later realize that you need to enable some flags that -### weren't enabled on old installs (be careful it'll override the existing -### service though so you should re-provide all relevant flags when doing so) - #================================================= # START SYSTEMD SERVICE #================================================= ynh_script_progression --message="Starting a systemd service..." --time --weight=1 -### `ynh_systemd_action` is used to start a systemd service for an app. -### Only needed if you have configure a systemd service -### If you're not using these lines: -### - Remove the section "STOP SYSTEMD SERVICE" and "START SYSTEMD SERVICE" in the backup script -### - As well as the section "START SYSTEMD SERVICE" in the restore script -### - As well as the section"STOP SYSTEMD SERVICE" and "START SYSTEMD SERVICE" in the upgrade script -### - And the section "STOP SYSTEMD SERVICE" and "START SYSTEMD SERVICE" in the change_url script - # Start a systemd service ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" @@ -260,14 +157,9 @@ ynh_script_progression --message="Configuring permissions..." --time --weight=1 # Make app public if necessary if [ $is_public -eq 1 ] then - # Everyone can access the app. - # The "main" permission is automatically created before the install script. ynh_permission_update --permission="main" --add="visitors" fi -# Everyone can access to the api part -# We don't want to display the tile in the sso so we put --show_tile="false" -# And we don't want that the YunoHost Admin can remove visitors group to this permission, so we put --protected="true" ynh_permission_create --permission="api" --url "/api" --allowed="visitors" --show_tile="false" --protected="true" #================================================= diff --git a/scripts/remove b/scripts/remove index 240542c..ae9926c 100755 --- a/scripts/remove +++ b/scripts/remove @@ -74,16 +74,6 @@ ynh_script_progression --message="Removing logrotate configuration..." --time -- # Remove the app-specific logrotate config ynh_remove_logrotate -#================================================= -# CLOSE A PORT -#================================================= - -if yunohost firewall list | grep -q "\- $port$" -then - ynh_script_progression --message="Closing port $port..." --time --weight=1 - ynh_exec_warn_less yunohost firewall disallow TCP $port -fi - #================================================= # SPECIFIC REMOVE #================================================= diff --git a/scripts/restore b/scripts/restore index a6c19c9..47fa664 100755 --- a/scripts/restore +++ b/scripts/restore @@ -77,7 +77,7 @@ ynh_system_user_create --username=$app #================================================= # Restore permissions on app files -chown -R root: $final_path +chown -R $app: $final_path chown -R $app: "/home/komga" #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index a010105..fc69692 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -24,12 +24,6 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) # CHECK VERSION #================================================= -### This helper will compare the version of the currently installed app and the version of the upstream package. -### $upgrade_type can have 2 different values -### - UPGRADE_APP if the upstream app version has changed -### - UPGRADE_PACKAGE if only the YunoHost package has changed -### ynh_check_app_version_changed will stop the upgrade if the app is up to date. -### UPGRADE_APP should be used to upgrade the core app only if there's an upgrade to do. upgrade_type=$(ynh_check_app_version_changed) #================================================= @@ -131,7 +125,7 @@ yunohost service add $app --description="A short description of the app" --log=" #================================================= ynh_script_progression --message="Starting a systemd service..." --time --weight=1 -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action=start --log_path="/var/log/$app/$app.log" #================================================= # RELOAD NGINX From 84a032d71164799e0c73f5017ba323d10eac81f9 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 28 Feb 2021 18:10:47 +0100 Subject: [PATCH 02/30] Fix --- conf/app.src | 2 +- conf/systemd.service | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/app.src b/conf/app.src index d9db22b..cf04753 100644 --- a/conf/app.src +++ b/conf/app.src @@ -3,4 +3,4 @@ SOURCE_SUM=3e39aefe18e48d9680e3590826b9f713ca22844c3c565982ab1d587e4ae6d7c3 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=jar SOURCE_IN_SUBDIR=true -SOURCE_EXTRACT=komga.jar +SOURCE_EXTRACT=false diff --git a/conf/systemd.service b/conf/systemd.service index a40e335..8056670 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -7,7 +7,7 @@ Type=simple User=__APP__ Group=__APP__ WorkingDirectory=__FINALPATH__/ -ExecStart=java -jar __FINALPATH__/komga.jar --server.port=__PORT__ --server.servlet.context-path="__PATH__" >> /var/log/__APP__/__APP__.log 2>&1 +ExecStart=java -jar __FINALPATH__/app.jar --server.port=__PORT__ --server.servlet.context-path="__PATH__" >> /var/log/__APP__/__APP__.log 2>&1 [Install] WantedBy=multi-user.target From 506151ddd7eb66e9a78c42a8af87babcb9d9d793 Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Sun, 28 Feb 2021 22:54:55 +0530 Subject: [PATCH 03/30] bumping version to test on server --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 80d6e09..19a7df6 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Media server for your comics, manga, comics and magazines. ", "fr": "Serveur multimédia pour vos bandes dessinées, mangas, BD et magazines" }, - "version": "0.75.1~ynh1", + "version": "0.75.1~ynh2", "url": "https://komga.org", "license": "MIT", "maintainer": { From 807ea2e9dd1db8e04ebf56b1221a5bfcf02a692e Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Sun, 28 Feb 2021 23:07:48 +0530 Subject: [PATCH 04/30] getting port in upgrade script --- scripts/upgrade | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/upgrade b/scripts/upgrade index fc69692..87acfc7 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -19,6 +19,7 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) +port=$(ynh_app_setting_get --app=$app --key=port) #================================================= # CHECK VERSION From 3e1605d11dc7c55b304bcc79b5c4c10af59c5e9f Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 28 Feb 2021 18:39:07 +0100 Subject: [PATCH 05/30] Fix --- conf/systemd.service | 4 ++-- manifest.json | 4 ++-- scripts/install | 30 +++++++++++++++--------------- scripts/remove | 18 +++++++++--------- 4 files changed, 28 insertions(+), 28 deletions(-) diff --git a/conf/systemd.service b/conf/systemd.service index 8056670..934d1e4 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -1,5 +1,5 @@ [Unit] -Description=Free and open source comics/mangas media server. +Description=Komga: comics and mangas media server After=network.target [Service] @@ -7,7 +7,7 @@ Type=simple User=__APP__ Group=__APP__ WorkingDirectory=__FINALPATH__/ -ExecStart=java -jar __FINALPATH__/app.jar --server.port=__PORT__ --server.servlet.context-path="__PATH__" >> /var/log/__APP__/__APP__.log 2>&1 +ExecStart=/usr/bin/java -jar __FINALPATH__/app.jar --server.port=__PORT__ --server.servlet.context-path="__PATH__" >> /var/log/__APP__/__APP__.log 2>&1 [Install] WantedBy=multi-user.target diff --git a/manifest.json b/manifest.json index 80d6e09..a18760e 100644 --- a/manifest.json +++ b/manifest.json @@ -3,8 +3,8 @@ "id": "komga", "packaging_format": 1, "description": { - "en": "Media server for your comics, manga, comics and magazines. ", - "fr": "Serveur multimédia pour vos bandes dessinées, mangas, BD et magazines" + "en": "Media server for your comics, manga and magazines", + "fr": "Serveur multimédia pour vos bandes dessinées, mangas et magazines" }, "version": "0.75.1~ynh1", "url": "https://komga.org", diff --git a/scripts/install b/scripts/install index 82087d8..32e8b46 100755 --- a/scripts/install +++ b/scripts/install @@ -33,7 +33,7 @@ app=$YNH_APP_INSTANCE_NAME #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= -ynh_script_progression --message="Validating installation parameters..." --time --weight=1 +ynh_script_progression --message="Validating installation parameters..." --weight=1 final_path=/opt/yunohost/$app test ! -e "$final_path" || ynh_die --message="This path already contains a folder" @@ -44,7 +44,7 @@ ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url #================================================= # STORE SETTINGS FROM MANIFEST #================================================= -ynh_script_progression --message="Storing installation settings..." --time --weight=1 +ynh_script_progression --message="Storing installation settings..." --weight=3 ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url @@ -54,10 +54,10 @@ ynh_app_setting_set --app=$app --key=path --value=$path_url #================================================= # FIND AND OPEN A PORT #================================================= -ynh_script_progression --message="Finding an available port..." --time --weight=1 +ynh_script_progression --message="Finding an available port..." --weight=1 # Find an available port -port=$(ynh_find_port --port=8080) +port=$(ynh_find_port --port=8443) ynh_app_setting_set --app=$app --key=port --value=$port #================================================= @@ -70,7 +70,7 @@ ynh_install_app_dependencies $pkg_dependencies #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_script_progression --message="Setting up source files..." --time --weight=1 +ynh_script_progression --message="Setting up source files..." --weight=15 ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src @@ -79,7 +79,7 @@ ynh_setup_source --dest_dir="$final_path" #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Configuring NGINX web server..." --time --weight=1 +ynh_script_progression --message="Configuring NGINX web server..." --weight=2 # Create a dedicated NGINX config ynh_add_nginx_config @@ -87,7 +87,7 @@ ynh_add_nginx_config #================================================= # CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Configuring system user..." --time --weight=1 +ynh_script_progression --message="Configuring system user..." --weight=2 # Create a system user ynh_system_user_create --username=$app @@ -109,7 +109,7 @@ chmod -R 755 /home/$app/.komga/ #================================================= # SETUP SYSTEMD #================================================= -ynh_script_progression --message="Configuring a systemd service..." --time --weight=1 +ynh_script_progression --message="Configuring a systemd service..." --weight=1 ynh_replace_string --match_string=__PORT__ --replace_string="$port" --target_file="../conf/systemd.service" ynh_replace_string --match_string=__PATH__ --replace_string="$path_url" --target_file="../conf/systemd.service" @@ -129,7 +129,7 @@ chown -R $app: $final_path #================================================= # SETUP LOGROTATE #================================================= -ynh_script_progression --message="Configuring log rotation..." --time --weight=1 +ynh_script_progression --message="Configuring log rotation..." --weight=1 # Use logrotate to manage application logfile(s) ynh_use_logrotate @@ -137,22 +137,22 @@ ynh_use_logrotate #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --time --weight=1 +ynh_script_progression --message="Integrating service in YunoHost..." --weight=2 yunohost service add $app --description="A short description of the app" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." --time --weight=1 +ynh_script_progression --message="Starting a systemd service..." --weight=1 # Start a systemd service -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action=start --log_path="/var/log/$app/$app.log" #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Configuring permissions..." --time --weight=1 +ynh_script_progression --message="Configuring permissions..." --weight=3 # Make app public if necessary if [ $is_public -eq 1 ] @@ -165,7 +165,7 @@ ynh_permission_create --permission="api" --url "/api" --allowed="visitors" --sho #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." --time --weight=1 +ynh_script_progression --message="Reloading NGINX web server..." --weight=6 ynh_systemd_action --service_name=nginx --action=reload @@ -173,4 +173,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Installation of $app completed" --time --last +ynh_script_progression --message="Installation of $app completed" --last diff --git a/scripts/remove b/scripts/remove index ae9926c..e7aa701 100755 --- a/scripts/remove +++ b/scripts/remove @@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --time --weight=1 +ynh_script_progression --message="Loading installation settings..." --weight=1 app=$YNH_APP_INSTANCE_NAME @@ -29,14 +29,14 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) # Remove the service from the list of services known by YunoHost (added from `yunohost service add`) if ynh_exec_warn_less yunohost service status $app >/dev/null then - ynh_script_progression --message="Removing $app service integration..." --time --weight=1 + ynh_script_progression --message="Removing $app service integration..." --weight=1 yunohost service remove $app fi #================================================= # STOP AND REMOVE SERVICE #================================================= -ynh_script_progression --message="Stopping and removing the systemd service..." --time --weight=1 +ynh_script_progression --message="Stopping and removing the systemd service..." --weight=2 # Remove the dedicated systemd config ynh_remove_systemd_config @@ -44,7 +44,7 @@ ynh_remove_systemd_config #================================================= # REMOVE DEPENDENCIES #================================================= -ynh_script_progression --message="Removing dependencies..." --time --weight=1 +ynh_script_progression --message="Removing dependencies..." --weight=1 # Remove metapackage and its dependencies ynh_remove_app_dependencies @@ -52,7 +52,7 @@ ynh_remove_app_dependencies #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_script_progression --message="Removing app main directory and database..." --time --weight=1 +ynh_script_progression --message="Removing app main directory and database..." --weight=6 # Remove the app directory securely ynh_secure_remove --file="$final_path" @@ -61,7 +61,7 @@ ynh_secure_remove --file="/home/komga/" #================================================= # REMOVE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Removing NGINX web server configuration..." --time --weight=1 +ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 # Remove the dedicated NGINX config ynh_remove_nginx_config @@ -69,7 +69,7 @@ ynh_remove_nginx_config #================================================= # REMOVE LOGROTATE CONFIGURATION #================================================= -ynh_script_progression --message="Removing logrotate configuration..." --time --weight=1 +ynh_script_progression --message="Removing logrotate configuration..." --weight=2 # Remove the app-specific logrotate config ynh_remove_logrotate @@ -90,7 +90,7 @@ ynh_secure_remove --file="/var/log/$app/" #================================================= # REMOVE DEDICATED USER #================================================= -ynh_script_progression --message="Removing the dedicated system user..." --time --weight=1 +ynh_script_progression --message="Removing the dedicated system user..." --weight=1 # Delete a system user ynh_system_user_delete --username=$app @@ -99,4 +99,4 @@ ynh_system_user_delete --username=$app # END OF SCRIPT #================================================= -ynh_script_progression --message="Removal of $app completed" --time --last +ynh_script_progression --message="Removal of $app completed" --last From 4f115d56f04aa8e5c121427546720ec6e5a5f0f3 Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Sun, 28 Feb 2021 23:15:14 +0530 Subject: [PATCH 06/30] added part to upgrade systemd script --- scripts/upgrade | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 87acfc7..39b87ca 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -89,6 +89,9 @@ ynh_script_progression --message="Making sure dedicated system user exists..." - # Create a dedicated user (if not existing) ynh_system_user_create --username=$app +ynh_replace_string --match_string=__PORT__ --replace_string="$port" --target_file="../conf/systemd.service" +ynh_replace_string --match_string=__PATH__ --replace_string="$path_url" --target_file="../conf/systemd.service" + #================================================= # SETUP SYSTEMD #================================================= From 2a54d07178600b8506d2a9d6bfd2648ab2d345b2 Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Sun, 28 Feb 2021 23:17:05 +0530 Subject: [PATCH 07/30] bumping version --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 20ac6c8..3d67fb2 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Media server for your comics, manga and magazines", "fr": "Serveur multimédia pour vos bandes dessinées, mangas et magazines" }, - "version": "0.75.1~ynh2", + "version": "0.75.1~ynh3", "url": "https://komga.org", "license": "MIT", "maintainer": { From 4fa9dc4021c94b8fe305bf1d2b907794dcc02aa5 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 28 Feb 2021 19:16:46 +0100 Subject: [PATCH 08/30] Fix --- conf/systemd.service | 8 ++++++-- scripts/install | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/conf/systemd.service b/conf/systemd.service index 934d1e4..e942943 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -1,5 +1,5 @@ [Unit] -Description=Komga: comics and mangas media server +Description=Komga server After=network.target [Service] @@ -7,7 +7,11 @@ Type=simple User=__APP__ Group=__APP__ WorkingDirectory=__FINALPATH__/ -ExecStart=/usr/bin/java -jar __FINALPATH__/app.jar --server.port=__PORT__ --server.servlet.context-path="__PATH__" >> /var/log/__APP__/__APP__.log 2>&1 +ExecStart=/usr/bin/java -jar -Xmx4g app.jar --server.port=__PORT__ --server.servlet.context-path="__PATH__/" +Restart=on-failure +RestartSec=10 +StandardOutput=null +StandardError=syslog [Install] WantedBy=multi-user.target diff --git a/scripts/install b/scripts/install index 32e8b46..5d7c64a 100755 --- a/scripts/install +++ b/scripts/install @@ -63,7 +63,7 @@ ynh_app_setting_set --app=$app --key=port --value=$port #================================================= # INSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Installing dependencies..." --time --weight=1 +ynh_script_progression --message="Installing dependencies..." --weight=1 ynh_install_app_dependencies $pkg_dependencies From 9bb3b429592091939528163440ef6e5c1791f0c1 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 28 Feb 2021 19:29:02 +0100 Subject: [PATCH 09/30] Cleaning up --- scripts/change_url | 16 ++++++++-------- scripts/install | 4 ++-- scripts/restore | 24 ++++++++++++------------ scripts/upgrade | 2 +- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index 4401818..2b07437 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -24,7 +24,7 @@ app=$YNH_APP_INSTANCE_NAME #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --time --weight=1 +ynh_script_progression --message="Loading installation settings..." --weight=1 # Needed for helper "ynh_add_nginx_config" final_path=$(ynh_app_setting_get --app=$app --key=final_path) @@ -32,7 +32,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --time --weight=1 +ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --weight=1 # Backup the current version of the app ynh_backup_before_upgrade @@ -67,14 +67,14 @@ fi #================================================= # STOP SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Stopping a systemd service..." --time --weight=1 +ynh_script_progression --message="Stopping a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" #================================================= # MODIFY URL IN NGINX CONF #================================================= -ynh_script_progression --message="Updating NGINX web server configuration..." --time --weight=1 +ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1 nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf @@ -105,14 +105,14 @@ fi #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." --time --weight=1 +ynh_script_progression --message="Starting a systemd service..." --weight=5 -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." --time --weight=1 +ynh_script_progression --message="Reloading NGINX web server..." --weight=1 ynh_systemd_action --service_name=nginx --action=reload @@ -120,4 +120,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Change of URL completed for $app" --time --last +ynh_script_progression --message="Change of URL completed for $app" --last diff --git a/scripts/install b/scripts/install index 5d7c64a..74845e7 100755 --- a/scripts/install +++ b/scripts/install @@ -139,7 +139,7 @@ ynh_use_logrotate #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --weight=2 -yunohost service add $app --description="A short description of the app" --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" #================================================= # START SYSTEMD SERVICE @@ -160,7 +160,7 @@ then ynh_permission_update --permission="main" --add="visitors" fi -ynh_permission_create --permission="api" --url "/api" --allowed="visitors" --show_tile="false" --protected="true" +#ynh_permission_create --permission="api" --url "/api" --allowed="visitors" --show_tile="false" --protected="true" #================================================= # RELOAD NGINX diff --git a/scripts/restore b/scripts/restore index 47fa664..a58a5b8 100755 --- a/scripts/restore +++ b/scripts/restore @@ -24,7 +24,7 @@ ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --time --weight=1 +ynh_script_progression --message="Loading installation settings..." --weight=1 app=$YNH_APP_INSTANCE_NAME @@ -35,7 +35,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= # CHECK IF THE APP CAN BE RESTORED #================================================= -ynh_script_progression --message="Validating restoration parameters..." --time --weight=1 +ynh_script_progression --message="Validating restoration parameters..." --weight=1 ynh_webpath_available --domain=$domain --path_url=$path_url \ || ynh_die --message="Path not available: ${domain}${path_url}" @@ -53,21 +53,21 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # RESTORE THE APP MAIN DIR #================================================= -ynh_script_progression --message="Restoring the app main directory..." --time --weight=1 +ynh_script_progression --message="Restoring the app main directory..." --weight=3 ynh_restore_file --origin_path="$final_path" #================================================= # RESTORE THE DATABASE DIR #================================================= -ynh_script_progression --message="Restoring the app database..." --time --weight=1 +ynh_script_progression --message="Restoring the app database..." --weight=6 ynh_restore_file --origin_path="/home/komga" #================================================= # RECREATE THE DEDICATED USER #================================================= -ynh_script_progression --message="Recreating the dedicated system user..." --time --weight=1 +ynh_script_progression --message="Recreating the dedicated system user..." --weight=2 # Create the dedicated user (if not existing) ynh_system_user_create --username=$app @@ -85,7 +85,7 @@ chown -R $app: "/home/komga" #================================================= # REINSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Reinstalling dependencies..." --time --weight=1 +ynh_script_progression --message="Reinstalling dependencies..." --weight=1 # Define and install dependencies ynh_install_app_dependencies $pkg_dependencies @@ -93,7 +93,7 @@ ynh_install_app_dependencies $pkg_dependencies #================================================= # RESTORE SYSTEMD #================================================= -ynh_script_progression --message="Restoring the systemd configuration..." --time --weight=1 +ynh_script_progression --message="Restoring the systemd configuration..." --weight=6 ynh_restore_file --origin_path="/etc/systemd/system/$app.service" systemctl enable $app.service --quiet @@ -101,14 +101,14 @@ systemctl enable $app.service --quiet #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --time --weight=1 +ynh_script_progression --message="Integrating service in YunoHost..." --weight=2 -yunohost service add $app --description="A short description of the app" --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" #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." --time --weight=1 +ynh_script_progression --message="Starting a systemd service..." --weight=3 ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" @@ -123,7 +123,7 @@ ynh_restore_file --origin_path="/etc/logrotate.d/$app" #================================================= # RELOAD NGINX AND PHP-FPM #================================================= -ynh_script_progression --message="Reloading NGINX web server..." --time --weight=1 +ynh_script_progression --message="Reloading NGINX web server..." --weight=1 ynh_systemd_action --service_name=nginx --action=reload @@ -131,4 +131,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Restoration completed for $app" --time --last +ynh_script_progression --message="Restoration completed for $app" --last diff --git a/scripts/upgrade b/scripts/upgrade index 39b87ca..7d40f2e 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -122,7 +122,7 @@ ynh_use_logrotate --non-append #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --time --weight=1 -yunohost service add $app --description="A short description of the app" --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" #================================================= # START SYSTEMD SERVICE From 79c2cfd42dc934761b93934babd5dd329187f5ad Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 28 Feb 2021 21:21:15 +0100 Subject: [PATCH 10/30] Fix --- application.yml | 26 ++++++++++++++++++++++++++ scripts/change_url | 4 ++-- scripts/install | 8 ++------ scripts/remove | 6 ++---- scripts/upgrade | 24 ++++++++++++------------ 5 files changed, 44 insertions(+), 24 deletions(-) create mode 100644 application.yml diff --git a/application.yml b/application.yml new file mode 100644 index 0000000..1be4500 --- /dev/null +++ b/application.yml @@ -0,0 +1,26 @@ +komga: + libraries-scan-cron: "* */15 * * * ?" #periodic scan every 15 minutes + libraries-scan-cron: "-" #disable periodic scan + libraries-scan-startup: false #scan libraries at startup + libraries-scan-directory-exclusions: #patterns to exclude directories from the scan + - "#recycle" #synology NAS recycle bin + - "@eaDir" #synology NAS index/metadata folders + remember-me: + key: changeMe! #required to activate the remember-me auto-login via cookies + validity: 2592000 #validity of the cookie in seconds, here 1 month + database: + file: /home/__APP__/.komga/database.sqlite + database-backup: + path: ~/.komga/database-backup.zip + schedule: "0 0 */6 * * ?" #every 6 hours + enabled: true + startup: true +server: + port: __PORT__ + servlet.context-path: __PATH__/ +spring: + datasource: + url: jdbc:h2:/path/to/your/database.h2 #absolute path for Unix + url: jdbc:h2:D:\\komga\database.h2 #absolute path for Windows + url: jdbc:h2:~/.komga/database.h2 #relative path to user home directory + url: jdbc:h2:./komga/database.h2 #relative path to current directory diff --git a/scripts/change_url b/scripts/change_url index 2b07437..0e2df49 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -69,7 +69,7 @@ fi #================================================= ynh_script_progression --message="Stopping a systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action=stop --log_path="/var/log/$app/$app.log" #================================================= # MODIFY URL IN NGINX CONF @@ -107,7 +107,7 @@ fi #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=5 -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" +ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" #================================================= # RELOAD NGINX diff --git a/scripts/install b/scripts/install index 74845e7..703efec 100755 --- a/scripts/install +++ b/scripts/install @@ -100,12 +100,6 @@ ynh_system_user_create --username=$app mkdir -p /home/$app/.komga/ -#================================================= -# SECURING FILES AND DIRECTORIES -#================================================= - -chmod -R 755 /home/$app/.komga/ - #================================================= # SETUP SYSTEMD #================================================= @@ -125,6 +119,8 @@ ynh_add_systemd_config # Set permissions to app files chown -R $app: $final_path +chown -R $app: /home/$app +chmod -R 755 /home/$app/.komga/ #================================================= # SETUP LOGROTATE diff --git a/scripts/remove b/scripts/remove index e7aa701..e025c61 100755 --- a/scripts/remove +++ b/scripts/remove @@ -56,7 +56,7 @@ ynh_script_progression --message="Removing app main directory and database..." - # Remove the app directory securely ynh_secure_remove --file="$final_path" -ynh_secure_remove --file="/home/komga/" +ynh_secure_remove --file="/home/komga" #================================================= # REMOVE NGINX CONFIGURATION @@ -80,10 +80,8 @@ ynh_remove_logrotate # REMOVE VARIOUS FILES #================================================= -ynh_secure_remove --file="/etc/$app/" - # Remove the log files -ynh_secure_remove --file="/var/log/$app/" +ynh_secure_remove --file="/var/log/$app" #================================================= # GENERIC FINALIZATION diff --git a/scripts/upgrade b/scripts/upgrade index 7d40f2e..0bd477b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --time --weight=1 +ynh_script_progression --message="Loading installation settings..." --weight=1 app=$YNH_APP_INSTANCE_NAME @@ -30,12 +30,12 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= -ynh_script_progression --message="Ensuring downward compatibility..." --time --weight=1 +ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --time --weight=1 +ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=2 # Backup the current version of the app ynh_backup_before_upgrade @@ -50,9 +50,9 @@ ynh_abort_if_errors #================================================= # STOP SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Stopping a systemd service..." --time --weight=1 +ynh_script_progression --message="Stopping a systemd service..." --weight=2 -ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action=stop --log_path="/var/log/$app/$app.log" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -60,7 +60,7 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app if [ "$upgrade_type" == "UPGRADE_APP" ] then - ynh_script_progression --message="Upgrading source files..." --time --weight=1 + ynh_script_progression --message="Upgrading source files..." --weight=3 # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" @@ -69,7 +69,7 @@ fi #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading NGINX web server configuration..." --time --weight=1 +ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=5 # Create a dedicated NGINX config ynh_add_nginx_config @@ -77,26 +77,26 @@ ynh_add_nginx_config #================================================= # UPGRADE DEPENDENCIES #================================================= -ynh_script_progression --message="Upgrading dependencies..." --time --weight=1 +ynh_script_progression --message="Upgrading dependencies..." --weight=1 ynh_install_app_dependencies $pkg_dependencies #================================================= # CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Making sure dedicated system user exists..." --time --weight=1 +ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 # Create a dedicated user (if not existing) ynh_system_user_create --username=$app -ynh_replace_string --match_string=__PORT__ --replace_string="$port" --target_file="../conf/systemd.service" -ynh_replace_string --match_string=__PATH__ --replace_string="$path_url" --target_file="../conf/systemd.service" - #================================================= # SETUP SYSTEMD #================================================= ynh_script_progression --message="Upgrading systemd configuration..." --time --weight=1 +ynh_replace_string --match_string=__PORT__ --replace_string="$port" --target_file="../conf/systemd.service" +ynh_replace_string --match_string=__PATH__ --replace_string="$path_url" --target_file="../conf/systemd.service" + # Create a dedicated systemd config ynh_add_systemd_config From cf909c9c9c9e62125dd64e535ec37530620b478e Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 28 Feb 2021 21:59:46 +0100 Subject: [PATCH 11/30] Update nginx.conf --- conf/nginx.conf | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 64b5254..02a7d09 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -7,12 +7,16 @@ location __PATH__/ { } proxy_pass http://127.0.0.1:__PORT__; - proxy_pass_request_headers on; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header X-Forwarded-Host $http_host; + proxy_redirect off; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-Port $server_port; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Host $server_name; + + #WebSocket Support + proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $http_connection; From 0c8111922ef04fc498bb10f715947c0f2e2780c2 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 28 Feb 2021 22:09:19 +0100 Subject: [PATCH 12/30] add config file --- application.yml => conf/application.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename application.yml => conf/application.yml (100%) diff --git a/application.yml b/conf/application.yml similarity index 100% rename from application.yml rename to conf/application.yml From 8ee0a4c83a616d68623315f839791b960afe30f2 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 28 Feb 2021 22:21:50 +0100 Subject: [PATCH 13/30] Update install --- scripts/install | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/install b/scripts/install index 703efec..b702a0b 100755 --- a/scripts/install +++ b/scripts/install @@ -111,6 +111,8 @@ ynh_replace_string --match_string=__PATH__ --replace_string="$path_url" --target # Create a dedicated systemd config ynh_add_systemd_config + + #================================================= # GENERIC FINALIZATION #================================================= @@ -119,6 +121,7 @@ ynh_add_systemd_config # Set permissions to app files chown -R $app: $final_path +chmod +x $final_path/app.jar chown -R $app: /home/$app chmod -R 755 /home/$app/.komga/ From 9e7618739577da4160b00aa7f9df2aa4d0820e7d Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 28 Feb 2021 22:26:15 +0100 Subject: [PATCH 14/30] Set log_path to systemd --- scripts/change_url | 3 ++- scripts/install | 6 ++---- scripts/restore | 2 +- scripts/upgrade | 3 ++- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index 0e2df49..3c1994d 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -28,6 +28,7 @@ ynh_script_progression --message="Loading installation settings..." --weight=1 # Needed for helper "ynh_add_nginx_config" final_path=$(ynh_app_setting_get --app=$app --key=final_path) +port=$(ynh_app_setting_get --app=$app --key=port) #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP @@ -107,7 +108,7 @@ fi #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=5 -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action=start --log_path="systemd" #================================================= # RELOAD NGINX diff --git a/scripts/install b/scripts/install index b702a0b..e690744 100755 --- a/scripts/install +++ b/scripts/install @@ -138,7 +138,7 @@ ynh_use_logrotate #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --weight=2 -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="systemd" #================================================= # START SYSTEMD SERVICE @@ -146,7 +146,7 @@ yunohost service add $app --description="Media server for your comics, manga and ynh_script_progression --message="Starting a systemd service..." --weight=1 # Start a systemd service -ynh_systemd_action --service_name=$app --action=start --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action=start --log_path="systemd" #================================================= # SETUP SSOWAT @@ -159,8 +159,6 @@ then ynh_permission_update --permission="main" --add="visitors" fi -#ynh_permission_create --permission="api" --url "/api" --allowed="visitors" --show_tile="false" --protected="true" - #================================================= # RELOAD NGINX #================================================= diff --git a/scripts/restore b/scripts/restore index a58a5b8..a1f9107 100755 --- a/scripts/restore +++ b/scripts/restore @@ -110,7 +110,7 @@ yunohost service add $app --description="Media server for your comics, manga and #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=3 -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action=start --log_path="systemd" #================================================= # RESTORE THE LOGROTATE CONFIGURATION diff --git a/scripts/upgrade b/scripts/upgrade index 0bd477b..c3d6cd0 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -108,6 +108,7 @@ ynh_add_systemd_config # Set permissions on app files chown -R $app: $final_path +chmod +x $final_path/app.jar #================================================= # SETUP LOGROTATE @@ -129,7 +130,7 @@ yunohost service add $app --description="Media server for your comics, manga and #================================================= ynh_script_progression --message="Starting a systemd service..." --time --weight=1 -ynh_systemd_action --service_name=$app --action=start --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action=start --log_path="systemd" #================================================= # RELOAD NGINX From f1b383d2481249b5b7e80acd9c0492b45177c6fe Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 28 Feb 2021 23:03:22 +0100 Subject: [PATCH 15/30] Update systemd.service --- conf/systemd.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/systemd.service b/conf/systemd.service index e942943..16142ad 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -7,7 +7,7 @@ Type=simple User=__APP__ Group=__APP__ WorkingDirectory=__FINALPATH__/ -ExecStart=/usr/bin/java -jar -Xmx4g app.jar --server.port=__PORT__ --server.servlet.context-path="__PATH__/" +ExecStart=/usr/bin/java -jar -Xmx1g app.jar --server.port=__PORT__ --server.servlet.context-path="__PATH__/" Restart=on-failure RestartSec=10 StandardOutput=null From ea3651aafa5b92cb0ec6f936635d36791cbcca55 Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Mon, 1 Mar 2021 12:43:29 +0530 Subject: [PATCH 16/30] bumping ynh version to test --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 3d67fb2..4c23c22 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Media server for your comics, manga and magazines", "fr": "Serveur multimédia pour vos bandes dessinées, mangas et magazines" }, - "version": "0.75.1~ynh3", + "version": "0.75.1~ynh4", "url": "https://komga.org", "license": "MIT", "maintainer": { From 265ffdd0c1b1d3f62310cb2ac7248f106849f081 Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Mon, 1 Mar 2021 13:27:22 +0530 Subject: [PATCH 17/30] decrementing --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 4c23c22..20ac6c8 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Media server for your comics, manga and magazines", "fr": "Serveur multimédia pour vos bandes dessinées, mangas et magazines" }, - "version": "0.75.1~ynh4", + "version": "0.75.1~ynh2", "url": "https://komga.org", "license": "MIT", "maintainer": { From 2f7234795f689c3ff178d5d74546fe10d1318c43 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 1 Mar 2021 09:17:49 +0100 Subject: [PATCH 18/30] Cleaning up --- scripts/upgrade | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index c3d6cd0..f733863 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -84,7 +84,7 @@ ynh_install_app_dependencies $pkg_dependencies #================================================= # CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 +ynh_script_progression --message="Making sure dedicated system user exists..." --weight=6 # Create a dedicated user (if not existing) ynh_system_user_create --username=$app @@ -113,7 +113,7 @@ chmod +x $final_path/app.jar #================================================= # SETUP LOGROTATE #================================================= -ynh_script_progression --message="Upgrading logrotate configuration..." --time --weight=1 +ynh_script_progression --message="Upgrading logrotate configuration..." --weight=2 # Use logrotate to manage app-specific logfile(s) ynh_use_logrotate --non-append @@ -121,21 +121,21 @@ ynh_use_logrotate --non-append #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --time --weight=1 +ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 yunohost service add $app --description="Media server for your comics, manga and magazines" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." --time --weight=1 +ynh_script_progression --message="Starting a systemd service..." --weight=2 ynh_systemd_action --service_name=$app --action=start --log_path="systemd" #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." --time --weight=1 +ynh_script_progression --message="Reloading NGINX web server..." --weight=3 ynh_systemd_action --service_name=nginx --action=reload @@ -143,4 +143,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Upgrade of $app completed" --time --last +ynh_script_progression --message="Upgrade of $app completed" --last From a23aa5db9fdcab7a479a5da30fbe7e91a2d36b10 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 1 Mar 2021 09:18:07 +0100 Subject: [PATCH 19/30] Update upgrade --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index f733863..dd6166c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -92,7 +92,7 @@ ynh_system_user_create --username=$app #================================================= # SETUP SYSTEMD #================================================= -ynh_script_progression --message="Upgrading systemd configuration..." --time --weight=1 +ynh_script_progression --message="Upgrading systemd configuration..." --weight=1 ynh_replace_string --match_string=__PORT__ --replace_string="$port" --target_file="../conf/systemd.service" ynh_replace_string --match_string=__PATH__ --replace_string="$path_url" --target_file="../conf/systemd.service" From aa4ec5ff60ef71215492b612fc8600b3abae0ced Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 1 Mar 2021 10:03:40 +0100 Subject: [PATCH 20/30] Fix linter warnings --- check_process | 2 +- scripts/install | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/check_process b/check_process index f031c9f..344d514 100644 --- a/check_process +++ b/check_process @@ -17,7 +17,7 @@ upgrade=1 upgrade=1 from_commit=1bfcc7c84ce84fa28e682e4e3167d3a9b90bbd24cc59ac5c371b8f61a9af550b backup_restore=1 - multi_instance=0 + multi_instance=1 port_already_use=0 change_url=1 ;;; Options diff --git a/scripts/install b/scripts/install index e690744..9bc09f6 100755 --- a/scripts/install +++ b/scripts/install @@ -138,7 +138,7 @@ ynh_use_logrotate #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --weight=2 -yunohost service add $app --description="Media server for your comics, manga and magazines" --log="systemd" +yunohost service add $app --description="Media server for your comics, manga and magazines" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE From cd9d60c7672f90b21e87413b12f80d84af04ebfe Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 1 Mar 2021 10:04:47 +0100 Subject: [PATCH 21/30] Update check_process --- check_process | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/check_process b/check_process index 344d514..cd75927 100644 --- a/check_process +++ b/check_process @@ -15,7 +15,6 @@ setup_private=1 setup_public=1 upgrade=1 - upgrade=1 from_commit=1bfcc7c84ce84fa28e682e4e3167d3a9b90bbd24cc59ac5c371b8f61a9af550b backup_restore=1 multi_instance=1 port_already_use=0 @@ -24,7 +23,7 @@ Email= Notification=none ;;; Upgrade options - ; commit=1bfcc7c84ce84fa28e682e4e3167d3a9b90bbd24cc59ac5c371b8f61a9af550b - name=2021-02-28 commit + ; commit= + name= manifest_arg=domain=DOMAIN&path=PATH&is_public=1&port=8080& From 10a108ea92e0db1fcff14cc2bed8d7d0ee3d95d2 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 1 Mar 2021 10:08:28 +0100 Subject: [PATCH 22/30] Add line_match to prevent 502 --- scripts/change_url | 2 +- scripts/install | 2 +- scripts/restore | 2 +- scripts/upgrade | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index 3c1994d..6851d0c 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -108,7 +108,7 @@ fi #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=5 -ynh_systemd_action --service_name=$app --action=start --log_path="systemd" +ynh_systemd_action --service_name=$app --action=start --log_path="systemd" --line_match="Started Komga server" #================================================= # RELOAD NGINX diff --git a/scripts/install b/scripts/install index 9bc09f6..5786c89 100755 --- a/scripts/install +++ b/scripts/install @@ -146,7 +146,7 @@ yunohost service add $app --description="Media server for your comics, manga and 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" +ynh_systemd_action --service_name=$app --action=start --log_path="systemd" --line_match="Started Komga server" #================================================= # SETUP SSOWAT diff --git a/scripts/restore b/scripts/restore index a1f9107..fff50a6 100755 --- a/scripts/restore +++ b/scripts/restore @@ -110,7 +110,7 @@ yunohost service add $app --description="Media server for your comics, manga and #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=3 -ynh_systemd_action --service_name=$app --action=start --log_path="systemd" +ynh_systemd_action --service_name=$app --action=start --log_path="systemd" --line_match="Started Komga server" #================================================= # RESTORE THE LOGROTATE CONFIGURATION diff --git a/scripts/upgrade b/scripts/upgrade index dd6166c..535bc56 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -130,7 +130,7 @@ yunohost service add $app --description="Media server for your comics, manga and #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=2 -ynh_systemd_action --service_name=$app --action=start --log_path="systemd" +ynh_systemd_action --service_name=$app --action=start --log_path="systemd" --line_match="Started Komga server" #================================================= # RELOAD NGINX From 76642ce0ee0c63e81eddaf8dccd705eb2298e146 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Mon, 1 Mar 2021 14:33:28 +0100 Subject: [PATCH 23/30] disable auth_header --- scripts/install | 2 ++ scripts/upgrade | 2 ++ 2 files changed, 4 insertions(+) diff --git a/scripts/install b/scripts/install index 5786c89..1a1f004 100755 --- a/scripts/install +++ b/scripts/install @@ -153,6 +153,8 @@ ynh_systemd_action --service_name=$app --action=start --log_path="systemd" --lin #================================================= ynh_script_progression --message="Configuring permissions..." --weight=3 +ynh_permission_url --permission="main" --auth_header="false" + # Make app public if necessary if [ $is_public -eq 1 ] then diff --git a/scripts/upgrade b/scripts/upgrade index 535bc56..946d0ab 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -32,6 +32,8 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 +ynh_permission_url --permission="main" --auth_header="false" + #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= From 0b2e46aa50c155088a518741572d1808672c9c91 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Mon, 1 Mar 2021 14:34:03 +0100 Subject: [PATCH 24/30] fix line_match --- conf/systemd.service | 2 -- scripts/change_url | 2 +- scripts/install | 2 +- scripts/restore | 3 ++- scripts/upgrade | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/conf/systemd.service b/conf/systemd.service index 16142ad..6e2c583 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -10,8 +10,6 @@ WorkingDirectory=__FINALPATH__/ ExecStart=/usr/bin/java -jar -Xmx1g app.jar --server.port=__PORT__ --server.servlet.context-path="__PATH__/" Restart=on-failure RestartSec=10 -StandardOutput=null -StandardError=syslog [Install] WantedBy=multi-user.target diff --git a/scripts/change_url b/scripts/change_url index 6851d0c..20c8fc5 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -108,7 +108,7 @@ fi #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=5 -ynh_systemd_action --service_name=$app --action=start --log_path="systemd" --line_match="Started Komga server" +ynh_systemd_action --service_name=$app --action=start --log_path="systemd" --line_match="Tomcat started on port\(s\): $port \(http\) with context path '$path_url'" #================================================= # RELOAD NGINX diff --git a/scripts/install b/scripts/install index 1a1f004..682881c 100755 --- a/scripts/install +++ b/scripts/install @@ -146,7 +146,7 @@ yunohost service add $app --description="Media server for your comics, manga and 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="Started Komga server" +ynh_systemd_action --service_name=$app --action=start --log_path="systemd" --line_match="Tomcat started on port\(s\): $port \(http\) with context path '$path_url'" #================================================= # SETUP SSOWAT diff --git a/scripts/restore b/scripts/restore index fff50a6..5c4fdc8 100755 --- a/scripts/restore +++ b/scripts/restore @@ -31,6 +31,7 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) +port=$(ynh_app_setting_get --app=$app --key=port) #================================================= # CHECK IF THE APP CAN BE RESTORED @@ -110,7 +111,7 @@ yunohost service add $app --description="Media server for your comics, manga and #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=3 -ynh_systemd_action --service_name=$app --action=start --log_path="systemd" --line_match="Started Komga server" +ynh_systemd_action --service_name=$app --action=start --log_path="systemd" --line_match="Tomcat started on port\(s\): $port \(http\) with context path '$path_url'" #================================================= # RESTORE THE LOGROTATE CONFIGURATION diff --git a/scripts/upgrade b/scripts/upgrade index 946d0ab..7557524 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -132,7 +132,7 @@ yunohost service add $app --description="Media server for your comics, manga and #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=2 -ynh_systemd_action --service_name=$app --action=start --log_path="systemd" --line_match="Started Komga server" +ynh_systemd_action --service_name=$app --action=start --log_path="systemd" --line_match="Tomcat started on port\(s\): $port \(http\) with context path '$path_url'" #================================================= # RELOAD NGINX From 774f6117805e4142643b5a74d0ed2c4371e79a03 Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Mon, 1 Mar 2021 19:17:39 +0530 Subject: [PATCH 25/30] Update scripts/upgrade removes setting auth header to false in upgrade script Co-authored-by: Kayou --- scripts/upgrade | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 7557524..c70870b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -32,8 +32,6 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 -ynh_permission_url --permission="main" --auth_header="false" - #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= From f62dc9073f142d61e3ce5e479e8f521fb1781c13 Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Tue, 2 Mar 2021 16:31:15 +0530 Subject: [PATCH 26/30] adding timeout and changing line match --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 682881c..e8ca779 100755 --- a/scripts/install +++ b/scripts/install @@ -146,7 +146,7 @@ yunohost service add $app --description="Media server for your comics, manga and 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="Tomcat started on port\(s\): $port \(http\) with context path '$path_url'" +ynh_systemd_action --service_name=$app --action=start --log_path="systemd" --line_match="Tomcat initialized with port\(s\): $port \(http\)" --timeout="120" #================================================= # SETUP SSOWAT From 2f411dfa9c5eaf6126e6cbaf74a49abf354fd31b Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Tue, 2 Mar 2021 16:31:42 +0530 Subject: [PATCH 27/30] Update upgrade --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index c70870b..a3758a5 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -130,7 +130,7 @@ yunohost service add $app --description="Media server for your comics, manga and #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=2 -ynh_systemd_action --service_name=$app --action=start --log_path="systemd" --line_match="Tomcat started on port\(s\): $port \(http\) with context path '$path_url'" +ynh_systemd_action --service_name=$app --action=start --log_path="systemd" --line_match="Tomcat initialized with port\(s\): $port \(http\)" --timeout="120" #================================================= # RELOAD NGINX From 18bf349d31c0b0bba598fda5df7c40b5e9d26475 Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Thu, 4 Mar 2021 14:55:05 +0530 Subject: [PATCH 28/30] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index e8ca779..7e513af 100755 --- a/scripts/install +++ b/scripts/install @@ -146,7 +146,7 @@ yunohost service add $app --description="Media server for your comics, manga and 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="Tomcat initialized with port\(s\): $port \(http\)" --timeout="120" +ynh_systemd_action --service_name=$app --action=start --log_path="systemd" --line_match="Tomcat initialized with port\(s\): $port \(http\)" --timeout="500" #================================================= # SETUP SSOWAT From 776503b71e453df6f12236fdf07a30ade4cfb274 Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Thu, 4 Mar 2021 14:55:39 +0530 Subject: [PATCH 29/30] Update upgrade --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index a3758a5..a1f566b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -130,7 +130,7 @@ yunohost service add $app --description="Media server for your comics, manga and #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=2 -ynh_systemd_action --service_name=$app --action=start --log_path="systemd" --line_match="Tomcat initialized with port\(s\): $port \(http\)" --timeout="120" +ynh_systemd_action --service_name=$app --action=start --log_path="systemd" --line_match="Tomcat initialized with port\(s\): $port \(http\)" --timeout="500" #================================================= # RELOAD NGINX From 3b5d649d8005f0acb2fbea465d50a762d4cbd5a3 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 4 Mar 2021 15:13:34 +0100 Subject: [PATCH 30/30] Fix badges --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3827f6c..8cf4b2f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Komga for YunoHost -[![Integration level](https://dash.yunohost.org/integration/Komga.svg)](https://dash.yunohost.org/appci/app/Komga) ![](https://ci-apps.yunohost.org/ci/badges/Komga.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/Komga.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/komga.svg)](https://dash.yunohost.org/appci/app/komga) ![](https://ci-apps.yunohost.org/ci/badges/komga.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/komga.maintain.svg) [![Install Komga with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=komga) *[Lire ce readme en français.](./README_fr.md)*