diff --git a/Dockerfile b/Dockerfile index c82884a..bfb5fd3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,8 @@ WORKDIR /usr/src/app RUN addgroup -S s3manager && adduser -S s3manager -G s3manager RUN apk add --no-cache \ ca-certificates \ - dumb-init + dumb-init \ + tzdata COPY --from=builder --chown=s3manager:s3manager /usr/src/app/bin/s3manager ./ USER s3manager EXPOSE 8080 diff --git a/README.md b/README.md index dfdd6fd..a1c8e13 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ The application can be configured with the following environment variables: - `ALLOW_DELETE`: Enable buttons to delete objects (defaults to `true`) - `FORCE_DOWNLOAD`: Add response headers for object downloading instead of opening in a new tab (defaults to `true`) - `LIST_RECURSIVE`: List all objects in buckets recursively (defaults to `false`) +- `TZ`: IANA timezone used when displaying object Last Modified times (defaults to UTC; for example `Europe/Berlin`) - `BUCKET_NAME`: Restrict the buckets view to a single named bucket (defaults to unset, showing all buckets) - `USE_IAM`: Use IAM role instead of key pair (defaults to `false`) - `IAM_ENDPOINT`: Endpoint for IAM role retrieving (Can be blank for AWS) diff --git a/main.go b/main.go index aba499f..a0c5c58 100644 --- a/main.go +++ b/main.go @@ -9,6 +9,7 @@ import ( "os" "strings" "time" + _ "time/tzdata" "github.com/cloudlena/adapters/logging" "github.com/cloudlena/s3manager/internal/app/s3manager" diff --git a/web/template/bucket.html.tmpl b/web/template/bucket.html.tmpl index 0046be9..37fb392 100644 --- a/web/template/bucket.html.tmpl +++ b/web/template/bucket.html.tmpl @@ -216,7 +216,7 @@ {{ $object.SizeDisplay }} {{ $object.Owner }} - {{ $object.LastModified }} + {{ $object.LastModified.Local.Format "2006-01-02 15:04:05 MST" }} {{ if not $object.IsFolder }}