my_webapp_ynh/manifest.toml
Antoine Lima 9c6143df27
Add NodeJS server as an alternative to PHP
This adds:
- Two entries in the manifest:
    - A choice for the NodeJS version
    - A port (provisionned in any case due to ynh limitations, but this should not matter)
- Services and configs:
    - Systemctl configs to run the NodeJS server
    - A watcher service and path to restart NodeJS upon file update
    - A custom NGinx config because it is incompatible with the default one
- Docs:
    - More info in the description and admin

The install/remove/backup/restore have been adapted and tested.
The upgrade script is updated but not tested
The change_url script does not change

It is not possible to have both PHP and NodeJS to keep the scripts simple.
2024-03-10 14:43:30 +01:00

104 lines
2.8 KiB
TOML

packaging_format = 2
id = "my_webapp"
name = "My Webapp"
description.en = "Custom Web app with SFTP access to serve static (HTML, CSS, JS) and PHP files"
description.fr = "Application Web personnalisée avec accès SFTP pour servir des fichiers statiques (HTML, CSS, JS) et PHP"
version = "1.0~ynh15"
maintainers = []
[upstream]
license = "GPL-3.0-only"
code = "https://github.com/YunoHost-Apps/my_webapp_ynh"
[integration]
yunohost = ">= 11.2.4"
architectures = "all"
multi_instance = true
ldap = "not_relevant"
sso = "not_relevant"
disk = "50M"
ram.build = "50M"
ram.runtime = "50M"
[install]
[install.domain]
type = "domain"
[install.path]
type = "path"
default = "/site"
[install.with_sftp]
ask.en = "Do you need a SFTP access?"
ask.fr = "Avez-vous besoin d'un accès SFTP ?"
type = "boolean"
default = true
[install.password]
type = "password"
optional = true
[install.init_main_permission]
type = "group"
default = "visitors"
[install.phpversion]
ask.en = "Choose a PHP version you want to use for your app"
ask.fr = "Choisissez une version PHP que vous souhaitez utiliser pour votre application"
help.en = "You can only choose NodeJS or PHP, not both"
help.fr = "Vous ne pouvez avoir que NodeJS ou PHP, pas les deux"
type = "select"
choices = ["none", "7.4", "8.0", "8.1", "8.2"]
default = "8.0"
[install.nodeversion]
ask.en = "Choose a NodeJS version you want to use for your app"
ask.fr = "Choisissez une version NodeJS que vous souhaitez utiliser pour votre application"
help.en = "You can only choose NodeJS or PHP, not both"
help.fr = "Vous ne pouvez avoir que NodeJS ou PHP, pas les deux"
type = "select"
choices = ["none", "18", "20", "21"]
default = "none"
[install.database]
ask.en = "Do you need a database?"
ask.fr = "Avez-vous besoin d'une base de données ?"
type = "select"
choices = [ "none", "mysql", "postgresql" ]
default = "none"
[resources]
[resources.system_user]
[resources.install_dir]
[resources.ports]
main.default = 3000
[resources.permissions]
main.url = "/"
[resources.apt]
packages = "nginx" # Kind of "dummy" value to be sure to have a non-empty dep list
packages_from_raw_bash = """
if [[ "$database" == "mysql" ]]; then
echo "mariadb-server"
if [[ "$phpversion" != none ]]; then
echo "php${phpversion}-mysql"
fi
elif [[ "$database" == "postgresql" ]]; then
echo "postgresql postgresql-contrib"
if [[ "$phpversion" != none ]]; then
echo "php${phpversion}-pgsql"
fi
fi
if [[ "$phpversion" != none ]]; then
echo "php${phpversion}-fpm"
fi
"""