_configuration.tpl 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. {{- define "storj.configuration" -}}
  2. secret:
  3. storj:
  4. enabled: true
  5. data:
  6. authToken: {{ .Values.storjConfig.authToken | quote }}
  7. storj-config:
  8. enabled: true
  9. data:
  10. EMAIL: {{ .Values.storjConfig.email }}
  11. STORAGE: {{ printf "%vGB" .Values.storjConfig.storageSizeGB }}
  12. ADDRESS: {{ printf "%s:%v" .Values.storjConfig.domainAddress .Values.storjNetwork.p2pPort }}
  13. WALLET: {{ .Values.storjConfig.wallet | quote }}
  14. configmap:
  15. storj:
  16. enabled: true
  17. data:
  18. init_config.sh: |
  19. #!/bin/sh
  20. echo "Checking for identity certificate"
  21. if ! [ -f ${DEFAULT_CERT_PATH} ] && ! [ -f ${DEFAULT_IDENTITY_CERT_PATH} ]; then
  22. echo "Downloading identity generator tool"
  23. curl -L https://github.com/storj/storj/releases/latest/download/identity_linux_amd64.zip -o identity_linux_amd64.zip
  24. unzip -o identity_linux_amd64.zip
  25. chmod +x identity
  26. echo "Generating identity certificate"
  27. ./identity create storagenode
  28. echo "Authorizing identity certificate"
  29. ./identity authorize storagenode ${AUTH_KEY}
  30. echo "Storagenode identity certificate generated"
  31. chown -R {{ .Values.storjRunAs.user }}:{{ .Values.storjRunAs.group }} {{ template "storj.idPath" }}
  32. else
  33. echo "Identity certificate already exists"
  34. fi
  35. {{- end -}}
  36. {{- define "storj.args" -}}
  37. {{- $wallets := list -}}
  38. {{- if .Values.storjConfig.wallets.zkSync -}}
  39. {{- $wallets = mustAppend $wallets "zksync" -}}
  40. {{- end -}}
  41. {{- if .Values.storjConfig.wallets.zkSyncEra -}}
  42. {{- $wallets = mustAppend $wallets "zksync-era" -}}
  43. {{- end -}}
  44. {{- if $wallets -}}
  45. args:
  46. - --operator.wallet-features={{ join "," $wallets }}
  47. {{- end -}}
  48. {{- end -}}
  49. {{- define "storj.idPath" -}}
  50. {{- print "/root/.local/share/storj/identity/storagenode" -}}
  51. {{- end -}}