From 012d6de0154d115505d72c3f20e70183b156f776 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 12 Jun 2024 15:12:04 +0200 Subject: [PATCH] add settings --- conf/application.yml | 34 ++++++++++++---------------------- conf/systemd.service | 2 +- manifest.toml | 3 +-- scripts/install | 10 ++++++++++ scripts/upgrade | 10 ++++++++++ 5 files changed, 34 insertions(+), 25 deletions(-) diff --git a/conf/application.yml b/conf/application.yml index 43005f9..fb38f86 100644 --- a/conf/application.yml +++ b/conf/application.yml @@ -1,26 +1,16 @@ +# Only keep lines that are relevant to you! +# Lines starting with # are comments +# Make sure indentation is correct (2 spaces at every indentation level), yaml is very sensitive! 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 + config-dir: __DATA_DIR__/ database: - file: __DATA_DIR__/.komga/database.sqlite - database-backup: - path: ~/.komga/database-backup.zip - schedule: "0 0 */6 * * ?" #every 6 hours - enabled: true - startup: true + file: __DATA_DIR__/database.sqlite + cors.allowed-origins: + - http://127.0.0.1:__PORT__ + delete-empty-collections: true + delete-empty-read-lists: 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 + servlet: + session.timeout: 7d # session timeout, here 7 days + context-path: __PATH__/ diff --git a/conf/systemd.service b/conf/systemd.service index f9e5eca..db4f26b 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -7,7 +7,7 @@ Type=simple User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ -ExecStart=/usr/bin/java -jar -Xmx1g komga.jar --server.port=__PORT__ --server.servlet.context-path="__PATH__" +ExecStart=/usr/bin/java -jar -Xmx1g komga.jar --server.port=__PORT__ --server.servlet.context-path="__PATH__" --komga.config-dir="__DATA_DIR__/" Restart=on-failure RestartSec=10 diff --git a/manifest.toml b/manifest.toml index 167c656..b23b584 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Komga" description.en = "Media server for your comics, manga and magazines" description.fr = "Serveur multimédia pour vos bandes dessinées, mangas et magazines" -version = "1.10.3~ynh1" +version = "1.11.1~ynh1" maintainers = ["Navan Chauhan"] @@ -55,7 +55,6 @@ ram.runtime = "50M" [resources.install_dir] [resources.data_dir] - subdirs = [".komga"] [resources.permissions] main.url = "/" diff --git a/scripts/install b/scripts/install index 7d144e1..8b80ac6 100755 --- a/scripts/install +++ b/scripts/install @@ -19,6 +19,16 @@ ynh_setup_source --dest_dir="$install_dir" chown -R $app:www-data "$install_dir" chmod +x $install_dir/komga.jar +#================================================= +# APP INITIAL CONFIGURATION +#================================================= +ynh_script_progression --message="Adding $app's configuration files..." --weight=1 + +ynh_add_config --template="application.yml" --destination="$data_dir/application.yml" + +chmod 400 "$data_dir/application.yml" +chown "$app:$app" "$data_dir/application.yml" + #================================================= # SYSTEM CONFIGURATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 124f67c..4dee396 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -28,6 +28,16 @@ ynh_setup_source --dest_dir="$install_dir" chown -R $app:www-data "$install_dir" chmod +x $install_dir/komga.jar +#================================================= +# UPDATE A CONFIG FILE +#================================================= +ynh_script_progression --message="Updating $app's configuration files..." --weight=1 + +ynh_add_config --template="application.yml" --destination="$data_dir/application.yml" + +chmod 400 "$data_dir/application.yml" +chown "$app:$app" "$data_dir/application.yml" + #================================================= # REAPPLY SYSTEM CONFIGURATIONS #=================================================