2018-09-03 20:06:05 +02:00
|
|
|
|
---
|
|
|
|
|
# The home-server project produces a multi-purpose setup using Ansible.
|
2023-07-30 19:31:56 +02:00
|
|
|
|
# Copyright © 2018–2023 Y. Gablin, under the GPL-3.0-or-later license.
|
2018-09-03 20:06:05 +02:00
|
|
|
|
# Full licensing information in the LICENSE file, or gnu.org/licences/gpl-3.0.txt if the file is missing.
|
|
|
|
|
|
|
|
|
|
- name: configure nginx for Gitea
|
|
|
|
|
copy:
|
|
|
|
|
content: |
|
|
|
|
|
location = /git {
|
|
|
|
|
rewrite ^ /git/ last;
|
|
|
|
|
}
|
|
|
|
|
location {{http_pfx_gitea}}/ {
|
|
|
|
|
proxy_pass http://unix:/run/shared_sockets/gitea:/;
|
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
|
}
|
|
|
|
|
dest: /etc/nginx/inc.d/gitea.https.inc
|
|
|
|
|
mode: 0440
|
|
|
|
|
owner: http
|
|
|
|
|
group: http
|
|
|
|
|
notify:
|
2023-12-30 16:32:52 +01:00
|
|
|
|
- restart openresty.service
|
|
|
|
|
|
|
|
|
|
- name: configure SSO
|
|
|
|
|
copy:
|
|
|
|
|
content: |
|
|
|
|
|
{ "patterns": [{
|
|
|
|
|
"lua_regex": [
|
|
|
|
|
"^{{http_pfx_gitea}}/admin",
|
|
|
|
|
"^{{http_pfx_gitea}}/repo/create",
|
|
|
|
|
"^{{http_pfx_gitea}}/repo/migrate",
|
|
|
|
|
"^{{http_pfx_gitea}}/org/create",
|
|
|
|
|
"^{{http_pfx_gitea}}/.-/wiki/_new"
|
|
|
|
|
],
|
|
|
|
|
"allow": ["*"]
|
|
|
|
|
},{
|
|
|
|
|
"lua_regex": ["^{{http_pfx_gitea}}/"],
|
|
|
|
|
"public": true,
|
|
|
|
|
"portal": {"{{http_pfx_gitea}}/": "Git"}
|
|
|
|
|
}]
|
|
|
|
|
}
|
|
|
|
|
dest: /etc/nginx/ssso/sites/git.json
|
|
|
|
|
when: (is_sso_used is defined)
|
|
|
|
|
notify:
|
|
|
|
|
- restart openresty.service
|
2018-09-03 20:06:05 +02:00
|
|
|
|
|
|
|
|
|
### LOCAL COMMIT ⇒ ###
|
|
|
|
|
- name: commit local changes
|
|
|
|
|
include_role: name=etckeeper.inc allow_duplicates=true tasks_from=local.yml
|
|
|
|
|
vars:
|
|
|
|
|
msg: Gitea
|
|
|
|
|
### ⇐ LOCAL COMMIT ###
|
|
|
|
|
- meta: flush_handlers
|