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!
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

57 linhas
2.3KB

  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 GITEA_CONF=/usr/local/etc/gitea/conf/app.ini && \
  20. chown git:git /var/db/gitea && \
  21. sed -i -e 's/127.0.0.1/127.0.8.1/g' $GITEA_CONF && \
  22. sed -i -e 's/localhost/xyz.com/g' $GITEA_CONF && \
  23. crudini --set --inplace $GITEA_CONF server ROOT_URL https://xyz.com && \
  24. crudini --set --inplace $GITEA_CONF server DISABLE_SSH true && \
  25. export SECRET_CONF=/var/db/gitea/focker-secrets.ini && \
  26. if [ ! -f $SECRET_CONF ]; then
  27. touch $SECRET_CONF && \
  28. chown root:git $SECRET_CONF && \
  29. chmod 640 $SECRET_CONF && \
  30. crudini --set --inplace $SECRET_CONF oauth2 JWT_SECRET `gitea generate secret JWT_SECRET` && \
  31. crudini --set --inplace $SECRET_CONF security INTERNAL_TOKEN `gitea generate secret INTERNAL_TOKEN` && \
  32. crudini --set --inplace $SECRET_CONF security SECRET_KEY `gitea generate secret SECRET_KEY`; \
  33. fi && \
  34. if [ ! -f /var/db/gitea/gitea.db ]; then \
  35. su git -c 'gitea migrate -c $GITEA_CONF' && \
  36. su git -c 'gitea admin -c $GITEA_CONF create-user --username admin1 --password "AdminAdmin1+" --email "invaliduser@nonexistentdomain.com" --admin'; \
  37. fi && \
  38. crudini --set --inplace $GITEA_CONF oauth2 JWT_SECRET `crudini --get $SECRET_CONF oauth2 JWT_SECRET` && \
  39. crudini --set --inplace $GITEA_CONF security INTERNAL_TOKEN `crudini --get $SECRET_CONF security INTERNAL_TOKEN` && \
  40. crudini --set --inplace $GITEA_CONF security SECRET_KEY `crudini --get $SECRET_CONF security SECRET_KEY` && \
  41. /bin/sh /etc/rc
  42. certbot-gitea:
  43. image: certbot-latest
  44. mounts:
  45. certbot-webroot: /certbot/webroot
  46. certbot-config-gitea: /usr/local/etc/letsencrypt
  47. ip4.addr: 127.0.9.1
  48. exec.start: |
  49. if [ ! -f /usr/local/etc/letsencrypt/cli.ini ]; then
  50. echo 'webroot-path=/certbot/webroot' >>/usr/local/etc/letsencrypt/cli.ini && \
  51. echo 'authenticator=webroot' >>/usr/local/etc/letsencrypt/cli.ini;
  52. fi && \
  53. /bin/sh /etc/rc