From 493f0600bf01c009bd26b3f4fa9d33e503cd7035 Mon Sep 17 00:00:00 2001 From: butlerx Date: Thu, 27 Aug 2020 21:35:20 +0100 Subject: [PATCH] update base container to node 10 --- Dockerfile | 11 +++++++---- docker-compose.yml | 5 ++--- package.json | 2 +- src/server/command/ssh.ts | 14 +++++++++++--- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1f65d28..12db737 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:carbon-alpine as builder +FROM node:dubnium-alpine as builder RUN apk add -U build-base python WORKDIR /usr/src/app COPY . /usr/src/app @@ -6,7 +6,7 @@ RUN yarn && \ yarn build && \ yarn install --production --ignore-scripts --prefer-offline -FROM node:carbon-alpine +FROM node:dubnium-alpine LABEL maintainer="butlerx@notthe.cloud" WORKDIR /usr/src/app ENV NODE_ENV=production @@ -17,6 +17,9 @@ COPY package.json /usr/src/app COPY index.js /usr/src/app RUN apk add -U openssh-client sshpass && \ mkdir ~/.ssh && \ - ssh-keyscan -H wetty-ssh >> ~/.ssh/known_hosts + echo '#!/usr/bin/env sh' >> /entrypoint.sh && \ + echo 'ssh-keyscan -H wetty-ssh >> ~/.ssh/known_hosts' >> /entrypoint.sh && \ + echo 'node .' >> /entrypoint.sh && \ + chmod +x /entrypoint.sh -ENTRYPOINT [ "node", "." ] +ENTRYPOINT [ "/entrypoint.sh" ] diff --git a/docker-compose.yml b/docker-compose.yml index fd7ed97..7709e2c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,7 +3,7 @@ version: '3.5' services: wetty: build: . - image: butlerx/wetty + image: wettyoss/wetty container_name: wetty tty: true working_dir: /usr/src/app @@ -13,7 +13,6 @@ services: SSHHOST: 'wetty-ssh' SSHPORT: 22 NODE_ENV: 'development' - command: yarn start --sshhost redbrick.dcu.ie web: image: nginx @@ -37,7 +36,7 @@ services: build: context: . dockerfile: ssh.Dockerfile - image: butlerx/wetty:ssh + image: wettyoss/wetty:ssh container_name: 'wetty-ssh' networks: diff --git a/package.json b/package.json index d091b48..cac59d6 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "wetty": "./index.js" }, "engines": { - "node": ">=6.9" + "node": ">=10.22" }, "nodemonConfig": { "ignore": [ diff --git a/src/server/command/ssh.ts b/src/server/command/ssh.ts index c7ad0df..fc0e761 100644 --- a/src/server/command/ssh.ts +++ b/src/server/command/ssh.ts @@ -3,11 +3,19 @@ import parseCommand from './parse'; import logger from '../utils/logger'; export default function sshOptions( - { pass, path, command, host, port, auth, knownhosts }: { [s: string]: string }, + { + pass, + path, + command, + host, + port, + auth, + knownhosts, + }: { [s: string]: string }, key?: string ): string[] { const cmd = parseCommand(command, path); - const hostChecking = (knownhosts !== '/dev/null') ? 'yes' : 'no' + const hostChecking = knownhosts !== '/dev/null' ? 'yes' : 'no'; const sshRemoteOptsBase = [ 'ssh', host, @@ -18,7 +26,7 @@ export default function sshOptions( `PreferredAuthentications=${auth}`, '-o', `UserKnownHostsFile=${knownhosts}`, - '-o', + '-o', `StrictHostKeyChecking=${hostChecking}`, ]; logger.info(`Authentication Type: ${auth}`);