Compare commits

...

128 commits

Author SHA1 Message Date
Christian Fraß f647e15aee [task-393] 2025-10-23 23:41:31 +02:00
Christian Fraß 53b88c896f [task-410] 2025-10-15 08:10:38 +02:00
fenris 4bb1c0d1be [del] role:sqlite-for-hedgedoc 2025-10-09 01:49:33 +02:00
fenris c2e100b1aa [task-406] owncloud 2025-10-09 01:49:09 +02:00
fenris 6294edaa59 [task-406] nginx 2025-10-09 01:47:49 +02:00
fenris 88a65ad919 [task-406] hedgedoc 2025-10-09 01:47:20 +02:00
fenris 5b283c7804 [task-406] nginx 2025-10-09 01:45:37 +02:00
fenris df9f32ad02 [task-406] hedgedoc 2025-10-09 01:45:22 +02:00
fenris 59510fb415 [task-406] nginx 2025-10-09 01:44:12 +02:00
fenris e0f485e556 [task-406] authelia 2025-10-09 01:43:49 +02:00
fenris fb931da668 [task-406] nginx 2025-10-09 01:42:26 +02:00
fenris 5d1b1908a5 [task-406] tlscert_selfsigned 2025-10-09 01:41:40 +02:00
Christian Fraß 283b8d9863 [add] tool:cfg-man 2025-10-09 01:36:32 +02:00
Christian Fraß 03a84c0d6a Revert "[int]"
This reverts commit ae35b71940.
2025-10-07 14:38:48 +02:00
Christian Fraß ae35b71940 [int] 2025-10-07 14:35:48 +02:00
Christian Fraß fc51133a78 [mod] galaxy definition 2025-09-26 00:19:49 +02:00
Christian Fraß 1cbc725793 [mod] galaxy definition 2025-09-26 00:18:28 +02:00
Christian Fraß f63cdf2fb8 [mod] galaxy definition [mod] readme 2025-09-22 21:52:26 +02:00
Christian Fraß eb00d988bb [mod] role:tandoor:info 2025-09-17 23:40:06 +02:00
Christian Fraß 969a3187a9 [upd] role:tandoor 2025-09-17 23:39:02 +02:00
Christian Fraß e4a5beddcc [fix] role:hedgedoc:conf template:authorization url 2025-09-17 17:55:02 +02:00
Christian Fraß 32750c5335 [mod] tools:check:sorting 2025-09-17 15:38:01 +02:00
Christian Fraß c17fb1d17e [fix] authelia:Quellen eintragen 2025-09-17 15:37:02 +02:00
Christian Fraß cb7ed44c61 [fix] role:synapse:conf template 2025-09-17 15:35:52 +02:00
Christian Fraß 71762b5208 [mod] role:synapse:info 2025-09-17 08:22:47 +00:00
Christian Fraß fcffff701f [fix] role:synapse:package sources 2025-09-17 08:14:17 +00:00
Christian Fraß e4988f2f85 [fix] role:tandoor 2025-09-16 20:32:49 +02:00
Christian Fraß aa12caf444 [fix] tandoor:auth 2025-08-27 22:08:55 +00:00
Christian Fraß a70936f56d [mod] forgejo:default:version 2025-04-22 17:12:45 +00:00
roydfalk 605737c675 Merge pull request 'Rolle | Tandoor' (#6) from task-230-tandoor into main
Reviewed-on: https://forgejo.linke.sx/misc/ansible-base/pulls/6
2025-01-12 10:07:19 +01:00
Christian Fraß eaa5f24046 [task-230] [mod] kleine Anpassungen 2025-01-12 10:05:20 +01:00
Christian Fraß 59ea4e256c [task-230] [fix] role:postgresql-for-tandoor 2025-01-11 15:49:53 +01:00
Christian Fraß 41ece50aa2 [task-230] [fix] role:postgresql-for-tandoor 2025-01-11 15:47:48 +01:00
Christian Fraß 9a86117869 [task-230] [fix] role:postgresql-for-tandoor 2025-01-11 15:45:08 +01:00
Christian Fraß 5a7f10561c [task-230] [fix] tandoor: authelia 2025-01-08 22:56:02 +01:00
Christian Fraß 52c675f6e3 [task-230] [add] authelia-for-tandoor 2025-01-08 22:00:01 +01:00
Christian Fraß f426927df1 [task-230] [mod] tandoor: admin user and auth stuff 2025-01-08 21:59:45 +01:00
Christian Fraß 46a1a98751 [task-230] [fix] tandoor stuff 2025-01-08 20:10:56 +01:00
Christian Fraß 6ce4717a45 [taks-230] [fix] tandoor: systemd-unit-Zeilen 2024-12-31 14:21:14 +01:00
Christian Fraß 173d7790f6 [taks-230] [fix] tandoor: systemd-unit-Einsatz 2024-12-31 13:56:40 +01:00
Christian Fraß 2971154dba [taks-230] [fix] tandoor: git-Aufruf 2024-12-31 13:40:26 +01:00
Christian Fraß e740be07f4 [taks-230] [fix] tandoor: Daten nur holen, falls noch nicht da 2024-12-31 13:37:47 +01:00
Christian Fraß f80e6ee661 [task-230] [mod] tandoor: Befehle in Schleife zusammengefasst [fix] yarn-Befehl korrigiert 2024-12-31 13:34:24 +01:00
Christian Fraß 43c35f0620 [task-230] [mod] tandoor: richtiges Verzeichnis auswählen 2024-12-31 13:23:17 +01:00
Christian Fraß 8ab3117ba8 [task-230] [mod] tandoor: env-Variablen richtig setzen 2024-12-31 13:21:29 +01:00
Christian Fraß 9b473372db [task-230] [mod] tandoor: Abhängigkeiten installieren 2024-12-31 13:17:26 +01:00
Christian Fraß 5d7019fdee [task-230] [mod] become-Parameter ergänzt 2024-12-30 17:04:03 +01:00
Christian Fraß a6a7460230 [task-230] [mod] tandoor: create venv 2024-12-30 17:02:04 +01:00
Christian Fraß 5a1eb1a764 [task-230] [mod] tandoor: fix pip install 2024-12-30 15:09:22 +01:00
Christian Fraß b2a6c20c94 [task-230] [mod] tandoor: fix pip install 2024-12-30 14:59:39 +01:00
Christian Fraß 4319326513 [task-230] [mod] install path 2024-12-30 14:55:58 +01:00
Christian Fraß bacbc78b2e [add] tandoor-and-nginx 2024-12-30 13:35:31 +01:00
Christian Fraß 83fcb5aca2 [add] tandoor 2024-12-30 13:35:21 +01:00
Christian Fraß 5b9545010a [add] postgresql-for-tandoor 2024-12-30 13:35:11 +01:00
roydfalk 45cd387e99 Merge pull request 'Authelia | scopes richten' (#5) from task-187 into main
Reviewed-on: https://forgejo.linke.sx/misc/ansible-base/pulls/5
2024-10-26 13:43:32 +02:00
Christian Fraß 9002fc9604 [task-187] [mod] authelia-for-hedgedoc:"grant_types" entfernt 2024-10-26 12:15:12 +02:00
roydfalk 62b4aac895 Merge pull request 'Authelia | response types richten' (#4) from task-186 into main
Reviewed-on: https://forgejo.linke.sx/misc/ansible-base/pulls/4
2024-10-26 12:13:47 +02:00
roydfalk 9da7a88358 Merge pull request 'Authelia | client-secrets hashen' (#3) from dev-authelia_hashed_client_secrets into main
Reviewed-on: https://forgejo.linke.sx/misc/ansible-base/pulls/3
2024-10-26 12:10:57 +02:00
Christian Fraß f2766fcf43 [task-183] [mod] authelia-for-owncloud 2024-10-26 11:54:25 +02:00
Christian Fraß cef1c0aeda [task-186] [mod] authelia-for-owncloud:"response_types" zu conf-Vorlagen hinzugefügt 2024-10-26 11:45:47 +02:00
Christian Fraß b14b80b129 [task-184] [mod] authelia:conf template 2024-10-26 11:13:05 +02:00
Christian Fraß cd31cdea2e [task-185] [mod] authelia:conf template 2024-10-26 11:06:20 +02:00
Christian Fraß 4d4059f294 [task-184] [mod] authelia:conf template 2024-10-26 11:05:48 +02:00
Christian Fraß d690a6454a [task-183] [mod] authelia-for-vikunja 2024-10-26 10:33:41 +02:00
Christian Fraß 0eaf14609c [task-183] [mod] authelia-for-synapse 2024-10-26 10:32:43 +02:00
Christian Fraß 50b5dd63e2 [task-183] [mod] authelia-for-owncloud 2024-10-26 10:31:15 +02:00
Christian Fraß c54ef3281c [task-183] [mod] authelia-for-hedgedoc 2024-10-26 10:25:00 +02:00
Christian Fraß 40fbc3d001 [task-183] [mod] authelia-for-gitlab 2024-10-26 10:23:55 +02:00
Christian Fraß a9e1070d46 [task-183] [mod] authelia-for-forgejo 2024-10-26 10:23:40 +02:00
Christian Fraß ff436ae67c [task-183] [mod] authelia-for-dokuwiki 2024-10-26 10:20:55 +02:00
Christian Fraß 27ac5d7173 [task-183] [mod] authelia-for-wiki_js 2024-10-26 10:13:25 +02:00
Christian Fraß 05d1c0a8c1 [task-183] [mod] authelia-for-wiki_js 2024-10-26 10:10:47 +02:00
Christian Fraß 13561a2019 [task-183] [mod] authelia-for-wiki_js 2024-10-26 10:07:49 +02:00
Christian Fraß 09e667a34d [task-183] [mod] authelia-for-wiki_js 2024-10-26 10:00:34 +02:00
Christian Fraß 6aa922a20a [fix] role:wiki.js:file:cli client 2024-10-26 01:54:27 +02:00
Christian Fraß 30313bff2e [fix] role:wiki.js 2024-10-26 01:13:25 +02:00
Christian Fraß 6378c0dd92 [fix] role:wiki.js 2024-10-26 01:08:52 +02:00
Christian Fraß ef84185102 [fix] role:synapse:apt stuff 2024-10-25 10:16:13 +02:00
Christian Fraß 55d5c57cc2 [mod] hedgedoc:default:auth:changed to "internal" 2024-10-17 18:07:16 +02:00
Christian Fraß 6a1e9938f8 [mod] synapse:info 2024-10-13 13:16:00 +02:00
Christian Fraß 359a65d361 [fix] role:wiki_js 2024-10-11 14:19:35 +02:00
roydfalk 2f43ccd173 Merge pull request 'Rolle | Wiki.js' (#1) from dev-wiki.js into main
Reviewed-on: https://forgejo.linke.sx/misc/ansible-base/pulls/1
2024-10-11 09:25:20 +02:00
Christian Fraß 97622f5c7a [mod] role:wiki.js:info:cli-projekt-link hinzugefügt 2024-09-30 10:15:40 +02:00
Christian Fraß e6ee5fb35f [mod] role:wiki_js 2024-09-30 09:51:07 +02:00
Christian Fraß 4dde5388bc [mod] role:wiki_js:cli 2024-09-30 08:23:32 +02:00
Christian Fraß 064c47b270 [mod] wiki_js 2024-09-28 23:35:36 +02:00
Christian Fraß cd7db6cf4e [fix] wiki.js-roles 2024-09-28 13:22:17 +02:00
Christian Fraß e516bcacc5 [mod] role:wiki.js 2024-09-28 09:57:22 +02:00
Christian Fraß b0f9767f90 [int] 2024-09-27 17:49:18 +02:00
Christian Fraß b1a4da69c2 [fix] role:wiki.js:vars 2024-09-27 12:54:39 +02:00
Christian Fraß a11d75297e [mod] role:synapse:variable für Benachrichtigungs-Quelle 2024-09-06 09:58:45 +02:00
Christian Fraß 8dc07a1bc5 [mod] wiki_js roles 2024-09-04 00:06:52 +02:00
Christian Fraß c45fcfa757 Merge remote-tracking branch 'origin/main' into dev-wiki.js 2024-09-03 22:56:07 +02:00
Christian Fraß 24a5648766 [add] role:postgresql-for-wiki_js [add] role:authelia-for-wiki_js [add] role:wiki_js [add] role:wiki_js-and-nginx 2024-09-03 11:37:12 +02:00
Christian Fraß 1ca2b0afbf [mod] role:synapse:Variablen für E-Mail-Benachrichtigungen 2024-08-27 15:22:52 +02:00
Christian Fraß 1ffba118da [mod] todo 2024-08-23 10:26:46 +02:00
Christian Fraß a89fe95c78 [mod] role:owncloud:info 2024-08-23 10:26:38 +02:00
Christian Fraß 93cf477d43 [fix] role:owncloud:auth 2024-08-23 10:26:28 +02:00
Christian Fraß a7d449b24a Merge branch 'dev-owncloud' into 'main'
Rolle | ownCloud

See merge request misc/ansible-base!13
2024-08-22 13:31:55 +00:00
Christian Fraß 3c0d1a3f45 Merge branch 'dev-forgejo' into 'main'
Rolle | Forgejo

See merge request misc/ansible-base!15
2024-08-22 13:31:42 +00:00
Christian Fraß 1d765fc78e Rolle | Forgejo 2024-08-22 13:31:42 +00:00
Christian Fraß 34daa66373 [fix] role:authelia:conf template 2024-08-22 15:31:25 +02:00
Christian Fraß 67e9e06c82 [fix] role:murmur:ssl paths 2024-08-22 15:29:48 +02:00
Christian Fraß 4ec9a5c899 [fix] role:hedgedoc-and-nginx:syntax for vserver conf 2024-08-22 15:28:31 +02:00
Christian Fraß 0a8cc8d1df [mod] role:authelia:variable lifespans and cors endpoints 2024-08-22 15:27:43 +02:00
Christian Fraß c25f90eefe [fix] role:authelia-for-owncloud:enable 1fa 2024-08-22 15:24:20 +02:00
Christian Fraß 824eeb3fb3 [mod] role:hedgedoc:user directory 2024-08-21 20:14:17 +02:00
Christian Fraß 9b0535e39a [mod] role:owncloud:Variable für Hinauflad-Größen-Grenzen 2024-08-20 10:07:47 +02:00
Christian Fraß 9831e1a8e4 [mod] role:owncloud-and-nginx:force tls 2024-07-30 15:36:47 +02:00
Christian Fraß 320cd91ccd [res] 2024-07-30 15:35:16 +02:00
Christian Fraß d71099c4e5 [res] 2024-07-30 15:33:45 +02:00
Christian Fraß 576e8524d5 Merge branch 'dev-tls_switch' into 'main'
TLS-Schalter

See merge request misc/ansible-base!11
2024-07-30 13:29:12 +00:00
Christian Fraß 54fb0d8dc6 TLS-Schalter 2024-07-30 13:29:12 +00:00
Christian Fraß f1524c5b04 [mod] roles:owncloud-and-nginx:größere Uploads erlauben 2024-07-30 08:46:18 +02:00
Christian Fraß bef3f226e1 [fix] role:owncloud 2024-07-09 13:47:27 +02:00
Christian Fraß 97a0fc7db1 [fix] role:owncloud 2024-07-09 13:36:46 +02:00
Christian Fraß f6a4d902ec Merge branch 'dev-tls_switch' into dev-owncloud 2024-07-09 13:34:07 +02:00
Christian Fraß 349832c77e [mod] role:owncloud:auth 2024-07-09 13:28:50 +02:00
Christian Fraß 09c48d60bb [mod] role:system_basics:install package "acl" 2024-07-09 11:16:20 +02:00
Christian Fraß 37a5b0cb7b [mod] role:owncloud-and-nginx:tls switch 2024-07-04 23:00:25 +02:00
Christian Fraß 6cf5a0666b [fix] role:authelia:Variablen für ownCloud-Anbindung 2024-07-04 11:20:40 +02:00
Christian Fraß 717898fea8 [fix] role:authelia-for-owncloud:desktop client stuff [fix] role:owncloud:desktop client stuff 2024-07-04 09:48:33 +02:00
Christian Fraß 0d8d5c3651 [mod] role:authelia:Variablen für ownCloud-Anbindung 2024-07-04 09:47:26 +02:00
Christian Fraß a81ba565e1 [mod] role:owncloud:Einstellungen für öffentliche Freigaben 2024-07-03 08:26:19 +02:00
Christian Fraß 2b18625dd3 [mod] role:owncloud:Einstellungen für öffentliche Freigaben 2024-07-02 18:59:16 +02:00
Christian Fraß 704012f888 [fix] role:owncloud 2024-07-02 00:11:36 +02:00
Christian Fraß 0235238dd7 [fix] role:authelia-for-owncloud 2024-07-02 00:11:22 +02:00
Christian Fraß 6c8b3d1b08 [add] role:authelia-for-owncloud [add] owncloud [add] owncloud-and-nginx 2024-06-27 19:07:58 +02:00
138 changed files with 5133 additions and 646 deletions

View file

@ -1,4 +1,4 @@
# Ansible Collection - linke.standard
# Ansible Collection - roydfalk.standard
Sammlung von allgemeinen, wiederverwendbaren Ansible-Rollen

View file

@ -2,10 +2,10 @@
# The namespace of the collection. This can be a company/brand/organization or product namespace under which all
# content lives. May only contain alphanumeric lowercase characters and underscores. Namespaces cannot start with
# underscores or numbers and cannot contain consecutive underscores
namespace: linke
namespace: fenris
# The name of the collection. Has the same character restrictions as 'namespace'
name: standard
name: base
# The version of the collection. Must be compatible with semantic versioning
version: 1.0.0
@ -16,12 +16,12 @@ readme: README.md
# A list of the collection's content authors. Can be just the name or in the format 'Full Name <email> (url)
# @nicks:irc/im.site#channel'
authors:
- Royd Falk <roydfalk@folksprak.org>
- Fenris <fenris@folksprak.org>
- Marius <marius@rasumi.net>
### OPTIONAL but strongly recommended
# A short summary description of the collection
description: "Sammlung von allgemeinen, wiederverwendbaren Ansible-Rollen (ursprünglich für Infrastruktur der Partei 'DIE LINKE.')"
description: "Sammlung von allgemeinen, wiederverwendbaren Ansible-Rollen"
# Either a single license or a list of licenses for content inside of a collection. Ansible Galaxy currently only
# accepts L(SPDX,https://spdx.org/licenses/) licenses. This key is mutually exclusive with 'license_file'

View file

@ -0,0 +1,24 @@
{
"nullable": false,
"type": "object",
"properties": {
"domain": {
"nullable": false,
"type": "string"
},
"tls_mode": {
"nullable": false,
"type": "string",
"options": [
"disable",
"enable",
"force"
],
"enum": "force"
}
},
"additionalProperties": false,
"required": [
"domain"
]
}

View file

@ -1,4 +1,5 @@
{
"var_authelia_and_nginx_domain": "authelia.example.org",
"var_authelia_and_nginx_tls_mode": "enable"
"cfg_authelia_and_nginx_defaults": {
"tls_mode": "force"
}
}

View file

@ -1,4 +1,11 @@
[
{
"name": "show vars",
"when": "switch_show_vars",
"ansible.builtin.debug": {
"var": "vars.cfg_authelia_and_nginx"
}
},
{
"name": "deactivate default site",
"become": true,
@ -12,7 +19,7 @@
"become": true,
"ansible.builtin.template": {
"src": "conf.j2",
"dest": "/etc/nginx/sites-available/{{var_authelia_and_nginx_domain}}"
"dest": "/etc/nginx/sites-available/{{cfg_authelia_and_nginx.domain}}"
}
},
{
@ -20,8 +27,8 @@
"become": true,
"ansible.builtin.file": {
"state": "link",
"src": "/etc/nginx/sites-available/{{var_authelia_and_nginx_domain}}",
"dest": "/etc/nginx/sites-enabled/{{var_authelia_and_nginx_domain}}"
"src": "/etc/nginx/sites-available/{{cfg_authelia_and_nginx.domain}}",
"dest": "/etc/nginx/sites-enabled/{{cfg_authelia_and_nginx.domain}}"
}
},
{

View file

@ -45,27 +45,27 @@
{% endmacro %}
server {
server_name {{var_authelia_and_nginx_domain}};
server_name {{cfg_authelia_and_nginx.domain}};
listen 80;
listen [::]:80;
{% if (var_authelia_and_nginx_tls_mode == 'force') %}
{% if (cfg_authelia_and_nginx.tls_mode == 'force') %}
return 301 https://$http_host$request_uri;
{% else %}
{{ authelia_common() }}
{% endif %}
}
{% if (var_authelia_and_nginx_tls_mode != 'disable') %}
{% if (cfg_authelia_and_nginx.tls_mode != 'disable') %}
server {
server_name {{var_authelia_and_nginx_domain}};
server_name {{cfg_authelia_and_nginx.domain}};
listen [::]:443 ssl http2;
listen 443 ssl http2;
ssl_certificate_key /etc/ssl/private/{{var_authelia_and_nginx_domain}}.pem;
ssl_certificate /etc/ssl/fullchains/{{var_authelia_and_nginx_domain}}.pem;
ssl_certificate_key /etc/ssl/private/{{cfg_authelia_and_nginx.domain}}.pem;
ssl_certificate /etc/ssl/fullchains/{{cfg_authelia_and_nginx.domain}}.pem;
include /etc/nginx/ssl-hardening.conf;
{{ authelia_common() }}

View file

@ -1,15 +0,0 @@
{
"domain": {
"type": "string",
"mandatory": false
},
"tls_mode": {
"type": "string",
"options": [
"disable",
"enable",
"force"
],
"mandatory": false
}
}

View file

@ -1,4 +1,12 @@
[
{
"name": "configuration | compute client secret hash",
"become": true,
"ansible.builtin.shell": {
"cmd": "authelia crypto hash generate bcrypt --password {{var_authelia_for_dokuwiki_client_secret}} | cut --delimiter=' ' --fields='2-'"
},
"register": "temp_authelia_for_dokuwiki_client_secret_hashed"
},
{
"name": "configuration | emplace",
"become": true,

View file

@ -1,6 +1,6 @@
{
"client_id": "{{var_authelia_for_dokuwiki_client_id}}",
"client_secret": "{{var_authelia_for_dokuwiki_client_secret}}",
"client_secret": "{{temp_authelia_for_dokuwiki_client_secret_hashed.stdout}}",
"client_name": "DokuWiki",
"public": false,
"authorization_policy": "one_factor",

View file

@ -0,0 +1,5 @@
{
"var_authelia_for_forgejo_forgejo_url_base": "https://forgejo.example.org",
"var_authelia_for_forgejo_client_id": "forgejo",
"var_authelia_for_forgejo_client_secret": "REPLACE_ME"
}

View file

@ -0,0 +1,9 @@
## Beschreibung
Um [Forgejo](../forgejo) gegen [Authelia](../authelia) authentifizieren zu lassen
## Verweise
- [Forgejo-Dokumentation | Configuration | OpenID](https://forgejo.org/docs/latest/admin/config-cheat-sheet/#openid-openid)
- [Authelia-Dokumentation | Gitea Integration](https://www.authelia.com/integration/openid-connect/gitea/)

View file

@ -0,0 +1,33 @@
[
{
"name": "configuration | compute client secret hash",
"become": true,
"ansible.builtin.shell": {
"cmd": "authelia crypto hash generate bcrypt --password {{var_authelia_for_forgejo_client_secret}} | cut --delimiter=' ' --fields='2-'"
},
"register": "temp_authelia_for_forgejo_client_secret_hashed"
},
{
"name": "configuration | emplace",
"become": true,
"ansible.builtin.template": {
"src": "authelia-client-conf.json.j2",
"dest": "/etc/authelia/conf.d/clients/forgejo.json"
}
},
{
"name": "configuration | apply",
"become": true,
"ansible.builtin.command": {
"cmd": "/usr/bin/authelia-conf-compose"
}
},
{
"name": "restart service",
"become": true,
"ansible.builtin.systemd_service": {
"state": "restarted",
"name": "authelia"
}
}
]

View file

@ -0,0 +1,17 @@
{
"client_id": "{{var_authelia_for_forgejo_client_id}}",
"client_secret": "{{temp_authelia_for_forgejo_client_secret_hashed.stdout}}",
"client_name": "Forgejo",
"public": false,
"authorization_policy": "one_factor",
"redirect_uris": [
"{{var_authelia_for_forgejo_forgejo_url_base}}/user/oauth2/authelia/callback"
],
"scopes": [
"openid",
"email",
"profile"
],
"userinfo_signed_response_alg": "none",
"token_endpoint_auth_method": "client_secret_basic"
}

View file

@ -1,4 +1,12 @@
[
{
"name": "configuration | compute client secret hash",
"become": true,
"ansible.builtin.shell": {
"cmd": "authelia crypto hash generate bcrypt --password {{var_authelia_for_gitlab_client_secret}} | cut --delimiter=' ' --fields='2-'"
},
"register": "temp_authelia_for_gitlab_client_secret_hashed"
},
{
"name": "configuration | emplace",
"become": true,

View file

@ -1,6 +1,6 @@
{
"client_id": "{{var_authelia_for_gitlab_client_id}}",
"client_secret": "{{var_authelia_for_gitlab_client_secret}}",
"client_secret": "{{temp_authelia_for_gitlab_client_secret_hashed.stdout}}",
"client_name": "GitLab",
"public": false,
"authorization_policy": "one_factor",

View file

@ -0,0 +1,25 @@
{
"nullable": false,
"type": "object",
"properties": {
"hedgedoc_url_base": {
"nullable": false,
"type": "string"
},
"client_id": {
"nullable": false,
"type": "string",
"default": "hedgedoc"
},
"client_secret": {
"nullable": false,
"type": "string"
}
},
"additionalProperties": false,
"required": [
"hedgedoc_url_base",
"client_id",
"client_secret"
]
}

View file

@ -1,5 +1,5 @@
{
"var_authelia_for_hedgedoc_hedgedoc_url_base": "https://hedgedoc.example.org",
"var_authelia_for_hedgedoc_client_id": "hedgedoc",
"var_authelia_for_hedgedoc_client_secret": "REPLACE_ME"
"cfg_authelia_for_hedgedoc_defaults": {
"client_id": "hedgedoc"
}
}

View file

@ -1,4 +1,19 @@
[
{
"name": "show vars",
"when": "switch_show_vars",
"ansible.builtin.debug": {
"var": "vars.cfg_authelia_for_hedgedoc"
}
},
{
"name": "configuration | compute client secret hash",
"become": true,
"ansible.builtin.shell": {
"cmd": "authelia crypto hash generate bcrypt --password {{cfg_authelia_for_hedgedoc.client_secret}} | cut --delimiter=' ' --fields='2-'"
},
"register": "temp_authelia_for_hedgedoc_client_secret_hashed"
},
{
"name": "configuration | emplace",
"become": true,

View file

@ -1,6 +1,6 @@
{
"client_id": "{{var_authelia_for_hedgedoc_client_id}}",
"client_secret": "{{var_authelia_for_hedgedoc_client_secret}}",
"client_id": "{{cfg_authelia_for_hedgedoc.client_id}}",
"client_secret": "{{temp_authelia_for_hedgedoc_client_secret_hashed.stdout}}",
"client_name": "Hedgedoc",
"public": false,
"authorization_policy": "one_factor",
@ -10,11 +10,7 @@
"profile"
],
"redirect_uris": [
"{{var_authelia_for_hedgedoc_hedgedoc_url_base}}/auth/oauth2/callback"
],
"grant_types": [
"refresh_token",
"authorization_code"
"{{cfg_authelia_for_hedgedoc.hedgedoc_url_base}}/auth/oauth2/callback"
],
"response_types": [
"code"

View file

@ -0,0 +1,97 @@
{
"nullable": false,
"type": "object",
"properties": {
"owncloud_url_base": {
"nullable": false,
"type": "string"
},
"web": {
"nullable": true,
"type": "object",
"properties": {
"client_id": {
"nullable": false,
"type": "string",
"default": "owncloud_web"
}
},
"additionalProperties": false,
"required": [
],
"default": {
}
},
"desktop": {
"nullable": true,
"type": "object",
"properties": {
"client_id": {
"nullable": false,
"type": "string",
"default": "xdXOt13JKxym1B1QcEncf2XDkLAexMBFwiT9j6EfhhHFJhs2KM9jbjTmf8JBXE69"
},
"client_secret": {
"nullable": false,
"type": "string",
"default": "UBntmLjC2yYCeHwsyj73Uwo9TAaecAetRwMw0xYcvNL9yRdLSUi0hUAHfvCHFeFh"
}
},
"additionalProperties": false,
"required": [
],
"default": {
}
},
"android": {
"nullable": true,
"type": "object",
"properties": {
"client_id": {
"nullable": false,
"type": "string",
"default": "e4rAsNUSIUs0lF4nbv9FmCeUkTlV9GdgTLDH1b5uie7syb90SzEVrbN7HIpmWJeD"
},
"client_secret": {
"nullable": false,
"type": "string",
"default": "dInFYGV33xKzhbRmpqQltYNdfLdJIfJ9L5ISoKhNoT9qZftpdWSP71VrpGR9pmoD"
}
},
"additionalProperties": false,
"required": [
],
"default": {
}
},
"ios": {
"nullable": true,
"type": "object",
"properties": {
"client_id": {
"nullable": false,
"type": "string",
"default": "mxd5OQDk6es5LzOzRvidJNfXLUZS2oN3oUFeXPP8LpPrhx3UroJFduGEYIBOxkY1"
},
"client_secret": {
"nullable": false,
"type": "string",
"default": "KFeFWWEZO9TkisIQzR3fo7hfiMXlOpaqP8CFuTbSHzV1TUuGECglPxpiVKJfOXIx"
}
},
"additionalProperties": false,
"required": [
],
"default": {
}
}
},
"additionalProperties": false,
"required": [
"owncloud_url_base",
"web",
"desktop",
"android",
"ios"
]
}

View file

@ -0,0 +1,19 @@
{
"cfg_authelia_for_owncloud_defaults": {
"web": {
"client_id": "owncloud_web"
},
"desktop": {
"client_id": "xdXOt13JKxym1B1QcEncf2XDkLAexMBFwiT9j6EfhhHFJhs2KM9jbjTmf8JBXE69",
"client_secret": "UBntmLjC2yYCeHwsyj73Uwo9TAaecAetRwMw0xYcvNL9yRdLSUi0hUAHfvCHFeFh"
},
"android": {
"client_id": "e4rAsNUSIUs0lF4nbv9FmCeUkTlV9GdgTLDH1b5uie7syb90SzEVrbN7HIpmWJeD",
"client_secret": "dInFYGV33xKzhbRmpqQltYNdfLdJIfJ9L5ISoKhNoT9qZftpdWSP71VrpGR9pmoD"
},
"ios": {
"client_id": "mxd5OQDk6es5LzOzRvidJNfXLUZS2oN3oUFeXPP8LpPrhx3UroJFduGEYIBOxkY1",
"client_secret": "KFeFWWEZO9TkisIQzR3fo7hfiMXlOpaqP8CFuTbSHzV1TUuGECglPxpiVKJfOXIx"
}
}
}

View file

@ -0,0 +1,10 @@
## Beschreibung
Um [ownCloud](../owncloud) gegen [Authelia](../authelia) authentifizieren zu lassen
## Verweise
- [Authelia-Dokumentation | ownCloud Infinite Scale Integration](https://www.authelia.com/integration/openid-connect/ocis/)
- [Helge Klein | SSO via Authelia: ownCloud OpenID Connect Authentication](https://helgeklein.com/blog/owncloud-infinite-scale-with-openid-connect-authentication-for-home-networks/#sso-via-authelia-owncloud-openid-connect-authentication)
- [ownCloud Forums | OCIS + Authelia](https://central.owncloud.org/t/ocis-authelia/44222)

View file

@ -0,0 +1,109 @@
[
{
"name": "show vars",
"when": "switch_show_vars",
"ansible.builtin.debug": {
"var": "vars.cfg_authelia_for_owncloud"
}
},
{
"name": "configuration | client",
"block": [
{
"name": "configuration | client | web",
"when": "cfg_authelia_for_owncloud.web != None",
"block": [
{
"name": "emplace",
"become": true,
"ansible.builtin.template": {
"src": "authelia-client-conf-web.json.j2",
"dest": "/etc/authelia/conf.d/clients/owncloud-web.json"
}
}
]
},
{
"name": "configuration | client | desktop",
"when": "cfg_authelia_for_owncloud.desktop != None",
"block": [
{
"name": "compute client secret hash",
"become": true,
"ansible.builtin.shell": {
"cmd": "authelia crypto hash generate bcrypt --password {{cfg_authelia_for_owncloud.desktop.client_secret}} | cut --delimiter=' ' --fields='2-'"
},
"register": "temp_authelia_for_owncloud_desktop_client_secret_hashed"
},
{
"name": "emplace",
"become": true,
"ansible.builtin.template": {
"src": "authelia-client-conf-desktop.json.j2",
"dest": "/etc/authelia/conf.d/clients/owncloud-desktop.json"
}
}
]
},
{
"name": "configuration | client | android",
"when": "cfg_authelia_for_owncloud.android != None",
"block": [
{
"name": "compute client secret hash",
"become": true,
"ansible.builtin.shell": {
"cmd": "authelia crypto hash generate bcrypt --password {{cfg_authelia_for_owncloud.android.client_secret}} | cut --delimiter=' ' --fields='2-'"
},
"register": "temp_authelia_for_owncloud_android_client_secret_hashed"
},
{
"name": "emplace",
"become": true,
"ansible.builtin.template": {
"src": "authelia-client-conf-android.json.j2",
"dest": "/etc/authelia/conf.d/clients/owncloud-android.json"
}
}
]
},
{
"name": "configuration | client | ios",
"when": "cfg_authelia_for_owncloud.ios != None",
"block": [
{
"name": "compute client secret hash",
"become": true,
"ansible.builtin.shell": {
"cmd": "authelia crypto hash generate bcrypt --password {{cfg_authelia_for_owncloud.ios.client_secret}} | cut --delimiter=' ' --fields='2-'"
},
"register": "temp_authelia_for_owncloud_ios_client_secret_hashed"
},
{
"name": "emplace",
"become": true,
"ansible.builtin.template": {
"src": "authelia-client-conf-ios.json.j2",
"dest": "/etc/authelia/conf.d/clients/owncloud-ios.json"
}
}
]
}
]
},
{
"name": "configuration | apply",
"become": true,
"ansible.builtin.command": {
"cmd": "/usr/bin/authelia-conf-compose"
}
},
{
"name": "restart service",
"become": true,
"ansible.builtin.systemd_service": {
"state": "restarted",
"name": "authelia"
}
}
]

View file

@ -0,0 +1,33 @@
{
"client_id": "{{cfg_authelia_for_owncloud.android.client_id}}",
"client_secret": "{{temp_authelia_for_owncloud_android_client_secret_hashed.stdout}}",
"client_name": "ownCloud | Android Client",
"public": false,
"authorization_policy": "one_factor",
"require_pkce": true,
"pkce_challenge_method": "S256",
"scopes": [
"openid",
"offline_access",
"groups",
"profile",
"email"
],
"redirect_uris": [
"oc://android.owncloud.com"
],
"response_types": [
"code"
],
"grant_types": [
"authorization_code",
"refresh_token"
],
"access_token_signed_response_alg": "none",
"userinfo_signed_response_alg": "none",
"token_endpoint_auth_method": "client_secret_basic"
}

View file

@ -0,0 +1,33 @@
{
"client_id": "{{cfg_authelia_for_owncloud.desktop.client_id}}",
"client_secret": "{{temp_authelia_for_owncloud_desktop_client_secret_hashed.stdout}}",
"client_name": "ownCloud | Desktop Client",
"public": false,
"authorization_policy": "one_factor",
"require_pkce": true,
"pkce_challenge_method": "S256",
"scopes": [
"openid",
"offline_access",
"groups",
"profile",
"email"
],
"redirect_uris": [
"http://127.0.0.1",
"http://localhost"
],
"response_types": [
"code"
],
"grant_types": [
"authorization_code",
"refresh_token"
],
"access_token_signed_response_alg": "none",
"userinfo_signed_response_alg": "none",
"token_endpoint_auth_method": "client_secret_basic"
}

View file

@ -0,0 +1,33 @@
{
"client_id": "{{cfg_authelia_for_owncloud.ios.client_id}}",
"client_secret": "{{temp_authelia_for_owncloud_ios_client_secret_hashed.stdout}}",
"client_name": "ownCloud | iOS Client",
"public": false,
"authorization_policy": "one_factor",
"require_pkce": true,
"pkce_challenge_method": "S256",
"scopes": [
"openid",
"offline_access",
"groups",
"profile",
"email"
],
"redirect_uris": [
"oc://ios.owncloud.com",
"oc.ios://ios.owncloud.com"
],
"response_types": [
"code"
],
"grant_types": [
"authorization_code",
"refresh_token"
],
"access_token_signed_response_alg": "none",
"userinfo_signed_response_alg": "none",
"token_endpoint_auth_method": "client_secret_basic"
}

View file

@ -0,0 +1,33 @@
{
"client_id": "{{cfg_authelia_for_owncloud.web.client_id}}",
"client_name": "ownCloud | Web Client",
"lifespan": "long",
"public": true,
"authorization_policy": "one_factor",
"require_pkce": true,
"pkce_challenge_method": "S256",
"scopes": [
"openid",
"offline_access",
"groups",
"profile",
"email"
],
"redirect_uris": [
"https://{{cfg_authelia_for_owncloud.owncloud_url_base}}",
"https://{{cfg_authelia_for_owncloud.owncloud_url_base}}/oidc-callback.html",
"https://{{cfg_authelia_for_owncloud.owncloud_url_base}}/oidc-silent-redirect.html",
"https://{{cfg_authelia_for_owncloud.owncloud_url_base}}/apps/openidconnect/redirect"
],
"response_types": [
"code"
],
"grant_types": [
"authorization_code",
"refresh_token"
],
"access_token_signed_response_alg": "none",
"userinfo_signed_response_alg": "none",
"token_endpoint_auth_method": "none"
}

View file

@ -1,4 +1,12 @@
[
{
"name": "configuration | compute client secret hash",
"become": true,
"ansible.builtin.shell": {
"cmd": "authelia crypto hash generate bcrypt --password {{var_authelia_for_synapse_client_secret}} | cut --delimiter=' ' --fields='2-'"
},
"register": "temp_authelia_for_synapse_client_secret_hashed"
},
{
"name": "configuration | emplace",
"become": true,

View file

@ -1,6 +1,6 @@
{
"client_id": "{{var_authelia_for_synapse_client_id}}",
"client_secret": "{{var_authelia_for_synapse_client_secret}}",
"client_secret": "{{temp_authelia_for_synapse_client_secret_hashed.stdout}}",
"client_name": "Synapse",
"public": false,
"authorization_policy": "one_factor",

View file

@ -0,0 +1,5 @@
{
"var_authelia_for_tandoor_tandoor_url_base": "https://tandoor.example.org",
"var_authelia_for_tandoor_client_id": "tandoor",
"var_authelia_for_tandoor_client_secret": "REPLACE_ME"
}

View file

@ -0,0 +1,8 @@
## Beschreibung
Um [Tandoor](../tandoor) gegen [Authelia](../authelia) authentifizieren zu lassen
## Verweise
- [allauth-Dokumentation | Authelia](https://django-allauth.readthedocs.io/en/latest/socialaccount/providers/authelia.html)

View file

@ -0,0 +1,33 @@
[
{
"name": "configuration | compute client secret hash",
"become": true,
"ansible.builtin.shell": {
"cmd": "authelia crypto hash generate bcrypt --password {{var_authelia_for_tandoor_client_secret}} | cut --delimiter=' ' --fields='2-'"
},
"register": "temp_authelia_for_tandoor_client_secret_hashed"
},
{
"name": "configuration | emplace",
"become": true,
"ansible.builtin.template": {
"src": "authelia-client-conf.json.j2",
"dest": "/etc/authelia/conf.d/clients/tandoor.json"
}
},
{
"name": "configuration | apply",
"become": true,
"ansible.builtin.command": {
"cmd": "/usr/bin/authelia-conf-compose"
}
},
{
"name": "restart service",
"become": true,
"ansible.builtin.systemd_service": {
"state": "restarted",
"name": "authelia"
}
}
]

View file

@ -0,0 +1,17 @@
{
"client_id": "{{var_authelia_for_tandoor_client_id}}",
"client_secret": "{{temp_authelia_for_tandoor_client_secret_hashed.stdout}}",
"client_name": "Tandoor",
"public": false,
"authorization_policy": "one_factor",
"redirect_uris": [
"{{var_authelia_for_tandoor_tandoor_url_base}}/accounts/oidc/authelia/login/callback/"
],
"scopes": [
"openid",
"email",
"profile"
],
"userinfo_signed_response_alg": "none",
"token_endpoint_auth_method": "client_secret_basic"
}

View file

@ -1,4 +1,12 @@
[
{
"name": "configuration | compute client secret hash",
"become": true,
"ansible.builtin.shell": {
"cmd": "authelia crypto hash generate bcrypt --password {{var_authelia_for_vikunja_client_secret}} | cut --delimiter=' ' --fields='2-'"
},
"register": "temp_authelia_for_vikunja_client_secret_hashed"
},
{
"name": "configuration | emplace",
"become": true,

View file

@ -1,6 +1,6 @@
{
"client_id": "{{var_authelia_for_vikunja_client_id}}",
"client_secret": "{{var_authelia_for_vikunja_client_secret}}",
"client_secret": "{{temp_authelia_for_vikunja_client_secret_hashed.stdout}}",
"client_name": "Vikunja",
"public": false,
"authorization_policy": "one_factor",

View file

@ -0,0 +1,6 @@
{
"var_authelia_for_wiki_js_wiki_js_url_base": "https://wiki-js.example.org",
"var_authelia_for_wiki_js_client_id": "wiki_js",
"var_authelia_for_wiki_js_client_secret": "REPLACE_ME",
"var_authelia_for_wiki_js_strategy_id": "authelia"
}

View file

@ -0,0 +1,9 @@
## Beschreibung
Um [Wiki.js](../wiki.js) gegen [Authelia](../authelia) authentifizieren zu lassen
## Verweise
[Wiki.js-Dokumentation | Authentication](https://docs.requarks.io/auth)
[Authelia-Dokumentation | Wiki.js Integration](https://www.authelia.com/integration/openid-connect/wikijs/)

View file

@ -0,0 +1,33 @@
[
{
"name": "configuration | compute client secret hash",
"become": true,
"ansible.builtin.shell": {
"cmd": "authelia crypto hash generate bcrypt --password {{var_authelia_for_wiki_js_client_secret}} | cut --delimiter=' ' --fields='2-'"
},
"register": "temp_authelia_for_wiki_js_client_secret_hashed"
},
{
"name": "configuration | emplace",
"become": true,
"ansible.builtin.template": {
"src": "authelia-client-conf.json.j2",
"dest": "/etc/authelia/conf.d/clients/wiki_js.json"
}
},
{
"name": "configuration | apply",
"become": true,
"ansible.builtin.command": {
"cmd": "/usr/bin/authelia-conf-compose"
}
},
{
"name": "restart service",
"become": true,
"ansible.builtin.systemd_service": {
"state": "restarted",
"name": "authelia"
}
}
]

View file

@ -0,0 +1,17 @@
{
"client_id": "{{var_authelia_for_wiki_js_client_id}}",
"client_secret": "{{temp_authelia_for_wiki_js_client_secret_hashed.stdout}}",
"client_name": "Wiki.js",
"public": false,
"authorization_policy": "one_factor",
"redirect_uris": [
"{{var_authelia_for_wiki_js_wiki_js_url_base}}/login/{{var_authelia_for_wiki_js_strategy_id}}/callback"
],
"scopes": [
"openid",
"email",
"profile"
],
"userinfo_signed_response_alg": "none",
"token_endpoint_auth_method": "client_secret_post"
}

View file

@ -0,0 +1,449 @@
{
"nullable": false,
"type": "object",
"properties": {
"listen_address": {
"nullable": false,
"type": "string",
"default": "0.0.0.0"
},
"domain": {
"nullable": false,
"type": "string"
},
"session_domain": {
"nullable": false,
"type": "string"
},
"redirect_url": {
"nullable": false,
"type": "string"
},
"jwt_secret": {
"nullable": false,
"type": "string"
},
"session_secret": {
"nullable": false,
"type": "string"
},
"storage_encryption_key": {
"nullable": false,
"type": "string"
},
"users_file_path": {
"nullable": false,
"type": "string",
"default": "/var/authelia/users.yml"
},
"log_file_path": {
"nullable": false,
"type": "string",
"default": "/var/authelia/log.jsonl"
},
"storage": {
"anyOf": [
{
"nullable": false,
"type": "object",
"properties": {
"kind": {
"nullable": false,
"type": "string",
"enum": ["sqlite"],
"default": "sqlite"
},
"data": {
"nullable": false,
"type": "object",
"properties": {
"path": {
"nullable": false,
"type": "string",
"default": "/var/authelia/state.db"
}
},
"additionalProperties": false,
"required": [
"path"
],
"default": {
}
}
},
"additionalProperties": false,
"required": [
"kind",
"data"
],
"default": {
}
},
{
"nullable": false,
"type": "object",
"properties": {
"kind": {
"nullable": false,
"type": "string",
"enum": ["postgresql"]
},
"data": {
"nullable": false,
"type": "object",
"properties": {
"host": {
"nullable": false,
"type": "string",
"ddefault": "localhost"
},
"port": {
"nullable": false,
"type": "integer",
"default": 5432
},
"username": {
"nullable": false,
"type": "string",
"default": "authelia_user"
},
"password": {
"nullable": false,
"type": "string"
},
"schema": {
"nullable": false,
"type": "string",
"default": "authelia"
}
},
"additionalProperties": false,
"required": [
"host",
"port",
"username",
"password",
"schema"
],
"default": {
}
}
},
"additionalProperties": false,
"required": [
"kind",
"data"
],
"default": {
}
},
{
"nullable": false,
"type": "object",
"properties": {
"kind": {
"nullable": false,
"type": "string",
"enum": ["mariadb"]
},
"data": {
"nullable": false,
"type": "object",
"properties": {
"host": {
"nullable": false,
"type": "string",
"ddefault": "localhost"
},
"port": {
"nullable": false,
"type": "integer",
"default": 3306
},
"username": {
"nullable": false,
"type": "string",
"default": "authelia_user"
},
"password": {
"nullable": false,
"type": "string"
},
"schema": {
"nullable": false,
"type": "string",
"default": "authelia"
}
},
"additionalProperties": false,
"required": [
"host",
"port",
"username",
"password",
"schema"
],
"default": {
}
}
},
"additionalProperties": false,
"required": [
"kind",
"data"
],
"default": {
}
}
]
},
"ntp_server": {
"nullable": false,
"type": "string",
"default": "time.cloudflare.com:123"
},
"password_reset": {
"nullable": false,
"type": "object",
"properties": {
"enabled": {
"nullable": false,
"type": "boolean",
"default": false
},
"custom_url": {
"nullable": true,
"type": "string",
"default": null
}
},
"additionalProperties": false,
"required": [
"enabled",
"custom_url"
],
"default": {
}
},
"notification": {
"anyOf": [
{
"nullable": false,
"type": "object",
"properties": {
"kind": {
"nullable": false,
"type": "string",
"enum": ["file"],
"default": "file"
},
"data": {
"nullable": false,
"type": "object",
"properties": {
"path": {
"nullable": false,
"type": "string",
"default": "/var/authelia/notifications"
}
},
"additionalProperties": false,
"required": [
"path"
],
"default": {
}
}
},
"additionalProperties": false,
"required": [
"kind",
"data"
],
"default": {
}
},
{
"nullable": false,
"type": "object",
"properties": {
"kind": {
"nullable": false,
"type": "string",
"enum": ["smtp"],
"default": "smtp"
},
"data": {
"nullable": false,
"type": "object",
"properties": {
"host": {
"nullable": false,
"type": "string"
},
"port": {
"nullable": false,
"type": "integer",
"default": 465
},
"username": {
"nullable": false,
"type": "string",
"default": "authelia"
},
"password": {
"nullable": false,
"type": "string"
},
"sender": {
"nullable": false,
"type": "string",
"default": "authelia@example.org"
}
},
"additionalProperties": false,
"required": [
"host",
"port",
"username",
"password",
"sender"
]
}
},
"additionalProperties": false,
"required": [
"kind",
"data"
],
"default": {
}
}
]
},
"oidc": {
"nullable": false,
"type": "object",
"properties": {
"hmac_secret": {
"nullable": false,
"type": "string"
},
"lifespan": {
"nullable": false,
"type": "object",
"properties": {
"default": {
"nullable": false,
"type": "object",
"properties": {
"access_token": {
"nullable": false,
"type": "string",
"default": "1h"
},
"refresh_token": {
"nullable": false,
"type": "string",
"default": "1m"
}
},
"additionalProperties": false,
"required": [
],
"default": {
}
},
"custom": {
"nullable": false,
"type": "object",
"properties": {
},
"additionalProperties": {
"nullable": false,
"type": "object",
"properties": {
"access_token": {
"nullable": false,
"type": "string"
},
"refresh_token": {
"nullable": false,
"type": "string"
}
},
"additionalProperties": false,
"required": [
"access_token",
"refresh_token"
]
},
"required": [
],
"default": {
"long": {
"access_token": "2d",
"refresh_token": "3d"
}
}
}
},
"additionalProperties": false,
"required": [
],
"default": {
}
},
"cors_endpoints": {
"nullable": true,
"type": "array",
"items": {
"nullable": false,
"type": "string",
"enum": [
"authorization",
"pushed-authorization-request",
"token",
"revocation",
"introspection",
"userinfo"
]
},
"default": [
"authorization",
"token",
"revocation",
"introspection",
"userinfo"
]
}
},
"additionalProperties": false,
"required": [
"hmac_secret",
"lifespan",
"cors_endpoints"
],
"default": {
}
}
},
"additionalProperties": false,
"required": [
"listen_address",
"domain",
"session_domain",
"redirect_url",
"jwt_secret",
"session_secret",
"storage_encryption_key",
"users_file_path",
"log_file_path",
"storage",
"ntp_server",
"notification",
"oidc"
],
"default": {
}
}

View file

@ -1,36 +1,45 @@
{
"var_authelia_version": "4.37.5",
"var_authelia_architecture": "amd64",
"var_authelia_listen_address": "0.0.0.0",
"var_authelia_jwt_secret": "REPLACE_ME",
"var_authelia_users_file_path": "/var/authelia/users.yml",
"var_authelia_log_file_path": "/var/authelia/log.jsonl",
"var_authelia_domain": "authelia.example.org",
"var_authelia_redirect_url": "https://example.org",
"var_authelia_session_domain": "example.org",
"var_authelia_session_secret": "REPLACE_ME",
"var_authelia_storage_encryption_key": "REPLACE_ME",
"var_authelia_storage_kind": "sqlite",
"var_authelia_storage_data_sqlite_path": "/var/authelia/state.db",
"var_authelia_storage_data_postgresql_host": "localhost",
"var_authelia_storage_data_postgresql_port": 5432,
"var_authelia_storage_data_postgresql_username": "authelia_user",
"var_authelia_storage_data_postgresql_password": "REPLACE_ME",
"var_authelia_storage_data_postgresql_schema": "authelia",
"var_authelia_storage_data_mariadb_host": "localhost",
"var_authelia_storage_data_mariadb_port": 3306,
"var_authelia_storage_data_mariadb_username": "authelia_user",
"var_authelia_storage_data_mariadb_password": "REPLACE_ME",
"var_authelia_storage_data_mariadb_schema": "authelia",
"var_authelia_ntp_server": "time.cloudflare.com:123",
"var_authelia_password_reset_enabled": false,
"var_authelia_password_reset_custom_url": null,
"var_authelia_notification_mode": "smtp",
"var_authelia_notification_file_path": "/var/authelia/notifications",
"var_authelia_notification_smtp_host": "smtp.example.org",
"var_authelia_notification_smtp_port": 465,
"var_authelia_notification_smtp_username": "authelia",
"var_authelia_notification_smtp_password": "REPLACE_ME",
"var_authelia_notification_smtp_sender": "authelia@example.org",
"var_authelia_oidc_hmac_secret": "REPLACE_ME"
"cfg_authelia_defaults": {
"listen_address": "0.0.0.0",
"users_file_path": "/var/authelia/users.yml",
"log_file_path": "/var/authelia/log.jsonl",
"storage": {
"kind": "sqlite",
"data": {
"path": "/var/authelia/state.db"
}
},
"ntp_server": "time.cloudflare.com:123",
"password_reset": {
"enabled": false,
"custom_url": null
},
"notification": {
"kind": "file",
"data": {
"path": "/var/authelia/notifications"
}
},
"oidc": {
"lifespan": {
"default": {
"access_token": "1d",
"refresh_token": "1h"
},
"custom": {
"long": {
"access_token": "2d",
"refresh_token": "3d"
}
}
},
"cors_endpoints": [
"authorization",
"token",
"revocation",
"introspection",
"userinfo"
]
}
}
}

View file

@ -1,32 +1,45 @@
[
{
"name": "packages | prerequisites",
"name": "show vars",
"when": "switch_show_vars",
"ansible.builtin.debug": {
"var": "vars.cfg_authelia"
}
},
{
"name": "packages",
"block": [
{
"name": "prerequisites",
"become": true,
"ansible.builtin.apt": {
"update_cache": true,
"pkg": [
"apt-transport-https",
"ca-certificates",
"gpg"
]
}
},
{
"name": "packages | keys",
"name": "keys",
"become": true,
"ansible.builtin.apt_key": {
"url": "https://apt.authelia.com/organization/signing.asc"
"ansible.builtin.get_url": {
"url": "https://www.authelia.com/keys/authelia-security.gpg",
"dest": "/usr/share/keyrings/authelia-security.gpg"
}
},
{
"name": "packages | repository",
"name": "repository",
"become": true,
"ansible.builtin.apt_repository": {
"repo": "deb https://apt.authelia.com/stable/debian/debian/ all main"
"ansible.builtin.shell": {
"cmd": "echo \"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/authelia-security.gpg] https://apt.authelia.com stable main\" > /etc/apt/sources.list.d/authelia.list",
"creates": "/etc/apt/sources.list.d/authelia.list"
}
},
{
"name": "packages | installation",
"name": "installation",
"become": true,
"ansible.builtin.apt": {
"update_cache": true,
@ -37,6 +50,8 @@
"authelia"
]
}
}
]
},
{
"name": "generate private key for signing OIDC JWTs",
@ -49,6 +64,9 @@
},
"register": "temp_tls_result"
},
{
"name": "configuration",
"block": [
{
"name": "configuration | compose script",
"become": true,
@ -84,40 +102,51 @@
"ansible.builtin.command": {
"cmd": "/usr/bin/authelia-conf-compose --main-file-path=/etc/authelia/conf.d/main.json --clients-directory-path=/etc/authelia/conf.d/clients --output-format=yaml --output-path=/etc/authelia/configuration.yml"
}
}
]
},
{
"name": "setup log directory",
"become": true,
"ansible.builtin.file": {
"state": "directory",
"path": "{{var_authelia_log_file_path | dirname}}"
"owner": "authelia",
"group": "authelia",
"path": "{{cfg_authelia.log_file_path | dirname}}"
}
},
{
"name": "users | directory",
"name": "users",
"block": [
{
"name": "directory",
"become": true,
"ansible.builtin.file": {
"state": "directory",
"path": "{{var_authelia_users_file_path | dirname}}"
"owner": "authelia",
"group": "authelia",
"path": "{{cfg_authelia.users_file_path | dirname}}"
}
},
{
"name": "users | initial file",
"name": "initial file",
"become": true,
"ansible.builtin.template": {
"src": "users.yml.j2",
"dest": "{{var_authelia_users_file_path}}",
"dest": "{{cfg_authelia.users_file_path}}",
"force": false
}
},
{
"name": "users | management script",
"name": "management script",
"become": true,
"ansible.builtin.copy": {
"src": "user-manage.py",
"dest": "/usr/bin/authelia-user-manage",
"mode": "0700"
}
}
]
},
{
"name": "apply",

View file

@ -2,12 +2,12 @@
"theme": "auto",
"identity_validation": {
"reset_password": {
"jwt_secret": "{{var_authelia_jwt_secret}}"
"jwt_secret": "{{cfg_authelia.jwt_secret}}"
}
},
"default_2fa_method": "totp",
"server": {
"address": "{{var_authelia_listen_address}}:9091",
"address": "{{cfg_authelia.listen_address}}:9091",
"endpoints": {
"enable_pprof": false,
"enable_expvars": false
@ -17,7 +17,7 @@
"log": {
"level": "info",
"format": "json",
"file_path": "{{var_authelia_log_file_path}}",
"file_path": "{{cfg_authelia.log_file_path}}",
"keep_stdout": false
},
"telemetry": {
@ -43,7 +43,7 @@
"user_verification": "preferred"
},
"ntp": {
"address": "{{var_authelia_ntp_server}}",
"address": "{{cfg_authelia.ntp_server}}",
"version": 4,
"max_desync": "3s",
"disable_startup_check": false,
@ -51,16 +51,16 @@
},
"authentication_backend": {
"password_reset": {
{% if var_authelia_password_reset_enabled %}
{% if cfg_authelia.password_reset.enabled %}
"disable": false,
{% else %}
"disable": true,
{% endif %}
"custom_url": "{{var_authelia_password_reset_custom_url}}"
"custom_url": {{cfg_authelia.password_reset.custom_url | to_json}}
},
"refresh_interval": "5m",
"file": {
"path": "{{var_authelia_users_file_path}}",
"path": "{{cfg_authelia.users_file_path}}",
"watch": true,
"search": {
"email": false,
@ -121,15 +121,15 @@
"session": {
"name": "authelia_session",
"same_site": "lax",
"secret": "{{var_authelia_session_secret}}",
"secret": "{{cfg_authelia.session_secret}}",
"expiration": "1h",
"inactivity": "5m",
"remember_me": "1M",
"cookies": [
{
"domain": "{{var_authelia_session_domain}}",
"authelia_url": "https://{{var_authelia_domain}}/",
"default_redirection_url": "{{var_authelia_redirect_url}}"
"domain": "{{cfg_authelia.session_domain}}",
"authelia_url": "https://{{cfg_authelia.domain}}/",
"default_redirection_url": "{{cfg_authelia.redirect_url}}"
}
]
},
@ -139,45 +139,44 @@
"ban_time": "5m"
},
"storage": {
"encryption_key": "{{var_authelia_storage_encryption_key}}",
{% if var_authelia_storage_kind == "sqlite" %}
"encryption_key": "{{cfg_authelia.storage_encryption_key}}",
{% if cfg_authelia.storage.kind == "sqlite" %}
"local": {
"path": "{{var_authelia_storage_data_sqlite_path}}"
"path": "{{cfg_authelia.storage.data.path}}"
}
{% endif %}
{% if var_authelia_storage_kind == "postgresql" %}
{% if cfg_authelia.storage.kind == "postgresql" %}
"postgres": {
"address": "{{var_authelia_storage_data_postgresql_host}}:{{var_authelia_storage_data_postgresql_port | string}}",
"address": "{{cfg_authelia.storage.data.host}}:{{cfg_authelia.storage.data.port | string}}",
"schema": "public",
"username": "{{var_authelia_storage_data_postgresql_username}}",
"password": "{{var_authelia_storage_data_postgresql_password}}",
"database": "{{var_authelia_storage_data_postgresql_schema}}"
"username": "{{cfg_authelia.storage.data.username}}",
"password": "{{cfg_authelia.storage.data.password}}",
"database": "{{cfg_authelia.storage.data.schema}}"
}
{% endif %}
{% if var_authelia_storage_kind == "mariadb" %}
{% if cfg_authelia.storage.kind == "mariadb" %}
"mysql": {
"host": "{{var_authelia_storage_data_mariadb_host}}",
"port": {{var_authelia_storage_data_mariadb_port | string}},
"username": "{{var_authelia_storage_data_mariadb_username}}",
"password": "{{var_authelia_storage_data_mariadb_password}}",
"database": "{{var_authelia_storage_data_mariadb_schema}}"
"host": "{{cfg_authelia.storage.data.host}}",
"port": {{cfg_authelia.storage.data.port | string}},
"username": "{{cfg_authelia.storage.data.username}}",
"password": "{{cfg_authelia.storage.data.password}}",
"database": "{{cfg_authelia.storage.data.schema}}"
}
{% endif %}
},
"notifier": {
"disable_startup_check": true,
{% if var_authelia_notification_mode == "file" %}
{% if cfg_authelia.notification.kind == "file" %}
"filesystem": {
"filename": "{{var_authelia_notification_file_path}}"
"filename": "{{cfg_authelia.notification.data.path}}"
}
{% endif %}
{% if var_authelia_notification_mode == "smtp" %}
{% if cfg_authelia.notification.kind == "smtp" %}
"smtp": {
"host": "{{var_authelia_notification_smtp_host}}",
"port": {{var_authelia_notification_smtp_port | string}},
"username": "{{var_authelia_notification_smtp_username}}",
"password": "{{var_authelia_notification_smtp_password}}",
"sender": "{{var_authelia_notification_smtp_sender}}",
"address": "{{cfg_authelia.notification.data.host}}:{{cfg_authelia.notification.data.port | string}}",
"username": "{{cfg_authelia.notification.data.username}}",
"password": "{{cfg_authelia.notification.data.password}}",
"sender": "{{cfg_authelia.notification.data.sender}}",
"disable_require_tls": false,
"disable_html_emails": false,
"tls": {
@ -188,10 +187,24 @@
},
"identity_providers": {
"oidc": {
"hmac_secret": "{{var_authelia_oidc_hmac_secret}}",
"issuer_private_key": "{{temp_tls_result.privatekey | replace('\n', '\\n')}}",
"hmac_secret": "{{cfg_authelia.oidc.hmac_secret}}",
"jwks": [
{
"algorithm": "RS256",
"key": "{{temp_tls_result.privatekey | replace('\n', '\\n')}}"
}
],
"lifespans": {
"access_token": "{{cfg_authelia.oidc.lifespan.default.access_token}}",
"refresh_token": "{{cfg_authelia.oidc.lifespan.default.refresh_token}}",
"custom": {{cfg_authelia.oidc.lifespan.custom | to_json}}
},
"cors": {
"allowed_origins_from_client_redirect_uris": true
{% if cfg_authelia.oidc.cors_endpoints == None %}
{% else %}
,"endpoints": {{cfg_authelia.oidc.cors_endpoints | to_json}}
{% endif %}
},
"clients": [
]

View file

@ -1,143 +0,0 @@
{
"version": {
"type": "string",
"mandatory": false
},
"architecture": {
"type": "string",
"mandatory": false
},
"listen_address": {
"type": "string",
"mandatory": false
},
"jwt_secret": {
"type": "string",
"mandatory": true
},
"users_file_path": {
"type": "string",
"mandatory": false
},
"log_file_path": {
"type": "string",
"mandatory": false
},
"domain": {
"type": "string",
"mandatory": false
},
"redirect_url": {
"type": "string",
"mandatory": false
},
"session_domain": {
"type": "string",
"mandatory": false
},
"session_secret": {
"type": "string",
"mandatory": true
},
"storage_encryption_key": {
"type": "string",
"mandatory": true
},
"storage_kind": {
"type": "string",
"mandatory": false
},
"storage_data_sqlite_path": {
"type": "string",
"mandatory": false
},
"storage_data_postgresql_host": {
"type": "string",
"mandatory": false
},
"storage_data_postgresql_port": {
"type": "integer",
"mandatory": false
},
"storage_data_postgresql_username": {
"type": "string",
"mandatory": false
},
"storage_data_postgresql_password": {
"type": "string",
"mandatory": false
},
"storage_data_postgresql_schema": {
"type": "string",
"mandatory": false
},
"storage_data_mariadb_host": {
"type": "string",
"mandatory": false
},
"storage_data_mariadb_port": {
"type": "integer",
"mandatory": false
},
"storage_data_mariadb_username": {
"type": "string",
"mandatory": false
},
"storage_data_mariadb_password": {
"type": "string",
"mandatory": false
},
"storage_data_mariadb_schema": {
"type": "string",
"mandatory": false
},
"ntp_server": {
"type": "string",
"mandatory": false
},
"password_reset_enabled": {
"type": "boolean",
"mandatory": false
},
"password_reset_custom_url": {
"nullable": true,
"type": "string",
"mandatory": false
},
"notification_mode": {
"type": "string",
"mandatory": false,
"options": [
"file",
"smtp"
]
},
"notification_file_path": {
"type": "string",
"mandatory": false
},
"notification_smtp_host": {
"type": "string",
"mandatory": false
},
"notification_smtp_port": {
"type": "integer",
"mandatory": false
},
"notification_smtp_username": {
"type": "string",
"mandatory": false
},
"notification_smtp_password": {
"type": "string",
"mandatory": false
},
"notification_smtp_sender": {
"type": "string",
"mandatory": false
},
"oidc_hmac_secret": {
"type": "string",
"mandatory": true
}
}

View file

@ -1,5 +1,5 @@
{
"var_dokuwiki_and_nginx_directory": "/opt/dokuwiki",
"var_dokuwiki_and_nginx_domain": "dokuwiki.example.org",
"var_dokuwiki_and_nginx_tls_mode": "enable"
"var_dokuwiki_and_nginx_tls_mode": "force"
}

View file

@ -1,5 +1,5 @@
{
"var_element_and_nginx_domain": "element.example.org",
"var_element_and_nginx_path": "/opt/element",
"var_element_and_nginx_tls_mode": "enable"
"var_element_and_nginx_tls_mode": "force"
}

View file

@ -0,0 +1,5 @@
{
"var_forgejo_and_nginx_domain": "forgejo.example.org",
"var_forgejo_and_nginx_port": 2378,
"var_forgejo_and_nginx_tls_mode": "force"
}

View file

@ -0,0 +1 @@

View file

@ -0,0 +1,35 @@
[
{
"name": "deactivate default site",
"become": true,
"ansible.builtin.file": {
"state": "absent",
"dest": "/etc/nginx/sites-enabled/default"
}
},
{
"name": "emplace configuration | data",
"become": true,
"ansible.builtin.template": {
"src": "conf.j2",
"dest": "/etc/nginx/sites-available/{{var_forgejo_and_nginx_domain}}"
}
},
{
"name": "emplace configuration | link",
"become": true,
"ansible.builtin.file": {
"state": "link",
"src": "/etc/nginx/sites-available/{{var_forgejo_and_nginx_domain}}",
"dest": "/etc/nginx/sites-enabled/{{var_forgejo_and_nginx_domain}}"
}
},
{
"name": "restart nginx",
"become": true,
"ansible.builtin.systemd_service": {
"state": "restarted",
"name": "nginx"
}
}
]

View file

@ -0,0 +1,34 @@
{% macro forgejo_common() %}
location / {
proxy_pass http://localhost:{{var_forgejo_and_nginx_port | string}};
client_max_body_size 20M;
}
{% endmacro %}
server {
listen 80;
listen [::]:80;
server_name {{var_forgejo_and_nginx_domain}};
{% if var_forgejo_and_nginx_tls_mode == 'force' %}
return 301 https://$http_host$request_uri;
{% else %}
{{ forgejo_common() }}
{% endif %}
}
{% if var_forgejo_and_nginx_tls_mode != 'disable' %}
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name {{var_forgejo_and_nginx_domain}};
ssl_certificate_key /etc/ssl/private/{{var_forgejo_and_nginx_domain}}.pem;
ssl_certificate /etc/ssl/fullchains/{{var_forgejo_and_nginx_domain}}.pem;
include /etc/nginx/ssl-hardening.conf;
{{ forgejo_common() }}
}
{% endif %}

View file

@ -0,0 +1,19 @@
{
"domain": {
"mandatory": false,
"type": "string"
},
"port": {
"mandatory": false,
"type": "integer"
},
"tls_mode": {
"mandatory": false,
"type": "string",
"options": [
"disable",
"enable",
"force"
]
}
}

View file

@ -0,0 +1,31 @@
{
"var_forgejo_user": "forgejo",
"var_forgejo_directory_main": "/opt/forgejo",
"var_forgejo_directory_repositories": "/var/forgejo/repositories",
"var_forgejo_version": "10.0.3",
"var_forgejo_platform": "linux-amd64",
"var_forgejo_secret_key": "REPLACE_ME",
"var_forgejo_internal_token": "REPLACE_ME",
"var_forgejo_domain": "forgejo.example.org",
"var_forgejo_listen_address": "0.0.0.0",
"var_forgejo_listen_port": 2378,
"var_forgejo_database_kind": "sqlite",
"var_forgejo_database_data_sqlite_path": "/var/forgejo/data.sqlite",
"var_forgejo_database_data_postgresql_host": "postgresql.example.org",
"var_forgejo_database_data_postgresql_port": 5432,
"var_forgejo_database_data_postgresql_username": "forgejo_user",
"var_forgejo_database_data_postgresql_password": "REPLACE_ME",
"var_forgejo_database_data_postgresql_scheme": "forgejo",
"var_forgejo_authentication_kind": "internal",
"var_forgejo_authentication_data_authelia_url_base": "https://authelia.example.org",
"var_forgejo_authentication_data_authelia_client_id": "forgejo",
"var_forgejo_authentication_data_authelia_client_secret": "REPLACE_ME",
"var_forgejo_smtp_host": "smtp.example.org",
"var_forgejo_smtp_port": 465,
"var_forgejo_smtp_username": "REPLACE_ME",
"var_forgejo_smtp_password": "REPLACE_ME",
"var_forgejo_email_sending_enabled": false,
"var_forgejo_email_sending_sender": "forgejo@example.org",
"var_forgejo_email_sending_html": false,
"var_forgejo_title": "Forgejo: Beyond coding. We Forge."
}

14
roles/forgejo/info.md Normal file
View file

@ -0,0 +1,14 @@
## Beschreibung
Zur Einrichtung der DevOps-Platform [Forgejo](https://forgejo.org/)
## Verweise
- [Forgejo | Documentation | Administrator Guide](https://forgejo.org/docs/latest/admin/)
- [Forgejo | Documentation | Configuration Cheat Sheet](https://forgejo.org/docs/latest/admin/config-cheat-sheet/)
## ToDo
- Download verfizieren

View file

@ -0,0 +1,101 @@
[
{
"name": "packages",
"become": true,
"ansible.builtin.apt": {
"update_cache": true,
"pkg": [
"git"
]
}
},
{
"name": "user",
"become": true,
"ansible.builtin.user": {
"name": "{{var_forgejo_user}}",
"create_home": true,
"home": "{{var_forgejo_directory_main}}"
}
},
{
"name": "directories | external",
"become": true,
"loop": [
"{{var_forgejo_database_data_sqlite_path | dirname}}",
"{{var_forgejo_directory_repositories}}"
],
"ansible.builtin.file": {
"path": "{{item}}",
"state": "directory",
"owner": "{{var_forgejo_user}}"
}
},
{
"name": "directories | internal",
"become": true,
"become_user": "{{var_forgejo_user}}",
"loop": [
"{{var_forgejo_directory_main}}/custom/conf"
],
"ansible.builtin.file": {
"path": "{{item}}",
"state": "directory"
}
},
{
"name": "download",
"become": true,
"become_user": "{{var_forgejo_user}}",
"ansible.builtin.get_url": {
"url": "https://codeberg.org/forgejo/forgejo/releases/download/v{{var_forgejo_version}}/forgejo-{{var_forgejo_version}}-{{var_forgejo_platform}}",
"dest": "{{var_forgejo_directory_main}}/forgejo",
"mode": "u+rx"
}
},
{
"name": "config | base",
"become": true,
"become_user": "{{var_forgejo_user}}",
"ansible.builtin.template": {
"src": "config.ini.j2",
"dest": "{{var_forgejo_directory_main}}/custom/conf/app.ini"
}
},
{
"name": "config | database",
"become": true,
"become_user": "{{var_forgejo_user}}",
"ansible.builtin.command": {
"chdir": "{{var_forgejo_directory_main}}",
"cmd": "./forgejo migrate"
}
},
{
"name": "config | authelia",
"when": "var_forgejo_authentication_kind == 'authelia'",
"become": true,
"become_user": "{{var_forgejo_user}}",
"ansible.builtin.shell": {
"chdir": "{{var_forgejo_directory_main}}",
"cmd": "(./forgejo admin auth list | grep authelia) || ./forgejo admin auth add-oauth --provider='openidConnect' --name='authelia' --key={{var_forgejo_authentication_data_authelia_client_id}} --secret={{var_forgejo_authentication_data_authelia_client_secret}} --auto-discover-url='{{var_forgejo_authentication_data_authelia_url_base}}/.well-known/openid-configuration' --scopes='openid email profile'"
}
},
{
"name": "systemd unit",
"become": true,
"ansible.builtin.template": {
"src": "systemd-unit.j2",
"dest": "/etc/systemd/system/forgejo.service"
}
},
{
"name": "start",
"become": true,
"ansible.builtin.systemd_service": {
"enabled": true,
"state": "restarted",
"name": "forgejo"
}
}
]

View file

@ -0,0 +1,123 @@
APP_NAME = {{var_forgejo_title}}
RUN_USER = {{var_forgejo_user}}
RUN_MODE = prod
[server]
DOMAIN = {{var_forgejo_domain}}
ROOT_URL = https://{{var_forgejo_domain}}
;HTTP_ADDR = {{var_forgejo_listen_address}}
HTTP_PORT = {{var_forgejo_listen_port | string}}
;LANDING_PAGE = home
[database]
{% if var_forgejo_database_kind == 'sqlite' %}
DB_TYPE = sqlite3
PATH = {{var_forgejo_database_data_sqlite_path}}
{% endif %}
{% if var_forgejo_database_kind == 'postgresql' %}
DB_TYPE = postgres
HOST = {{var_forgejo_database_data_postgresql_host}}:{{var_forgejo_database_data_postgresql_port | string}}
USER = {{var_forgejo_database_data_postgresql_username}}
PASSWD = {{var_forgejo_database_data_postgresql_password}}
NAME = {{var_forgejo_database_data_postgresql_scheme}}
{% endif %}
[security]
INSTALL_LOCK = true
SECRET_KEY = {{var_forgejo_secret_key}}
INTERNAL_TOKEN = {{var_forgejo_internal_token}}
DISABLE_GIT_HOOKS = true
[oauth2]
ENABLED = false
[log]
MODE = console
LEVEL = Info
[git]
HOME_PATH = {{var_forgejo_directory_main}}
[service]
REGISTER_EMAIL_CONFIRM = false
{% if var_forgejo_authentication_kind == 'internal' %}
DISABLE_REGISTRATION = false
ALLOW_ONLY_INTERNAL_REGISTRATION = true
ALLOW_ONLY_EXTERNAL_REGISTRATION = false
SHOW_REGISTRATION_BUTTON = true
{% else %}
DISABLE_REGISTRATION = false
ALLOW_ONLY_INTERNAL_REGISTRATION = false
ALLOW_ONLY_EXTERNAL_REGISTRATION = true
SHOW_REGISTRATION_BUTTON = false
{% endif %}
;REQUIRE_SIGNIN_VIEW = false
ENABLE_NOTIFY_MAIL = true
;ENABLE_BASIC_AUTHENTICATION = true
;ENABLE_REVERSE_PROXY_AUTHENTICATION = false
;ENABLE_REVERSE_PROXY_AUTHENTICATION_API = false
;ENABLE_REVERSE_PROXY_AUTO_REGISTRATION = false
;ENABLE_REVERSE_PROXY_EMAIL = false
;ENABLE_REVERSE_PROXY_FULL_NAME = false
;DEFAULT_KEEP_EMAIL_PRIVATE = false
;DEFAULT_ALLOW_CREATE_ORGANIZATION = true
;DEFAULT_USER_IS_RESTRICTED = false
;DEFAULT_USER_VISIBILITY = public
;ALLOWED_USER_VISIBILITY_MODES = public,limited,private
;DEFAULT_ORG_VISIBILITY = public
;DEFAULT_ORG_MEMBER_VISIBLE = false
;DEFAULT_ENABLE_DEPENDENCIES = true
;ALLOW_CROSS_REPOSITORY_DEPENDENCIES = true
ENABLE_USER_HEATMAP = false
ENABLE_TIMETRACKING = false
DEFAULT_ENABLE_TIMETRACKING = false
{% if var_forgejo_authentication_kind == 'internal' %}
SHOW_REGISTRATION_BUTTON = true
{% else %}
SHOW_REGISTRATION_BUTTON = false
{% endif %}
AUTO_WATCH_NEW_REPOS = false
AUTO_WATCH_ON_CHANGES = false
[repository]
ROOT = {{var_forgejo_directory_repositories}}
{% if var_forgejo_authentication_kind == 'internal' %}
[openid]
ENABLE_OPENID_SIGNIN = false
ENABLE_OPENID_SIGNUP = false
{% else %}
[openid]
ENABLE_OPENID_SIGNIN = false
ENABLE_OPENID_SIGNUP = true
WHITELISTED_URIS = {{var_forgejo_authentication_data_authelia_url_base}}
[oauth2_client]
REGISTER_EMAIL_CONFIRM = false
OPENID_CONNECT_SCOPES = openid email profile
ENABLE_AUTO_REGISTRATION = true
USERNAME = nickname
{% endif %}
[mailer]
{% if var_forgejo_email_sending_enabled %}
ENABLED = true
SMTP_ADDR = {{var_forgejo_smtp_host}}
SMTP_PORT = {{var_forgejo_smtp_port | string}}
FROM = {{var_forgejo_email_sending_sender}}
USER = {{var_forgejo_smtp_username}}
PASSWD = {{var_forgejo_smtp_password}}
{% if var_forgejo_email_sending_html %}
SEND_AS_PLAIN_TEXT = false
{% else %}
SEND_AS_PLAIN_TEXT = true
{% endif %}
{% else %}
ENABLED = false
{% endif %}

View file

@ -0,0 +1,21 @@
[Unit]
Description=Forgejo
After=network.target
{% if var_forgejo_database_kind == 'postgresql' %}
Wants=postgresql.service
After=postgresql.service
{% endif %}
[Service]
RestartSec=2s
Type=simple
User={{var_forgejo_user}}
Group={{var_forgejo_user}}
WorkingDirectory={{var_forgejo_directory_main}}
ExecStart={{var_forgejo_directory_main}}/forgejo web --config {{var_forgejo_directory_main}}/custom/conf/app.ini
Restart=always
# Environment=USER=git HOME=/home/git FORGEJO_WORK_DIR=/var/lib/forgejo
# Environment=PATH=/path/to/git/bin:/bin:/sbin:/usr/bin:/usr/sbin
[Install]
WantedBy=multi-user.target

126
roles/forgejo/vardef.json Normal file
View file

@ -0,0 +1,126 @@
{
"user": {
"type": "string",
"mandatory": false
},
"directory_main": {
"type": "string",
"mandatory": false
},
"directory_repositories": {
"type": "string",
"mandatory": false
},
"version": {
"type": "string",
"mandatory": false
},
"platform": {
"type": "string",
"mandatory": false
},
"secret_key": {
"type": "string",
"mandatory": true
},
"internal_token": {
"type": "string",
"mandatory": true
},
"domain": {
"type": "string",
"mandatory": false
},
"listen_address": {
"type": "string",
"mandatory": false
},
"listen_port": {
"type": "integer",
"mandatory": false
},
"database_kind": {
"mandatory": false,
"type": "string",
"options": [
"sqlite",
"postgresql"
]
},
"database_data_sqlite_path": {
"mandatory": false,
"type": "string"
},
"database_data_postgresql_host": {
"mandatory": false,
"type": "string"
},
"database_data_postgresql_port": {
"mandatory": false,
"type": "string"
},
"database_data_postgresql_username": {
"mandatory": false,
"type": "string"
},
"database_data_postgresql_password": {
"mandatory": false,
"type": "string"
},
"database_data_postgresql_schema": {
"mandatory": false,
"type": "string"
},
"authentication_kind": {
"mandatory": false,
"type": "string",
"options": [
"internal",
"authelia"
]
},
"authentication_data_authelia_url_base": {
"mandatory": false,
"type": "string"
},
"authentication_data_authelia_client_id": {
"mandatory": false,
"type": "string"
},
"authentication_data_authelia_client_secret": {
"mandatory": false,
"type": "string"
},
"smtp_host": {
"mandatory": false,
"type": "string"
},
"smtp_port": {
"mandatory": false,
"type": "integer"
},
"smtp_username": {
"mandatory": false,
"type": "string"
},
"smtp_password": {
"mandatory": false,
"type": "string"
},
"email_sending_enabled": {
"mandatory": false,
"type": "boolean"
},
"email_sending_sender": {
"mandatory": false,
"type": "string"
},
"email_sending_html": {
"mandatory": false,
"type": "boolean"
},
"title": {
"mandatory": false,
"type": "string"
}
}

View file

@ -1,5 +1,5 @@
{
"var_gitlab_and_nginx_domain": "element.example.org",
"var_gitlab_and_nginx_path": "/opt/element",
"var_gitlab_and_nginx_tls_mode": "enable"
"var_gitlab_and_nginx_tls_mode": "force"
}

View file

@ -0,0 +1,24 @@
{
"nullable": false,
"type": "object",
"properties": {
"domain": {
"nullable": false,
"type": "string"
},
"tls_mode": {
"nullable": false,
"type": "string",
"options": [
"disable",
"enable",
"force"
],
"default": "force"
}
},
"additionalProperties": false,
"required": [
"domain"
]
}

View file

@ -1,4 +1,5 @@
{
"var_hedgedoc_and_nginx_domain": "hedgedoc.example.org",
"var_hedgedoc_and_nginx_tls_mode": "enable"
"cfg_hedgedoc_and_nginx_defaults": {
"tls_mode": "force"
}
}

View file

@ -1,4 +1,11 @@
[
{
"name": "show vars",
"when": "switch_show_vars",
"ansible.builtin.debug": {
"var": "vars.cfg_hedgedoc_and_nginx"
}
},
{
"name": "deactivate default site",
"become": true,
@ -12,7 +19,7 @@
"become": true,
"ansible.builtin.template": {
"src": "conf.j2",
"dest": "/etc/nginx/sites-available/{{var_hedgedoc_and_nginx_domain}}"
"dest": "/etc/nginx/sites-available/{{cfg_hedgedoc_and_nginx.domain}}"
}
},
{
@ -20,8 +27,8 @@
"become": true,
"ansible.builtin.file": {
"state": "link",
"src": "/etc/nginx/sites-available/{{var_hedgedoc_and_nginx_domain}}",
"dest": "/etc/nginx/sites-enabled/{{var_hedgedoc_and_nginx_domain}}"
"src": "/etc/nginx/sites-available/{{cfg_hedgedoc_and_nginx.domain}}",
"dest": "/etc/nginx/sites-enabled/{{cfg_hedgedoc_and_nginx.domain}}"
}
},
{

View file

@ -24,28 +24,29 @@ map $http_upgrade $connection_upgrade {
{% endmacro %}
server {
server_name {{var_hedgedoc_and_nginx_domain}};
server_name {{cfg_hedgedoc_and_nginx.domain}};
listen 80;
listen [::]:80;
{% if (var_element_and_nginx_tls_mode == 'force') %}
{% if (cfg_hedgedoc_and_nginx.tls_mode == 'force') %}
return 301 https://$http_host$request_uri;
{% else %}
{{ hedgedoc_common() }}
{% endif %}
}
{% if (var_hedgedoc_and_nginx_tls_mode != 'disable') %}
{% if (cfg_hedgedoc_and_nginx.tls_mode != 'disable') %}
server {
server_name {{var_hedgedoc_and_nginx_domain}};
server_name {{cfg_hedgedoc_and_nginx.domain}};
listen [::]:443 ssl http2;
listen 443 ssl http2;
ssl_certificate_key /etc/ssl/private/{{var_hedgedoc_and_nginx_domain}}.pem;
ssl_certificate /etc/ssl/fullchains/{{var_hedgedoc_and_nginx_domain}}.pem;
ssl_certificate_key /etc/ssl/private/{{cfg_hedgedoc_and_nginx.domain}}.pem;
ssl_certificate /etc/ssl/fullchains/{{cfg_hedgedoc_and_nginx.domain}}.pem;
include /etc/nginx/ssl-hardening.conf;
{{ hedgedoc_common() }}
}
{% endif %}

View file

@ -1,15 +0,0 @@
{
"domain": {
"type": "string",
"mandatory": false
},
"tls_mode": {
"type": "string",
"options": [
"disable",
"enable",
"force"
],
"mandatory": false
}
}

View file

@ -0,0 +1,248 @@
{
"nullable": false,
"type": "object",
"properties": {
"user_name": {
"nullable": false,
"type": "string",
"default": "hedgedoc"
},
"directory": {
"nullable": false,
"type": "string",
"default": "/opt/hedgedoc"
},
"version": {
"nullable": false,
"type": "string",
"default": "1.10.3"
},
"domain": {
"nullable": false,
"type": "string"
},
"session_secret": {
"nullable": false,
"type": "string"
},
"database": {
"anyOf": [
{
"nullable": false,
"type": "object",
"properties": {
"kind": {
"nullable": false,
"type": "string",
"enum": ["sqlite"],
"default": "sqlite"
},
"data": {
"nullable": false,
"type": "object",
"properties": {
"path": {
"nullable": false,
"type": "string",
"default": "/var/hedgedoc/data.sqlite"
}
},
"additionalProperties": false,
"required": [
"path"
],
"default": {
}
}
},
"additionalProperties": false,
"required": [
"kind",
"data"
]
},
{
"nullable": false,
"type": "object",
"properties": {
"kind": {
"nullable": false,
"type": "string",
"enum": ["postgresql"],
"default": "postgresql"
},
"data": {
"nullable": false,
"type": "object",
"properties": {
"host": {
"nullable": false,
"type": "string",
"default": "localhost"
},
"port": {
"nullable": false,
"type": "integer",
"default": 5432
},
"username": {
"nullable": false,
"type": "string",
"default": "hedgedoc_user"
},
"password": {
"nullable": false,
"type": "string"
},
"schema": {
"nullable": false,
"type": "string",
"default": "hedgedoc"
}
},
"additionalProperties": false,
"required": [
"host",
"port",
"username",
"password",
"schema"
]
}
},
"additionalProperties": false,
"required": [
"kind",
"data"
]
}
]
},
"authentication": {
"anyOf": [
{
"nullable": false,
"type": "object",
"properties": {
"kind": {
"nullable": false,
"type": "string",
"enum": ["internal"],
"default": "internal"
},
"data": {
"nullable": false,
"type": "object",
"properties": {
},
"additionalProperties": false,
"required": [
],
"default": {
}
}
},
"additionalProperties": false,
"required": [
"kind",
"data"
]
},
{
"nullable": false,
"type": "object",
"properties": {
"kind": {
"nullable": false,
"type": "string",
"enum": ["authelia"],
"default": "authelia"
},
"data": {
"nullable": false,
"type": "object",
"properties": {
"url_base": {
"nullable": false,
"type": "string"
},
"client_id": {
"nullable": false,
"type": "string",
"default": "hedgedoc"
},
"client_secret": {
"nullable": false,
"type": "string"
},
"provider_name": {
"nullable": false,
"type": "string",
"default": "Authelia"
}
},
"additionalProperties": false,
"required": [
"url_base",
"client_id",
"client_secret",
"provider_name"
]
}
},
"additionalProperties": false,
"required": [
"kind",
"data"
]
}
]
},
"guest_allow_create": {
"nullable": false,
"type": "boolean",
"default": false
},
"guest_allow_change": {
"nullable": false,
"type": "boolean",
"default": false
},
"free_names_mode": {
"nullable": false,
"type": "string",
"enum": [
"never",
"authed",
"always"
],
"default": "authed"
},
"log_level": {
"nullable": false,
"type": "string",
"enum": [
"debug",
"verbose",
"info",
"warn",
"error"
],
"default": "error"
}
},
"additionalProperties": false,
"required": [
"user_name",
"directory",
"version",
"domain",
"session_secret",
"database",
"authentication",
"guest_allow_create",
"guest_allow_change",
"free_names_mode",
"log_level"
]
}

View file

@ -1,21 +1,22 @@
{
"var_hedgedoc_user_name": "hedgedoc",
"var_hedgedoc_directory": "/opt/hedgedoc",
"var_hedgedoc_version": "1.9.9",
"var_hedgedoc_session_secret": "REPLACE_ME",
"var_hedgedoc_database_kind": "sqlite",
"var_hedgedoc_database_data_sqlite_path": "/var/hedgedoc/data.sqlite",
"var_hedgedoc_database_data_postgresql_host": "localhost",
"var_hedgedoc_database_data_postgresql_port": 5432,
"var_hedgedoc_database_data_postgresql_username": "hedgedoc_user",
"var_hedgedoc_database_data_postgresql_password": "REPLACE_ME",
"var_hedgedoc_database_data_postgresql_schema": "hedgedoc",
"var_hedgedoc_domain": "hedgedoc.example.org",
"var_hedgedoc_authentication_kind": "authelia",
"var_hedgedoc_authentication_data_authelia_client_id": "hedgedoc",
"var_hedgedoc_authentication_data_authelia_client_secret": "REPLACE_ME",
"var_hedgedoc_authentication_data_authelia_url_base": "https://authelia.example.org",
"var_hedgedoc_guest_allow_create": false,
"var_hedgedoc_guest_allow_change": false,
"var_hedgedoc_free_names_mode": "authed"
"cfg_hedgedoc_defaults": {
"user_name": "hedgedoc",
"directory": "/opt/hedgedoc",
"version": "1.10.3",
"database": {
"kind": "sqlite",
"data": {
"path": "/var/hedgedoc/data.sqlite"
}
},
"authentication": {
"kind": "internal",
"data": {
}
},
"guest_allow_create": false,
"guest_allow_change": false,
"free_names_mode": "authed",
"log_level": "error"
}
}

View file

@ -1,4 +1,11 @@
[
{
"name": "show vars",
"when": "switch_show_vars",
"ansible.builtin.debug": {
"var": "vars.cfg_hedgedoc"
}
},
{
"name": "packages",
"become": true,
@ -26,15 +33,41 @@
"name": "user",
"become": true,
"ansible.builtin.user": {
"name": "{{var_hedgedoc_user_name}}",
"create_home": true
"name": "{{cfg_hedgedoc.user_name}}",
"create_home": true,
"home": "{{cfg_hedgedoc.directory}}"
}
},
{
"name": "database",
"when": "cfg_hedgedoc.database.kind == 'sqlite'",
"block": [
{
"name": "database | directory",
"become": true,
"ansible.builtin.file": {
"state": "directory",
"path": "{{cfg_hedgedoc.database.data.sqlite.path | dirname}}",
"owner": "{{cfg_hedgedoc.user_name}}"
}
},
{
"name": "database | file",
"become": true,
"ansible.builtin.file": {
"state": "touch",
"path": "{{cfg_hedgedoc.database.data.sqlite.path}}",
"owner": "{{cfg_hedgedoc.user_name}}"
}
}
]
},
{
"name": "download",
"become": false,
"ansible.builtin.get_url": {
"url": "https://github.com/hedgedoc/hedgedoc/releases/download/{{var_hedgedoc_version}}/hedgedoc-{{var_hedgedoc_version}}.tar.gz",
"url": "https://github.com/hedgedoc/hedgedoc/releases/download/{{cfg_hedgedoc.version}}/hedgedoc-{{cfg_hedgedoc.version}}.tar.gz",
"dest": "/tmp/hedgedoc.tar.gz"
}
},
@ -44,8 +77,8 @@
"ansible.builtin.unarchive": {
"remote_src": true,
"src": "/tmp/hedgedoc.tar.gz",
"dest": "{{var_hedgedoc_directory | dirname}}",
"owner": "{{var_hedgedoc_user_name}}"
"dest": "{{cfg_hedgedoc.directory | dirname}}",
"owner": "{{cfg_hedgedoc.user_name}}"
}
},
{
@ -53,7 +86,7 @@
"become": true,
"become_user": "hedgedoc",
"ansible.builtin.command": {
"chdir": "{{var_hedgedoc_directory}}",
"chdir": "{{cfg_hedgedoc.directory}}",
"cmd": "bin/setup"
}
},
@ -62,7 +95,7 @@
"become": true,
"ansible.builtin.template": {
"src": "config.json.j2",
"dest": "{{var_hedgedoc_directory}}/config.json"
"dest": "{{cfg_hedgedoc.directory}}/config.json"
}
},
{

View file

@ -1,61 +1,61 @@
{
"production": {
"loglevel": "error",
{% if var_hedgedoc_database_kind == 'sqlite' %}
"loglevel": "{{cfg_hedgedoc.log_level}}",
{% if cfg_hedgedoc.database.kind == 'sqlite' %}
"db": {
"dialect": "sqlite",
"storage": "{{var_hedgedoc_database_data_sqlite_path}}"
"storage": "{{cfg_hedgedoc.database.data.sqlite.path}}"
},
{% endif %}
{% if var_hedgedoc_database_kind == 'postgresql' %}
{% if cfg_hedgedoc.database.kind == 'postgresql' %}
"db": {
"dialect": "postgres",
"host": "{{var_hedgedoc_database_data_postgresql_host}}",
"port": {{var_hedgedoc_database_data_postgresql_port | to_json}},
"username": "{{var_hedgedoc_database_data_postgresql_username}}",
"password": "{{var_hedgedoc_database_data_postgresql_password}}",
"database": "{{var_hedgedoc_database_data_postgresql_schema}}"
"host": "{{cfg_hedgedoc.database.data.postgresql.host}}",
"port": {{cfg_hedgedoc.database.data.postgresql.port | to_json}},
"username": "{{cfg_hedgedoc.database.data.postgresql.username}}",
"password": "{{cfg_hedgedoc.database.data.postgresql.password}}",
"database": "{{cfg_hedgedoc.database.data.postgresql.schema}}"
},
{% endif %}
"sessionSecret": "{{var_hedgedoc_session_secret}}",
"sessionSecret": "{{cfg_hedgedoc.session_secret}}",
"host": "localhost",
"allowOrigin": [
"localhost"
],
"domain": "{{var_hedgedoc_domain}}",
"domain": "{{cfg_hedgedoc.domain}}",
"urlAddPort": false,
"protocolUseSSL": true,
{% if var_hedgedoc_authentication_kind == 'internal' %}
{% if cfg_hedgedoc.authentication.kind == 'internal' %}
"email": true,
"allowEmailRegister": true,
{% endif %}
{% if var_hedgedoc_authentication_kind == 'authelia' %}
{% if cfg_hedgedoc.authentication.kind == 'authelia' %}
"oauth2": {
"providerName": "{{var_hedgedoc_authentication_data_authelia_provider_name}}",
"clientID": "{{var_hedgedoc_authentication_data_authelia_client_id}}",
"clientSecret": "{{var_hedgedoc_authentication_data_authelia_client_secret}}",
"providerName": "{{cfg_hedgedoc.authentication.data.authelia.provider_name}}",
"clientID": "{{cfg_hedgedoc.authentication.data.authelia.client_id}}",
"clientSecret": "{{cfg_hedgedoc.authentication.data.authelia.client_secret}}",
"scope": "openid email profile",
"userProfileUsernameAttr": "sub",
"userProfileDisplayNameAttr": "name",
"userProfileEmailAttr": "email",
"userProfileURL": "{{var_hedgedoc_authentication_data_authelia_url_base}}/api/oidc/userinfo",
"tokenURL": "{{var_hedgedoc_authentication_data_authelia_url_base}}/api/oidc/token",
"authorizationURL": "{{var_hedgedoc_authentication_data_authelia_url_base}}/api/oidc/authorize"
"userProfileURL": "{{cfg_hedgedoc.authentication.data.authelia.url_base}}/api/oidc/userinfo",
"tokenURL": "{{cfg_hedgedoc.authentication.data.authelia.url_base}}/api/oidc/token",
"authorizationURL": "{{cfg_hedgedoc.authentication.data.authelia.url_base}}/api/oidc/authorization"
},
"email": false,
"allowEmailRegister": false,
{% endif %}
"allowAnonymous": {{var_hedgedoc_guest_allow_create | to_json}},
"allowAnonymousEdits": {{var_hedgedoc_guest_allow_change | to_json}},
{% if var_hedgedoc_free_names_mode == 'never' %}
"allowAnonymous": {{cfg_hedgedoc.guest_allow_create | to_json}},
"allowAnonymousEdits": {{cfg_hedgedoc.guest_allow_change | to_json}},
{% if cfg_hedgedoc.free_names_mode == 'never' %}
"allowFreeURL": false,
"requireFreeURLAuthentication": false,
{% endif %}
{% if var_hedgedoc_free_names_mode == 'authed' %}
{% if cfg_hedgedoc.free_names_mode == 'authed' %}
"allowFreeURL": true,
"requireFreeURLAuthentication": true,
{% endif %}
{% if var_hedgedoc_free_names_mode == 'always' %}
{% if cfg_hedgedoc.free_names_mode == 'always' %}
"allowFreeURL": true,
"requireFreeURLAuthentication": false,
{% endif %}

View file

@ -3,8 +3,8 @@ Description=Hedgedoc
After=multi-user.target
[Service]
WorkingDirectory={{var_hedgedoc_directory}}
User={{var_hedgedoc_user_name}}
WorkingDirectory={{cfg_hedgedoc.directory}}
User={{cfg_hedgedoc.user_name}}
Environment="NODE_ENV=production"
ExecStart=yarn start
SyslogIdentifier=hedgedoc

View file

@ -1,87 +0,0 @@
{
"user_name": {
"type": "string",
"mandatory": false
},
"directory": {
"type": "string",
"mandatory": false
},
"version": {
"type": "string",
"mandatory": false
},
"session_secret": {
"type": "string",
"mandatory": true
},
"database_kind": {
"type": "string",
"mandatory": false,
"options": [
"sqlite",
"postgresql",
"mariadb"
]
},
"database_data_sqlite_path": {
"type": "string",
"mandatory": false
},
"database_data_postgresql_host": {
"type": "string",
"mandatory": false
},
"database_data_postgresql_port": {
"type": "integer",
"mandatory": false
},
"database_data_postgresql_username": {
"type": "string",
"mandatory": false
},
"database_data_postgresql_password": {
"type": "string",
"mandatory": false
},
"database_data_postgresql_schema": {
"type": "string",
"mandatory": false
},
"domain": {
"type": "string",
"mandatory": false
},
"authentication_kind": {
"type": "string",
"mandatory": false,
"options": [
"internal",
"authelia"
]
},
"authentication_data_authelia_client_id": {
"type": "string",
"mandatory": false
},
"authentication_data_authelia_client_secret": {
"type": "string",
"mandatory": false
},
"authentication_data_authelia_url_base": {
"type": "string",
"mandatory": false
},
"guest_allow_create": {
"type": "boolean",
"mandatory": false
},
"guest_allow_change": {
"type": "boolean",
"mandatory": false
},
"free_names_mode": {
"type": "string",
"mandatory": false
}
}

View file

@ -15,7 +15,7 @@
"become": true,
"ansible.builtin.file": {
"state": "directory",
"path": "/var/murmur"
"path": "/var/murmurd"
}
},
{
@ -23,11 +23,10 @@
"when": "var_murmur_tls",
"become": true,
"loop": [
{"from": "/etc/ssl/private/{{var_murmur_domain}}.pem", "to": "/var/murmur/tls-key.pem"},
{"from": "/etc/ssl/fullchains/{{var_murmur_domain}}.pem", "to": "/var/murmur/tls-fullchain.pem"}
{"from": "/etc/ssl/private/{{var_murmur_domain}}.pem", "to": "/var/murmurd/tls-key.pem"},
{"from": "/etc/ssl/fullchains/{{var_murmur_domain}}.pem", "to": "/var/murmurd/tls-fullchain.pem"}
],
"ansible.builtin.copy": {
"state": "directory",
"remote_src": true,
"src": "{{item.from}}",
"dest": "{{item.to}}",

View file

@ -0,0 +1,28 @@
{
"nullable": false,
"type": "object",
"properties": {
"auto_reload_interval": {
"nullable": true,
"type": "integer",
"description": "in hours",
"default": null
},
"dhparam_size": {
"nullable": true,
"type": "integer",
"default": null
},
"improved_security": {
"nullable": false,
"type": "boolean",
"default": false
}
},
"additionalProperties": false,
"required": [
"auto_reload_interval",
"dhparam_size",
"improved_security"
]
}

View file

@ -1,3 +1,7 @@
{
"var_nginx_auto_reload_interval": null
"cfg_nginx_defaults": {
"auto_reload_interval": null,
"dhparam_size": null,
"improved_security": false
}
}

View file

@ -1,4 +1,11 @@
[
{
"name": "show vars",
"when": "switch_show_vars",
"ansible.builtin.debug": {
"var": "vars.cfg_nginx"
}
},
{
"name": "install packages",
"become": true,
@ -12,9 +19,10 @@
},
{
"name": "generate dhparams file",
"when": "cfg_nginx.dhparam_size != None",
"become": true,
"ansible.builtin.command": {
"cmd": "openssl dhparam -out /etc/nginx/dhparam 4096"
"cmd": "openssl dhparam -out /etc/nginx/dhparam {{cfg_nginx.dhparam_size | string}}"
},
"args": {
"creates": "/etc/nginx/dhparam"
@ -23,13 +31,16 @@
{
"name": "place hardening config",
"become": true,
"ansible.builtin.copy": {
"src": "ssl-hardening.conf",
"ansible.builtin.template": {
"src": "ssl-hardening.conf.j2",
"dest": "/etc/nginx/ssl-hardening.conf"
}
},
{
"name": "ufw | check",
"name": "ufw",
"block": [
{
"name": "check",
"become": true,
"check_mode": true,
"community.general.ufw": {
@ -38,7 +49,7 @@
"register": "ufw_enable_check"
},
{
"name": "ufw | allow port 80",
"name": "allow port 80",
"when": "not ufw_enable_check.changed",
"become": true,
"community.general.ufw": {
@ -48,7 +59,7 @@
}
},
{
"name": "ufw | allow port 443",
"name": "allow port 443",
"when": "not ufw_enable_check.changed",
"become": true,
"community.general.ufw": {
@ -56,16 +67,18 @@
"port": "443",
"proto": "tcp"
}
}
]
},
{
"name": "auto reload",
"when": "var_nginx_auto_reload_interval == None",
"when": "cfg_nginx.auto_reload_interval == None",
"become": true,
"ansible.builtin.cron": {
"name": "nginx_auto_reload",
"disabled": true,
"minute": "0",
"hour": "*/{{var_nginx_auto_reload_interval | string}}",
"hour": "*/{{cfg_nginx.auto_reload_interval | string}}",
"day": "*",
"month": "*",
"weekday": "*",
@ -74,13 +87,13 @@
},
{
"name": "auto reload",
"when": "var_nginx_auto_reload_interval != None",
"when": "cfg_nginx.auto_reload_interval != None",
"become": true,
"ansible.builtin.cron": {
"name": "nginx_auto_reload",
"disabled": false,
"minute": "0",
"hour": "*/{{var_nginx_auto_reload_interval | string}}",
"hour": "*/{{cfg_nginx.auto_reload_interval | string}}",
"day": "*",
"month": "*",
"weekday": "*",

View file

@ -3,7 +3,9 @@ ssl_session_cache shared:MozSSL:10m; # about 40000 sessions
ssl_session_tickets off;
# curl https://ssl-config.mozilla.org/ffdhe2048.txt > /path/to/dhparam
{% if cfg_nginx.dhparam_size != None %}
ssl_dhparam /etc/nginx/dhparam;
{% endif %}
# intermediate configuration
ssl_protocols TLSv1.2 TLSv1.3;

View file

@ -1,8 +0,0 @@
{
"auto_reload_interval": {
"description": "in hours",
"nullable": true,
"type": "integer",
"mandatory": false
}
}

View file

@ -0,0 +1,31 @@
{
"nullable": false,
"type": "object",
"properties": {
"domain": {
"nullable": false,
"type": "string"
},
"tls_mode": {
"nullable": false,
"type": "string",
"enum": [
"disable",
"enable",
"force"
],
"default": "force"
},
"maximum_upload_size": {
"nullable": false,
"type": "string",
"default": "1G"
}
},
"additionalProperties": false,
"required": [
"domain",
"tls_mode",
"maximum_upload_size"
]
}

View file

@ -0,0 +1,6 @@
{
"cfg_owncloud_and_nginx_defaults": {
"tls_mode": "force",
"maximum_upload_size": "1G"
}
}

View file

@ -0,0 +1,42 @@
[
{
"name": "show vars",
"when": "switch_show_vars",
"ansible.builtin.debug": {
"var": "vars.cfg_owncloud_and_nginx"
}
},
{
"name": "deactivate default site",
"become": true,
"ansible.builtin.file": {
"state": "absent",
"dest": "/etc/nginx/sites-enabled/default"
}
},
{
"name": "emplace configuration | data",
"become": true,
"ansible.builtin.template": {
"src": "conf.j2",
"dest": "/etc/nginx/sites-available/{{cfg_owncloud_and_nginx.domain}}"
}
},
{
"name": "emplace configuration | link",
"become": true,
"ansible.builtin.file": {
"state": "link",
"src": "/etc/nginx/sites-available/{{cfg_owncloud_and_nginx.domain}}",
"dest": "/etc/nginx/sites-enabled/{{cfg_owncloud_and_nginx.domain}}"
}
},
{
"name": "restart nginx",
"become": true,
"ansible.builtin.systemd_service": {
"state": "restarted",
"name": "nginx"
}
}
]

View file

@ -0,0 +1,34 @@
{% macro owncloud_common() %}
location / {
proxy_pass http://localhost:9200;
client_max_body_size {{cfg_owncloud_and_nginx.maximum_upload_size}};
}
{% endmacro %}
server {
listen 80;
listen [::]:80;
server_name {{cfg_owncloud_and_nginx.domain}};
{% if cfg_owncloud_and_nginx.tls_mode == 'force' %}
return 301 https://$http_host$request_uri;
{% else %}
{{ owncloud_common() }}
{% endif %}
}
{% if cfg_owncloud_and_nginx.tls_mode != 'disable' %}
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name {{cfg_owncloud_and_nginx.domain}};
ssl_certificate_key /etc/ssl/private/{{cfg_owncloud_and_nginx.domain}}.pem;
ssl_certificate /etc/ssl/fullchains/{{cfg_owncloud_and_nginx.domain}}.pem;
include /etc/nginx/ssl-hardening.conf;
{{ owncloud_common() }}
}
{% endif %}

View file

@ -0,0 +1,152 @@
{
"nullable": false,
"type": "object",
"properties": {
"user": {
"nullable": false,
"type": "string",
"default": "owncloud"
},
"directory": {
"nullable": false,
"type": "string",
"default": "/opt/owncloud"
},
"version": {
"nullable": false,
"type": "string",
"default": "7.2.0"
},
"platform": {
"nullable": false,
"type": "string",
"default": "linux-amd64"
},
"domain": {
"nullable": false,
"type": "string"
},
"admin_password": {
"nullable": false,
"type": "string"
},
"authentication": {
"anyOf": [
{
"nullable": false,
"type": "object",
"properties": {
"kind": {
"type": "string",
"enum": ["internal"],
"default": "internal"
},
"data": {
"nullable": false,
"type": "object",
"properties": {
},
"additionalProperties": false,
"required": [
],
"default": {
}
}
},
"additionalProperties": false,
"required": [
"kind",
"data"
]
},
{
"nullable": false,
"type": "object",
"properties": {
"kind": {
"type": "string",
"enum": ["authelia"],
"default": "authelia"
},
"data": {
"nullable": false,
"type": "object",
"properties": {
"url_base": {
"nullable": false,
"type": "string"
},
"web": {
"nullable": true,
"type": "object",
"properties": {
"client_id": {
"type": "string",
"mandatory": false,
"default": "owncloud_web"
}
},
"additionalProperties": false,
"required": [
"client_id"
],
"default": {
}
}
},
"additionalProperties": false,
"required": [
"url_base",
"web"
]
}
},
"additionalProperties": false,
"required": [
"kind",
"data"
]
}
]
},
"public_share": {
"nullable": false,
"type": "object",
"properties": {
"password_necessity": {
"nullable": false,
"type": "string",
"enum": [
"nothing",
"writable",
"all"
],
"default": "writable"
},
"password_policy_active": {
"nullable": false,
"type": "boolean",
"default": true
}
},
"additionalProperties": false,
"required": [
"password_necessity",
"password_policy_active"
],
"default": {
}
}
},
"additionalProperties": false,
"required": [
"user",
"directory",
"version",
"platform",
"domain",
"admin_password",
"authentication",
"public_share"
]
}

View file

@ -0,0 +1,16 @@
{
"cfg_owncloud_defaults": {
"user": "owncloud",
"directory": "/opt/owncloud",
"version": "7.2.0",
"platform": "linux-amd64",
"domain": "owncloud.example.org",
"authentication": {
"kind": "internal"
},
"public_share": {
"password_necessity": "writable",
"password_policy_active": true
}
}
}

32
roles/owncloud/info.md Normal file
View file

@ -0,0 +1,32 @@
## Beschreibung
Cloud-Plattform [ownCloud](https://owncloud.com/) (the rewrite in Go named "Infinite Scale")
## Verweise
- [ownCloud-Dokumentation | How to install ownCloud Infinite Scale Tech Preview in three easy steps](https://owncloud.com/news/howto-install-owncloud-infinite-scale-tech-preview/)
- [ownCloud-Dokumentation | oCIS](https://owncloud.dev/ocis/)
- [ownCloud-Dokumentation | Upgrading](https://doc.owncloud.com/ocis/next/migration/upgrading-ocis.html)
- [ownCloud-Dokumentation | env var types](https://doc.owncloud.com/ocis/next/deployment/services/envvar-types-description.html)
- [ownCloud-Dokumentation | Service | Web](https://doc.owncloud.com/ocis/next/deployment/services/s-list/web.html)
- [ownCloud-Dokumentation | Service | Proxy](https://doc.owncloud.com/ocis/next/deployment/services/s-list/proxy.html)
- [ownCloud-Dokumentation | Service | Sharing](https://doc.owncloud.com/ocis/next/deployment/services/s-list/sharing.html)
- [GitHub | ocis](https://github.com/owncloud/ocis/)
- [ownCloud-Foren | OCIS + Authelia](https://central.owncloud.org/t/ocis-authelia/44222)
## Bemerkungen
- die `.ocis/config/ocis.yaml` wird erzeugt auf Grundlage der `.env`
- `.ocis/config/ocis.yaml` sollte niemals einfach neu erstellt werden, da man sich sonst nicht mehr einloggen kann
- wenn man sich plötzlich nicht mehr über OIDC anmelden kann, kann das daran lieget, dass `.ocis/idm/ldap.crt` abgelaufen ist — siehe dazu [diesen Thread](https://central.owncloud.org/t/certificate-error-after-upgrade-to-5-0-0-from-4-0-6/47824/7); man könnte auch `OCIS_LDAP_INSECURE` auf `true` setzen, aber naja…
## ToDo
- Download prüfen
- `csp.yaml` einsetzen
- prüfen ob folgende `.env`-Variablen gebraucht werden:
- `PROXY_OIDC_ISSUER`
- `PROXY_OIDC_SKIP_USER_INFO`

View file

@ -0,0 +1,87 @@
[
{
"name": "show vars",
"when": "switch_show_vars",
"ansible.builtin.debug": {
"var": "vars.cfg_owncloud"
}
},
{
"name": "user",
"become": true,
"ansible.builtin.user": {
"name": "{{cfg_owncloud.user}}",
"create_home": true,
"home": "{{cfg_owncloud.directory}}"
}
},
{
"name": "download",
"become": true,
"become_user": "{{cfg_owncloud.user}}",
"ansible.builtin.get_url": {
"url": "https://download.owncloud.com/ocis/ocis/stable/{{cfg_owncloud.version}}/ocis-{{cfg_owncloud.version}}-{{cfg_owncloud.platform}}",
"dest": "{{cfg_owncloud.directory}}/ocis",
"mode": "u+rx"
}
},
{
"name": "directories",
"become": true,
"become_user": "{{cfg_owncloud.user}}",
"loop": [
"log"
],
"ansible.builtin.file": {
"state": "directory",
"recurse": true,
"path": "{{cfg_owncloud.directory}}/{{item}}"
}
},
{
"name": "csp",
"become": true,
"become_user": "{{cfg_owncloud.user}}",
"ansible.builtin.template": {
"src": "csp.yaml.j2",
"mode": "644",
"dest": "{{cfg_owncloud.directory}}/csp.yaml"
}
},
{
"name": "env",
"become": true,
"become_user": "{{cfg_owncloud.user}}",
"ansible.builtin.template": {
"src": "env.j2",
"mode": "644",
"dest": "{{cfg_owncloud.directory}}/.env"
}
},
{
"name": "setup",
"become": true,
"become_user": "{{cfg_owncloud.user}}",
"ansible.builtin.shell": {
"chdir": "{{cfg_owncloud.directory}}",
"cmd": "./ocis init --insecure no --admin-password={{cfg_owncloud.admin_password}}"
}
},
{
"name": "systemd unit",
"become": true,
"ansible.builtin.template": {
"src": "systemd_unit.j2",
"dest": "/etc/systemd/system/owncloud.service"
}
},
{
"name": "run",
"become": true,
"ansible.builtin.systemd_service": {
"name": "owncloud",
"enabled": true,
"state": "restarted"
}
}
]

View file

@ -0,0 +1,7 @@
directives:
connect-src:
- '''self'''
- 'https://{{cfg_owncloud.domain}}'
{% if cfg_owncloud.authentication.kind == 'authelia' %}
- '{{cfg_owncloud.authentication.data.url_base}}'
{% endif %}

View file

@ -0,0 +1,62 @@
## web client
WEB_LOG_LEVEL=info
WEB_LOG_FILE={{cfg_owncloud.directory}}/log/web
WEB_LOG_PRETTY=true
WEB_LOG_COLOR=true
{% if cfg_owncloud.authentication.kind == 'internal' %}
{% endif %}
{% if cfg_owncloud.authentication.kind == 'authelia' %}
WEB_OIDC_AUTHORITY={{cfg_owncloud.authentication.data.url_base}}
WEB_OIDC_CLIENT_ID={{cfg_owncloud.authentication.data.web.client_id}}
WEB_OIDC_RESPONSE_TYPE=code
WEB_OIDC_SCOPE=openid profile email groups
WEB_OPTION_LOGIN_URL={{cfg_owncloud.authentication.data.url_base}}
WEB_OPTION_LOGOUT_URL={{cfg_owncloud.authentication.data.url_base}}
WEB_UI_THEME_SERVER=https://{{cfg_owncloud.domain}}
WEB_UI_CONFIG_SERVER=https://{{cfg_owncloud.domain}}
{% endif %}
## other clients
PROXY_LOG_LEVEL=info
PROXY_LOG_FILE={{cfg_owncloud.directory}}/log/proxy
PROXY_LOG_PRETTY=true
PROXY_LOG_COLOR=true
PROXY_CSP_CONFIG_FILE_LOCATION={{cfg_owncloud.directory}}/csp.yaml
PROXY_TLS=false
{% if cfg_owncloud.authentication.kind == 'internal' %}
PROXY_AUTOPROVISION_ACCOUNTS=false
{% endif %}
{% if cfg_owncloud.authentication.kind == 'authelia' %}
OCIS_URL=https://{{cfg_owncloud.domain}}
PROXY_OIDC_ISSUER={{cfg_owncloud.authentication.data.url_base}}
PROXY_OIDC_REWRITE_WELLKNOWN=true
PROXY_OIDC_ACCESS_TOKEN_VERIFY_METHOD=none
PROXY_OIDC_SKIP_USER_INFO=false
PROXY_AUTOPROVISION_ACCOUNTS=true
PROXY_AUTOPROVISION_CLAIM_USERNAME=preferred_username
PROXY_AUTOPROVISION_CLAIM_EMAIL=email
PROXY_AUTOPROVISION_CLAIM_DISPLAYNAME=name
PROXY_AUTOPROVISION_CLAIM_GROUPS=groups
PROXY_USER_OIDC_CLAIM=preferred_username
PROXY_USER_CS3_CLAIM=username
{% endif %}
## sharing
{% if cfg_owncloud.public_share.password_necessity == 'nothing' %}
OCIS_SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD=false
OCIS_SHARING_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD=false
{% endif %}
{% if cfg_owncloud.public_share.password_necessity == 'writable' %}
OCIS_SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD=false
OCIS_SHARING_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD=true
{% endif %}
{% if cfg_owncloud.public_share.password_necessity == 'all' %}
OCIS_SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD=true
OCIS_SHARING_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD=true
{% endif %}
{% if cfg_owncloud.public_share.password_policy_active %}
OCIS_SHARING_PASSWORD_POLICY_DISABLED=false
{% else %}
OCIS_SHARING_PASSWORD_POLICY_DISABLED=true
{% endif %}

View file

@ -0,0 +1,15 @@
[Unit]
Description=ownCloud
After=network.target
[Service]
WorkingDirectory={{cfg_owncloud.directory}}
EnvironmentFile={{cfg_owncloud.directory}}/.env
ExecStart={{cfg_owncloud.directory}}/ocis server
Type=simple
Restart=always
User={{cfg_owncloud.user}}
[Install]
WantedBy=default.target
RequiredBy=network.target

View file

@ -39,7 +39,7 @@
"become_user": "postgres",
"community.postgresql.postgresql_privs": {
"state": "present",
"db": "{{var_postgresql_for_authelia_schema}}",
"login_db": "{{var_postgresql_for_authelia_schema}}",
"objs": "ALL_IN_SCHEMA",
"roles": "{{var_postgresql_for_authelia_username}}",
"privs": "ALL",

View file

@ -0,0 +1,5 @@
{
"var_postgresql_for_forgejo_username": "forgejo_user",
"var_postgresql_for_forgejo_password": "REPLACE_ME",
"var_postgresql_for_forgejo_schema": "forgejo"
}

View file

@ -0,0 +1,49 @@
[
{
"name": "packages",
"become": true,
"ansible.builtin.apt": {
"update_cache": true,
"pkg": [
"acl",
"python3-psycopg2"
]
}
},
{
"name": "user",
"become": true,
"become_user": "postgres",
"community.postgresql.postgresql_user": {
"state": "present",
"name": "{{var_postgresql_for_forgejo_username}}",
"password": "{{var_postgresql_for_forgejo_password}}"
},
"environment": {
"PGOPTIONS": "-c password_encryption=scram-sha-256"
}
},
{
"name": "schema",
"become": true,
"become_user": "postgres",
"community.postgresql.postgresql_db": {
"state": "present",
"name": "{{var_postgresql_for_forgejo_schema}}",
"owner": "{{var_postgresql_for_forgejo_username}}"
}
},
{
"name": "rights",
"become": true,
"become_user": "postgres",
"community.postgresql.postgresql_privs": {
"state": "present",
"login_db": "{{var_postgresql_for_forgejo_schema}}",
"objs": "ALL_IN_SCHEMA",
"roles": "{{var_postgresql_for_forgejo_username}}",
"privs": "ALL",
"grant_option": true
}
}
]

View file

@ -39,7 +39,7 @@
"become_user": "postgres",
"community.postgresql.postgresql_privs": {
"state": "present",
"db": "{{var_postgresql_for_gitlab_schema}}",
"login_db": "{{var_postgresql_for_gitlab_schema}}",
"objs": "ALL_IN_SCHEMA",
"roles": "{{var_postgresql_for_gitlab_username}}",
"privs": "ALL",
@ -57,7 +57,7 @@
],
"community.postgresql.postgresql_ext": {
"state": "present",
"db": "{{var_postgresql_for_gitlab_schema}}",
"login_db": "{{var_postgresql_for_gitlab_schema}}",
"name": "{{item}}"
}
}

View file

@ -39,7 +39,7 @@
"become_user": "postgres",
"community.postgresql.postgresql_privs": {
"state": "present",
"db": "{{var_postgresql_for_hedgedoc_schema}}",
"login_db": "{{var_postgresql_for_hedgedoc_schema}}",
"objs": "ALL_IN_SCHEMA",
"roles": "{{var_postgresql_for_hedgedoc_username}}",
"privs": "ALL",

View file

@ -43,7 +43,7 @@
"become_user": "postgres",
"community.postgresql.postgresql_privs": {
"state": "present",
"db": "{{var_postgresql_for_synapse_schema}}",
"login_db": "{{var_postgresql_for_synapse_schema}}",
"objs": "ALL_IN_SCHEMA",
"roles": "{{var_postgresql_for_synapse_username}}",
"privs": "ALL",

View file

@ -0,0 +1,5 @@
{
"var_postgresql_for_tandoor_username": "tandoor_user",
"var_postgresql_for_tandoor_password": "REPLACE_ME",
"var_postgresql_for_tandoor_schema": "tandoor"
}

View file

@ -0,0 +1,50 @@
[
{
"name": "packages",
"become": true,
"ansible.builtin.apt": {
"update_cache": true,
"pkg": [
"acl",
"python3-psycopg2",
"libpq-dev"
]
}
},
{
"name": "user",
"become": true,
"become_user": "postgres",
"community.postgresql.postgresql_user": {
"state": "present",
"name": "{{var_postgresql_for_tandoor_username}}",
"password": "{{var_postgresql_for_tandoor_password}}"
},
"environment": {
"PGOPTIONS": "-c password_encryption=scram-sha-256"
}
},
{
"name": "schema",
"become": true,
"become_user": "postgres",
"community.postgresql.postgresql_db": {
"state": "present",
"name": "{{var_postgresql_for_tandoor_schema}}",
"owner": "{{var_postgresql_for_tandoor_username}}"
}
},
{
"name": "rights",
"become": true,
"become_user": "postgres",
"community.postgresql.postgresql_privs": {
"state": "present",
"login_db": "{{var_postgresql_for_tandoor_schema}}",
"objs": "ALL_IN_SCHEMA",
"roles": "{{var_postgresql_for_tandoor_username}}",
"privs": "ALL",
"grant_option": true
}
}
]

View file

@ -39,7 +39,7 @@
"become_user": "postgres",
"community.postgresql.postgresql_privs": {
"state": "present",
"db": "{{var_postgresql_for_vikunja_schema}}",
"login_db": "{{var_postgresql_for_vikunja_schema}}",
"objs": "ALL_IN_SCHEMA",
"roles": "{{var_postgresql_for_vikunja_username}}",
"privs": "ALL",

View file

@ -0,0 +1,5 @@
{
"var_postgresql_for_wiki_js_username": "wiki_js_user",
"var_postgresql_for_wiki_js_password": "REPLACE_ME",
"var_postgresql_for_wiki_js_schema": "wiki_js"
}

View file

@ -0,0 +1,49 @@
[
{
"name": "packages",
"become": true,
"ansible.builtin.apt": {
"update_cache": true,
"pkg": [
"acl",
"python3-psycopg2"
]
}
},
{
"name": "user",
"become": true,
"become_user": "postgres",
"community.postgresql.postgresql_user": {
"state": "present",
"name": "{{var_postgresql_for_wiki_js_username}}",
"password": "{{var_postgresql_for_wiki_js_password}}"
},
"environment": {
"PGOPTIONS": "-c password_encryption=scram-sha-256"
}
},
{
"name": "schema",
"become": true,
"become_user": "postgres",
"community.postgresql.postgresql_db": {
"state": "present",
"name": "{{var_postgresql_for_wiki_js_schema}}",
"owner": "{{var_postgresql_for_wiki_js_username}}"
}
},
{
"name": "rights",
"become": true,
"become_user": "postgres",
"community.postgresql.postgresql_privs": {
"state": "present",
"login_db": "{{var_postgresql_for_wiki_js_schema}}",
"objs": "ALL_IN_SCHEMA",
"roles": "{{var_postgresql_for_wiki_js_username}}",
"privs": "ALL",
"grant_option": true
}
}
]

View file

@ -1,4 +0,0 @@
{
"var_sqlite_for_hedgedoc_path": "/var/hedgedoc/data.sqlite",
"var_sqlite_for_hedgedoc_user_name": "hedgedoc"
}

View file

@ -1,20 +0,0 @@
[
{
"name": "directory",
"become": true,
"ansible.builtin.file": {
"state": "directory",
"path": "{{var_sqlite_for_hedgedoc_path | dirname}}",
"owner": "{{var_hedgedoc_user_name}}"
}
},
{
"name": "file",
"become": true,
"ansible.builtin.file": {
"state": "touch",
"path": "{{var_sqlite_for_hedgedoc_path}}",
"owner": "{{var_sqlite_for_hedgedoc_user_name}}"
}
}
]

View file

@ -1,10 +0,0 @@
{
"path": {
"type": "string",
"mandatory": false
},
"user_name": {
"type": "string",
"mandatory": false
}
}

Some files were not shown because too many files have changed in this diff Show more