Add analytics to forgejo
This commit is contained in:
parent
ea037209f6
commit
22af530918
4 changed files with 35 additions and 3 deletions
|
@ -0,0 +1 @@
|
||||||
|
<a class="item" href="https://www.serguzim.me/imprint/">Impressum</a>
|
|
@ -8,5 +8,32 @@
|
||||||
env: "{{ forgejo_env }}"
|
env: "{{ forgejo_env }}"
|
||||||
compose: "{{ forgejo_compose }}"
|
compose: "{{ forgejo_compose }}"
|
||||||
block:
|
block:
|
||||||
- name: Import tasks to deploy common service
|
- name: Import prepare tasks for common service
|
||||||
ansible.builtin.import_tasks: tasks/deploy-common-service.yml
|
ansible.builtin.import_tasks: tasks/prepare-common-service.yml
|
||||||
|
|
||||||
|
- name: Copy the template files
|
||||||
|
ansible.builtin.copy:
|
||||||
|
src: templates/
|
||||||
|
dest: "{{ (service_path, 'templates') | path_join }}"
|
||||||
|
mode: "0644"
|
||||||
|
register: cmd_result
|
||||||
|
|
||||||
|
- name: Set the docker force-recreate flag
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
docker_force_recreate: --force-recreate
|
||||||
|
when: cmd_result.changed # noqa: no-handler We need to handle the restart per service. Handlers don't support variables.
|
||||||
|
|
||||||
|
- name: Template the custom footer
|
||||||
|
ansible.builtin.template:
|
||||||
|
src: footer.tmpl.j2
|
||||||
|
dest: "{{ (service_path, 'templates', 'custom', 'footer.tmpl') | path_join }}"
|
||||||
|
mode: "0644"
|
||||||
|
register: cmd_result
|
||||||
|
|
||||||
|
- name: Set the docker force-recreate flag
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
docker_force_recreate: --force-recreate
|
||||||
|
when: cmd_result.changed # noqa: no-handler We need to handle the restart per service. Handlers don't support variables.
|
||||||
|
|
||||||
|
- name: Import start tasks for common service
|
||||||
|
ansible.builtin.import_tasks: tasks/start-common-service.yml
|
||||||
|
|
1
roles/forgejo/templates/footer.tmpl.j2
Normal file
1
roles/forgejo/templates/footer.tmpl.j2
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<script async src="/_a/script.js" data-website-id="{{ vault_forgejo.umami }}"></script>
|
|
@ -3,7 +3,9 @@ forgejo_svc:
|
||||||
domain: git.serguzim.me
|
domain: git.serguzim.me
|
||||||
name: forgejo
|
name: forgejo
|
||||||
port: 3000
|
port: 3000
|
||||||
caddy_extra: header /attachments/* Access-Control-Allow-Origin *
|
caddy_extra: |
|
||||||
|
import analytics
|
||||||
|
header /attachments/* Access-Control-Allow-Origin *
|
||||||
db:
|
db:
|
||||||
host: "{{ postgres.host }}"
|
host: "{{ postgres.host }}"
|
||||||
port: "{{ postgres.port }}"
|
port: "{{ postgres.port }}"
|
||||||
|
@ -82,6 +84,7 @@ forgejo_compose:
|
||||||
image: codeberg.org/forgejo/forgejo:1.21
|
image: codeberg.org/forgejo/forgejo:1.21
|
||||||
volumes:
|
volumes:
|
||||||
- data:/data
|
- data:/data
|
||||||
|
- ./templates:/data/gitea/templates
|
||||||
- /etc/timezone:/etc/timezone:ro
|
- /etc/timezone:/etc/timezone:ro
|
||||||
- /etc/localtime:/etc/localtime:ro
|
- /etc/localtime:/etc/localtime:ro
|
||||||
file:
|
file:
|
||||||
|
|
Reference in a new issue