Compare commits
4 Commits
Author | SHA1 | Date |
---|---|---|
meaz | faf1fb5895 | |
meaz | 58b4b3d74e | |
meaz | edf2d1721d | |
meaz | a2b34421b3 |
|
@ -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/
|
||||
|
|
|
@ -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.7-0'
|
||||
forgejo_arch: 'linux-amd64'
|
||||
#forgejo_download_url: 'https://github.com/go-gitea/gitea/releases/download/v{{ forgejo_version }}/gitea-{{ forgejo_version }}-{{ forgejo_arch }}'
|
||||
|
||||
|
@ -132,6 +132,15 @@ forgejo_email_incoming:
|
|||
- 'DELETE_HANDLED_MESSAGE = true'
|
||||
- 'MAXIMUM_MESSAGE_SIZE = 0'
|
||||
|
||||
|
||||
# Systemd
|
||||
# forgejo_dbservice: 'postgresql.service' # uncomment to enable this. You can cnange to mysql, mariadb, redis, memcached
|
||||
# forgejo_websocket: 'true' # uncomment to enable this
|
||||
# forgejo_limitnofile: '524288:524288' # Uncomment if you have repos with lots of files and get a HTTP 500 error because of that
|
||||
# forgejo_custom_path: 'Environment=PATH={{ forgejo_custom_path }}:/bin:/sbin:/usr/bin:/usr/sbin' # Uncomment if you install Git to directory prefix other than default PATH and add that prefix to PATH
|
||||
# forgejo_cap_net_bind_service: 'CAP_NET_BIND_SERVICE' # Uncomment if you want to bind Forgejo to a port below 1024, or use socket activation to pass Forgejo its ports as above
|
||||
# forgejo_privateusers: 'false' # Uncomment, when using forgejo_cap_net_bind_service option, to allow capabilities to be applied on Forgejo process. If set to true sandboxes Forgejo service and prevent any processes from running with privileges in the host user namespace
|
||||
|
||||
#apt
|
||||
forgejo_apt_list:
|
||||
- git
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,34 +1,97 @@
|
|||
[Unit]
|
||||
Description=Forgejo (Git with a cup of tea)
|
||||
Description=Forgejo (Beyond coding. We forge.)
|
||||
After=syslog.target
|
||||
After=network.target
|
||||
#Requires=mysql.service
|
||||
#Requires=mariadb.service
|
||||
#Requires=postgresql.service
|
||||
#Requires=memcached.service
|
||||
#Requires=redis.service
|
||||
###
|
||||
# Don't forget to add the database service dependencies
|
||||
###
|
||||
{% if forgejo_dbservice is defined %}
|
||||
Wants={{ forgejo_dbservice }}
|
||||
After={{ forgejo_dbservice }}
|
||||
{% endif %}
|
||||
|
||||
###
|
||||
# If using socket activation for main http/s
|
||||
###
|
||||
{% if forgejo_websocket is defined %}
|
||||
After=forgejo.main.socket
|
||||
Requires=forgejo.main.socket
|
||||
|
||||
###
|
||||
# (You can also provide forgejo an http fallback and/or ssh socket too)
|
||||
#
|
||||
# An example of /etc/systemd/system/forgejo.main.socket
|
||||
###
|
||||
|
||||
[Unit]
|
||||
Description=Forgejo Web Socket
|
||||
PartOf=forgejo.service
|
||||
|
||||
[Socket]
|
||||
Service=forgejo.service
|
||||
ListenStream=<some_port>
|
||||
NoDelay=true
|
||||
|
||||
[Install]
|
||||
WantedBy=sockets.target
|
||||
{% endif %}
|
||||
|
||||
|
||||
[Service]
|
||||
# Modify these two values and uncomment them if you have
|
||||
# repos with lots of files and get an HTTP error 500 because
|
||||
# of that
|
||||
###
|
||||
#LimitMEMLOCK=infinity
|
||||
#LimitNOFILE=65535
|
||||
# Uncomment the next line if you have repos with lots of files and get a HTTP 500 error because of that
|
||||
{% if forgejo_limitnofile is defined %}
|
||||
LimitNOFILE={{ forgejo_limitnofile }}
|
||||
{% else %}
|
||||
# LimitNOFILE=524288:524288
|
||||
{% endif %}
|
||||
RestartSec=2s
|
||||
Type=simple
|
||||
User={{ forgejo_user }}
|
||||
Group={{ forgejo_group }}
|
||||
WorkingDirectory={{ forgejo_lib_dir }}
|
||||
# If using Unix socket: tells systemd to create the /run/forgejo folder, which will contain the forgejo.sock file
|
||||
# (manually creating /run/forgejo doesn't work, because it would not persist across reboots)
|
||||
{% if forgejo_websocket is defined %}
|
||||
RuntimeDirectory=forgejo
|
||||
{% else %}
|
||||
#RuntimeDirectory=forgejo
|
||||
{% endif %}
|
||||
ExecStart={{ forgejo_bindir }}/forgejo web -c {{ forgejo_confdir }}
|
||||
Restart=always
|
||||
RestartSec=3
|
||||
Environment=USER={{ forgejo_user }} HOME=/home/{{ forgejo_user }} FORGEJO_WORK_DIR={{ forgejo_lib_dir }} FORGEJO_CUSTOM={{ forgejo_theme_dir }}
|
||||
# If you want to bind Forgejo to a port below 1024 uncomment
|
||||
# the two values below
|
||||
# If you install Git to directory prefix other than default PATH (which happens
|
||||
# for example if you install other versions of Git side-to-side with
|
||||
# distribution version), uncomment below line and add that prefix to PATH
|
||||
# Don't forget to place git-lfs binary on the PATH below if you want to enable
|
||||
# Git LFS support
|
||||
{% if forgejo_custom_path is defined %}
|
||||
Environment=PATH={{ forgejo_custom_path }}:/bin:/sbin:/usr/bin:/usr/sbin
|
||||
{% else %}
|
||||
#Environment=PATH=/path/to/git/bin:/bin:/sbin:/usr/bin:/usr/sbin
|
||||
{% endif %}
|
||||
# If you want to bind Forgejo to a port below 1024, uncomment
|
||||
# the two values below, or use socket activation to pass Forgejo its ports as above
|
||||
###
|
||||
{% if forgejo_cap_net_bind_service is defined %}
|
||||
CapabilityBoundingSet={{ forgejo_cap_net_bind_service }}
|
||||
AmbientCapabilities={{ forgejo_cap_net_bind_service }}
|
||||
{% else %}
|
||||
#CapabilityBoundingSet=CAP_NET_BIND_SERVICE
|
||||
#AmbientCapabilities=CAP_NET_BIND_SERVICE
|
||||
{% endif %}
|
||||
###
|
||||
# In some cases, when using CapabilityBoundingSet and AmbientCapabilities option, you may want to
|
||||
# set the following value to false to allow capabilities to be applied on Forgejo process. The following
|
||||
# value if set to true sandboxes Forgejo service and prevent any processes from running with privileges
|
||||
# in the host user namespace.
|
||||
###
|
||||
{% if forgejo_privateusers is defined %}
|
||||
PrivateUsers={{ forgejo_privateusers }}
|
||||
{% else %}
|
||||
#PrivateUsers=false
|
||||
{% endif %}
|
||||
###
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
|
Loading…
Reference in New Issue