An Ansible Playbook for deploying your own self-hosted Gitea instance
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 1.4KB

1 year ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. # Setting up a Gitea code hosting platform
  2. Gitea is a self-hosted Git-based Code Hosting Platform and a nice alternative to Github and other proprietary services. You can use this Ansible Playbook to host your own Code Hosting Platform under your own control.
  3. This setup offers:
  4. * Gitea
  5. * PostgreSQL backend
  6. * Nginx reverse proxy
  7. * Fail2Ban Gitea protection
  8. * HTTPS by Let's Encrypt
  9. ## Prerequisites
  10. * A Debian or Ubuntu machine.
  11. * A publicly available FQDN:
  12. ```
  13. git.example.org. 300 IN A 1.2.3.4
  14. ```
  15. ## Deploy gitea
  16. Clone the repository:
  17. ```
  18. $ git clone https://git.theo-andreou.org/Personal/ansible-deploy-gitea.git
  19. $ cd ansible-deploy-gitea
  20. ```
  21. Prepare a *vars/all.yml* file (you can use *vars/all.yml.example* as reference):
  22. ```
  23. # vars/all.yml
  24. gitea_fqdn: git.example.org
  25. gitea_db: giteadb
  26. gitea_db_user: giteadbuser
  27. gitea_version: 1.4.2
  28. ```
  29. Adjusts the host(s) in *deploy_gitea.yml* and run the Playbook:
  30. ```
  31. $ ansible-playbook deploy_gitea.yml
  32. ```
  33. When done rush to https://git.example.org. First one to create an account gets to be an admin!
  34. References
  35. ----------
  36. * https://docs.gitea.io/en-us/install-from-binary/
  37. * https://docs.gitea.io/en-us/linux-service/
  38. * https://dl.gitea.io/gitea/1.4.2/
  39. * https://docs.gitea.io/en-us/fail2ban-setup/
  40. * https://docs.ansible.com/ansible/latest/modules/postgresql_db_module.html
  41. * https://docs.ansible.com/ansible/latest/modules/postgresql_user_module.html