From dba5d82f86dc9dc757404f03bf80ebbe28a5a0b1 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sat, 5 Sep 2020 09:43:06 +0200 Subject: Expose Attachemnt Settings by API (#12514) close #12368 --- routers/api/v1/settings/settings.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'routers/api/v1/settings') 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, + }) +} -- cgit v1.2.3