Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update tezos-faucet chart for latest faucet code #606

Merged
merged 1 commit into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions charts/tezos-faucet/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,9 @@ metadata:
namespace: {{ .Release.Namespace }}
data:
config.json: |
{{- $newProfiles := dict }}
{{- range $key, $value := .Values.profiles }}
{{- $newProfiles = set $newProfiles $key (pick $value "amount" "profile") }}
{{- end }}
{{- $_ := set .Values.config.application "profiles" $newProfiles }}
{{- $_ := set .Values.config.application "disableChallenges" .Values.disableChallenges }}
{{- $_ := set .Values.config.application "minTez" .Values.minTez }}
{{- $_ := set .Values.config.application "maxTez" .Values.maxTez }}
{{ .Values.config | mustToPrettyJson | indent 4 }}
---
{{- end }}
Expand All @@ -22,11 +19,16 @@ metadata:
name: faucet-backend-config
namespace: {{ .Release.Namespace }}
data:
profiles.json: {{ .Values.profiles | mustToPrettyJson | quote }}

AUTHORIZED_HOST: "{{ .Values.authorizedHost }}"
DISABLE_CHALLENGES: "{{ .Values.disableChallenges }}"
ENABLE_CAPTCHA: "{{ .Values.enableCaptcha }}"
MAX_BALANCE: "{{ .Values.maxBalance }}"
REDIS_URL: "{{ .Values.redis.url }}"
RPC_URL: "{{ .Values.backendRpcUrl | default .Values.config.network.rpcUrl | required "An rpc url is required." }}"
MIN_TEZ: "{{ .Values.minTez }}"
MAX_TEZ: "{{ .Values.maxTez }}"
MIN_CHALLENGES: "{{ .Values.minChallenges }}"
MAX_CHALLENGES: "{{ .Values.maxChallenges }}"
MAX_CHALLENGES_WITH_CAPTCHA: "{{ .Values.maxChallengesWithCaptcha }}"
CHALLENGE_SIZE: "{{ .Values.challengeSize }}"
DIFFICULTY: "{{ .Values.difficulty }}"
11 changes: 0 additions & 11 deletions charts/tezos-faucet/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,6 @@ spec:
name: faucet-backend-config
- secretRef:
name: faucet-backend-secret
env:
# profiles.json is stored in faucet-backend-config instead of in a new
# dedicated configmap. We don't need it to be an env var so we make it
# empty here to counteract envFrom.
- name: profiles.json
value: ""
volumeMounts:
- name: faucet-backend-config
mountPath: /app/dist/profiles.json
subPath: profiles.json
readOnly: true
{{- if .Values.enableUI }}
- name: faucet
image: {{ .Values.images.tezosFaucet }}
Expand Down
44 changes: 18 additions & 26 deletions charts/tezos-faucet/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# Faucet frontend: https://github.com/oxheadalpha/tezos-faucet

images:
tezosFaucet: ghcr.io/oxheadalpha/tezos-faucet:2.0.0
tezosFaucetBackend: ghcr.io/oxheadalpha/tezos-faucet-backend:2.0.0
tezosFaucet: ghcr.io/oxheadalpha/tezos-faucet:2.1.0
tezosFaucetBackend: ghcr.io/oxheadalpha/tezos-faucet-backend:2.1.0

# Frontend app configuration. You can optionally deploy only the faucet backend.
enableUI: true
Expand All @@ -28,34 +28,26 @@ authorizedHost: "*"
backendRpcUrl: http://tezos-node-rpc:8732
# If the backend requires CAPTCHA tokens to be submitted.
enableCaptcha: true
# Faucet won't dispense to an address if its balance exceeds this.
# Faucet won't dispense to an address if its balance will exceed this.
maxBalance: 6000

# Configuration for the faucet profiles. To prevent spamming and abuse, each
# profile has specific parameters that control the distribution of Tez and the
# complexity and number of PoW challenges needed.
# - `profile`: The name of the profile.
# - `amount`: Amount of Tez to be distributed for this profile.
# - `challengesNeeded`: Number of challenges given when CAPTCHA isn't used.
# - `challengesNeededWithCaptcha`: Number of challenges given when CAPTCHA is used.
# - `difficulty`: Challenge difficulty level when CAPTCHA isn't used.
# - `difficultyWithCaptcha`: Challenge difficulty level when CAPTCHA is used.
profiles:
user:
amount: 1
challengesNeeded: 5
challengesNeededWithCaptcha: 4
difficulty: 4
difficultyWithCaptcha: 3
baker:
amount: 6000
challengesNeeded: 6
challengesNeededWithCaptcha: 5
difficulty: 5
difficultyWithCaptcha: 4
# The minimum Tez allowed per request.
minTez: 1
# The maximum Tez allowed per request.
maxTez: 6000

# Set to true to disable the requirement of solving PoW challenges.
disableChallenges: false
# Minimum number of challenges required for the minimum Tez request.
minChallenges: 1
# Maximum number of challenges required for the maximum Tez request.
maxChallenges: 550
# Maximum number of challenges required for the maximum Tez request when a
# captcha is used.
maxChallengesWithCaptcha: 66
# How many bytes the challenge string should be.
challengeSize: 2048
# Difficulty level for challenges.
difficulty: 4

# Config for the Redis backend for the PoW challenges. Redis is not needed if
# challenges are disabled.
Expand Down