summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/settings
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2020-09-05 09:43:06 +0200
committerGitHub <noreply@github.com>2020-09-05 08:43:06 +0100
commitdba5d82f86dc9dc757404f03bf80ebbe28a5a0b1 (patch)
treeb59de4d8745ff000d3e4fc9c581ede5abaae6bdf /routers/api/v1/settings
parentbab1204db4c6f0b3346a84b3c37fd6386fcee48d (diff)
downloadgitea-dba5d82f86dc9dc757404f03bf80ebbe28a5a0b1.tar.gz
gitea-dba5d82f86dc9dc757404f03bf80ebbe28a5a0b1.zip
Expose Attachemnt Settings by API (#12514)
close #12368
Diffstat (limited to 'routers/api/v1/settings')
-rw-r--r--routers/api/v1/settings/settings.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/routers/api/v1/settings/settings.go b/routers/api/v1/settings/settings.go
index 7ec0d74c83..29210751d6 100644
--- a/routers/api/v1/settings/settings.go
+++ b/routers/api/v1/settings/settings.go
@@ -60,3 +60,21 @@ func GetGeneralRepoSettings(ctx *context.APIContext) {
HTTPGitDisabled: setting.Repository.DisableHTTPGit,
})
}
+
+// GetGeneralAttachmentSettings returns instance's global settings for Attachment
+func GetGeneralAttachmentSettings(ctx *context.APIContext) {
+ // swagger:operation GET /settings/Attachment settings getGeneralAttachmentSettings
+ // ---
+ // summary: Get instance's global settings for Attachment
+ // produces:
+ // - application/json
+ // responses:
+ // "200":
+ // "$ref": "#/responses/GeneralAttachmentSettings"
+ ctx.JSON(http.StatusOK, api.GeneralAttachmentSettings{
+ Enabled: setting.Attachment.Enabled,
+ AllowedTypes: setting.Attachment.AllowedTypes,
+ MaxFiles: setting.Attachment.MaxFiles,
+ MaxSize: setting.Attachment.MaxSize,
+ })
+}