Skip to content

Commit 265bca3

Browse files
committed
Add custom footer support
1 parent 0fc5aaa commit 265bca3

File tree

6 files changed

+51
-3
lines changed

6 files changed

+51
-3
lines changed

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,9 @@ As this will only deploy config files, fail2ban already has to be installed or o
215215

216216
### optional customisation
217217
You can optionally customize your gitea using this ansible role. We got our information about customisation from [docs.gitea.io/en-us/customizing-gitea](https://docs.gitea.io/en-us/customizing-gitea/).
218-
To deploy multiple files we created the ``gitea_custom_search`` variable, that can point to the path where you put the custom gitea files *( default ``"files/host_files/{{ inventory_hostname }}/gitea"``.
218+
To deploy multiple files we created the ``gitea_custom_search`` variable, that can point to the path where you put the custom gitea files *( default ``"files/host_files/{{ inventory_hostname }}/gitea"``)*.
219219

220-
+ LOGO
220+
+ **LOGO**:
221221
- Set ``gitea_customize_logo`` to ``true``
222222
- We search for:
223223
* ``logo.svg`` - Used for favicon, site icon, app icon
@@ -229,6 +229,15 @@ To deploy multiple files we created the ``gitea_custom_search`` variable, that c
229229
* ``files/{{ inventory_hostname }}/gitea_logo/``
230230
* ``files/{{ gitea_http_domain }}/gitea_logo/``
231231
* ``files/gitea_logo/``
232+
+ **FOOTER**:
233+
- Set ``gitea_customize_footer`` to ``true``
234+
- We Search using first_found in:
235+
* "{{ gitea_custom_search }}/gitea_footer/extra_links_footer.tmpl"
236+
* "files/{{ inventory_hostname }}/gitea_footer/extra_links_footer.tmpl"
237+
* "files/{{ gitea_http_domain }}/gitea_footer/extra_links_footer.tmpl"
238+
* 'files/gitea_footer/extra_links_footer.tmpl'
239+
* 'files/extra_links_footer.tmpl'
240+
232241

233242
## Contributing
234243
Don't hesitate to create a pull request, and when in doubt you can reach me on

defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,3 +151,4 @@ gitea_fail2ban_jail_action: 'iptables-allports'
151151
gitea_custom_search: "files/host_files/{{ inventory_hostname }}/gitea"
152152
gitea_customize_logo: false
153153
gitea_custom: "{{ gitea_home }}/custom"
154+
gitea_customize_footer: false

files/extra_links_footer.tmpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<a class="item" href="{{AppSubUrl}}/datenschutz.html">Datenschutz</a>
2+
<a class="item" href="{{AppSubUrl}}/impressum.html">Impressum</a>

tasks/customize_footer.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
- name: create directory for custom footer
3+
become: true
4+
ansible.builtin.file:
5+
path: "{{ item }}"
6+
state: directory
7+
owner: "{{ gitea_user }}"
8+
group: "{{ gitea_group }}"
9+
mode: 'u=rwX,g=rX,o='
10+
with_items:
11+
- "{{ gitea_custom }}/templates"
12+
- "{{ gitea_custom }}/templates/custom"
13+
14+
- name: transfer custom footer template
15+
become: true
16+
ansible.builtin.copy:
17+
src: "{{ lookup('first_found', transfer_custom_footer) }}"
18+
dest: "{{ gitea_custom }}/templates/custom/extra_links_footer.tmpl"
19+
owner: "{{ gitea_user }}"
20+
group: "{{ gitea_group }}"
21+
mode: '0644'
22+
ignore_errors: true
23+
notify: "Restart gitea"

tasks/main.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,7 @@
5252
- name: optionally customize gitea
5353
ansible.builtin.include_tasks: customize_logo.yml
5454
when: gitea_customize_logo|bool
55+
56+
- name: optionally customize footer
57+
ansible.builtin.include_tasks: customize_footer.yml
58+
when: gitea_customize_footer|bool

vars/main.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,14 @@ transfer_custom_logo_appletouchiconpng:
4848
- "files/{{ gitea_http_domain }}/gitea_logo/apple-touch-icon.png"
4949
- 'files/gitea_logo/apple-touch-icon.png'
5050

51-
playbook_version_number: 16 # should be int
51+
transfer_custom_footer:
52+
files:
53+
- "{{ gitea_custom_search }}/gitea_footer/extra_links_footer.tmpl"
54+
- "files/{{ inventory_hostname }}/gitea_footer/extra_links_footer.tmpl"
55+
- "files/{{ gitea_http_domain }}/gitea_footer/extra_links_footer.tmpl"
56+
- 'files/gitea_footer/extra_links_footer.tmpl'
57+
- 'files/extra_links_footer.tmpl'
58+
59+
60+
playbook_version_number: 17 # should be int
5261
playbook_version_path: 'do1jlr.gitea.version'

0 commit comments

Comments
 (0)