Automation and setup for sites I own.
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 
 

81 rader
2.0 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 = /var/lib/gitea/unix-domain-socket' $gitea_ini
  7. sed -i -e '/\[server\]/a PROTOCOL = unix' $gitea_ini
  8. sed -i -e '/\[server\]/a UNIX_SOCKET_PERMISSION = 666' $gitea_ini
  9. fi
  10. if ! grep OFFLINE_MODE $gitea_ini; then
  11. # Setup offlinemode we don't need the cdn crap
  12. sed -i -e '/\[server\]/a OFFLINE_MODE = true' $gitea_ini
  13. fi
  14. # Change the gitea APP_NAME
  15. if ! grep APP_NAME $gitea_ini; then
  16. sed -i -e '/^RUN_MODE.*/a APP_NAME = mitchtys git house' $gitea_ini
  17. fi
  18. # Ensure all new repos are private by default
  19. if ! grep FORCE_PRIVATE $gitea_ini; then
  20. sed -i -e '/\[repository\]/a FORCE_PRIVATE=true' $gitea_ini
  21. fi
  22. # No limits to repos
  23. if ! grep MAX_CREATION_LIMIT $gitea_ini; then
  24. sed -i -e '/\[repository\]/a MAX_CREATION_LIMIT=-1' $gitea_ini
  25. fi
  26. # Don't use http for git operations
  27. if ! grep DISABLE_HTTP_GIT $gitea_ini; then
  28. sed -i -e '/\[repository\]/a DISABLE_HTTP_GIT=true' $gitea_ini
  29. fi
  30. if ! grep CUSTOM $gitea_ini; then
  31. cat <<- FIN | tee -a $gitea_ini
  32. # CUSTOM
  33. [security]
  34. INTERNAL_TOKEN = $INTERNAL_TOKEN
  35. SECRET_KEY = $SECRET_KEY
  36. INSTALL_LOCK = true
  37. [oauth2]
  38. ENABLE = false
  39. [other]
  40. SHOW_FOOTER_VERSION = false
  41. [openid]
  42. ENABLE_OPENID_SIGNIN = false
  43. ENABLE_OPENID_SIGNUP = false
  44. [ui]
  45. SHOW_USER_EMAIL = false
  46. [api]
  47. ENABLE_SWAGGER = false
  48. [service]
  49. DEFAULT_KEEP_EMAIL_PRIVATE = true
  50. DISABLE_REGISTRATION = true
  51. REGISTER_EMAIL_CONFIRM = false
  52. ENABLE_NOTIFY_MAIL = false
  53. ENABLE_CAPTCHA = false
  54. REQUIRE_SIGNIN_VIEW = false
  55. DEFAULT_ALLOW_CREATE_ORGANIZATION = true
  56. NO_REPLY_ADDRESS = noreply.example.org
  57. ALLOW_ONLY_EXTERNAL_REGISTRATION = false
  58. DEFAULT_ENABLE_TIMETRACKING = true
  59. [mailer]
  60. ENABLED = false
  61. [picture]
  62. DISABLE_GRAVATAR = false
  63. ENABLE_FEDERATED_AVATAR = true
  64. FIN
  65. fi