Skip to content

Commit

Permalink
Optionally deploy frontend + add validations
Browse files Browse the repository at this point in the history
  • Loading branch information
harryttd committed Aug 18, 2023
1 parent 55ee748 commit 226a1f7
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 12 deletions.
10 changes: 6 additions & 4 deletions charts/tezos-faucet/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.enableUI }}
apiVersion: v1
kind: ConfigMap
metadata:
Expand All @@ -11,17 +12,18 @@ data:
{{- end }}
{{- $_ := set .Values.config.application "profiles" $newProfiles }}
{{ .Values.config | mustToPrettyJson | indent 4 }}

---
{{- end }}

apiVersion: v1
kind: ConfigMap
metadata:
name: faucet-backend-config
namespace: {{ .Release.Namespace }}
data:
AUTHORIZED_HOST: {{ .Values.authorizedHost }}
AUTHORIZED_HOST: "{{ .Values.authorizedHost }}"
DISABLE_CHALLENGES: "{{ .Values.disableChallenges }}"
ENABLE_CAPTCHA: "{{ .Values.enableCaptcha }}"
MAX_BALANCE: "{{ .Values.maxBalance }}"
REDIS_URL: {{ .Values.redis.url }}
RPC_URL: {{ .Values.config.network.rpcUrl }}
REDIS_URL: "{{ .Values.redis.url }}"
RPC_URL: "{{ required "config.network.rpcUrl is required." .Values.config.network.rpcUrl }}"
4 changes: 3 additions & 1 deletion charts/tezos-faucet/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ spec:
# https://helm.sh/docs/howto/charts_tips_and_tricks/#automatically-roll-deployments
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
spec:
restartPolicy: Always
containers:
- image: {{ .Values.images.tezosFaucetBackend }}
name: faucet-backend
Expand All @@ -29,6 +30,7 @@ spec:
name: faucet-backend-config
- secretRef:
name: faucet-backend-secret
{{- if .Values.enableUI }}
- image: {{ .Values.images.tezosFaucet }}
name: faucet
ports:
Expand All @@ -40,8 +42,8 @@ spec:
mountPath: /app/public/config.json
subPath: config.json
readOnly: true
restartPolicy: Always
volumes:
- name: faucet-config
configMap:
name: faucet-config
{{- end }}
6 changes: 5 additions & 1 deletion charts/tezos-faucet/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ $fullName }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "tezos-faucet.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
Expand Down Expand Up @@ -48,11 +49,14 @@ spec:
port:
number: 3000
{{- end }}

{{- if .Values.enableUI }}
- path: /
pathType: 'Prefix'
pathType: Prefix
backend:
service:
name: {{ $fullName }}
port:
number: 8080
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/tezos-faucet/templates/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ metadata:
namespace: {{ .Release.Namespace }}
data:
CAPTCHA_SECRET: {{ .Values.googleCaptchaSecretKey | b64enc }}
FAUCET_PRIVATE_KEY: {{ .Values.faucetPrivateKey | b64enc }}
FAUCET_PRIVATE_KEY: {{ required "faucetPrivateKey is required." .Values.faucetPrivateKey | b64enc }}
REDIS_PASSWORD: {{ .Values.redis.password | b64enc }}
6 changes: 4 additions & 2 deletions charts/tezos-faucet/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@ metadata:
namespace: {{ .Release.Namespace }}
spec:
type: NodePort
selector:
app: tezos-faucet
ports:
{{- if .Values.enableUI }}
- name: frontend
port: 8080
targetPort: frontend
protocol: TCP
{{- end }}
- name: backend
port: 3000
targetPort: backend
protocol: TCP
selector:
app: tezos-faucet
9 changes: 6 additions & 3 deletions charts/tezos-faucet/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,19 @@ images:
tezosFaucet: ghcr.io/oxheadalpha/tezos-faucet:latest
tezosFaucetBackend: ghcr.io/oxheadalpha/tezos-faucet-backend:latest

# Frontend application configuration.
# Frontend app configuration. You can optionally deploy only the faucet backend.
enableUI: true
config:
application:
name: "Tezos Faucet"
googleCaptchaSiteKey: "" # 6LefC8QmAAAAAIX...
backendUrl: "" # http://faucet-backend:3000
# Default value assumes faucet backend is available on localhost.
backendUrl: http://localhost:3000
githubRepo: https://github.com/oxheadalpha/tezos-faucet
network:
name: Custom
rpcUrl: "" # http://tezos-node-rpc:8732
# Default value assumes node rpc is available on localhost.
rpcUrl: http://localhost:8732
faucetAddress: "" # tz1PW...
viewer: "" # https://network.tzstats.com

Expand Down

0 comments on commit 226a1f7

Please sign in to comment.