feat(docker): allow user-customizable ssh host keys

There is a new ./data bind mount used here. If ssh_host_* keys are
in ./data when the git service starts, they'll override the
container-generated host keys.

Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
Kevin Morris 2021-11-20 18:40:32 -08:00
parent 233d25b1c3
commit ba3ef742ce
No known key found for this signature in database
GPG key ID: F7E46DED420788F3
2 changed files with 8 additions and 0 deletions

View file

@ -18,6 +18,7 @@ services:
restart: always restart: always
volumes: volumes:
- ${GIT_DATA_DIR}:/aurweb/aur.git - ${GIT_DATA_DIR}:/aurweb/aur.git
- ./data:/aurweb/data
- cache:/cache - cache:/cache
smartgit: smartgit:

View file

@ -60,6 +60,13 @@ sed -ri "s|^(ssh-cmdline) = .+|\1 = $ssh_cmdline|" $AUR_CONFIG_DEFAULTS
# Setup SSH Keys. # Setup SSH Keys.
ssh-keygen -A ssh-keygen -A
# In docker-compose.aur-dev.yml, we bind ./data to /aurweb/data.
# Production users wishing to include their own SSH keys should
# supply them in ./data.
if [ -d /aurweb/data ]; then
find /aurweb/data -type f -name 'ssh_host_*' -exec cp -vf "{}" /etc/ssh/ \;
fi
# Taken from INSTALL. # Taken from INSTALL.
mkdir -pv $GIT_REPO mkdir -pv $GIT_REPO