Compare commits

..

No commits in common. "2c9a70f0fd59d08193e29ee25f42d0151251865e" and "8766af831c50a8b2298d23dbe35ca3a78eab3269" have entirely different histories.

3 changed files with 17 additions and 40 deletions

View file

@ -102,24 +102,3 @@ Vaultwarden is a credentials manager.
* Stop Vaultwarden.
* Overwrite the data folder with one of the backups.
* Start it up again.
## Forgejo
Forgejo is a git server.
### Deploy
* Decide what subdomain you want to serve Forgejo on and add it to `services/forgejo/forgejo_vars.yml` on the `forgejo_subdomain`.
* Note that you will have to add a DNS entry to point to the VPS public IP.
* Run the deployment playbook: `ansible-playbook -i inventory.ini services/forgejo/deploy_forgejo_playbook.yml`.
### Configure
* Forgejo will be available for you to create a user on first start. Do that and store the creds safely.
* Default behaviour after that is not allow for registrations.
* You can tweak more settings from that point on.
* SSH cloning should work out of the box (after you've set up your SSH pub key in Forgejo, that is).
### Backups
No explicit backups. It's assumed that important repos will be in Lapy, and that perhaps you might even backup lapy as well.

View file

@ -1,9 +1,6 @@
- name: Install Forgejo on Debian 12 with Caddy reverse proxy
hosts: vipy
become: yes
vars_files:
- ../../infra_vars.yml
- ./forgejo_vars.yml
vars:
forgejo_domain: "{{ forgejo_subdomain }}.{{ root_domain }}"
@ -51,22 +48,10 @@
file:
path: "{{ forgejo_config_dir }}"
state: directory
owner: "{{ forgejo_user }}"
owner: "root"
group: "{{ forgejo_user }}"
mode: '0770'
- name: Create Forgejo config file
ansible.builtin.copy:
dest: "{{ forgejo_config_dir }}/app.ini"
content: |
APP_NAME = ; Countergit
[server]
HTTP_PORT = {{ forgejo_port }}
owner: "{{ forgejo_user }}"
group: "{{ forgejo_user }}"
mode: '0644'
- name: Download Forgejo systemd service file
get_url:
url: "{{ forgejo_service_url }}"
@ -83,12 +68,21 @@
enabled: yes
state: started
- name: Create Caddy reverse proxy configuration for forgejo
- name: Add Caddy reverse proxy config for Forgejo
copy:
dest: "{{ caddy_config_path }}"
mode: '0644'
content: |
{{ caddy_site_domain }} {
reverse_proxy localhost:3000
}
- name: Create Caddy reverse proxy configuration for uptime kuma
copy:
dest: "{{ caddy_sites_dir }}/forgejo.conf"
content: |
{{ forgejo_domain }} {
reverse_proxy localhost:{{ forgejo_port }}
{{ uptime_kuma_domain }} {
reverse_proxy localhost:{{ uptime_kuma_port }}
}
owner: root
group: root

View file

@ -17,3 +17,7 @@ forgejo_subdomain: forgejo
remote_host: "{{ groups['vipy'][0] }}"
remote_user: "{{ hostvars[remote_host]['ansible_user'] }}"
remote_key_file: "{{ hostvars[remote_host]['ansible_ssh_private_key_file'] | default('') }}"
# Local backup
local_backup_dir: "{{ lookup('env', 'HOME') }}/forgejo-backups"
backup_script_path: "{{ lookup('env', 'HOME') }}/.local/bin/forgejo_backup.sh"