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.

migrations.go 902B

12345678910111213141516171819202122232425262728
  1. // Copyright 2019 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package setting
  4. // Migrations settings
  5. var Migrations = struct {
  6. MaxAttempts int
  7. RetryBackoff int
  8. AllowedDomains string
  9. BlockedDomains string
  10. AllowLocalNetworks bool
  11. SkipTLSVerify bool
  12. }{
  13. MaxAttempts: 3,
  14. RetryBackoff: 3,
  15. }
  16. func loadMigrationsFrom(rootCfg ConfigProvider) {
  17. sec := rootCfg.Section("migrations")
  18. Migrations.MaxAttempts = sec.Key("MAX_ATTEMPTS").MustInt(Migrations.MaxAttempts)
  19. Migrations.RetryBackoff = sec.Key("RETRY_BACKOFF").MustInt(Migrations.RetryBackoff)
  20. Migrations.AllowedDomains = sec.Key("ALLOWED_DOMAINS").MustString("")
  21. Migrations.BlockedDomains = sec.Key("BLOCKED_DOMAINS").MustString("")
  22. Migrations.AllowLocalNetworks = sec.Key("ALLOW_LOCALNETWORKS").MustBool(false)
  23. Migrations.SkipTLSVerify = sec.Key("SKIP_TLS_VERIFY").MustBool(false)
  24. }