Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
stevekaplan123 committed Mar 22, 2022
2 parents 9bade14 + 3b98d18 commit 1789652
Show file tree
Hide file tree
Showing 18 changed files with 209 additions and 143 deletions.
22 changes: 0 additions & 22 deletions helm-chart/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -1,25 +1,3 @@
{{/*
Create the name of the local-settings secret
*/}}
{{/*{{- define "localSettings.env" }}
{{- range $key, $val := $.Values.localSettings }}
- name: {{ $key }}
valueFrom:
configMapKeyRef:
name: local-settings-{{ $.Values.deployEnv }}
key: {{ $key }}
{{- end }}
{{- end }}
*/}}

{{- define "secrets.localSettings" -}}
{{- if .Values.secrets.localSettings.ref }}
{{- .Values.secrets.localSettings.ref }}
{{- else -}}
local-settings-secrets-{{ .Values.deployEnv }}
{{- end }}
{{- end }}

{{- define "secrets.googleClient" }}
{{- if .Values.web.secrets.googleClient.ref -}}
{{- .Values.web.secrets.googleClient.ref }}
Expand Down
6 changes: 5 additions & 1 deletion helm-chart/templates/cronjob/daily-email-notifications.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ spec:
value: "varnish-{{ .Values.deployEnv }}-{{ .Release.Revision }}"
envFrom:
- secretRef:
name: {{ template "secrets.localSettings" . }}
name: {{ .Values.secrets.localSettings.ref }}
optional: true
- secretRef:
name: local-settings-secrets-{{ .Values.deployEnv }}
optional: true
- configMapRef:
name: local-settings-{{ .Values.deployEnv }}
volumeMounts:
Expand Down
6 changes: 5 additions & 1 deletion helm-chart/templates/cronjob/index-from-queue.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ spec:
value: "varnish-{{ .Values.deployEnv }}-{{ .Release.Revision }}"
envFrom:
- secretRef:
name: {{ template "secrets.localSettings" . }}
name: {{ .Values.secrets.localSettings.ref }}
optional: true
- secretRef:
name: local-settings-secrets-{{ .Values.deployEnv }}
optional: true
- configMapRef:
name: local-settings-{{ .Values.deployEnv }}
volumeMounts:
Expand Down
6 changes: 5 additions & 1 deletion helm-chart/templates/cronjob/metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ spec:
value: "varnish-{{ .Values.deployEnv }}-{{ .Release.Revision }}"
envFrom:
- secretRef:
name: {{ template "secrets.localSettings" . }}
name: {{ .Values.secrets.localSettings.ref }}
optional: true
- secretRef:
name: local-settings-secrets-{{ .Values.deployEnv }}
optional: true
- configMapRef:
name: local-settings-{{ .Values.deployEnv }}
volumeMounts:
Expand Down
6 changes: 5 additions & 1 deletion helm-chart/templates/cronjob/nation-builder-sync.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ spec:
value: "varnish-{{ .Values.deployEnv }}-{{ .Release.Revision }}"
envFrom:
- secretRef:
name: {{ template "secrets.localSettings" . }}
name: {{ .Values.secrets.localSettings.ref }}
optional: true
- secretRef:
name: local-settings-secrets-{{ .Values.deployEnv }}
optional: true
- configMapRef:
name: local-settings-{{ .Values.deployEnv }}
volumeMounts:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ spec:
value: "varnish-{{ .Values.deployEnv }}-{{ .Release.Revision }}"
envFrom:
- secretRef:
name: {{ template "secrets.localSettings" . }}
name: {{ .Values.secrets.localSettings.ref }}
optional: true
- secretRef:
name: local-settings-secrets-{{ .Values.deployEnv }}
optional: true
- configMapRef:
name: local-settings-{{ .Values.deployEnv }}
volumeMounts:
Expand Down
6 changes: 5 additions & 1 deletion helm-chart/templates/cronjob/reindex-elasticsearch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ spec:
key: slack-webhook
envFrom:
- secretRef:
name: {{ template "secrets.localSettings" . }}
name: {{ .Values.secrets.localSettings.ref }}
optional: true
- secretRef:
name: local-settings-secrets-{{ .Values.deployEnv }}
optional: true
- configMapRef:
name: local-settings-{{ .Values.deployEnv }}
volumeMounts:
Expand Down
6 changes: 5 additions & 1 deletion helm-chart/templates/cronjob/sitemaps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ spec:
value: "varnish-{{ .Values.deployEnv }}-{{ .Release.Revision }}"
envFrom:
- secretRef:
name: {{ template "secrets.localSettings" . }}
name: {{ .Values.secrets.localSettings.ref }}
optional: true
- secretRef:
name: local-settings-secrets-{{ .Values.deployEnv }}
optional: true
- configMapRef:
name: local-settings-{{ .Values.deployEnv }}
volumeMounts:
Expand Down
6 changes: 5 additions & 1 deletion helm-chart/templates/cronjob/topics-indexing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ spec:
value: "varnish-{{ .Values.deployEnv }}-{{ .Release.Revision }}"
envFrom:
- secretRef:
name: {{ template "secrets.localSettings" . }}
name: {{ .Values.secrets.localSettings.ref }}
optional: true
- secretRef:
name: local-settings-secrets-{{ .Values.deployEnv }}
optional: true
- configMapRef:
name: local-settings-{{ .Values.deployEnv }}
volumeMounts:
Expand Down
6 changes: 5 additions & 1 deletion helm-chart/templates/cronjob/weekly-email-notifications.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ spec:
value: "varnish-{{ .Values.deployEnv }}-{{ .Release.Revision }}"
envFrom:
- secretRef:
name: {{ template "secrets.localSettings" . }}
name: {{ .Values.secrets.localSettings.ref }}
optional: true
- secretRef:
name: local-settings-secrets-{{ .Values.deployEnv }}
optional: true
- configMapRef:
name: local-settings-{{ .Values.deployEnv }}
volumeMounts:
Expand Down
6 changes: 5 additions & 1 deletion helm-chart/templates/rollout/monitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ spec:
value: "varnish-{{ .Values.deployEnv }}-{{ .Release.Revision }}"
envFrom:
- secretRef:
name: {{ template "secrets.localSettings" . }}
name: {{ .Values.secrets.localSettings.ref }}
optional: true
- secretRef:
name: local-settings-secrets-{{ .Values.deployEnv }}
optional: true
- configMapRef:
name: local-settings-{{ .Values.deployEnv }}
resources: {{ toYaml .Values.monitor.resources | nindent 10 }}
Expand Down
6 changes: 5 additions & 1 deletion helm-chart/templates/rollout/web.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,11 @@ spec:
value: "{{ .Release.Revision }}"
envFrom:
- secretRef:
name: {{ template "secrets.localSettings" . }}
name: {{ .Values.secrets.localSettings.ref }}
optional: true
- secretRef:
name: local-settings-secrets-{{ .Values.deployEnv }}
optional: true
- configMapRef:
name: local-settings-{{ .Values.deployEnv }}
ports:
Expand Down
43 changes: 3 additions & 40 deletions helm-chart/templates/secret/local-settings.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.secrets.localSettings.DATABASES_HOST }}
{{- if .Values.secrets.localSettings.data }}
apiVersion: v1
kind: Secret
metadata:
Expand All @@ -8,44 +8,7 @@ metadata:
{{- include "sefaria.labels" . | nindent 4 }}
type: Opaque
data:
{{- with .Values.secrets.localSettings }}
DATABASES_HOST: {{ .DATABASES_HOST | b64enc }}
DATABASES_PASS: {{ .DATABASES_PASS | b64enc }}
DATABASES_USER: {{ .DATABASES_USER | b64enc }}
DATABASES_PORT: {{ .DATABASES_PORT | b64enc }}
GOOGLE_OAUTH2_CLIENT_ID: {{ .GOOGLE_OAUTH2_CLIENT_ID | b64enc }}
GOOGLE_OAUTH2_CLIENT_SECRET: {{ .GOOGLE_OAUTH2_CLIENT_SECRET | b64enc }}
SECRET_KEY: {{ .SECRET_KEY | b64enc }}
MANDRILL_API_KEY: {{ .MANDRILL_API_KEY | b64enc }}
SEFARIA_DB: {{ .SEFARIA_DB | b64enc }}
SEFARIA_DB_USER: {{ .SEFARIA_DB_USER | b64enc }}
SEFARIA_DB_PASSWORD: {{ .SEFARIA_DB_PASSWORD | b64enc }}
SEARCH_ADMIN_USER: {{ .SEARCH_ADMIN_USER | b64enc }}
SEARCH_ADMIN_PW: {{ .SEARCH_ADMIN_PW | b64enc }}
SEARCH_ADMIN_K8S: {{ .SEARCH_ADMIN_K8S | b64enc }}
TURN_SECRET: {{ .TURN_SECRET | b64enc }}
TURN_USER: {{ .TURN_USER | b64enc }}
SEFARIA_BOT_API_KEY: {{ .SEFARIA_BOT_API_KEY | b64enc }}
CLOUDFLARE_ZONE: {{ .CLOUDFLARE_ZONE | b64enc }}
CLOUDFLARE_EMAIL: {{ .CLOUDFLARE_EMAIL | b64enc }}
CLOUDFLARE_TOKEN: {{ .CLOUDFLARE_TOKEN | b64enc }}
GOOGLE_TAG_MANAGER_CODE: {{ .GOOGLE_TAG_MANAGER_CODE | b64enc }}
GOOGLE_ANALYTICS_CODE: {{ .GOOGLE_ANALYTICS_CODE | b64enc }}
GOOGLE_MAPS_API_KEY: {{ .GOOGLE_MAPS_API_KEY | b64enc }}
MIXPANEL_CODE: {{ .MIXPANEL_CODE | b64enc }}
HOTJAR_ID: {{ .HOTJAR_ID | b64enc }}
AWS_ACCESS_KEY: {{ .AWS_ACCESS_KEY | b64enc }}
AWS_SECRET_KEY: {{ .AWS_SECRET_KEY | b64enc }}
S3_BUCKET: {{ .S3_BUCKET | b64enc }}
NATIONBUILDER_TOKEN: {{ .NATIONBUILDER_TOKEN | b64enc }}
NATIONBUILDER_CLIENT_ID: {{ .NATIONBUILDER_CLIENT_ID | b64enc }}
NATIONBUILDER_CLIENT_SECRET: {{ .NATIONBUILDER_CLIENT_SECRET | b64enc }}
MAILCHIMP_API_KEY: {{ .MAILCHIMP_API_KEY | b64enc }}
MAILCHIMP_ANNOUNCE_ID: {{ .MAILCHIMP_ANNOUNCE_ID | b64enc }}
MAILCHIMP_WEBHOOK_KEY: {{ .MAILCHIMP_WEBHOOK_KEY | b64enc }}
RECAPTCHA_PUBLIC_KEY: {{ .RECAPTCHA_PUBLIC_KEY | b64enc }}
RECAPTCHA_PRIVATE_KEY: {{ .RECAPTCHA_PRIVATE_KEY | b64enc }}
SIMPLE_JWT_SIGNING_KEY: {{ .SIMPLE_JWT_SIGNING_KEY | b64enc }}
MOBILE_APP_KEY: {{ .MOBILE_APP_KEY | b64enc }}
{{- range $k, $v := .Values.secrets.localSettings.data }}
{{ $k }}: {{ $v | b64enc }}
{{- end }}
{{- end }}
88 changes: 44 additions & 44 deletions helm-chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -203,50 +203,50 @@ monitor:

