Files
aptly/api/s3.go
T
André Roth c63324756b s3: fix pathCache race condition
Make sure pathCache is properly locked for concurrent access.

Add RWMutex to the PublishedStorage struct:
- Cache initialization
  Read-lock to test for nil, then write-lock with a second nil check before populating
- Cache reads
  RLock/RUnlock, allowing concurrent readers
- Cache writes / deletes
  Lock/Unlock
2026-06-19 12:53:44 +02:00

23 lines
461 B
Go

package api
import (
"github.com/gin-gonic/gin"
)
// @Summary S3 buckets
// @Description **Get list of S3 buckets**
// @Description
// @Description List configured S3 buckets.
// @Tags Status
// @Produce json
// @Success 200 {array} string "List of S3 buckets"
// @Router /api/s3 [get]
func apiS3List(c *gin.Context) {
keys := []string{}
s3Roots := context.Config().S3PublishRoots
for k := range s3Roots {
keys = append(keys, k)
}
c.JSON(200, keys)
}