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.

settings.go 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // Copyright 2020 The Gitea Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package settings
  5. import (
  6. "net/http"
  7. "code.gitea.io/gitea/modules/context"
  8. "code.gitea.io/gitea/modules/setting"
  9. api "code.gitea.io/gitea/modules/structs"
  10. )
  11. // GetGeneralUISettings returns instance's global settings for ui
  12. func GetGeneralUISettings(ctx *context.APIContext) {
  13. // swagger:operation GET /settings/ui settings getGeneralUISettings
  14. // ---
  15. // summary: Get instance's global settings for ui
  16. // produces:
  17. // - application/json
  18. // responses:
  19. // "200":
  20. // "$ref": "#/responses/GeneralUISettings"
  21. ctx.JSON(http.StatusOK, api.GeneralUISettings{
  22. AllowedReactions: setting.UI.Reactions,
  23. })
  24. }
  25. // GetGeneralRepoSettings returns instance's global settings for repositories
  26. func GetGeneralRepoSettings(ctx *context.APIContext) {
  27. // swagger:operation GET /settings/repository settings getGeneralRepositorySettings
  28. // ---
  29. // summary: Get instance's global settings for repositories
  30. // produces:
  31. // - application/json
  32. // responses:
  33. // "200":
  34. // "$ref": "#/responses/GeneralRepoSettings"
  35. ctx.JSON(http.StatusOK, api.GeneralRepoSettings{
  36. MirrorsDisabled: setting.Repository.DisableMirrors,
  37. HTTPGitDisabled: setting.Repository.DisableHTTPGit,
  38. })
  39. }