feat(docker): allow configurable SSH_CMDLINE in git service

Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
Kevin Morris 2021-11-20 19:03:35 -08:00
parent ba3ef742ce
commit a1e547c057
No known key found for this signature in database
GPG key ID: F7E46DED420788F3
3 changed files with 7 additions and 2 deletions

View file

@ -16,6 +16,10 @@ services:
git:
restart: always
environment:
- AUR_CONFIG=/aurweb/conf/config
# SSH_CMDLINE should be updated to production's ssh cmdline.
- SSH_CMDLINE=${SSH_CMDLINE:-ssh ssh://aur@localhost:2222}
volumes:
- ${GIT_DATA_DIR}:/aurweb/aur.git
- ./data:/aurweb/data

View file

@ -100,6 +100,7 @@ services:
init: true
environment:
- AUR_CONFIG=/aurweb/conf/config
- SSH_CMDLINE=${SSH_CMDLINE:-ssh ssh://aur@localhost:2222}
entrypoint: /docker/git-entrypoint.sh
command: /docker/scripts/run-sshd.sh
ports:

View file

@ -54,8 +54,8 @@ fi
# Set some defaults needed for pathing and ssh uris.
sed -ri "s|^(repo-path) = .+|\1 = /aurweb/aur.git/|" $AUR_CONFIG_DEFAULTS
ssh_cmdline='ssh ssh://aur@localhost:2222'
sed -ri "s|^(ssh-cmdline) = .+|\1 = $ssh_cmdline|" $AUR_CONFIG_DEFAULTS
# SSH_CMDLINE can be provided via override in docker-compose.aur-dev.yml.
sed -ri "s|^(ssh-cmdline) = .+$|\1 = ${SSH_CMDLINE}|" $AUR_CONFIG_DEFAULTS
# Setup SSH Keys.
ssh-keygen -A