Automation and setup for sites I own.
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.
 
 
 
 

79 line
1.9 KiB

  1. #!/usr/bin/env sh
  2. #-*-mode: Shell-script; coding: utf-8;-*-
  3. gitea_ini=/etc/gitea/app.ini
  4. # We want to listen on 127.0.0.1 instead of 0.0.0.0 for now
  5. if ! grep HTTP_ADDR $gitea_ini; then
  6. sed -i -e '/\[server\]/a HTTP_ADDR=127.0.0.1' $gitea_ini
  7. fi
  8. if ! grep OFFLINE_MODE $gitea_ini; then
  9. # Setup offlinemode we don't need the cdn crap
  10. sed -i -e '/\[server\]/a OFFLINE_MODE = true' $gitea_ini
  11. fi
  12. # Change the gitea APP_NAME
  13. if ! grep APP_NAME $gitea_ini; then
  14. sed -i -e '/^RUN_MODE.*/a APP_NAME = mitchtys git house' $gitea_ini
  15. fi
  16. # Ensure all new repos are private by default
  17. if ! grep FORCE_PRIVATE $gitea_ini; then
  18. sed -i -e '/\[repository\]/a FORCE_PRIVATE=true' $gitea_ini
  19. fi
  20. # No limits to repos
  21. if ! grep MAX_CREATION_LIMIT $gitea_ini; then
  22. sed -i -e '/\[repository\]/a MAX_CREATION_LIMIT=-1' $gitea_ini
  23. fi
  24. # Don't use http for git operations
  25. if ! grep DISABLE_HTTP_GIT $gitea_ini; then
  26. sed -i -e '/\[repository\]/a DISABLE_HTTP_GIT=true' $gitea_ini
  27. fi
  28. if ! grep CUSTOM $gitea_ini; then
  29. cat <<- FIN | tee -a $gitea_ini
  30. # CUSTOM
  31. [security]
  32. INTERNAL_TOKEN = $INTERNAL_TOKEN
  33. SECRET_KEY = $SECRET_KEY
  34. INSTALL_LOCK = true
  35. [oauth2]
  36. ENABLE = false
  37. [other]
  38. SHOW_FOOTER_VERSION = false
  39. [openid]
  40. ENABLE_OPENID_SIGNIN = false
  41. ENABLE_OPENID_SIGNUP = false
  42. [ui]
  43. SHOW_USER_EMAIL = false
  44. [api]
  45. ENABLE_SWAGGER = false
  46. [service]
  47. DEFAULT_KEEP_EMAIL_PRIVATE = true
  48. DISABLE_REGISTRATION = true
  49. REGISTER_EMAIL_CONFIRM = false
  50. ENABLE_NOTIFY_MAIL = false
  51. ENABLE_CAPTCHA = false
  52. REQUIRE_SIGNIN_VIEW = false
  53. DEFAULT_ALLOW_CREATE_ORGANIZATION = true
  54. NO_REPLY_ADDRESS = noreply.example.org
  55. ALLOW_ONLY_EXTERNAL_REGISTRATION = false
  56. DEFAULT_ENABLE_TIMETRACKING = true
  57. [mailer]
  58. ENABLED = false
  59. [picture]
  60. DISABLE_GRAVATAR = false
  61. ENABLE_FEDERATED_AVATAR = true
  62. FIN
  63. fi