File tree Expand file tree Collapse file tree 4 files changed +51
-3
lines changed
Expand file tree Collapse file tree 4 files changed +51
-3
lines changed Original file line number Diff line number Diff line change @@ -271,8 +271,9 @@ async def get_current_user_info(
271271 )
272272
273273 # Add is_admin field, debug_mode, and role
274+ # is_admin is true if: database flag OR email in ADMIN_EMAILS env var
274275 user_data = user_response .model_dump ()
275- user_data ['is_admin' ] = settings .is_admin (user .email )
276+ user_data ['is_admin' ] = user . is_admin or settings .is_admin (user .email )
276277 user_data ['debug_mode' ] = user .debug_mode
277278
278279 # Add role information with permissions
Original file line number Diff line number Diff line change @@ -191,12 +191,44 @@ postgresql+asyncpg://{{ $username }}:$(POSTGRES_PASSWORD)@{{ $host }}:{{ $port }
191191{{- end }}
192192
193193{{/*
194- Redis URL
194+ Redis secret name - Supports external secrets or subchart-generated secrets
195+ */ }}
196+ {{- define " myelectricaldata.redis.secretName" -}}
197+ {{- if .Values.redis.enabled }}
198+ {{- if .Values.redis.auth.existingSecret }}
199+ {{- .Values.redis.auth.existingSecret }}
200+ {{- else }}
201+ {{- printf " %s -redis" .Release.Name }}
202+ {{- end }}
203+ {{- else if .Values.externalRedis.existingSecret }}
204+ {{- .Values.externalRedis.existingSecret }}
205+ {{- else }}
206+ {{- printf " %s -external-redis" (include " myelectricaldata.fullname" . ) }}
207+ {{- end }}
208+ {{- end }}
209+
210+ {{/*
211+ Redis secret key - Returns the key name for the password in the secret
212+ */ }}
213+ {{- define " myelectricaldata.redis.secretKey" -}}
214+ {{- if .Values.redis.enabled }}
215+ {{- if .Values.redis.auth.existingSecret }}
216+ {{- .Values.redis.auth.existingSecretKey | default " redis-password" }}
217+ {{- else }}
218+ {{- " redis-password" }}
219+ {{- end }}
220+ {{- else }}
221+ {{- " password" }}
222+ {{- end }}
223+ {{- end }}
224+
225+ {{/*
226+ Redis URL - uses REDIS_PASSWORD env var for the password
195227*/ }}
196228{{- define " myelectricaldata.redisUrl" -}}
197229{{- $host := include " myelectricaldata.redis.host" . -}}
198230{{- $port := include " myelectricaldata.redis.port" . -}}
199- redis://{{ $host }}:{{ $port }}/0
231+ redis://: $ (REDIS_PASSWORD)@ {{ $host }}:{{ $port }}/0
200232{{- end }}
201233
202234{{/*
Original file line number Diff line number Diff line change 6767 key : {{ include "myelectricaldata.postgres.secretKey" . | trim }}
6868 - name : DATABASE_URL
6969 value : {{ include "myelectricaldata.databaseUrl" . | quote }}
70+ # Redis password MUST be defined before REDIS_URL for $(REDIS_PASSWORD) substitution
71+ - name : REDIS_PASSWORD
72+ valueFrom :
73+ secretKeyRef :
74+ name : {{ include "myelectricaldata.redis.secretName" . | trim }}
75+ key : {{ include "myelectricaldata.redis.secretKey" . | trim }}
7076 - name : REDIS_URL
7177 value : {{ include "myelectricaldata.redisUrl" . | quote }}
7278 - name : ENEDIS_ENVIRONMENT
Original file line number Diff line number Diff line change @@ -250,6 +250,15 @@ redis:
250250 tag : " 7-alpine"
251251 pullPolicy : IfNotPresent
252252
253+ # Redis authentication
254+ auth :
255+ # Option 1: Set password directly (Helm creates the secret)
256+ password : " "
257+ # Option 2: Use an existing secret with a generated password
258+ # The secret must contain the key specified in existingSecretKey
259+ existingSecret : " " # e.g., "redis-credentials"
260+ existingSecretKey : " redis-password" # Key containing the password in the secret
261+
253262 # Redis configuration
254263 config :
255264 maxmemory : " 256mb"
You can’t perform that action at this time.
0 commit comments