Initial version of the magic ssh server

This commit is contained in:
Tom Wiesing 2020-07-29 14:44:31 +02:00
parent f44693f1f2
commit a7c4ded7e9
No known key found for this signature in database
GPG key ID: DC1F29F2BC78AB15
15 changed files with 84 additions and 7 deletions

View file

@ -77,5 +77,8 @@ CMD ["apache2-foreground"]
# Add the provision script
ADD scripts/provision_container.sh /provision_container.sh
# Add the user_shell.sh
ADD scripts/user_shell.sh /user_shell.sh
# expose port 8080
EXPOSE 8080

View file

@ -4,6 +4,7 @@ services:
barrel:
build: .
restart: always
hostname: ${VIRTUAL_HOST}
environment:
# port and hostname for this image to use
VIRTUAL_HOST: ${VIRTUAL_HOST}
@ -16,11 +17,14 @@ services:
# label it with the current slug
labels:
eu.wiss-ki.barrel.slug: ${SLUG}
eu.wiss-ki.barrel.authfile: /var/www/.ssh/authorized_keys,/var/www/.ssh/global_authorized_keys
# the volumes to
# volumes that are mounted
volumes:
- ${GLOBAL_AUTHORIZED_KEYS_FILE}:/var/www/.ssh/global_authorized_keys:ro
- ${REAL_PATH}/.composer:/var/www/.composer
- ${REAL_PATH}/data:/var/www/data
- ${REAL_PATH}/authorized_keys:/var/www/.ssh/authorized_keys
networks:
default:

View file

@ -0,0 +1,5 @@
#!/bin/bash
# This script is used to start a user shell inside the docker container.
cd "/var/www/data/project"
sudo -u www-data /bin/bash "$@"

View file

@ -0,0 +1,17 @@
version: "3.7"
services:
ssh:
image: tkw01536/proxyssh
command: -hostkey /keys/hostkey -shell /user_shell.sh -keylabel eu.wiss-ki.barrel.authfile -userlabel eu.wiss-ki.barrel.slug -L triplestore:7200
ports:
- "2222:2222"
volumes:
- './data/keys:/keys'
- '/var/run/docker.sock:/var/run/docker.sock:ro'
restart: always
networks:
default:
external:
name: distillery