From 42457ae98dd77ddd39b310eb47e4128c3609c64a Mon Sep 17 00:00:00 2001 From: meaz Date: Fri, 8 Dec 2023 23:11:51 +0100 Subject: [PATCH 1/4] Update to v1.21.1-0 --- README.md | 4 ++-- defaults/main.yml | 2 +- tasks/configure.yml | 13 +++++++++++-- tasks/custom_themes.yml | 16 ++++------------ 4 files changed, 18 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 9e08c62..3156d65 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,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/ diff --git a/defaults/main.yml b/defaults/main.yml index 4f4106b..421bde9 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -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.1-0' forgejo_arch: 'linux-amd64' #forgejo_download_url: 'https://github.com/go-gitea/gitea/releases/download/v{{ forgejo_version }}/gitea-{{ forgejo_version }}-{{ forgejo_arch }}' diff --git a/tasks/configure.yml b/tasks/configure.yml index 6e36ed2..b76b6dd 100644 --- a/tasks/configure.yml +++ b/tasks/configure.yml @@ -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 diff --git a/tasks/custom_themes.yml b/tasks/custom_themes.yml index f794e20..99c9bf5 100644 --- a/tasks/custom_themes.yml +++ b/tasks/custom_themes.yml @@ -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 -- 2.30.2 From 6a49d45f8bdd2f77a55bf3ea567a125450288da6 Mon Sep 17 00:00:00 2001 From: meaz Date: Sat, 9 Dec 2023 07:13:02 +0100 Subject: [PATCH 2/4] add info about admin in readme --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 3156d65..a2cdd8f 100644 --- a/README.md +++ b/README.md @@ -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: -- 2.30.2 From 1f2cf1d36aeafe2e7adc38b2a0cf69b50075d16c Mon Sep 17 00:00:00 2001 From: meaz Date: Sat, 9 Dec 2023 07:13:13 +0100 Subject: [PATCH 3/4] update to 1.21.2-0 --- defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index 421bde9..9478760 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -7,7 +7,7 @@ forgejo_group: 'git' forgejo_confdir: '/etc/forgejo/app.ini' forgejo_flavor: 'forgejo' -forgejo_version: '1.21.1-0' +forgejo_version: '1.21.2-0' forgejo_arch: 'linux-amd64' #forgejo_download_url: 'https://github.com/go-gitea/gitea/releases/download/v{{ forgejo_version }}/gitea-{{ forgejo_version }}-{{ forgejo_arch }}' -- 2.30.2 From 181f28306fe3685acbe86901c40e2482b3a3ba34 Mon Sep 17 00:00:00 2001 From: meaz Date: Wed, 13 Dec 2023 08:19:54 +0100 Subject: [PATCH 4/4] bump to 1.21.2-1 --- defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index 9478760..4467ac8 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -7,7 +7,7 @@ forgejo_group: 'git' forgejo_confdir: '/etc/forgejo/app.ini' forgejo_flavor: 'forgejo' -forgejo_version: '1.21.2-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 }}' -- 2.30.2