mirror of
https://github.com/YunoHost-Apps/komga_ynh.git
synced 2024-09-03 19:36:07 +02:00
commit
3b8d4d1144
16 changed files with 141 additions and 233 deletions
|
@ -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 Komga itself. Refer to its documentation or repository for help.*
|
||||
- *Otherwise, the issue may be due to the app 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 komga
|
||||
sudo yunohost app install the_app
|
||||
```
|
||||
- *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:*
|
16
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
16
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
|
@ -0,0 +1,16 @@
|
|||
## Problem
|
||||
|
||||
- *Description of why you made this PR*
|
||||
|
||||
## Solution
|
||||
|
||||
- *And how do you fix that problem*
|
||||
|
||||
## PR Status
|
||||
|
||||
- [ ] Code finished and ready to be reviewed/tested
|
||||
- [ ] The fix/enhancement were manually tested (if applicable)
|
||||
|
||||
## Automatic tests
|
||||
|
||||
Automatic tests can be triggered on https://ci-apps-dev.yunohost.org/ *after creating the PR*, by commenting "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!". (N.B. : for this to work you need to be a member of the Yunohost-Apps organization)
|
68
README.md
68
README.md
|
@ -1,3 +1,8 @@
|
|||
<!--
|
||||
N.B.: This README was automatically generated by https://github.com/YunoHost/apps/tree/master/tools/README-generator
|
||||
It shall NOT be edited by hand.
|
||||
-->
|
||||
|
||||
# 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)
|
||||
|
@ -10,61 +15,20 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
|
|||
|
||||
## Overview
|
||||
|
||||
Komga is a free and open source comics/mangas server.
|
||||
Media server for your comics, manga and magazines
|
||||
|
||||
Features include:
|
||||
**Shipped version:** 0.106.1~ynh1
|
||||
|
||||
* Browse libraries, series and books
|
||||
* Search bar
|
||||
* Download book files
|
||||
* Manage multiple users, with per-library accesss control
|
||||
* Webreader
|
||||
**Demo:** https://demo.komga.org
|
||||
|
||||
**Shipped version:** 0.75.1
|
||||
## Documentation and resources
|
||||
|
||||
## Screenshots
|
||||
|
||||
![](./screenshots/home.png)
|
||||
|
||||
## Demo
|
||||
|
||||
* [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.
|
||||
|
||||
## Documentation
|
||||
|
||||
* Official documentation: Link to the official documentation of this app
|
||||
|
||||
## YunoHost specific features
|
||||
|
||||
#### Multi-user support
|
||||
|
||||
Are LDAP and HTTP auth supported? **No**
|
||||
Can the app be used by multiple users? **Yes**
|
||||
|
||||
#### Supported architectures
|
||||
|
||||
* 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
|
||||
|
||||
* None discovered yet.
|
||||
|
||||
## Links
|
||||
|
||||
* Report a bug: https://github.com/YunoHost-Apps/komga_ynh/issues
|
||||
* App website: https://komga.org
|
||||
* Upstream app repository: https://github.com/gotson/komga
|
||||
* YunoHost website: https://yunohost.org/
|
||||
|
||||
---
|
||||
* Official app website: https://komga.org
|
||||
* Official user documentation: https://yunohost.org/apps
|
||||
* Official admin documentation: https://komga.org/guides/
|
||||
* Upstream app code repository: https://github.com/gotson/komga
|
||||
* YunoHost documentation for this app: https://yunohost.org/app_komga
|
||||
* Report a bug: https://github.com/YunoHost-Apps/komga_ynh/issues
|
||||
|
||||
## Developer info
|
||||
|
||||
|
@ -76,3 +40,5 @@ sudo yunohost app install https://github.com/YunoHost-Apps/komga_ynh/tree/testin
|
|||
or
|
||||
sudo yunohost app upgrade komga -u https://github.com/YunoHost-Apps/komga_ynh/tree/testing --debug
|
||||
```
|
||||
|
||||
**More info regarding app packaging:** https://yunohost.org/packaging_apps
|
69
README_fr.md
69
README_fr.md
|
@ -4,70 +4,27 @@
|
|||
[![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)*
|
||||
*[Lire ce readme en français.](./README_fr.md)*
|
||||
|
||||
> *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.*
|
||||
Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.*
|
||||
|
||||
## Vue d'ensemble
|
||||
Komga est un serveur multimédia pour vos bandes dessinées, mangas, BD et magazines.
|
||||
|
||||
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
|
||||
Serveur multimédia pour vos bandes dessinées, mangas et magazines
|
||||
|
||||
**Version incluse :** 0.75.1
|
||||
**Version incluse :** 0.106.1~ynh1
|
||||
|
||||
## Captures d'écran
|
||||
**Démo :** https://demo.komga.org
|
||||
|
||||
![](./screenshots/home.png)
|
||||
## Documentations et ressources
|
||||
|
||||
## Démo
|
||||
|
||||
* [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
|
||||
|
||||
## Documentation
|
||||
|
||||
* 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 ? **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/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
|
||||
|
||||
* Limitations connues.
|
||||
|
||||
## Informations additionnelles
|
||||
|
||||
* Autres informations que vous souhaitez ajouter sur cette application.
|
||||
|
||||
## Liens
|
||||
|
||||
* 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/
|
||||
|
||||
---
|
||||
* Site officiel de l'app : https://komga.org
|
||||
* Documentation officielle utilisateur : https://yunohost.org/apps
|
||||
* Documentation officielle de l'admin : https://komga.org/guides/
|
||||
* Dépôt de code officiel de l'app : https://github.com/gotson/komga
|
||||
* Documentation YunoHost pour cette app : https://yunohost.org/app_komga
|
||||
* Signaler un bug : https://github.com/YunoHost-Apps/komga_ynh/issues
|
||||
|
||||
## Informations pour les développeurs
|
||||
|
||||
|
@ -79,3 +36,5 @@ sudo yunohost app install https://github.com/YunoHost-Apps/komga_ynh/tree/testin
|
|||
ou
|
||||
sudo yunohost app upgrade komga -u https://github.com/YunoHost-Apps/komga_ynh/tree/testing --debug
|
||||
```
|
||||
|
||||
**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps
|
|
@ -1,12 +1,9 @@
|
|||
# See here for more information
|
||||
# https://github.com/YunoHost/package_check#syntax-check_process-file
|
||||
|
||||
;; Test complet
|
||||
; Manifest
|
||||
domain="domain.tld" (DOMAIN)
|
||||
path="/path" (PATH)
|
||||
is_public=1 (PUBLIC|public=1|private=0)
|
||||
port="8080" (PORT)
|
||||
domain="domain.tld"
|
||||
path="/path"
|
||||
is_public=1
|
||||
port="8080"
|
||||
; Checks
|
||||
pkg_linter=1
|
||||
setup_sub_dir=1
|
||||
|
@ -17,7 +14,6 @@
|
|||
upgrade=1
|
||||
backup_restore=1
|
||||
multi_instance=1
|
||||
port_already_use=0
|
||||
change_url=1
|
||||
;;; Options
|
||||
Email=
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
SOURCE_URL=https://github.com/gotson/komga/releases/download/v0.87.4/komga-0.87.4.jar
|
||||
SOURCE_SUM=35ff050b912d516e8026e22a85deb5e76d70744d520d7e92203192fb9abb4101
|
||||
SOURCE_URL=https://github.com/gotson/komga/releases/download/v0.106.1/komga-0.106.1.jar
|
||||
SOURCE_SUM=53c7c617793acbfb134ed5c3c48c1702761feb67fd6a5478bdf403f3479fc40a
|
||||
SOURCE_SUM_PRG=sha256sum
|
||||
SOURCE_FORMAT=jar
|
||||
SOURCE_IN_SUBDIR=true
|
||||
SOURCE_IN_SUBDIR=false
|
||||
SOURCE_EXTRACT=false
|
||||
SOURCE_FILENAME=komga.jar
|
||||
|
|
|
@ -6,8 +6,8 @@ After=network.target
|
|||
Type=simple
|
||||
User=__APP__
|
||||
Group=__APP__
|
||||
WorkingDirectory=__FINALPATH__/
|
||||
ExecStart=/usr/bin/java -jar -Xmx1g app.jar --server.port=__PORT__ --server.servlet.context-path="__PATH__/"
|
||||
WorkingDirectory=__FINALPATH__
|
||||
ExecStart=/usr/bin/java -jar -Xmx1g komga.jar --server.port=__PORT__ --server.servlet.context-path="__PATH__"
|
||||
Restart=on-failure
|
||||
RestartSec=10
|
||||
|
||||
|
|
0
doc/DISCLAIMER.md
Normal file
0
doc/DISCLAIMER.md
Normal file
|
@ -6,8 +6,16 @@
|
|||
"en": "Media server for your comics, manga and magazines",
|
||||
"fr": "Serveur multimédia pour vos bandes dessinées, mangas et magazines"
|
||||
},
|
||||
"version": "0.87.4~ynh1",
|
||||
"version": "0.106.1~ynh1",
|
||||
"url": "https://komga.org",
|
||||
"upstream": {
|
||||
"license": "MIT",
|
||||
"website": "https://komga.org",
|
||||
"demo": "https://demo.komga.org",
|
||||
"admindoc": "https://komga.org/guides/",
|
||||
"userdoc": "https://yunohost.org/apps",
|
||||
"code": "https://github.com/gotson/komga"
|
||||
},
|
||||
"multi_instance": true,
|
||||
"license": "MIT",
|
||||
"maintainer": {
|
||||
|
@ -16,7 +24,7 @@
|
|||
"url": "https://navan.dev"
|
||||
},
|
||||
"requirements": {
|
||||
"yunohost": ">= 4.1.3"
|
||||
"yunohost": ">= 4.2.4"
|
||||
},
|
||||
"services": [
|
||||
"nginx"
|
||||
|
@ -26,29 +34,17 @@
|
|||
{
|
||||
"name": "domain",
|
||||
"type": "domain",
|
||||
"ask": {
|
||||
"en": "Choose a domain name for Komga",
|
||||
"fr": "Choisissez un nom de domaine pour Komga"
|
||||
},
|
||||
"example": "example.com"
|
||||
},
|
||||
{
|
||||
"name": "path",
|
||||
"type": "path",
|
||||
"ask": {
|
||||
"en": "Choose a path for Komga",
|
||||
"fr": "Choisissez un chemin pour Komga"
|
||||
},
|
||||
"example": "/komga",
|
||||
"default": "/komga"
|
||||
},
|
||||
{
|
||||
"name": "is_public",
|
||||
"type": "boolean",
|
||||
"ask": {
|
||||
"en": "Is it a public application?",
|
||||
"fr": "Est-ce une application publique ?"
|
||||
},
|
||||
"default": true
|
||||
}
|
||||
]
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
## Problem
|
||||
- *Description of why you made this PR*
|
||||
|
||||
## Solution
|
||||
- *And how do you fix that problem*
|
||||
|
||||
## PR Status
|
||||
- [ ] Code finished.
|
||||
- [ ] Tested with Package_check.
|
||||
- [ ] Fix or enhancement tested.
|
||||
- [ ] Upgrade from last version tested.
|
||||
- [ ] Can be reviewed and tested.
|
||||
|
||||
## Package_check results
|
||||
---
|
||||
* An automatic package_check will be launch at https://ci-apps-dev.yunohost.org/, when you add a specific comment to your Pull Request: "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!"*
|
|
@ -30,6 +30,7 @@ app=$YNH_APP_INSTANCE_NAME
|
|||
|
||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
|
||||
|
||||
#=================================================
|
||||
# DECLARE DATA AND CONF FILES TO BACKUP
|
||||
|
@ -46,7 +47,7 @@ ynh_backup --src_path="$final_path"
|
|||
# BACKUP THE Database DIR
|
||||
#=================================================
|
||||
|
||||
ynh_backup --src_path="/home/komga"
|
||||
ynh_backup --src_path="$datadir" --is_big
|
||||
|
||||
#=================================================
|
||||
# BACKUP THE NGINX CONFIGURATION
|
||||
|
|
|
@ -101,6 +101,15 @@ then
|
|||
ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# SETUP SYSTEMD
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring a systemd service..." --weight=1
|
||||
|
||||
path_url=$new_path
|
||||
# Create a dedicated systemd config
|
||||
ynh_add_systemd_config
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALISATION
|
||||
#=================================================
|
||||
|
@ -108,7 +117,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="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="Started ApplicationKt"
|
||||
|
||||
#=================================================
|
||||
# RELOAD NGINX
|
||||
|
|
|
@ -67,6 +67,14 @@ ynh_script_progression --message="Installing dependencies..." --weight=1
|
|||
|
||||
ynh_install_app_dependencies $pkg_dependencies
|
||||
|
||||
#=================================================
|
||||
# CREATE DEDICATED USER
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring system user..." --weight=2
|
||||
|
||||
# Create a system user
|
||||
ynh_system_user_create --username=$app --home_dir="$final_path"
|
||||
|
||||
#=================================================
|
||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||
#=================================================
|
||||
|
@ -76,6 +84,11 @@ 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"
|
||||
|
||||
chmod 750 "$final_path"
|
||||
chmod -R o-rwx "$final_path"
|
||||
chown -R $app:www-data "$final_path"
|
||||
chmod +x $final_path/komga.jar
|
||||
|
||||
#=================================================
|
||||
# NGINX CONFIGURATION
|
||||
#=================================================
|
||||
|
@ -85,46 +98,27 @@ ynh_script_progression --message="Configuring NGINX web server..." --weight=2
|
|||
ynh_add_nginx_config
|
||||
|
||||
#=================================================
|
||||
# CREATE DEDICATED USER
|
||||
# CREATE DATA DIRECTORY
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring system user..." --weight=2
|
||||
ynh_script_progression --message="Creating a data directory..." --weight=1
|
||||
|
||||
# Create a system user
|
||||
ynh_system_user_create --username=$app
|
||||
datadir=/home/yunohost.app/$app
|
||||
ynh_app_setting_set --app=$app --key=datadir --value=$datadir
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC SETUP
|
||||
#=================================================
|
||||
# CREATE DIRECTORIES
|
||||
#=================================================
|
||||
mkdir -p $datadir/.komga
|
||||
|
||||
mkdir -p /home/$app/.komga/
|
||||
chmod 750 "$datadir"
|
||||
chmod -R o-rwx "$datadir"
|
||||
chown -R $app:www-data "$datadir"
|
||||
|
||||
#=================================================
|
||||
# SETUP SYSTEMD
|
||||
#=================================================
|
||||
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"
|
||||
|
||||
# Create a dedicated systemd config
|
||||
ynh_add_systemd_config
|
||||
|
||||
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
#=================================================
|
||||
# SECURE FILES AND DIRECTORIES
|
||||
#=================================================
|
||||
|
||||
# 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/
|
||||
|
||||
#=================================================
|
||||
# SETUP LOGROTATE
|
||||
#=================================================
|
||||
|
@ -146,7 +140,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="Completed initialization" --timeout="120"
|
||||
ynh_systemd_action --service_name=$app --action=start --log_path="systemd" --line_match="Started ApplicationKt"
|
||||
|
||||
#=================================================
|
||||
# SETUP SSOWAT
|
||||
|
|
|
@ -56,7 +56,6 @@ 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"
|
||||
|
||||
#=================================================
|
||||
# REMOVE NGINX CONFIGURATION
|
||||
|
@ -74,15 +73,6 @@ ynh_script_progression --message="Removing logrotate configuration..." --weight=
|
|||
# Remove the app-specific logrotate config
|
||||
ynh_remove_logrotate
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC REMOVE
|
||||
#=================================================
|
||||
# REMOVE VARIOUS FILES
|
||||
#=================================================
|
||||
|
||||
# Remove the log files
|
||||
ynh_secure_remove --file="/var/log/$app"
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
#=================================================
|
||||
|
|
|
@ -32,6 +32,7 @@ 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)
|
||||
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
|
||||
|
||||
#=================================================
|
||||
# CHECK IF THE APP CAN BE RESTORED
|
||||
|
@ -51,6 +52,14 @@ test ! -d $final_path \
|
|||
|
||||
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||
|
||||
#=================================================
|
||||
# RECREATE THE DEDICATED USER
|
||||
#=================================================
|
||||
ynh_script_progression --message="Recreating the dedicated system user..." --weight=2
|
||||
|
||||
# Create the dedicated user (if not existing)
|
||||
ynh_system_user_create --username=$app --home_dir="$final_path"
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE APP MAIN DIR
|
||||
#=================================================
|
||||
|
@ -58,28 +67,23 @@ ynh_script_progression --message="Restoring the app main directory..." --weight=
|
|||
|
||||
ynh_restore_file --origin_path="$final_path"
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE DATABASE DIR
|
||||
#=================================================
|
||||
ynh_script_progression --message="Restoring the app database..." --weight=6
|
||||
|
||||
ynh_restore_file --origin_path="/home/komga"
|
||||
chmod 750 "$final_path"
|
||||
chmod -R o-rwx "$final_path"
|
||||
chown -R $app:www-data "$final_path"
|
||||
chmod +x $final_path/komga.jar
|
||||
|
||||
#=================================================
|
||||
# RECREATE THE DEDICATED USER
|
||||
# RESTORE THE DATA DIRECTORY
|
||||
#=================================================
|
||||
ynh_script_progression --message="Recreating the dedicated system user..." --weight=2
|
||||
ynh_script_progression --message="Restoring the data directory..." --weight=1
|
||||
|
||||
# Create the dedicated user (if not existing)
|
||||
ynh_system_user_create --username=$app
|
||||
ynh_restore_file --origin_path="$datadir" --not_mandatory
|
||||
|
||||
#=================================================
|
||||
# RESTORE USER RIGHTS
|
||||
#=================================================
|
||||
mkdir -p $datadir
|
||||
|
||||
# Restore permissions on app files
|
||||
chown -R $app: $final_path
|
||||
chown -R $app: "/home/komga"
|
||||
chmod 750 "$datadir"
|
||||
chmod -R o-rwx "$datadir"
|
||||
chown -R $app:www-data "$datadir"
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC RESTORATION
|
||||
|
@ -111,7 +115,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="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="Started ApplicationKt"
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE LOGROTATE CONFIGURATION
|
||||
|
|
|
@ -54,6 +54,14 @@ 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"
|
||||
|
||||
#=================================================
|
||||
# CREATE DEDICATED USER
|
||||
#=================================================
|
||||
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 --home_dir="$final_path"
|
||||
|
||||
#=================================================
|
||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||
#=================================================
|
||||
|
@ -66,6 +74,11 @@ then
|
|||
ynh_setup_source --dest_dir="$final_path"
|
||||
fi
|
||||
|
||||
chmod 750 "$final_path"
|
||||
chmod -R o-rwx "$final_path"
|
||||
chown -R $app:www-data "$final_path"
|
||||
chmod +x $final_path/komga.jar
|
||||
|
||||
#=================================================
|
||||
# NGINX CONFIGURATION
|
||||
#=================================================
|
||||
|
@ -81,35 +94,14 @@ 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..." --weight=6
|
||||
|
||||
# Create a dedicated user (if not existing)
|
||||
ynh_system_user_create --username=$app
|
||||
|
||||
#=================================================
|
||||
# SETUP SYSTEMD
|
||||
#=================================================
|
||||
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"
|
||||
|
||||
# Create a dedicated systemd config
|
||||
ynh_add_systemd_config
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
#=================================================
|
||||
# SECURE FILES AND DIRECTORIES
|
||||
#=================================================
|
||||
|
||||
# Set permissions on app files
|
||||
chown -R $app: $final_path
|
||||
chmod +x $final_path/app.jar
|
||||
|
||||
#=================================================
|
||||
# SETUP LOGROTATE
|
||||
#=================================================
|
||||
|
@ -130,7 +122,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="Completed initialization" --timeout="120"
|
||||
ynh_systemd_action --service_name=$app --action=start --log_path="systemd" --line_match="Started ApplicationKt"
|
||||
|
||||
#=================================================
|
||||
# RELOAD NGINX
|
||||
|
|
Loading…
Reference in a new issue