From 5f0b99ef194e4e975a77e386f68d58fc7aaf17bb Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Tue, 14 Feb 2023 10:16:23 +0100 Subject: [PATCH] add forgejo-formation --- README.md | 1 + seed/README.md | 6 +++ seed/forgejo-formation/README.md | 45 +++++++++++++++++++ seed/forgejo-formation/applicationservice.yml | 5 +++ .../dictionaries/32_forgejo.xml | 25 +++++++++++ .../patches/forgejo.service.patch | 22 +++++++++ 6 files changed, 104 insertions(+) create mode 100644 seed/README.md create mode 100644 seed/forgejo-formation/README.md create mode 100644 seed/forgejo-formation/applicationservice.yml create mode 100644 seed/forgejo-formation/dictionaries/32_forgejo.xml create mode 100644 seed/forgejo-formation/patches/forgejo.service.patch diff --git a/README.md b/README.md index a3376b4..537946a 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # dataset-formation +[This dataset application services](seed/README.md) diff --git a/seed/README.md b/seed/README.md new file mode 100644 index 0000000..cc9158c --- /dev/null +++ b/seed/README.md @@ -0,0 +1,6 @@ +# Application services + +- [forgejo-formation](forgejo-formation/README.md): Formation in Forgejo + +# Providers and suppliers + diff --git a/seed/forgejo-formation/README.md b/seed/forgejo-formation/README.md new file mode 100644 index 0000000..4432c98 --- /dev/null +++ b/seed/forgejo-formation/README.md @@ -0,0 +1,45 @@ +--- +forgejo: none +include_toc: true +--- + +# forgejo-formation + +[All applications services for this dataset.](../README.md) + +## Description + +Formation in Forgejo. + +[For more informations](https://forgejo.org/) + +## Dependances + +- [forgejo (in external dataset)](https://forge.cloud.silique.fr/gnunux/dataset/src/branch/main/seed/forgejo/README.md) + - [base-fedora-37 (in external dataset)](https://forge.cloud.silique.fr/gnunux/dataset/src/branch/main/seed/base-fedora-37/README.md) + - [base-fedora (in external dataset)](https://forge.cloud.silique.fr/gnunux/dataset/src/branch/main/seed/base-fedora/README.md) + - [systemd (in external dataset)](https://forge.cloud.silique.fr/gnunux/dataset/src/branch/main/seed/systemd/README.md) + - [base-machine (in external dataset)](https://forge.cloud.silique.fr/gnunux/dataset/src/branch/main/seed/base-machine/README.md) + - [base (in external dataset)](https://forge.cloud.silique.fr/gnunux/dataset/src/branch/main/seed/base/README.md) + - [dns-local (in external dataset)](https://forge.cloud.silique.fr/gnunux/dataset/src/branch/main/seed/dns-local/README.md) + - [pki-tls (in external dataset)](https://forge.cloud.silique.fr/gnunux/dataset/src/branch/main/seed/pki-tls/README.md) + - [postgresql-client (in external dataset)](https://forge.cloud.silique.fr/gnunux/dataset/src/branch/main/seed/postgresql-client/README.md) + - [reverse-proxy-client (in external dataset)](https://forge.cloud.silique.fr/gnunux/dataset/src/branch/main/seed/reverse-proxy-client/README.md) + - [relay-mail-client (in external dataset)](https://forge.cloud.silique.fr/gnunux/dataset/src/branch/main/seed/relay-mail-client/README.md) + - [redis-client (in external dataset)](https://forge.cloud.silique.fr/gnunux/dataset/src/branch/main/seed/redis-client/README.md) + - [oauth2-client (in external dataset)](https://forge.cloud.silique.fr/gnunux/dataset/src/branch/main/seed/oauth2-client/README.md) + +## Variables + +### Général (*general*) + +#### forgejo (*general.forgejo*) + +| Description | Type | +|-------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------| +| **Utilisateur de type admin** (*[forgejo_user](dictionaries/32_forgejo.xml)*) | [unix_user](https://forge.cloud.silique.fr/risotto/rougail/src/branch/main/doc/variable/README.md#le-type-de-la-variable) | +| **Courriel de l'admin** (*[forgejo_email](dictionaries/32_forgejo.xml)*) | [mail](https://forge.cloud.silique.fr/risotto/rougail/src/branch/main/doc/variable/README.md#le-type-de-la-variable) | + + +- [+]: variable is multiple +- **bold**: variable is mandatory diff --git a/seed/forgejo-formation/applicationservice.yml b/seed/forgejo-formation/applicationservice.yml new file mode 100644 index 0000000..c8c55c1 --- /dev/null +++ b/seed/forgejo-formation/applicationservice.yml @@ -0,0 +1,5 @@ +format: '0.1' +description: Formation in Forgejo +website: https://forgejo.org/ +depends: + - forgejo diff --git a/seed/forgejo-formation/dictionaries/32_forgejo.xml b/seed/forgejo-formation/dictionaries/32_forgejo.xml new file mode 100644 index 0000000..62cbaed --- /dev/null +++ b/seed/forgejo-formation/dictionaries/32_forgejo.xml @@ -0,0 +1,25 @@ + + + + + + 3333 + + + + + + + + + + domain_name_eth0 + forgejo_user + forgejo + cleartext + hide_secret + forgejo_password + + + diff --git a/seed/forgejo-formation/patches/forgejo.service.patch b/seed/forgejo-formation/patches/forgejo.service.patch new file mode 100644 index 0000000..e0620a3 --- /dev/null +++ b/seed/forgejo-formation/patches/forgejo.service.patch @@ -0,0 +1,22 @@ +--- ../../../dataset/seed/forgejo/templates/forgejo.service 2023-01-03 11:30:06.865085785 +0100 ++++ modif/forgejo.service 2023-02-14 10:13:27.985282958 +0100 +@@ -20,18 +20,7 @@ + Group=forgejo + WorkingDirectory=/srv/forgejo/lib/ + ExecStart=/usr/bin/forgejo web --config /etc/forgejo/app.ini +-ExecStartPre=/bin/bash -c '%slurp +-/usr/bin/forgejo migrate --config /etc/forgejo/app.ini;%slurp +-if /usr/bin/forgejo admin auth list --config /etc/forgejo/app.ini | grep "OAuth2"; then %slurp +- echo "UPDATE";%slurp +- id=$(/usr/bin/forgejo --config /etc/forgejo/app.ini admin auth list |tail -n 1|awk "{ print \$1}");%slurp +- /usr/bin/forgejo admin auth update-oauth --id $id --name "%%domain_name_eth0" --provider "openidConnect" --key "%%oauth2_client_id" --secret "%%oauth2_client_secret" --scopes "profile email" --auto-discover-url "https://%%oauth2_client_server_domainname/.well-known/openid-configuration" --config /etc/forgejo/app.ini;%slurp +-else %slurp +- echo "CONFIGURE";%slurp +- /usr/bin/forgejo admin auth add-oauth --name "%%domain_name_eth0" --provider "openidConnect" --key "%%oauth2_client_id" --secret "%%oauth2_client_secret" --scopes "profile email" --auto-discover-url "https://%%oauth2_client_server_domainname/.well-known/openid-configuration" --config /etc/forgejo/app.ini;%slurp +-fi;%slurp +-sleep 2;%slurp +-echo "CONFIGURATION DONE"' ++ExecStartPre=-/bin/bash -c "/usr/bin/forgejo admin user create --username %%forgejo_user --password %%forgejo_password --email %%forgejo_email --admin -c /etc/forgejo/app.ini" + Restart=always + Environment=GITEA_WORK_DIR=/srv/forgejo/lib +