Skip to content

Commit

Permalink
Faucet configs cleanup (#259)
Browse files Browse the repository at this point in the history
Removing variables that aren't in use anymore.
Adding now required SMF_CONFIG_NETWORK variable.
  • Loading branch information
mutantcornholio committed Jun 23, 2023
1 parent aabf793 commit 448453d
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 65 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,11 @@ jobs:
env:
# TODO: rename the secret to avoid confusion
SMF_CONFIG_MATRIX_ACCESS_TOKEN: ${{ secrets.SMF_BOT_MATRIX_ACCESS_TOKEN }}
# TODO: remove these SMF_BACKEND_* / SMF_BOT_* vars after releasing corresponding faucet code
SMF_BOT_MATRIX_ACCESS_TOKEN: ${{ secrets.SMF_BOT_MATRIX_ACCESS_TOKEN }}
STAKING_MINER_CONFIG_SEED: ${{ secrets.STAKING_MINER_CONFIG_SEED }}
run: |
shopt -s globstar
for f in $(find **/ci/*-values.yaml); do
sed -i "s/__GITHUB_SECRET_SMF_CONFIG_MATRIX_ACCESS_TOKEN/$SMF_CONFIG_MATRIX_ACCESS_TOKEN/g" $f
# TODO: remove these SMF_BACKEND_* / SMF_BOT_* vars after releasing corresponding faucet code
sed -i "s/__GITHUB_SECRET_SMF_BOT_MATRIX_ACCESS_TOKEN/$SMF_BOT_MATRIX_ACCESS_TOKEN/g" $f
sed -i "s/__GITHUB_SECRET_STAKING_MINER_CONFIG_SEED/$STAKING_MINER_CONFIG_SEED/g" $f
done
if: steps.list-changed.outputs.changed
Expand Down
2 changes: 1 addition & 1 deletion charts/substrate-faucet/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: substrate-faucet
description: A Helm chart to deploy substrate-faucet
type: application
version: 2.2.0
version: 2.2.1
maintainers:
- name: Parity
url: https://github.com/paritytech/helm-charts
7 changes: 1 addition & 6 deletions charts/substrate-faucet/ci/kind-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,7 @@ faucet:
secret:
# your bot access token here is how to find it https://t2bot.io/docs/access_tokens/
SMF_CONFIG_MATRIX_ACCESS_TOKEN: "__GITHUB_SECRET_SMF_CONFIG_MATRIX_ACCESS_TOKEN"
# TODO: remove these SMF_BACKEND_* / SMF_BOT_* vars after releasing corresponding faucet code
SMF_BOT_MATRIX_ACCESS_TOKEN: "__GITHUB_SECRET_SMF_BOT_MATRIX_ACCESS_TOKEN"
config:
SMF_CONFIG_NETWORK: "rococo"
SMF_CONFIG_MATRIX_SERVER: "https://m.parity.io"
SMF_CONFIG_MATRIX_BOT_USER_ID: "@helm-charts-bot:parity.io"
# TODO: remove these SMF_BACKEND_* / SMF_BOT_* vars after releasing corresponding faucet code
SMF_BACKEND_RPC_ENDPOINT: "wss://westend-rpc.polkadot.io/"
SMF_BOT_MATRIX_SERVER: "https://m.parity.io"
SMF_BOT_MATRIX_BOT_USER_ID: "@helm-charts-bot:parity.io"
11 changes: 0 additions & 11 deletions charts/substrate-faucet/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ spec:
env:
- name: SMF_CONFIG_PORT
value: "5555"
# TODO: remove these SMF_BACKEND_* / SMF_BOT_* vars after releasing corresponding faucet code
- name: SMF_BACKEND_PORT
value: "5555"
{{- range $key, $val := .Values.faucet.secret }}
- name: {{ $key }}
valueFrom:
Expand All @@ -56,14 +53,6 @@ spec:
value: {{ now | date "2006-01-02T15:04:05" | quote }}
- name: SMF_CONFIG_EXTERNAL_ACCESS
value: {{ .Values.faucet.externalAccess | quote }}

# TODO: remove these SMF_BACKEND_* / SMF_BOT_* vars after releasing corresponding faucet code
- name: SMF_BACKEND_DEPLOYED_REF
value: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
- name: SMF_BACKEND_DEPLOYED_TIME
value: {{ now | date "2006-01-02T15:04:05" | quote }}
- name: SMF_BACKEND_EXTERNAL_ACCESS
value: {{ .Values.faucet.externalAccess | quote }}
ports:
- name: http
containerPort: 5555
Expand Down
45 changes: 2 additions & 43 deletions charts/substrate-faucet/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,10 @@ faucet:
##
SMF_CONFIG_MATRIX_ACCESS_TOKEN: "ThisIsNotARealAccessToken"

# TODO: remove these SMF_BACKEND_* / SMF_BOT_* vars after releasing corresponding faucet code
## @param faucet.secret.SMF_BACKEND_FAUCET_ACCOUNT_MNEMONIC Mnemonic seed for the faucet account
##
SMF_BACKEND_FAUCET_ACCOUNT_MNEMONIC: "this is a fake mnemonic"
## @param faucet.secret.SMF_BACKEND_RECAPTCHA_SECRET A secret recaptcha token used to validate external requests
##
SMF_BACKEND_RECAPTCHA_SECRET: "fakeRecaptchaSecret"
## @param faucet.secret.SMF_BOT_MATRIX_ACCESS_TOKEN Matrix Bot access token
##
SMF_BOT_MATRIX_ACCESS_TOKEN: "ThisIsNotARealAccessToken"

config:
## @param faucet.config.SMF_CONFIG_RPC_ENDPOINT WS RPC node endpoint
## @param faucet.config.SMF_CONFIG_NETWORK network name: rococo, westend, wococo, etc.
##
SMF_CONFIG_RPC_ENDPOINT: "wss://example.com/"
SMF_CONFIG_NETWORK: "rococo"
## @param faucet.config.SMF_CONFIG_MATRIX_SERVER Matrix server URL
##
SMF_CONFIG_MATRIX_SERVER: "https://matrix.org"
Expand All @@ -63,36 +52,6 @@ faucet:
##
SMF_CONFIG_FAUCET_IGNORE_LIST: ''

# TODO: remove these SMF_BACKEND_* / SMF_BOT_* vars after releasing corresponding faucet code
## @param faucet.config.SMF_BACKEND_RPC_ENDPOINT WS RPC node endpoint
##
SMF_BACKEND_RPC_ENDPOINT: "wss://example.com/"
## @param faucet.config.SMF_BACKEND_NETWORK_DECIMALS Number of decimal for the network
##
SMF_BACKEND_NETWORK_DECIMALS: 12
## @param faucet.config.SMF_BACKEND_INJECTED_TYPES To set if any type must be overriden
##
SMF_BACKEND_INJECTED_TYPES: '{}'
## @param faucet.config.SMF_BOT_DRIP_AMOUNT Default amount of tokens to send
##
SMF_BACKEND_FAUCET_BALANCE_CAP: 100
## @param faucet.config.SMF_BACKEND_FAUCET_BALANCE_CAP The bot wil verify this limit before
# sending tokens. If the account requesting tokens has more then the bot will not send tokens
##
SMF_BOT_DRIP_AMOUNT: 10
## @param faucet.config.SMF_BOT_MATRIX_SERVER Matrix server URL
##
SMF_BOT_MATRIX_SERVER: "https://matrix.org"
## @param faucet.config.SMF_BOT_MATRIX_BOT_USER_ID Bot user ID
##
SMF_BOT_MATRIX_BOT_USER_ID: "@test_bot_faucet:matrix.org"
## @param faucet.config.SMF_BOT_NETWORK_UNIT Token unit for the network
##
SMF_BOT_NETWORK_UNIT: "UNIT"
## @param faucet.config.SMF_BOT_FAUCET_IGNORE_LIST A list of Matrix accounts that will be silently ignored. Example: \"@alice:matrix.org,@bob:domain.com\"
##
SMF_BOT_FAUCET_IGNORE_LIST: ''


## @section Common parameters

Expand Down

0 comments on commit 448453d

Please sign in to comment.