Repository: YunoHost-Apps/shields_ynh
Pull request #6: Cleanup
Author: login: yalh76
Created: 2025-03-02T19:29:31Z | Merged: 2025-03-02T22:54:39Z



Diff:
diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md
new file mode 100644
index 0000000..1a128a3
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE.md
@@ -0,0 +1,55 @@
+---
+name: Bug report
+about: When creating a bug report, please use the following template to provide all the relevant information and help debugging efficiently.
+
+---
+
+**How to post a meaningful bug report**
+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 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.*
+--- 
+
+### Describe the bug
+
+*A clear and concise description of what the bug is.*
+
+### Context
+
+- Hardware: *VPS bought online / Old laptop or computer / Raspberry Pi at home / Internet Cube with VPN / Other ARM board / ...*
+- YunoHost version: x.x.x
+- I have access to my server: *Through SSH | through the webadmin | direct access via keyboard / screen | ...*
+- Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: *no / yes*
+  - If yes, please explain:
+- Using, or trying to install package version/branch:
+- If upgrading, current package version: *can be found in the admin, or with `yunohost app info $app_id`*
+
+### Steps to reproduce
+
+- *If you performed a command from the CLI, the command itself is enough. For example:*
+    ```sh
+    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:*
+   1. *Go to '...'*
+   2. *Click on '...'*
+   3. *Scroll down to '...'*
+   4. *See error*
+
+### Expected behavior
+
+*A clear and concise description of what you expected to happen. You can remove this section if the command above is enough to understand your intent.*
+
+### Logs
+
+*When an operation fails, YunoHost provides a simple way to share the logs.*
+- *In the webadmin, the error message contains a link to the relevant log page. On that page, you will be able to 'Share with Yunopaste'. If you missed it, the logs of previous operations are also available under Tools > Logs.*
+- *In command line, the command to share the logs is displayed at the end of the operation and looks like `yunohost log display [log name] --share`. If you missed it, you can find the log ID of a previous operation using `yunohost log list`.*
+
+*After sharing the log, please copypaste directly the link provided by YunoHost (to help readability, no need to copypaste the entire content of the log here, just the link is enough...)*
+
+*If applicable and useful, add screenshots to help explain your problem.*
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 0000000..0d2bfa6
--- /dev/null
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -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)
diff --git a/README.md b/README.md
index 40208a9..147f8b2 100644
--- a/README.md
+++ b/README.md
@@ -20,6 +20,7 @@ It shall NOT be edited by hand.
 
 Shields.io is a service for concise, consistent, and legible badges in SVG and raster format, which can easily be included in GitHub readmes or any other web page. The service supports dozens of continuous integration services, package registries, distributions, app stores, social networks, code coverage services, and code analysis services.
 
+
 **Shipped version:** 2025.03.01~ynh1
 
 ## Screenshots
diff --git a/README_es.md b/README_es.md
index 44fabd7..9d35a2b 100644
--- a/README_es.md
+++ b/README_es.md
@@ -20,6 +20,7 @@ No se debe editar a mano.
 
 Shields.io is a service for concise, consistent, and legible badges in SVG and raster format, which can easily be included in GitHub readmes or any other web page. The service supports dozens of continuous integration services, package registries, distributions, app stores, social networks, code coverage services, and code analysis services.
 
+
 **Versión actual:** 2025.03.01~ynh1
 
 ## Capturas
diff --git a/README_eu.md b/README_eu.md
index 1528345..2a8b839 100644
--- a/README_eu.md
+++ b/README_eu.md
@@ -20,6 +20,7 @@ EZ editatu eskuz.
 
 Shields.io is a service for concise, consistent, and legible badges in SVG and raster format, which can easily be included in GitHub readmes or any other web page. The service supports dozens of continuous integration services, package registries, distributions, app stores, social networks, code coverage services, and code analysis services.
 
+
 **Paketatutako bertsioa:** 2025.03.01~ynh1
 
 ## Pantaila-argazkiak
diff --git a/README_fr.md b/README_fr.md
index 16bd9f9..1607135 100644
--- a/README_fr.md
+++ b/README_fr.md
@@ -20,6 +20,7 @@ Il NE doit PAS être modifié à la main.
 
 Shields.io est un service de badges concis, cohérents et lisibles au format SVG et raster, qui peuvent facilement être inclus dans les fichiers readme de GitHub ou toute autre page Web. Le service prend en charge des dizaines de services d'intégration continue, de registres de packages, de distributions, de magasins d'applications, de réseaux sociaux, de services de couverture de code et de services d'analyse de code.
 
+
 **Version incluse :** 2025.03.01~ynh1
 
 ## Captures d’écran
diff --git a/README_gl.md b/README_gl.md
index 594ae2c..9a6a431 100644
--- a/README_gl.md
+++ b/README_gl.md
@@ -20,6 +20,7 @@ NON debe editarse manualmente.
 
 Shields.io is a service for concise, consistent, and legible badges in SVG and raster format, which can easily be included in GitHub readmes or any other web page. The service supports dozens of continuous integration services, package registries, distributions, app stores, social networks, code coverage services, and code analysis services.
 
+
 **Versión proporcionada:** 2025.03.01~ynh1
 
 ## Capturas de pantalla
diff --git a/README_id.md b/README_id.md
index 6929a77..a927472 100644
--- a/README_id.md
+++ b/README_id.md
@@ -20,6 +20,7 @@ Ini TIDAK boleh diedit dengan tangan.
 
 Shields.io is a service for concise, consistent, and legible badges in SVG and raster format, which can easily be included in GitHub readmes or any other web page. The service supports dozens of continuous integration services, package registries, distributions, app stores, social networks, code coverage services, and code analysis services.
 
+
 **Versi terkirim:** 2025.03.01~ynh1
 
 ## Tangkapan Layar
diff --git a/README_nl.md b/README_nl.md
index bc6c95a..69436d8 100644
--- a/README_nl.md
+++ b/README_nl.md
@@ -20,6 +20,7 @@ Hij mag NIET handmatig aangepast worden.
 
 Shields.io is a service for concise, consistent, and legible badges in SVG and raster format, which can easily be included in GitHub readmes or any other web page. The service supports dozens of continuous integration services, package registries, distributions, app stores, social networks, code coverage services, and code analysis services.
 
+
 **Geleverde versie:** 2025.03.01~ynh1
 
 ## Schermafdrukken
diff --git a/README_pl.md b/README_pl.md
index 2cad6ba..9a55937 100644
--- a/README_pl.md
+++ b/README_pl.md
@@ -20,6 +20,7 @@ Nie powinno być ono edytowane ręcznie.
 
 Shields.io is a service for concise, consistent, and legible badges in SVG and raster format, which can easily be included in GitHub readmes or any other web page. The service supports dozens of continuous integration services, package registries, distributions, app stores, social networks, code coverage services, and code analysis services.
 
+
 **Dostarczona wersja:** 2025.03.01~ynh1
 
 ## Zrzuty ekranu
diff --git a/README_ru.md b/README_ru.md
index c12a8b0..32663a4 100644
--- a/README_ru.md
+++ b/README_ru.md
@@ -20,6 +20,7 @@
 
 Shields.io is a service for concise, consistent, and legible badges in SVG and raster format, which can easily be included in GitHub readmes or any other web page. The service supports dozens of continuous integration services, package registries, distributions, app stores, social networks, code coverage services, and code analysis services.
 
+
 **Поставляемая версия:** 2025.03.01~ynh1
 
 ## Снимки экрана
diff --git a/README_zh_Hans.md b/README_zh_Hans.md
index 3815c73..693fa8a 100644
--- a/README_zh_Hans.md
+++ b/README_zh_Hans.md
@@ -20,6 +20,7 @@
 
 Shields.io is a service for concise, consistent, and legible badges in SVG and raster format, which can easily be included in GitHub readmes or any other web page. The service supports dozens of continuous integration services, package registries, distributions, app stores, social networks, code coverage services, and code analysis services.
 
+
 **分发版本：** 2025.03.01~ynh1
 
 ## 截图
diff --git a/conf/systemd.service b/conf/systemd.service
index 558ca15..1aef527 100644
--- a/conf/systemd.service
+++ b/conf/systemd.service
@@ -10,7 +10,40 @@ Environment="PATH=__PATH_WITH_NODEJS__"
 Environment="NODE_ENV=production"
 WorkingDirectory=__INSTALL_DIR__/
 ExecStart=__NODEJS_DIR__/node server __PORT__
-Restart=on-failure
+StandardOutput=append:/var/log/__APP__/__APP__.log
+StandardError=inherit
+
+# Sandboxing options to harden security
+# Details for these options: https://www.freedesktop.org/software/systemd/man/systemd.exec.html
+NoNewPrivileges=yes
+PrivateTmp=yes
+PrivateDevices=yes
+RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 AF_NETLINK
+RestrictNamespaces=yes
+RestrictRealtime=yes
+DevicePolicy=closed
+ProtectClock=yes
+ProtectHostname=yes
+ProtectProc=invisible
+ProtectSystem=full
+ProtectControlGroups=yes
+ProtectKernelModules=yes
+ProtectKernelTunables=yes
+LockPersonality=yes
+SystemCallArchitectures=native
+SystemCallFilter=~@clock @debug @module @mount @obsolete @reboot @setuid @swap @cpu-emulation @privileged
+
+# Denying access to capabilities that should not be relevant for webapps
+# Doc: https://man7.org/linux/man-pages/man7/capabilities.7.html
+CapabilityBoundingSet=~CAP_RAWIO CAP_MKNOD
+CapabilityBoundingSet=~CAP_AUDIT_CONTROL CAP_AUDIT_READ CAP_AUDIT_WRITE
+CapabilityBoundingSet=~CAP_SYS_BOOT CAP_SYS_TIME CAP_SYS_MODULE CAP_SYS_PACCT
+CapabilityBoundingSet=~CAP_LEASE CAP_LINUX_IMMUTABLE CAP_IPC_LOCK
+CapabilityBoundingSet=~CAP_BLOCK_SUSPEND CAP_WAKE_ALARM
+CapabilityBoundingSet=~CAP_SYS_TTY_CONFIG
+CapabilityBoundingSet=~CAP_MAC_ADMIN CAP_MAC_OVERRIDE
+CapabilityBoundingSet=~CAP_NET_ADMIN CAP_NET_BROADCAST CAP_NET_RAW
+CapabilityBoundingSet=~CAP_SYS_ADMIN CAP_SYS_PTRACE CAP_SYSLOG
 
 [Install]
-WantedBy=multi-user.target
\ No newline at end of file
+WantedBy=multi-user.target
diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md
index 6b2209f..358eb9d 100644
--- a/doc/DESCRIPTION.md
+++ b/doc/DESCRIPTION.md
@@ -1 +1 @@
-Shields.io is a service for concise, consistent, and legible badges in SVG and raster format, which can easily be included in GitHub readmes or any other web page. The service supports dozens of continuous integration services, package registries, distributions, app stores, social networks, code coverage services, and code analysis services.
\ No newline at end of file
+Shields.io is a service for concise, consistent, and legible badges in SVG and raster format, which can easily be included in GitHub readmes or any other web page. The service supports dozens of continuous integration services, package registries, distributions, app stores, social networks, code coverage services, and code analysis services.
diff --git a/doc/DESCRIPTION_fr.md b/doc/DESCRIPTION_fr.md
index 452af5c..1111919 100644
--- a/doc/DESCRIPTION_fr.md
+++ b/doc/DESCRIPTION_fr.md
@@ -1 +1 @@
-Shields.io est un service de badges concis, cohérents et lisibles au format SVG et raster, qui peuvent facilement être inclus dans les fichiers readme de GitHub ou toute autre page Web. Le service prend en charge des dizaines de services d'intégration continue, de registres de packages, de distributions, de magasins d'applications, de réseaux sociaux, de services de couverture de code et de services d'analyse de code.
\ No newline at end of file
+Shields.io est un service de badges concis, cohérents et lisibles au format SVG et raster, qui peuvent facilement être inclus dans les fichiers readme de GitHub ou toute autre page Web. Le service prend en charge des dizaines de services d'intégration continue, de registres de packages, de distributions, de magasins d'applications, de réseaux sociaux, de services de couverture de code et de services d'analyse de code.
diff --git a/manifest.toml b/manifest.toml
index b58c926..8df964b 100644
--- a/manifest.toml
+++ b/manifest.toml
@@ -22,7 +22,9 @@ yunohost = ">= 11.2.30"
 helpers_version = "2.1"
 architectures = "all"
 multi_instance = true
+
 ldap = false
+
 sso = false
 
 disk = "512M"
diff --git a/scripts/_common.sh b/scripts/_common.sh
index e4f53e2..87e1075 100644
--- a/scripts/_common.sh
+++ b/scripts/_common.sh
@@ -4,4 +4,4 @@
 # COMMON VARIABLES AND CUSTOM HELPERS
 #=================================================
 
-nodejs_version="20"
\ No newline at end of file
+nodejs_version="20"
diff --git a/scripts/backup b/scripts/backup
index 50e701d..0d9d14d 100755
--- a/scripts/backup
+++ b/scripts/backup
@@ -1,5 +1,10 @@
 #!/bin/bash
 
+#=================================================
+# IMPORT GENERIC HELPERS
+#=================================================
+
+# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
 source ../settings/scripts/_common.sh
 source /usr/share/yunohost/helpers
 
@@ -12,13 +17,18 @@ ynh_print_info "Declaring files to be backed up..."
 ynh_backup "$install_dir"
 
 #=================================================
-# SYSTEM CONFIGURATION
+# BACKUP SYSTEM CONFIGURATION
 #=================================================
 
+# Backup the NGINX configuration
 ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
 
+# Backup the systemd service unit
 ynh_backup "/etc/systemd/system/$app.service"
 
+# Backup the logrotate configuration
+ynh_backup "/etc/logrotate.d/$app"
+
 #=================================================
 # END OF SCRIPT
 #=================================================
diff --git a/scripts/change_url b/scripts/change_url
index 6977c19..4eeb8b0 100644
--- a/scripts/change_url
+++ b/scripts/change_url
@@ -8,7 +8,7 @@ source /usr/share/yunohost/helpers
 #=================================================
 ynh_script_progression "Stopping $app's systemd service..."
 
-ynh_systemctl --service="$app" --action="stop" --log_path="systemd"
+ynh_systemctl --service="$app" --action="stop" --log_path="/var/log/$app/$app.log"
 
 #=================================================
 # MODIFY URL IN NGINX CONF
@@ -22,7 +22,7 @@ ynh_config_change_url_nginx
 #=================================================
 ynh_script_progression "Starting $app's systemd service..."
 
-ynh_systemctl --service="$app" --action="start" --log_path="systemd"
+ynh_systemctl --service="$app" --action="start" --wait_until="Server is starting up" --log_path="/var/log/$app/$app.log"
 
 #=================================================
 # END OF SCRIPT
diff --git a/scripts/install b/scripts/install
index 19f36ec..5c98898 100755
--- a/scripts/install
+++ b/scripts/install
@@ -1,33 +1,42 @@
 #!/bin/bash
 
-source _common.sh
-source /usr/share/yunohost/helpers
-
 #=================================================
-# INSTALL DEPENDENCIES
+# IMPORT GENERIC HELPERS
 #=================================================
-ynh_script_progression "Installing dependencies..."
 
-ynh_nodejs_install
+source _common.sh
+source /usr/share/yunohost/helpers
 
 #=================================================
 # DOWNLOAD, CHECK AND UNPACK SOURCE
 #=================================================
 ynh_script_progression "Setting up source files..."
 
+# Download, check integrity, uncompress and patch the source from manifest.toml
 ynh_setup_source --dest_dir="$install_dir"
 
+#=================================================
+# INSTALL DEPENDENCIES
+#=================================================
+ynh_script_progression "Installing dependencies..."
+
+ynh_nodejs_install
+
 #=================================================
 # SYSTEM CONFIGURATION
 #=================================================
 ynh_script_progression "Adding system configurations related to $app..."
 
+# Create a dedicated NGINX config using the conf/nginx.conf template
 ynh_config_add_nginx
 
+# Create a dedicated systemd config
 ynh_config_add_systemd
-
 yunohost service add "$app" --description="Legible badges in SVG" --log="/var/log/$app/$app.log"
 
+# Use logrotate to manage application logfile(s)
+ynh_config_add_logrotate
+
 #=================================================
 # INSTALL SHIELDS
 #=================================================
@@ -35,7 +44,7 @@ ynh_script_progression "Installing $app..."
 
 pushd "$install_dir"
  	ynh_hide_warnings ynh_exec_as_app npm ci
- 	ynh_hide_warnings ynh_exec_as_app npm run build
+ 	ynh_hide_warnings ynh_exec_as_app NODE_OPTIONS="--max-old-space-size=3000" npm run build
 popd
 
 #=================================================
@@ -43,7 +52,8 @@ popd
 #=================================================
 ynh_script_progression "Starting $app's systemd service..."
 
-ynh_systemctl --service="$app" --action="start" --log_path="systemd"
+# Start a systemd service
+ynh_systemctl --service="$app" --action="start" --wait_until="Server is starting up" --log_path="/var/log/$app/$app.log"
 
 #=================================================
 # END OF SCRIPT
diff --git a/scripts/remove b/scripts/remove
index eec7780..49a8673 100755
--- a/scripts/remove
+++ b/scripts/remove
@@ -1,5 +1,9 @@
 #!/bin/bash
 
+#=================================================
+# IMPORT GENERIC HELPERS
+#=================================================
+
 source _common.sh
 source /usr/share/yunohost/helpers
 
@@ -8,10 +12,12 @@ source /usr/share/yunohost/helpers
 #=================================================
 ynh_script_progression "Removing system configurations related to $app..."
 
+ynh_config_remove_logrotate
+
+# Remove the service from the list of services known by YunoHost (added from `yunohost service add`)
 if ynh_hide_warnings yunohost service status "$app" >/dev/null; then
     yunohost service remove "$app"
 fi
-
 ynh_config_remove_systemd
 
 ynh_config_remove_nginx
diff --git a/scripts/restore b/scripts/restore
index cc5fe72..bb0efdf 100755
--- a/scripts/restore
+++ b/scripts/restore
@@ -1,5 +1,10 @@
 #!/bin/bash
 
+#=================================================
+# IMPORT GENERIC HELPERS
+#=================================================
+
+# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
 source ../settings/scripts/_common.sh
 source /usr/share/yunohost/helpers
 
@@ -26,15 +31,17 @@ ynh_restore "/etc/nginx/conf.d/$domain.d/$app.conf"
 
 ynh_restore "/etc/systemd/system/$app.service"
 systemctl enable "$app.service" --quiet
-
 yunohost service add "$app" --description="Legible badges in SVG" --log="/var/log/$app/$app.log"
 
+mkdir -p "/var/log/$app"
+ynh_restore "/etc/logrotate.d/$app"
+
 #=================================================
 # RELOAD NGINX AND PHP-FPM OR THE APP SERVICE
 #=================================================
 ynh_script_progression "Reloading NGINX web server and $app's service..."
 
-ynh_systemctl --service="$app" --action="start" --log_path="systemd"
+ynh_systemctl --service="$app" --action="start" --wait_until="Server is starting up" --log_path="/var/log/$app/$app.log"
 
 ynh_systemctl --service=nginx --action=reload
 
diff --git a/scripts/upgrade b/scripts/upgrade
index ec66874..7b3ebb6 100755
--- a/scripts/upgrade
+++ b/scripts/upgrade
@@ -1,5 +1,9 @@
 #!/bin/bash
 
+#=================================================
+# IMPORT GENERIC HELPERS
+#=================================================
+
 source _common.sh
 source /usr/share/yunohost/helpers
 
@@ -8,7 +12,7 @@ source /usr/share/yunohost/helpers
 #=================================================
 ynh_script_progression "Stopping $app's systemd service..."
 
-ynh_systemctl --service="$app" --action="stop" --log_path="systemd"
+ynh_systemctl --service="$app" --action="stop" --log_path="/var/log/$app/$app.log"
 
 #=================================================
 # INSTALL DEPENDENCIES
@@ -22,6 +26,7 @@ ynh_nodejs_install
 #=================================================
 ynh_script_progression "Upgrading source files..."
 
+# Download, check integrity, uncompress and patch the source from manifest.toml
 ynh_setup_source --dest_dir="$install_dir" --full_replace
 
 #=================================================
@@ -31,7 +36,7 @@ ynh_script_progression "Installing $app..."
 
 pushd "$install_dir"
  	ynh_hide_warnings ynh_exec_as_app npm ci
- 	ynh_hide_warnings ynh_exec_as_app npm run build
+ 	ynh_hide_warnings ynh_exec_as_app NODE_OPTIONS="--max-old-space-size=3000" npm run build
 popd
 
 #=================================================
@@ -42,15 +47,16 @@ ynh_script_progression "Upgrading system configurations related to $app..."
 ynh_config_add_nginx
 
 ynh_config_add_systemd
-
 yunohost service add "$app" --description="Legible badges in SVG" --log="/var/log/$app/$app.log"
 
+ynh_config_add_logrotate
+
 #=================================================
 # START SYSTEMD SERVICE
 #=================================================
 ynh_script_progression "Starting $app's systemd service..."
 
-ynh_systemctl --service="$app" --action="start" --log_path="systemd"
+ynh_systemctl --service="$app" --action="start" --wait_until="Server is starting up" --log_path="/var/log/$app/$app.log"
 
 #=================================================
 # END OF SCRIPT
diff --git a/tests.toml b/tests.toml
index 94abb79..fd8974e 100644
--- a/tests.toml
+++ b/tests.toml
@@ -3,3 +3,17 @@
 test_format = 1.0
 
 [default]
+
+    # ------------
+    # Tests to run
+    # ------------
+
+    # -------------------------------
+    # Default args to use for install
+    # -------------------------------
+
+    # -------------------------------
+    # Commits to test upgrade from
+    # -------------------------------
+
+    test_upgrade_from.41e2ffdab1cec27dd407230a3c82bcebded16138.name = "Upgrade from 2025.02.02~ynh1"


Reviews:
user: login: ericgaspar
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-02T20:35:43Z
user: login: yalh76
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-02T21:44:06Z

Review comments:
diff_hunk: @@ -1,49 +1,59 @@
 #!/bin/bash
 
-source _common.sh
-source /usr/share/yunohost/helpers
-
 #=================================================
-# INSTALL DEPENDENCIES
+# IMPORT GENERIC HELPERS
 #=================================================
-ynh_script_progression "Installing dependencies..."
 
-ynh_nodejs_install
+source _common.sh
+source /usr/share/yunohost/helpers
 
 #=================================================
 # DOWNLOAD, CHECK AND UNPACK SOURCE
 #=================================================
 ynh_script_progression "Setting up source files..."
 
+# Download, check integrity, uncompress and patch the source from manifest.toml
 ynh_setup_source --dest_dir="$install_dir"
 
+#=================================================
+# INSTALL DEPENDENCIES
+#=================================================
+ynh_script_progression "Installing dependencies..."
+
+ynh_nodejs_install
+
 #=================================================
 # SYSTEM CONFIGURATION
 #=================================================
 ynh_script_progression "Adding system configurations related to $app..."
 
+# Create a dedicated NGINX config using the conf/nginx.conf template
 ynh_config_add_nginx
 
+# Create a dedicated systemd config
 ynh_config_add_systemd
-
 yunohost service add "$app" --description="Legible badges in SVG" --log="/var/log/$app/$app.log"
 
+# Use logrotate to manage application logfile(s)
+ynh_config_add_logrotate
+
 #=================================================
 # INSTALL SHIELDS
 #=================================================
 ynh_script_progression "Installing $app..."
 
 pushd "$install_dir"
  	ynh_hide_warnings ynh_exec_as_app npm ci
- 	ynh_hide_warnings ynh_exec_as_app npm run build
+ 	ynh_hide_warnings ynh_exec_as_app NODE_OPTIONS="--max-old-space-size=3000" npm run build
 popd
 
 #=================================================
 # START SYSTEMD SERVICE
 #=================================================
 ynh_script_progression "Starting $app's systemd service..."
 
-ynh_systemctl --service="$app" --action="start" --log_path="systemd"
+# Start a systemd service
+ynh_systemctl --service="$app" --action="start" --wait_until="Server is starting up" --log_path="/var/log/$app/$app.log"
path: scripts/install
user: login: ericgaspar
body: is `--wait_until="Server is starting up"` really needed?
created_at: 2025-03-02T20:35:43Z
author_association: MEMBER
diff_hunk: @@ -1,49 +1,59 @@
 #!/bin/bash
 
-source _common.sh
-source /usr/share/yunohost/helpers
-
 #=================================================
-# INSTALL DEPENDENCIES
+# IMPORT GENERIC HELPERS
 #=================================================
-ynh_script_progression "Installing dependencies..."
 
-ynh_nodejs_install
+source _common.sh
+source /usr/share/yunohost/helpers
 
 #=================================================
 # DOWNLOAD, CHECK AND UNPACK SOURCE
 #=================================================
 ynh_script_progression "Setting up source files..."
 
+# Download, check integrity, uncompress and patch the source from manifest.toml
 ynh_setup_source --dest_dir="$install_dir"
 
+#=================================================
+# INSTALL DEPENDENCIES
+#=================================================
+ynh_script_progression "Installing dependencies..."
+
+ynh_nodejs_install
+
 #=================================================
 # SYSTEM CONFIGURATION
 #=================================================
 ynh_script_progression "Adding system configurations related to $app..."
 
+# Create a dedicated NGINX config using the conf/nginx.conf template
 ynh_config_add_nginx
 
+# Create a dedicated systemd config
 ynh_config_add_systemd
-
 yunohost service add "$app" --description="Legible badges in SVG" --log="/var/log/$app/$app.log"
 
+# Use logrotate to manage application logfile(s)
+ynh_config_add_logrotate
+
 #=================================================
 # INSTALL SHIELDS
 #=================================================
 ynh_script_progression "Installing $app..."
 
 pushd "$install_dir"
  	ynh_hide_warnings ynh_exec_as_app npm ci
- 	ynh_hide_warnings ynh_exec_as_app npm run build
+ 	ynh_hide_warnings ynh_exec_as_app NODE_OPTIONS="--max-old-space-size=3000" npm run build
 popd
 
 #=================================================
 # START SYSTEMD SERVICE
 #=================================================
 ynh_script_progression "Starting $app's systemd service..."
 
-ynh_systemctl --service="$app" --action="start" --log_path="systemd"
+# Start a systemd service
+ynh_systemctl --service="$app" --action="start" --wait_until="Server is starting up" --log_path="/var/log/$app/$app.log"
path: scripts/install
user: login: yalh76
body: it's what is written in the logs
created_at: 2025-03-02T21:44:06Z
author_association: MEMBER

PR comments:
user: login: yalh76
created_at: 2025-03-02T19:35:06Z
body: !testme


author_association: MEMBER
user: login: yunohost-bot
created_at: 2025-03-02T19:35:09Z
body: :rocket:
[![Test Badge](https://img.shields.io/endpoint?url=https://ci-apps-dev.yunohost.org/ci/api/job/7191/badge)](https://ci-apps-dev.yunohost.org/ci/job/7191)
[![](https://ci-apps-dev.yunohost.org/ci/summary/7191.png)](https://ci-apps-dev.yunohost.org/ci/job/7191)
author_association: CONTRIBUTOR
user: login: yunohost-bot
created_at: 2025-03-02T19:35:09Z
body: Living in the past, are we? :cow::eye:
[![Test Badge](https://img.shields.io/endpoint?url=https://ci-apps-bullseye-dev.yunohost.org/ci/api/job/22752/badge)](https://ci-apps-bullseye-dev.yunohost.org/ci/job/22752)
[![](https://ci-apps-bullseye-dev.yunohost.org/ci/summary/22752.png)](https://ci-apps-bullseye-dev.yunohost.org/ci/job/22752)
author_association: CONTRIBUTOR
user: login: yalh76
created_at: 2025-03-02T21:53:45Z
body: !testme


author_association: MEMBER
user: login: yunohost-bot
created_at: 2025-03-02T21:53:48Z
body: :sunflower:
[![Test Badge](https://img.shields.io/endpoint?url=https://ci-apps-dev.yunohost.org/ci/api/job/7197/badge)](https://ci-apps-dev.yunohost.org/ci/job/7197)
[![](https://ci-apps-dev.yunohost.org/ci/summary/7197.png)](https://ci-apps-dev.yunohost.org/ci/job/7197)
author_association: CONTRIBUTOR
user: login: yunohost-bot
created_at: 2025-03-02T21:53:48Z
body: Living in the past, are we? :cow::eye:
[![Test Badge](https://img.shields.io/endpoint?url=https://ci-apps-bullseye-dev.yunohost.org/ci/api/job/22757/badge)](https://ci-apps-bullseye-dev.yunohost.org/ci/job/22757)
[![](https://ci-apps-bullseye-dev.yunohost.org/ci/summary/22757.png)](https://ci-apps-bullseye-dev.yunohost.org/ci/job/22757)
author_association: CONTRIBUTOR