trying to get anonymous access for buckets working

This commit is contained in:
Max Roby 2023-11-23 13:23:51 +01:00 committed by Chris Lu
parent ac6158818b
commit f33f7c10f0
2 changed files with 15 additions and 6 deletions

View file

@ -50,11 +50,18 @@ spec:
- "/bin/sh"
- "-ec"
- |
{{- range $.Values.filer.s3.createBuckets }}
{{- range $reg, $props := $.Values.filer.s3.createBuckets }}
exec /bin/echo \
"s3.bucket.create --name {{ . }}" |\
"s3.bucket.create --name {{ $props.name }}" |\
/usr/bin/weed shell
{{- end }}
{{- range $reg, $props := $.Values.filer.s3.createBuckets }}
{{- if $props.anonymousRead }}
exec /bin/echo \
"s3.configure --user anonymous --buckets {{ $props.name }}" |\
/usr/bin/weed shell
{{- end }}
{{- end }}
ports:
- containerPort: {{ .Values.master.port }}
name: swfs-master

View file

@ -580,11 +580,13 @@ filer:
# The user's credentials must be in an existing secret using the key names:
# 'ACCESS_KEY_ID' and 'ACCESS_SECRET_KEY'
# createBuckets:
# - bucket-a
# - bucket-b
# - name: bucket-a
# anonymousRead: true
# - name: bucket-b
# anonymousRead: false
# createUsers:
# - name: friend
# actions: "read,write,list"
# actions: "Read,Write,List"
# buckets: "bucket-b"
# secretName: friend_s3_creds