1
1
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_gitea.git synced 2024-08-16 11:39:50 +02:00

Merge pull request #37 from roles-ansible/imprint

Add custom footer support
This commit is contained in:
L3D 2021-06-03 21:10:20 +02:00 committed by GitHub
commit 6f0be6998e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 51 additions and 3 deletions

View file

@ -215,9 +215,9 @@ As this will only deploy config files, fail2ban already has to be installed or o
### optional customisation
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/).
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"``.
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"``)*.
+ LOGO
+ **LOGO**:
- Set ``gitea_customize_logo`` to ``true``
- We search for:
* ``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
* ``files/{{ inventory_hostname }}/gitea_logo/``
* ``files/{{ gitea_http_domain }}/gitea_logo/``
* ``files/gitea_logo/``
+ **FOOTER**:
- Set ``gitea_customize_footer`` to ``true``
- We Search using first_found in:
* "{{ gitea_custom_search }}/gitea_footer/extra_links_footer.tmpl"
* "files/{{ inventory_hostname }}/gitea_footer/extra_links_footer.tmpl"
* "files/{{ gitea_http_domain }}/gitea_footer/extra_links_footer.tmpl"
* 'files/gitea_footer/extra_links_footer.tmpl'
* 'files/extra_links_footer.tmpl'
## Contributing
Don't hesitate to create a pull request, and when in doubt you can reach me on

View file

@ -151,3 +151,4 @@ gitea_fail2ban_jail_action: 'iptables-allports'
gitea_custom_search: "files/host_files/{{ inventory_hostname }}/gitea"
gitea_customize_logo: false
gitea_custom: "{{ gitea_home }}/custom"
gitea_customize_footer: false

View file

@ -0,0 +1,2 @@
<a class="item" href="{{AppSubUrl}}/datenschutz.html">Datenschutz</a>
<a class="item" href="{{AppSubUrl}}/impressum.html">Impressum</a>

View file

@ -0,0 +1,23 @@
---
- name: create directory for custom footer
become: true
ansible.builtin.file:
path: "{{ item }}"
state: directory
owner: "{{ gitea_user }}"
group: "{{ gitea_group }}"
mode: 'u=rwX,g=rX,o='
with_items:
- "{{ gitea_custom }}/templates"
- "{{ gitea_custom }}/templates/custom"
- name: transfer custom footer template
become: true
ansible.builtin.copy:
src: "{{ lookup('first_found', transfer_custom_footer) }}"
dest: "{{ gitea_custom }}/templates/custom/extra_links_footer.tmpl"
owner: "{{ gitea_user }}"
group: "{{ gitea_group }}"
mode: '0644'
ignore_errors: true
notify: "Restart gitea"

View file

@ -52,3 +52,7 @@
- name: optionally customize gitea
ansible.builtin.include_tasks: customize_logo.yml
when: gitea_customize_logo|bool
- name: optionally customize footer
ansible.builtin.include_tasks: customize_footer.yml
when: gitea_customize_footer|bool

View file

@ -48,5 +48,14 @@ transfer_custom_logo_appletouchiconpng:
- "files/{{ gitea_http_domain }}/gitea_logo/apple-touch-icon.png"
- 'files/gitea_logo/apple-touch-icon.png'
playbook_version_number: 16 # should be int
transfer_custom_footer:
files:
- "{{ gitea_custom_search }}/gitea_footer/extra_links_footer.tmpl"
- "files/{{ inventory_hostname }}/gitea_footer/extra_links_footer.tmpl"
- "files/{{ gitea_http_domain }}/gitea_footer/extra_links_footer.tmpl"
- 'files/gitea_footer/extra_links_footer.tmpl'
- 'files/extra_links_footer.tmpl'
playbook_version_number: 17 # should be int
playbook_version_path: 'do1jlr.gitea.version'