1
0
Fork 0
mirror of https://github.com/YunoHost/apps.git synced 2024-09-03 20:06:07 +02:00
apps/tools/app_generator/templates/manifest.j2
2024-04-02 23:12:54 +02:00

178 lines
6.9 KiB
Django/Jinja

#:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/manifest.v2.schema.json
packaging_format = 2
id = "{{ data.app_id }}"
name = "{{ data.app_name }}"
description.en = "{{ data.description_en }}"
description.fr = "{{ data.description_fr }}"
version = "{{ data.version }}"
{% if data.maintainers -%}
maintainers = ["{{ data.maintainers }}"]
{%- endif %}
[upstream]
license = "{{ data.license }}"
{% if data.website -%}website = "{{ data.website }}"{%- endif %}
{% if data.demo -%}demo = "{{ data.demo }}"{%- endif %}
{% if data.admindoc -%}admindoc = "{{ data.admindoc }}"{%- endif %}
{% if data.userdoc -%}userdoc = "{{ data.userdoc }}"{%- endif %}
{% if data.code -%}code = "{{ data.code }}"{%- endif %}
[integration]
yunohost = '>= {{ data.yunohost_required_version or '11.2'}}'
{% if data.generator_mode == "tutorial" -%}
# List of supported archs using the dpkg --print-architecture nomenclature (amd64/i386/armhf/arm64), for example: ["amd64", "i386']
{% endif -%}
architectures = "{{ data.architectures }}" # TODO : handle the "all" option (no ["all"])
multi_instance = {{ "true" if data.multi_instance else "false" }}
ldap = "{{ data.ldap }}" # TODO : fixme, use actual booleans + handle the "not_relevant" value
sso = "{{ data.sso }}"
# FIXME: replace with an **estimate** minimum disk and RAM requirements. e.g. 20M, 400M, 1G... You may have have a look at CI results
disk = "50M"
ram.build = "50M"
ram.runtime = "50M"
[install]
{% if data.domain_and_path != "false" -%}
[install.domain]
{% if data.generator_mode == "tutorial" -%}
# this is a generic question - ask strings are automatically handled by YunoHost's core
{% endif -%}
type = "domain"
{% if data.domain_and_path != "full_domain" -%}
[install.path]
{% if data.generator_mode == "tutorial" -%}
# this is a generic question - ask strings are automatically handled by YunoHost's core
{% endif -%}
type = "path"
default = "/{{ data.app_id }}"
{% endif -%}
{% endif %}
{% if data.init_main_permission -%}
[install.init_main_permission]
{% if data.generator_mode == "tutorial" -%}
# this is a generic question - ask strings are automatically handled by YunoHost's core
# This won't be saved as setting and will instead be used to initialize the SSOwat permission
{% endif -%}
type = "group"
default = "visitors"
{% endif %}
{% if data.language != "_" -%}
[install.language]
ask.en = "Choose the application language"
ask.fr = "Choisissez la langue de l'application"
type = "select"
choices = {{ data.language |safe }}
{% endif %}
{% if data.init_admin_permission -%}
[install.init_admin_permission]
{% if data.generator_mode == "tutorial" -%}
# this is a generic question - ask strings are automatically handled by YunoHost's core
# This won't be saved as setting and will instead be used to initialize the SSOwat permission
{% endif -%}
type = "group"
default = "admins"
{% endif %}
[resources]
{% if data.generator_mode == "tutorial" -%}
# See the packaging documentation for the full set
# of explanation regarding the behavior and properties for each of those
# https://yunohost.org/packaging_apps_resources
{% endif %}
[resources.sources]
[resources.sources.main]
# This will pre-fetch the asset which can then be deployed during the install/upgrade scripts with :
# ynh_setup_source --dest_dir="$install_dir"
# You can also define other assets than "main" and add --source_id="foobar" in the previous command
url = "{{data.source_url}}"
sha256 = "{{data.sha256sum}}"
# These infos are used by https://github.com/YunoHost/apps/blob/master/tools/autoupdate_app_sources/autoupdate_app_sources.py
# to auto-update the previous asset urls and sha256sum + manifest version
# assuming the upstream's code repo is on github and relies on tags or releases
# See the 'sources' resource documentation for more details
{% if data.auto_update != "none" -%}
autoupdate.strategy = "{{ data.auto_update }}"
{% else -%}
{% if data.generator_mode == "tutorial" -%}
# You might want to add an "autoupdate strategy" setting to that your app receive automated pull request with each new update, which also trigger automated testing.
# autoupdate.strategy = ""
{%- endif -%}
{% endif %}
{% if data.system_user -%}
[resources.system_user]
{% if data.generator_mode == "tutorial" -%}
# This will provision/deprovision a unix system user
{%- endif -%}
{%- endif %}
{% if data.install_dir -%}
[resources.install_dir]
{% if data.generator_mode == "tutorial" -%}
# This will create/remove the install dir as /var/www/$app
# and store the corresponding setting $install_dir
{%- endif -%}
{%- endif %}
{% if data.data_dir -%}
[resources.data_dir]
{% if data.generator_mode == "tutorial" -%}
# This will create/remove the data dir as /home/yunohost.app/$app
# and store the corresponding setting $data_dir
{%- endif -%}
{%- endif %}
[resources.permissions]
{% if data.generator_mode == "tutorial" -%}
# This will configure SSOwat permission for $domain/$path/
# The initial allowed group of user is configured via the init_main_permission question (public=visitors, private=all_users)
{% endif -%}
main.url = "/"
{% if data.main_technology not in ['none', 'php'] -%}
[resources.ports]
{% if data.generator_mode == "tutorial" -%}
# This will pick a random port for reverse-proxying and store it as the $port setting
{% endif -%}
{%- endif %}
{%- if data.apt_dependencies or data.use_yarn -%}
[resources.apt]
{% if data.generator_mode == "tutorial" -%}
# This will automatically install/uninstall the following apt packages
# and implicitly define the $phpversion setting as 8.0 (if phpX.Y-foobar dependencies are listed)
{% endif -%}
packages = "{{ data.apt_dependencies }} {% if data.database == 'mysql' -%} mariadb-server {% elif data.database == 'postgresql' %} postgresql {% endif -%} {% if data.main_technology == 'python' -%} python3 python3-venv {% endif -%}"
{%- endif %}
{%- if data.use_nodejs_needs_yarn -%}
{% if data.generator_mode == "tutorial" -%}
# This will configure an extra repository to install yarn dependency
{% endif -%}
extras.yarn.repo = "deb https://dl.yarnpkg.com/debian/ stable main"
extras.yarn.key = "https://dl.yarnpkg.com/debian/pubkey.gpg"
extras.yarn.packages = "yarn"
{%- endif %}
{%- if data.database != 'false' -%}
[resources.database]
{% if data.generator_mode == "tutorial" -%}
# This will automatically provision/deprovison a database and store the corresponding credentials in settings $db_user, $db_name, $db_pwd
{% endif -%}
type = "{{ data.database }}"
{%- endif -%}