From 8c06a00c2437d0facb61b251c10a4a5729369166 Mon Sep 17 00:00:00 2001 From: Ronan Le Martret Date: Tue, 27 Jun 2017 14:45:53 +0200 Subject: Update Readme file * Add systemd service file * Add autoconfig for ssh contener * Add http port conf to xds-server-start.sh script Signed-off-by: Ronan Le Martret --- scripts/xds-docker-create-container.sh | 21 +++++++++++++++++++++ scripts/xds-server-start.sh | 2 ++ 2 files changed, 23 insertions(+) (limited to 'scripts') diff --git a/scripts/xds-docker-create-container.sh b/scripts/xds-docker-create-container.sh index 46dde96..b75ecfd 100755 --- a/scripts/xds-docker-create-container.sh +++ b/scripts/xds-docker-create-container.sh @@ -103,5 +103,26 @@ if ($FORCE); then docker exec --user $DOCKER_USER ${NAME} bash -c "nohup /usr/local/bin/xds-server-start.sh" || exit 1 fi +echo "Copying your identity to container $NAME" +#wait ssh service +echo -n wait ssh service . +res=3 +max=30 +count=0 +while [ $res -ne 0 ] && [ $count -le $max ]; do + sleep 1 + docker exec ${NAME} bash -c "systemctl status ssh" 2>/dev/null 1>&2 + res=$? + echo -n "." + count=$(expr $count + 1); +done +echo + +ssh-keygen -R [$(hostname)]:$SSH_PORT -f ~/.ssh/known_hosts +docker exec ${NAME} bash -c "mkdir -p /home/devel/.ssh" +docker cp ~/.ssh/id_rsa.pub ${NAME}:/home/devel/.ssh/authorized_keys +docker exec ${NAME} bash -c "chown devel:devel -R /home/devel/.ssh ;chmod 0700 /home/devel/.ssh;chmod 0600 /home/devel/.ssh/*" +ssh -o StrictHostKeyChecking=no -p $SSH_PORT devel@$(hostname) exit + echo "You can now login using:" echo " ssh -p $SSH_PORT $DOCKER_USER@$(hostname)" diff --git a/scripts/xds-server-start.sh b/scripts/xds-server-start.sh index 601d912..dc108fe 100755 --- a/scripts/xds-server-start.sh +++ b/scripts/xds-server-start.sh @@ -8,6 +8,7 @@ [ -z "$XDS_WWWDIR" ] && XDS_WWWDIR=webapp/dist [ -z "$LOGLEVEL" ] && LOGLEVEL=info [ -z "$LOGDIR" ] && LOGDIR=/tmp/xds-server/logs +[ -z "PORT_SRV" ] && PORT_SRV=8000 [ -z "$PORT_GUI" ] && PORT_GUI=8384 [ -z "$API_KEY" ] && API_KEY="1234abcezam" [ -z "$UPDATE_XDS_TARBALL" ] && UPDATE_XDS_TARBALL=1 @@ -22,6 +23,7 @@ if [ ! -f "${XDS_CONFFILE}" ]; then [ ! -f "$XDS_WWWDIR/index.html" ] && { echo "Cannot determine XDS-server webapp directory."; exit 1; } cat < ${XDS_CONFFILE} { + "HTTPPort": ${PORT_SRV}, "webAppDir": "${XDS_WWWDIR}", "shareRootDir": "${XDS_SHAREDIR}", "logsDir": "${LOGDIR}", -- cgit 1.2.3-korg