s3 api: get publish root list

This commit is contained in:
André Roth
2023-12-29 14:00:12 +01:00
parent a0af6a25aa
commit b5b0a52cbe
2 changed files with 18 additions and 0 deletions

View File

@@ -140,6 +140,10 @@ func Router(c *ctx.AptlyContext) http.Handler {
api.POST("/gpg/key", apiGPGAddKey)
}
{
api.GET("/s3", apiS3List)
}
{
api.GET("/files", apiFilesListDirs)
api.POST("/files/:dir", apiFilesUpload)

14
api/s3.go Normal file
View File

@@ -0,0 +1,14 @@
package api
import (
"github.com/gin-gonic/gin"
)
// GET /api/s3
func apiS3List(c *gin.Context) {
keys := []string{}
for k := range context.Config().S3PublishRoots {
keys = append(keys, k)
}
c.JSON(200, keys)
}