diff --git a/README.md b/README.md index 6c680e2..9e08c62 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ forgejo_download_url: 'https://github.com/go-gitea/gitea/releases/download/v{{ f ``` ## Playbook -The playbook includes postgresql role and deploys entire stack needed to run Gitea. Additional roles are also available in the Ansible roles repos in git. +The playbook includes postgresql role and deploys entire stack needed to run Forgejo. Additional roles are also available in the Ansible roles repos in git. ## 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`. diff --git a/defaults/main.yml b/defaults/main.yml index 9633664..15d18f3 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,10 +1,10 @@ --- -forgejo_bindir: "/usr/local/bin/gitea" -forgejo_lib_dir: "/var/lib/gitea" +forgejo_bindir: "/usr/local/bin/forgejo" +forgejo_lib_dir: "/var/lib/forgejo" forgejo_user: 'git' forgejo_group: 'git' -forgejo_confdir: '/etc/gitea/app.ini' +forgejo_confdir: '/etc/forgejo/app.ini' forgejo_flavor: 'forgejo' forgejo_version: '1.19.3-0' @@ -41,13 +41,13 @@ forgejo_security_config: forgejo_database_config: - 'DB_TYPE = postgres' - 'HOST = localhost:5432' - - 'NAME = gitea' + - 'NAME = forgejo' - 'USER = admin' - 'PASSWD = changeme' - 'SSL_MODE = disable' forgejo_repository_config: - - 'ROOT = /home/git/gitea-repositories' + - 'ROOT = /home/git/forgejo-repositories' forgejo_server_config: - 'SSH_DOMAIN = git.example.org' @@ -131,7 +131,7 @@ postgresql_pg_hba_default: - { type: host, database: all, user: all, address: '127.0.0.1/32', method: '{{ postgresql_default_auth_method_hosts }}', comment: 'IPv4 local connections:' } postgresql_databases: - - name: gitea + - name: forgejo owner: admin # optional; specify the owner of the database hstore: no # flag to install the hstore extension on this database (yes/no) uuid_ossp: no # flag to install the uuid-ossp extension on this database (yes/no) @@ -144,6 +144,6 @@ postgresql_users: postgresql_user_privileges: - name: admin # user name - db: gitea # database + db: forgejo # database priv: "ALL" # privilege string format: example: INSERT,UPDATE/table:SELECT/anothertable:ALL role_attr_flags: "" # role attribute flags diff --git a/tasks/configure.yml b/tasks/configure.yml index 47d45d6..3f5d23e 100644 --- a/tasks/configure.yml +++ b/tasks/configure.yml @@ -30,7 +30,7 @@ - name: '[DIR] - Create etc dir' file: - path: /etc/gitea + path: /etc/forgejo state: directory mode: '0770' owner: "{{ forgejo_user }}" @@ -38,7 +38,7 @@ - name: '[CONF] - Deploy forgejo config' template: - src: etc/gitea/app.ini.j2 + src: etc/forgejo/app.ini.j2 dest: "{{ forgejo_confdir }}" owner: "{{ forgejo_user }}" group: "{{ forgejo_group }}" diff --git a/tasks/install.yml b/tasks/install.yml index fa52f4f..9b6ee5d 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -19,19 +19,19 @@ - name: '[INSTALL] - Download forgejo binary' get_url: url: '{{ forgejo_download_url }}' - dest: '{{ forgejo_bindir }}/gitea' + dest: '{{ forgejo_bindir }}/forgejo' mode: '0750' owner: '{{ forgejo_user }}' group: '{{ forgejo_group }}' force: 'yes' notify: 'Restart forgejo' -- name: '[INSTALL] - Set /etc/gitea rights to read-only' +- name: '[INSTALL] - Set /etc/forgejo rights to read-only' file: - path: '/etc/gitea' + path: '/etc/forgejo' mode: '0750' - name: '[INSTALL] - Set app.ini rights to read-only' file: - path: '/etc/gitea/app.ini' + path: '/etc/forgejo/app.ini' mode: '0640' diff --git a/templates/etc/gitea/app.ini.j2 b/templates/etc/forgejo/app.ini.j2 similarity index 99% rename from templates/etc/gitea/app.ini.j2 rename to templates/etc/forgejo/app.ini.j2 index 681c74d..d75f891 100644 --- a/templates/etc/gitea/app.ini.j2 +++ b/templates/etc/forgejo/app.ini.j2 @@ -3,7 +3,6 @@ {{ item }} {% endfor %} - [oauth2] {% for item in forgejo_oauth2_config %} {{ item }} diff --git a/templates/etc/systemd/system/forgejo.service.j2 b/templates/etc/systemd/system/forgejo.service.j2 index 06d975a..e467f3d 100644 --- a/templates/etc/systemd/system/forgejo.service.j2 +++ b/templates/etc/systemd/system/forgejo.service.j2 @@ -19,11 +19,11 @@ RestartSec=2s Type=simple User={{ forgejo_user }} Group={{ forgejo_group }} -WorkingDirectory=/var/lib/gitea/ -ExecStart={{ forgejo_bindir }}/gitea web -c {{ forgejo_confdir }} +WorkingDirectory=/var/lib/forgejo/ +ExecStart={{ forgejo_bindir }}/forgejo web -c {{ forgejo_confdir }} Restart=always RestartSec=3 -Environment=USER={{ forgejo_user }} HOME=/home/{{ forgejo_user }} GITEA_WORK_DIR=/var/lib/gitea +Environment=USER={{ forgejo_user }} HOME=/home/{{ forgejo_user }} FORGEJO_WORK_DIR=/var/lib/forgejo # If you want to bind Forgejo to a port below 1024 uncomment # the two values below ###