IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an email to s dot adaszewski at gmail dot com. User accounts are meant only to report issues and/or generate pull requests. This is a purpose-specific Git hosting for ADARED projects. Thank you for your understanding!
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.

59 lines
2.4KB

  1. images:
  2. gitea-latest: .
  3. certbot-latest: ../certbot
  4. volumes:
  5. gitea-data: {}
  6. certbot-webroot: {}
  7. certbot-config-gitea: {}
  8. jails:
  9. gitea:
  10. meta:
  11. domains:
  12. - xyz.com
  13. - www.xyz.com
  14. image: gitea-latest
  15. mounts:
  16. gitea-data: /var/db/gitea
  17. ip4.addr: 127.0.8.1
  18. exec.start: |
  19. export IP4_ADDR=127.0.8.1 && \
  20. export DOMAIN_NAME=xyz.com && \
  21. export GITEA_CONF=/usr/local/etc/gitea/conf/app.ini && \
  22. chown git:git /var/db/gitea && \
  23. sed -i -e "s/127.0.0.1/${IP4_ADDR}/g" $GITEA_CONF && \
  24. sed -i -e "s/localhost/${DOMAIN_NAME}/g" $GITEA_CONF && \
  25. crudini --set --inplace $GITEA_CONF server ROOT_URL https://${DOMAIN_NAME} && \
  26. crudini --set --inplace $GITEA_CONF server DISABLE_SSH true && \
  27. export SECRET_CONF=/var/db/gitea/focker-secrets.ini && \
  28. if [ ! -f $SECRET_CONF ]; then
  29. touch $SECRET_CONF && \
  30. chown root:git $SECRET_CONF && \
  31. chmod 640 $SECRET_CONF && \
  32. crudini --set --inplace $SECRET_CONF oauth2 JWT_SECRET `gitea generate secret JWT_SECRET` && \
  33. crudini --set --inplace $SECRET_CONF security INTERNAL_TOKEN `gitea generate secret INTERNAL_TOKEN` && \
  34. crudini --set --inplace $SECRET_CONF security SECRET_KEY `gitea generate secret SECRET_KEY`; \
  35. fi && \
  36. if [ ! -f /var/db/gitea/gitea.db ]; then \
  37. su git -c 'gitea migrate -c $GITEA_CONF' && \
  38. su git -c 'gitea admin -c $GITEA_CONF create-user --username admin1 --password "AdminAdmin1+" --email "invaliduser@nonexistentdomain.com" --admin'; \
  39. fi && \
  40. crudini --set --inplace $GITEA_CONF oauth2 JWT_SECRET `crudini --get $SECRET_CONF oauth2 JWT_SECRET` && \
  41. crudini --set --inplace $GITEA_CONF security INTERNAL_TOKEN `crudini --get $SECRET_CONF security INTERNAL_TOKEN` && \
  42. crudini --set --inplace $GITEA_CONF security SECRET_KEY `crudini --get $SECRET_CONF security SECRET_KEY` && \
  43. /bin/sh /etc/rc
  44. certbot-gitea:
  45. image: certbot-latest
  46. mounts:
  47. certbot-webroot: /certbot/webroot
  48. certbot-config-gitea: /usr/local/etc/letsencrypt
  49. ip4.addr: 127.0.9.1
  50. exec.start: |
  51. if [ ! -f /usr/local/etc/letsencrypt/cli.ini ]; then
  52. echo 'webroot-path=/certbot/webroot' >>/usr/local/etc/letsencrypt/cli.ini && \
  53. echo 'authenticator=webroot' >>/usr/local/etc/letsencrypt/cli.ini;
  54. fi && \
  55. /bin/sh /etc/rc