v1.21.2-0 (#39)

Reviewed-on: #39
Reviewed-by: muppeth <muppeth@no-reply@disroot.org>
Co-authored-by: meaz <meaz@disroot.org>
Co-committed-by: meaz <meaz@disroot.org>
This commit is contained in:
meaz 2023-12-13 20:12:37 +00:00 committed by meaz
parent 2ac865ad85
commit a2b34421b3
4 changed files with 20 additions and 17 deletions

View File

@ -9,6 +9,8 @@ You can deploy test instance using `Vagrantfile` attached to the role.
Then you can then access forgejo from your computer on `http://192.168.33.14:3000`
The first user you create becomes the admin.
# Gitea or Forgejo
This role allows for deployment of gitea and forgejo. By default the role deploys forgejo and this is the flavor that is supported and maintained. Installing Gitea using the role is possible however starting from version 1.18.2 is no longer maintained by Disroot team.
To switch to gitea, update following variables in your Playbook/host_vars:
@ -27,7 +29,7 @@ The playbook includes postgresql role and deploys entire stack needed to run For
## Customization
You can deploy custom themes with this role. To do so, uncomment `forgejo_theme_dir` and `forgejo_custom_themes` from `defaults/main.yml`. Add the theme repos' address and name there, enable them and then deploy with `ansible-playbook -b Playbooks/forgejo.yml --tags theme`.
You can also add you own images like favicon, icons, etc. See https://docs.gitea.io/en-us/customizing-gitea/ to see how to prepare your images.
You can also add you own images like favicon, icons, etc. See https://forgejo.org/docs/v1.21/developer/customization/ to see how to prepare your images.
Then, copy them in the `img` folder of this role and uncomment `forgejo_extra_files_path` and `forgejo_theme_dir` from `defaults/main.yml`. You can then deploy with `ansible-playbook -b Playbooks/forgejo.yml --tags config`.
For more information about customizaton, check https://docs.gitea.io/en-us/customizing-gitea/.
For more information about customizaton, check https://forgejo.org/docs/v1.21/developer/customization/

View File

@ -7,7 +7,7 @@ forgejo_group: 'git'
forgejo_confdir: '/etc/forgejo/app.ini'
forgejo_flavor: 'forgejo'
forgejo_version: '1.20.6-0'
forgejo_version: '1.21.2-1'
forgejo_arch: 'linux-amd64'
#forgejo_download_url: 'https://github.com/go-gitea/gitea/releases/download/v{{ forgejo_version }}/gitea-{{ forgejo_version }}-{{ forgejo_arch }}'

View File

@ -45,9 +45,18 @@
notify: Restart forgejo
tags: config
- name: "[CONF] - Create assets dir"
file:
path: "{{ forgejo_theme_dir }}/public/assets/"
state: 'directory'
owner: '{{ forgejo_user }}'
group: '{{ forgejo_group }}'
when: forgejo_extra_files_path is defined
tags: config
- name: "[CONF] - Create img folder"
file:
path: "{{ forgejo_theme_dir }}/public/img/"
path: "{{ forgejo_theme_dir }}/public/assets/img/"
state: 'directory'
owner: '{{ forgejo_user }}'
group: '{{ forgejo_group }}'
@ -57,7 +66,7 @@
- name: "[CONF] - Deploy img folder"
copy:
src: '{{ forgejo_extra_files_path }}/'
dest: "{{ forgejo_theme_dir }}/public/img/"
dest: "{{ forgejo_theme_dir }}/public/assets/img/"
owner: "{{ forgejo_user }}"
group: "{{ forgejo_group }}"
mode: 0755

View File

@ -1,16 +1,8 @@
---
- name: '[THEME] - Create public dir'
file:
path: '{{ forgejo_theme_dir }}/public/'
state: directory
owner: "{{ forgejo_user }}"
group: "{{ forgejo_group }}"
tags: theme
- name: '[THEME] - Create css dir'
file:
path: '{{ forgejo_theme_dir }}/public/css'
path: '{{ forgejo_theme_dir }}/public/assets/css'
state: directory
owner: "{{ forgejo_user }}"
group: "{{ forgejo_group }}"
@ -19,7 +11,7 @@
# First, remove the css files from public folder, then theme repos
- name: "[THEME] - Remove css files from the css folder"
shell:
cmd: find "{{ forgejo_theme_dir }}/{{ item.name }}" -type f -name "*.css" -printf "%f\n" | xargs -I{} rm public/css/{}
cmd: find "{{ forgejo_theme_dir }}/{{ item.name }}" -type f -name "*.css" -printf "%f\n" | xargs -I{} rm public/assets/css/{}
chdir: "{{ forgejo_theme_dir }}"
loop: "{{ forgejo_custom_themes }}"
when: item.enable == 'false'
@ -49,7 +41,7 @@
- name: "[THEME] - Find css files from different repos and copy them in the public folder"
shell:
cmd: find "{{ forgejo_theme_dir }}" -type f -name "*.css" -not -path "{{ forgejo_theme_dir }}/public/*" | xargs cp -t "{{ forgejo_theme_dir }}/public/css"
cmd: find "{{ forgejo_theme_dir }}" -type f -name "*.css" -not -path "{{ forgejo_theme_dir }}/public/*" | xargs cp -t "{{ forgejo_theme_dir }}/public/assets/css"
chdir: "{{ forgejo_theme_dir }}"
become: true
become_user: "{{ forgejo_user }}"
@ -58,7 +50,7 @@
# Lastly, update app.ini by adding the theme's name list.
- name: "[THEME] - Get and prepare a list for app.ini of css files in public folder, register it"
shell:
cmd: ls "{{ forgejo_theme_dir }}/public/css" | sed -e 's/theme-//g' | sed -e 's/.css//g' | paste -s -d,
cmd: ls "{{ forgejo_theme_dir }}/public/assets/css" | sed -e 's/theme-//g' | sed -e 's/.css//g' | paste -s -d,
chdir: "{{ forgejo_theme_dir }}"
register: theme_name
tags: theme