Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ configurations offered by this image.
You can pass this as an environment variable to container and it will customize the `admin`
user password. If this is not set, the `admin` user will have a blank password.

### JENKINS_LOW_SECURITY_DOMAIN

Specify a domain, such as `example.com`, which should have a "lower-security" treatment that
does not require user input when the Jenkins container connects to the domain via SSH.

This is intended for use in conjunction with git-based platform-as-a-service providers.

## Customization

Expand Down
6 changes: 6 additions & 0 deletions root/etc/confd/conf.d/ssh-config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[template]
src="ssh_config.tmpl"
dest="/root/.ssh/config"
keys=[
"/",
]
8 changes: 8 additions & 0 deletions root/etc/confd/templates/ssh_config.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Host bitbucket.org
StrictHostKeyChecking no
Host github.com
StrictHostKeyChecking no
{{if getenv "JENKINS_LOW_SECURITY_DOMAIN"}}
Host {{getenv "JENKINS_LOW_SECURITY_DOMAIN"}}
StrictHostKeyChecking no
{{end}}
8 changes: 5 additions & 3 deletions root/etc/cont-init.d/20-outrigger-private-key
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
KEY_BASE=/root/.ssh
KEY_FILE=$KEY_BASE/outrigger.key

if [ -e $KEY_FILE ]; then

if [ -e $KEY_FILE ] && [ ! -d $KEY_FILE ]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would that be a directory?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you mount a non existent file on your host with a volume mount an empty directory shows up on both sides.

then
echo "KEY_FILE found. Setting up key..."

else

echo "##############################################################"
Expand Down Expand Up @@ -38,3 +37,6 @@ chmod 600 $PRIVATE_KEY
# Make sure that commands don't need to prompt for host keys
ssh-keyscan -H bitbucket.org >> $KEY_BASE/known_hosts
ssh-keyscan -H github.com >> $KEY_BASE/known_hosts
if [[ "$JENKINS_LOW_SECURITY_DOMAIN" ]]; then
ssh-keyscan -H $JENKINS_LOW_SECURITY_DOMAIN >> $KEY_BASE/known_hosts
fi
4 changes: 0 additions & 4 deletions root/root/.ssh/config

This file was deleted.