gitea: can now backup the database remotely

This commit is contained in:
CPunch 2023-02-01 23:30:14 -06:00
parent bf198f9d63
commit feaea47028
6 changed files with 37 additions and 10 deletions

3
.gitignore vendored
View File

@ -1 +1,2 @@
hosts
hosts
backups

View File

@ -1,3 +1,4 @@
---
domain: openpunk.com
contact_email: openpunk@proton.me
onionDomain: http://opnpnk6eutjiqy4ndpyvwxd5pncj2g2cmz6fkocr5uh3omnn4utvspad.onion

View File

@ -18,10 +18,6 @@
- zsh # :D
- python3-certbot-nginx
- name: Grab package facts
package_facts:
manager: auto
- name: Setup zsh
user:
name: "{{ ansible_user }}"

View File

@ -0,0 +1,25 @@
---
- name: Stop Gitea
systemd:
name: gitea
enabled: yes
state: stopped
- name: Dump Gitea
shell:
cmd: gitea dump -c /etc/gitea/app.ini --work-path=/etc/gitea --file=gitea-dump.zip
chdir: /etc/gitea
become: true
become_method: su
become_user: gitea
- name: Start Gitea
systemd:
name: gitea
enabled: yes
state: started
- name: Fetch backup
fetch:
src: /etc/gitea/gitea-dump.zip
dest: backups

View File

@ -4,6 +4,10 @@
path: /etc/apt/trusted.gpg.d/morph027-gitea.gpg
register: gitea_key
- name: Grab package facts
package_facts:
manager: auto
- name: Install Gitea
block:
- name: Add Gitea key, repository && install
@ -34,6 +38,10 @@
name: gitea
enabled: yes
state: started
- name: Backup db
include_tasks: backup.yml
tags: ['never', 'backup']
when: giteaUninstall == false
- name: Uninstall Gitea

View File

@ -8,11 +8,6 @@
vars_files:
- group_vars/all.yml
vars_prompt:
- name: domain
prompt: domain pointing to the vps
private: no
roles:
- role: essential
- role: firewall
@ -20,6 +15,7 @@
- role: deadswitch
- role: blog
- role: gitea
tags: [backup]
- role: nginx
- role: goaccess
- role: tor