summaryrefslogtreecommitdiffstats
path: root/docker/s6/openssh
diff options
context:
space:
mode:
authorJean-Philippe Roemer <roemer.jp@gmail.com>2015-10-12 16:39:40 +0100
committerJean-Philippe Roemer <roemer.jp@gmail.com>2015-10-12 18:46:45 +0100
commit9cba6ff84b703f1b8b69dc58caefb377cd835936 (patch)
treed494f85242f07172edfa886917f016092a5b197a /docker/s6/openssh
parent570ddefc3259b8bebebf6db6b7d9029b749358f9 (diff)
downloadgitea-9cba6ff84b703f1b8b69dc58caefb377cd835936.tar.gz
gitea-9cba6ff84b703f1b8b69dc58caefb377cd835936.zip
Volumed data setup changed to allow #1759
- Volumed subfolder now created up in the ENTRYPOINT script, this way they are created before S6 even starts making VOLUME. - The subfolder will be created during VOLUME creation too as ENTRYPOINT script will be run before /bin/true - SSH Keys will now be created on a single key basis not replying on the existence of /data/ssh folder
Diffstat (limited to 'docker/s6/openssh')
-rwxr-xr-xdocker/s6/openssh/setup22
1 files changed, 18 insertions, 4 deletions
diff --git a/docker/s6/openssh/setup b/docker/s6/openssh/setup
index 5997a33659..7e74440d62 100755
--- a/docker/s6/openssh/setup
+++ b/docker/s6/openssh/setup
@@ -1,12 +1,26 @@
#!/bin/sh
-if ! test -d /data/ssh; then
- mkdir -p /data/ssh
+# Check if host keys are present, else create them
+if ! test -d /data/ssh/ssh_host_key; then
ssh-keygen -q -f /data/ssh/ssh_host_key -N '' -t rsa1
+fi
+
+if ! test -d /data/ssh/ssh_host_rsa_key; then
ssh-keygen -q -f /data/ssh/ssh_host_rsa_key -N '' -t rsa
+fi
+
+if ! test -d /data/ssh/ssh_host_dsa_key; then
ssh-keygen -q -f /data/ssh/ssh_host_dsa_key -N '' -t dsa
+fi
+
+if ! test -d /data/ssh/ssh_host_ecdsa_key; then
ssh-keygen -q -f /data/ssh/ssh_host_ecdsa_key -N '' -t ecdsa
+fi
+
+if ! test -d /data/ssh/ssh_host_ed25519_key; then
ssh-keygen -q -f /data/ssh/ssh_host_ed25519_key -N '' -t ed25519
- chown -R root:root /data/ssh/*
- chmod 600 /data/ssh/*
fi
+
+# Set correct right to ssh keys
+chown -R root:root /data/ssh/*
+chmod 600 /data/ssh/*