secrets:
localSettings:
# If you're using a refenrece to an existing secret then the data: section
# should be commented out and vice-versa.
# A reference to a secret containing the local settings
ref:
# Add the value of these variables in the data: field for local use only.
# Also, it is understood that if you're adding one value you're adding
# all variable values
DATABASES_HOST:
DATABASES_PASS:
DATABASES_USER:
DATABASES_PORT:
GOOGLE_OAUTH2_CLIENT_ID:
GOOGLE_OAUTH2_CLIENT_SECRET:
SECRET_KEY:
MANDRILL_API_KEY:
SEFARIA_DB:
SEFARIA_DB_USER:
SEFARIA_DB_PASSWORD:
SEARCH_ADMIN_USER:
SEARCH_ADMIN_PW:
SEARCH_ADMIN_K8S:
TURN_SECRET:
TURN_USER:
SEFARIA_BOT_API_KEY:
CLOUDFLARE_ZONE:
CLOUDFLARE_EMAIL:
CLOUDFLARE_TOKEN:
GOOGLE_TAG_MANAGER_CODE:
GOOGLE_ANALYTICS_CODE:
GOOGLE_MAPS_API_KEY:
MIXPANEL_CODE:
HOTJAR_ID:
AWS_ACCESS_KEY:
AWS_SECRET_KEY:
S3_BUCKET:
NATIONBUILDER_TOKEN:
NATIONBUILDER_CLIENT_ID:
NATIONBUILDER_CLIENT_SECRET:
MAILCHIMP_API_KEY:
MAILCHIMP_ANNOUNCE_ID:
MAILCHIMP_WEBHOOK_KEY:
RECAPTCHA_PUBLIC_KEY:
RECAPTCHA_PRIVATE_KEY:
SIMPLE_JWT_SIGNING_KEY:
MOBILE_APP_KEY:
# The data keys can be used to override values in the local settings secret.
# This is intended for local development use and CI, do not use this in
# production.
#data:
# DATABASES_HOST:
# DATABASES_PASS:
# DATABASES_USER:
# DATABASES_PORT:
# GOOGLE_OAUTH2_CLIENT_ID:
# GOOGLE_OAUTH2_CLIENT_SECRET:
# SECRET_KEY:
# MANDRILL_API_KEY:
# SEFARIA_DB:
# SEFARIA_DB_USER:
# SEFARIA_DB_PASSWORD:
# SEARCH_ADMIN_USER:
# SEARCH_ADMIN_PW:
# SEARCH_ADMIN_K8S:
# TURN_SECRET:
# TURN_USER:
# SEFARIA_BOT_API_KEY:
# CLOUDFLARE_ZONE:
# CLOUDFLARE_EMAIL:
# CLOUDFLARE_TOKEN:
# GOOGLE_TAG_MANAGER_CODE:
# GOOGLE_ANALYTICS_CODE:
# GOOGLE_MAPS_API_KEY:
# MIXPANEL_CODE:
# HOTJAR_ID:
# AWS_ACCESS_KEY:
# AWS_SECRET_KEY:
# S3_BUCKET:
# NATIONBUILDER_TOKEN:
# NATIONBUILDER_CLIENT_ID:
# NATIONBUILDER_CLIENT_SECRET:
# MAILCHIMP_API_KEY:
# MAILCHIMP_ANNOUNCE_ID:
# MAILCHIMP_WEBHOOK_KEY:
# RECAPTCHA_PUBLIC_KEY:
# RECAPTCHA_PRIVATE_KEY:
# SIMPLE_JWT_SIGNING_KEY:
# MOBILE_APP_KEY:
backupManager:
# If you're using a reference to an existing secret then the data: section
# should be commented out and vice-versa.
Expand All @@ -256,7 +256,7 @@ secrets:
# serviceAccount:
# This is used in mongobackup & reindex-elasticsearch cron jobs.
slackWebhook:
# If you're using a refenrece to an existing secret then the data: section
# If you're using a reference to an existing secret then the data: section
# should be commented out and vice-versa.
ref:
# data:
Expand Down
1 change: 1 addition & 0 deletions static/css/s2.css
Original file line number Diff line number Diff line change
Expand Up @@ -3105,6 +3105,7 @@ a.navBlockTitle:hover {
}
.textTableOfContents .torahNavParshiot .tocLevel .schema-node-toc {
flex: 1 1 50%;
text-decoration: none;
}
.textTableOfContents > .tocLevel > .schema-node-toc {
margin: 10px 0;
Expand Down
Loading

0 comments on commit 1789652

Please sign in to comment.