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

Add support for custom scripts #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
10 changes: 10 additions & 0 deletions templates/custom-scripts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{{- if .Values.sftpConfig.customScripts }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "sftp-server.fullname" . }}-custom-scripts
data:
{{- range $k, $v := .Values.sftpConfig.customScripts }}
{{ $k }}: {{ $v | toYaml | indent 2 }}
{{- end }}
{{- end }}
10 changes: 10 additions & 0 deletions templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ spec:
subPath: {{ . }}
{{- end }}
{{- end }}
{{- if .Values.sftpConfig.customScripts }}
- name: custom-scripts
mountPath: /etc/sftp.d
{{- end }}
livenessProbe:
tcpSocket:
port: 22
Expand Down Expand Up @@ -120,6 +124,12 @@ spec:
secretName: {{ .Values.sftpConfig.hostKeys.secret }}
defaultMode: 384
{{- end }}
{{- if .Values.sftpConfig.customScripts }}
- name: custom-scripts
configMap:
name: {{ include "sftp-server.fullname" . }}-custom-scripts
defaultMode: 0755
{{- end }}
{{- if .Values.persistentVolume.enabled }}
- name: data
persistentVolumeClaim:
Expand Down
1 change: 1 addition & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ sftpConfig:
#- ssh_host_rsa_key
#- ssh_host_ed25519_key
authorizedKeys: {}
#customScripts: {}

debug:
enabled: false
Expand Down