mirror of
https://github.com/YunoHost-Apps/chatonsinfos_ynh.git
synced 2024-09-03 18:15:58 +02:00
[wip] Config panel template and hooks
This commit is contained in:
parent
a58f3fbc3d
commit
15c14fa134
4 changed files with 457 additions and 0 deletions
441
config_panel.toml.j2
Normal file
441
config_panel.toml.j2
Normal file
|
@ -0,0 +1,441 @@
|
|||
|
||||
version = "1.0"
|
||||
[main]
|
||||
|
||||
services = []
|
||||
|
||||
## (optional) This help properties is a short help displayed on the same line
|
||||
## than the panel title but not displayed in the tab.
|
||||
# help = ""
|
||||
|
||||
[main.organization]
|
||||
name = ""
|
||||
# help = ""
|
||||
|
||||
|
||||
|
||||
# [Organisation]
|
||||
# Nom de l'organisation (type STRING, obligatoire, ex. LibreServiceEU).
|
||||
[main.organization.name]
|
||||
ask.en = "Nom de l'oganisation"
|
||||
type = "string"
|
||||
bind = "organization.name>/var/www/chatonsinfo/public/organization.properties"
|
||||
|
||||
# Description de l'organisation (type STRING, recommandé, ex. LibreServiceEU est le chaton de Devinsy).
|
||||
[main.organization.description]
|
||||
ask.en = "Description de l'organisation"
|
||||
type = "string"
|
||||
bind = "organization.description"
|
||||
optional = true
|
||||
|
||||
[main.organization.status-level]
|
||||
ask.en = "Statut"
|
||||
type = "string"
|
||||
choices.ACTIVE = "Actif"
|
||||
choices.IDLE = "En pause"
|
||||
choices.AWAY = "Inactif"
|
||||
bind = "organization.status.level"
|
||||
optional = true
|
||||
|
||||
[main.organization.status-description]
|
||||
ask.en = "Description du statut"
|
||||
type = "string"
|
||||
bind = "organization.status.description"
|
||||
optional = true
|
||||
visible = "status-level == 'IDLE'"
|
||||
|
||||
[main.organization.startdate]
|
||||
ask.en = "Date de création"
|
||||
type = "date"
|
||||
optional = true
|
||||
|
||||
[main.organization.enddate]
|
||||
ask.en = "Date de fermeture"
|
||||
type = "date"
|
||||
optional = true
|
||||
visible = "status-level == 'AWAY'"
|
||||
|
||||
|
||||
[main.organization.type]
|
||||
ask.en = "Type d'organisation"
|
||||
type = "string"
|
||||
choices.ASSOCIATION = "Association"
|
||||
choices.INFORMAL = "Informel"
|
||||
choices.COOPERATIVE = "Coopérative"
|
||||
choices.MICROCOMPANY = "Micro entreprise"
|
||||
choices.COMPANY = "Société"
|
||||
choices.INDIVIDUAL = "Individue"
|
||||
choices.OTHER = "Autre"
|
||||
bind = "organization.type"
|
||||
|
||||
|
||||
[main.organization.website]
|
||||
ask.en = "Siteweb"
|
||||
type = "url"
|
||||
bind = "organization.website"
|
||||
optional = true
|
||||
|
||||
|
||||
[main.organization.logo]
|
||||
ask.en = "Name of the project"
|
||||
type = "url"
|
||||
bind = "organization.logo"
|
||||
optional = true
|
||||
|
||||
[main.organization.contact-url]
|
||||
ask.en = "URL de contact"
|
||||
type = "url"
|
||||
bind = "organization.contact.url"
|
||||
optional = true
|
||||
|
||||
[main.organization.contact-mail]
|
||||
ask.en = "Mail de contact"
|
||||
type = "email"
|
||||
bind = "organization.contact.email"
|
||||
optional = true
|
||||
|
||||
[main.organization.legal-url]
|
||||
ask.en = "Mentions légales"
|
||||
type = "url"
|
||||
bind = "organization.legal.url"
|
||||
optional = true
|
||||
|
||||
[main.organization.guide-technical]
|
||||
ask.en = "Documentation technique"
|
||||
type = "url"
|
||||
bind = "organization.guide.technical"
|
||||
default = "https://yunohost.org/admindoc"
|
||||
optional = true
|
||||
|
||||
[main.organization.guide-user]
|
||||
ask.en = "Documentation utilisateurice"
|
||||
type = "url"
|
||||
bind = "organization.guide.user"
|
||||
default = "https://yunohost.org/user_guide"
|
||||
optional = true
|
||||
|
||||
[main.organization.status-level-chatons]
|
||||
ask.en = "Statut"
|
||||
type = "string"
|
||||
choices.ACTIVE = "Actif"
|
||||
choices.IDLE = "En pause"
|
||||
choices.AWAY = "Inactif"
|
||||
bind = "organization.memberof.chatons.status.level"
|
||||
|
||||
[main.organization.status-description]
|
||||
ask.en = "Description du statut"
|
||||
type = "string"
|
||||
bind = "organization.memberof.chatons.status.description"
|
||||
optional = true
|
||||
visible = "status-level-chatons == 'IDLE'"
|
||||
|
||||
[main.organization.startdate-chatons]
|
||||
ask.en = "Date d'entrée dans le collectif"
|
||||
type = "date"
|
||||
bind = "organization.memberof.chatons.startdate"
|
||||
|
||||
[main.organization.enddate-chatons]
|
||||
ask.en = "Date de sortie du collectif"
|
||||
type = "date"
|
||||
optional = true
|
||||
visible = "status-level-chatons == 'AWAY'"
|
||||
bind = "organization.memberof.chatons.enddate"
|
||||
|
||||
[main.owner]
|
||||
name = "Propriétaire de l'organisation"
|
||||
optional = true
|
||||
|
||||
[main.owner.owner-name]
|
||||
ask.en = "Nom"
|
||||
type = "string"
|
||||
bind = "organization.owner.name"
|
||||
[main.owner.owner-website]
|
||||
ask.en = "siteweb"
|
||||
type = "url"
|
||||
bind = "organization.owner.website"
|
||||
[main.owner.owner-logo]
|
||||
ask.en = "Logo"
|
||||
type = "url"
|
||||
bind = "organization.owner.logo"
|
||||
|
||||
|
||||
|
||||
[main.location]
|
||||
name = "Localisation de l'organisation"
|
||||
# help = ""
|
||||
optional = true
|
||||
|
||||
[main.location.country-name]
|
||||
ask.en = "Pays de l'organisation"
|
||||
type = "string"
|
||||
bind = "organization.country.name"
|
||||
optional = false
|
||||
|
||||
[main.location.country-code]
|
||||
ask.en = "Code pays de l'organisation"
|
||||
help = "Table ISO 3166-1 alpha-2 : https://fr.wikipedia.org/wiki/ISO_3166-1#Table_de_codage"
|
||||
type = "string"
|
||||
bind = "organization.country.code"
|
||||
default = "FR"
|
||||
|
||||
# Latitude (type DECIMAL_DEGREE, recommandé, format DD, ex. 15,23456).
|
||||
[main.location.latitude]
|
||||
ask.en = "Latitude"
|
||||
type = "string"
|
||||
bind = "organization.geolocation.latitude"
|
||||
[main.location.longitude]
|
||||
ask.en = "Longitude"
|
||||
type = "string"
|
||||
bind = "organization.geolocation.longitude"
|
||||
|
||||
[main.location.address]
|
||||
ask.en = "Adresse"
|
||||
type = "string"
|
||||
bind = "organization.geolocation.address"
|
||||
|
||||
|
||||
|
||||
[main.socialnetworks]
|
||||
name = "Réseaux sociaux"
|
||||
help = "Liens vers les comptes réseaux sociaux de l'organisation"
|
||||
optional = true
|
||||
|
||||
[main.socialnetworks.diaspora]
|
||||
ask.en = "Diaspora"
|
||||
type = "url"
|
||||
bind = "organization.socialnetworks.diaspora"
|
||||
[main.socialnetworks.facebook]
|
||||
ask.en = "Facebook"
|
||||
type = "url"
|
||||
bind = "organization.socialnetworks.facebook"
|
||||
[main.socialnetworks.funkwhale]
|
||||
ask.en = "Funkwhale"
|
||||
type = "url"
|
||||
bind = "organization.socialnetworks.funkwhale"
|
||||
[main.socialnetworks.mastodon]
|
||||
ask.en = "Mastodon"
|
||||
type = "url"
|
||||
bind = "organization.socialnetworks.mastodon"
|
||||
[main.socialnetworks.pleroma]
|
||||
ask.en = "Pleroma"
|
||||
type = "url"
|
||||
bind = "organization.socialnetworks.pleroma"
|
||||
[main.socialnetworks.mobilizon]
|
||||
ask.en = "Mobilizon"
|
||||
type = "url"
|
||||
bind = "organization.socialnetworks.mobilizon"
|
||||
[main.socialnetworks.peertube]
|
||||
ask.en = "Peertube"
|
||||
type = "url"
|
||||
bind = "organization.socialnetworks.peertube"
|
||||
[main.socialnetworks.pixelfed]
|
||||
ask.en = "Pixelfed"
|
||||
type = "url"
|
||||
bind = "organization.socialnetworks.pixelfed"
|
||||
[main.socialnetworks.twitter]
|
||||
ask.en = "Twitter"
|
||||
type = "url"
|
||||
bind = "organization.socialnetworks.twitter"
|
||||
|
||||
[main.chatrooms]
|
||||
name = "Salons de discussion"
|
||||
help = "Adresse vers les salons/équipes de discussion publics de l'organisation"
|
||||
optional = true
|
||||
|
||||
[main.chatrooms.xmpp]
|
||||
ask.en = "XMPP"
|
||||
type = "url"
|
||||
bind = "organization.chatrooms.xmpp"
|
||||
[main.chatrooms.irc]
|
||||
ask.en = "IRC"
|
||||
type = "url"
|
||||
bind = "organization.chatrooms.irc"
|
||||
[main.chatrooms.matrix]
|
||||
ask.en = "Matrix"
|
||||
type = "url"
|
||||
bind = "organization.chatrooms.matrix"
|
||||
[main.chatrooms.rocketchat]
|
||||
ask.en = "RocketChat"
|
||||
type = "url"
|
||||
bind = "organization.chatrooms.rocketchat"
|
||||
[main.chatrooms.mattermost]
|
||||
ask.en = "Mattermost"
|
||||
type = "url"
|
||||
bind = "organization.chatrooms.mattermost"
|
||||
|
||||
|
||||
[main.funding]
|
||||
name = "Dons"
|
||||
help = "Services de paiement permettant de récolter des donations pour votre chaton"
|
||||
optional = true
|
||||
# Liens vers les services de paiement permettant de récolter des donations pour votre chaton (type URL, optionnel).
|
||||
# Dans le cas d'une solution maison (exemple : pont vers votre banque), choisir "organization.funding.custom".
|
||||
# Liste non exhaustive à laquelle vous pouvez ajouter d'autres services.
|
||||
[main.funding.liberapay]
|
||||
ask.en = "Liberapay"
|
||||
type = "url"
|
||||
bind = "organization.funding.liberapay"
|
||||
[main.funding.tipee]
|
||||
ask.en = "Tipee"
|
||||
type = "url"
|
||||
bind = "organization.funding.Tipee"
|
||||
[main.funding.helloasso]
|
||||
ask.en = "Helloasso"
|
||||
type = "url"
|
||||
bind = "organization.funding.helloasso"
|
||||
[main.funding.paypal]
|
||||
ask.en = "Paypal"
|
||||
type = "url"
|
||||
bind = "organization.funding.paypal"
|
||||
[main.funding.custom]
|
||||
ask.en = "Custom"
|
||||
type = "url"
|
||||
bind = "organization.funding.custom"
|
||||
|
||||
[host]
|
||||
name = "Hébergement"
|
||||
[host.provider]
|
||||
name = "Fournisseur"
|
||||
[host.provider.name]
|
||||
ask.en = "Nom de l'hébergeur"
|
||||
help.en = "Hébergeur de la machine qui fait tourner le service, dans le cas d'un auto-hébergement c'est vous !"
|
||||
type = "string"
|
||||
bind = "host.name"
|
||||
|
||||
[host.provider.description]
|
||||
ask.en = "Description"
|
||||
type = "string"
|
||||
bind = "host.description"
|
||||
|
||||
# Si vous avez du mal à remplir les champs précédents, ce tableau pourra vous aider :
|
||||
# NANO PHYSICAL VIRTUAL SHARED CLOUD
|
||||
# HOME pm pm vm shared cloud
|
||||
# HOSTEDBAY pm pm vm shared cloud
|
||||
# HOSTEDSERVER -- pm vm shared cloud
|
||||
# OUTSOURCED -- -- vps shared cloud
|
||||
# Légendes : pm : physical machine ; vm : virtual machine ; vps : virtual private server.
|
||||
|
||||
[host.provider.type]
|
||||
ask.en = "Type d'hébergement"
|
||||
type = "string"
|
||||
choices.HOME = "hébergement à domicile"
|
||||
choices.HOSTEDBAY = "serveur personnel hébergé dans une baie d'un fournisseur"
|
||||
choices.HOSTEDSERVER = "serveur d'un fournisseur"
|
||||
choices.OUTSOURCED = "infrastructure totalement sous-traitée"
|
||||
bind = "host.provider.type"
|
||||
|
||||
[host.provider.hypervisor]
|
||||
ask.en = "Nom de l'hyperviseur"
|
||||
help.en = ""
|
||||
type = "string"
|
||||
optional = true
|
||||
bind = "host.provider.hypervisor"
|
||||
|
||||
[host.provider.country-name]
|
||||
ask.en = "Pays"
|
||||
help.en = ""
|
||||
type = "string"
|
||||
bind = "host.country.name"
|
||||
|
||||
[host.provider.country-code]
|
||||
ask.en = "Code Pays"
|
||||
help = "Table ISO 3166-1 alpha-2 : https://fr.wikipedia.org/wiki/ISO_3166-1#Table_de_codage"
|
||||
type = "string"
|
||||
bind = "host.country.code"
|
||||
default = "FR"
|
||||
|
||||
[host.server.type]
|
||||
ask.en = "Type de serveur"
|
||||
type = "string"
|
||||
choices.NANO = "nano-ordinateur (Raspberry Pi, Olimex…)"
|
||||
choices.PHYSICAL = "machine physique"
|
||||
choices.VIRTUAL = "machine virtuelle"
|
||||
choices.SHARED = "hébergement mutualisé"
|
||||
choices.CLOUD = "infrastructure multi-serveurs"
|
||||
bind = "host.server.type"
|
||||
|
||||
{% for app in range(11) %}
|
||||
[{{ app }}]
|
||||
[{{ app }}.service]
|
||||
|
||||
[{{ app }}.service.published]
|
||||
ask.en = "Publié"
|
||||
help.en = "Faut-il publier la fiche descriptive (.properties) du service ?"
|
||||
type = "boolean"
|
||||
|
||||
[{{ app }}.service.startdate]
|
||||
ask.en = "Date d'ouverture"
|
||||
type = "date"
|
||||
bind = "service.startdate"
|
||||
visible = "{{ app }}.service.published"
|
||||
|
||||
[{{ app }}.service.enddate]
|
||||
ask.en = "Date de fermeture"
|
||||
type = "date"
|
||||
optional = true
|
||||
bind = "service.enddate"
|
||||
visible = "{{ app }}.service.published"
|
||||
|
||||
[{{ app }}.service.description]
|
||||
ask.en = "Description"
|
||||
type = "string"
|
||||
bind = "service.description"
|
||||
visible = "{{ app }}.service.published"
|
||||
|
||||
[{{ app }}.service.logo]
|
||||
ask.en = "Logo"
|
||||
type = "url"
|
||||
bind = "service.logo"
|
||||
visible = "{{ app }}.service.published"
|
||||
|
||||
[{{ app }}.service.legal-url]
|
||||
ask.en = "Mentions légales"
|
||||
type = "url"
|
||||
bind = "service.legal.url"
|
||||
visible = "{{ app }}.service.published"
|
||||
|
||||
[{{ app }}.service.guide-technical]
|
||||
ask.en = "Documentation technique"
|
||||
type = "url"
|
||||
bind = "service.guide.technical"
|
||||
visible = "{{ app }}.service.published"
|
||||
|
||||
[{{ app }}.service.guide-user]
|
||||
ask.en = "Documentation utilisateurices"
|
||||
type = "url"
|
||||
bind = "service.guide.user"
|
||||
visible = "{{ app }}.service.published"
|
||||
|
||||
[{{ app }}.service.contact-url]
|
||||
ask.en = "Page de support"
|
||||
type = "url"
|
||||
bind = "service.contact.url"
|
||||
optional = true
|
||||
visible = "{{ app }}.service.published"
|
||||
|
||||
[{{ app }}.service.contact-email]
|
||||
ask.en = "Courriel de support"
|
||||
type = "email"
|
||||
bind = "service.contact.email"
|
||||
optional = true
|
||||
visible = "{{ app }}.service.published"
|
||||
|
||||
[{{ app }}.service.registration]
|
||||
ask.en = "Inscription"
|
||||
type = "string"
|
||||
choices.None = "Le service s'utilise sans inscription"
|
||||
choices.Free = "Inscription nécessaire mais ouverte à tout le monde et gratuite"
|
||||
choices.Member = "Inscription restreinte aux membres (la notion de membre pouvant être très relative, par exemple, une famille, un cercle d’amis, adhérents d'association…)"
|
||||
choices.Client = "Inscription liée à une relation commerciale (facture…)"
|
||||
bind = "service.registration"
|
||||
visible = "{{ app }}.service.published"
|
||||
|
||||
[{{ app }}.service.registration-load]
|
||||
ask.en = "Capacité"
|
||||
type = "string"
|
||||
choices.OPEN = "Le service accueille de nouveaux comptes"
|
||||
choices.FULL = "Le service n'accueille plus de nouveau compte pour l'instant"
|
||||
bind = "service.registration.load"
|
||||
visible = "{{ app }}.service.published"
|
||||
|
||||
{% endfor %}
|
4
hooks/post_app_change_url
Normal file
4
hooks/post_app_change_url
Normal file
|
@ -0,0 +1,4 @@
|
|||
#!/bin/bash
|
||||
|
||||
source /usr/share/yunohost/helpers
|
||||
ynh_write_var_in_file --file="/var/www/chatonsinfo/public/${YNH_APP_INSTANCE_NAME}.properties" --key="service.website" --value="https://$YNH_APP_NEW_DOMAIN/$YNH_APP_NEW_PATH"
|
6
hooks/post_app_install
Normal file
6
hooks/post_app_install
Normal file
|
@ -0,0 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
source /etc/yunohost/apps/chatonsinfo/scripts/_common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
rewrite_config_panel()
|
6
hooks/post_app_remove
Normal file
6
hooks/post_app_remove
Normal file
|
@ -0,0 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
source /etc/yunohost/apps/chatonsinfo/scripts/_common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
rewrite_config_panel()
|
Loading…
Reference in a new issue