Browse Source

set node boron as min engine requirements

pull/126/head
butlerx 7 years ago
parent
commit
e43fe267c1
No known key found for this signature in database GPG Key ID: B37CA765BAA89170
  1. 2
      .prettierrc.js
  2. 4
      Dockerfile
  3. 2
      lib/command.mjs
  4. 2
      lib/emitter.mjs
  5. 2
      lib/index.mjs
  6. 5
      lib/logger.mjs
  7. 2
      lib/server.mjs
  8. 3
      package.json

2
.prettierrc.js

@ -1,6 +1,6 @@
module.exports = { module.exports = {
singleQuote: true, singleQuote: true,
trailingComma: 'all', trailingComma: 'es5',
proseWrap: 'always', proseWrap: 'always',
overrides: [ overrides: [
{ {

4
Dockerfile

@ -1,4 +1,4 @@
FROM node:alpine as builder FROM node:boron-alpine as builder
WORKDIR /usr/src/app WORKDIR /usr/src/app
COPY . /usr/src/app COPY . /usr/src/app
RUN apk add -U build-base python && \ RUN apk add -U build-base python && \
@ -6,7 +6,7 @@ RUN apk add -U build-base python && \
yarn build && \ yarn build && \
yarn install --production --ignore-scripts --prefer-offline yarn install --production --ignore-scripts --prefer-offline
FROM node:alpine FROM node:boron-alpine
LABEL maintainer="butlerx@notthe.cloud" LABEL maintainer="butlerx@notthe.cloud"
WORKDIR /app WORKDIR /app
ENV NODE_ENV=production ENV NODE_ENV=production

2
lib/command.mjs

@ -4,7 +4,7 @@ const localhost = host =>
export default ( export default (
{ request: { headers }, client: { conn } }, { request: { headers }, client: { conn } },
{ user, host, port, auth }, { user, host, port, auth }
) => ({ ) => ({
args: localhost(host) args: localhost(host)
? ['login', '-h', conn.remoteAddress.split(':')[3]] ? ['login', '-h', conn.remoteAddress.split(':')[3]]

2
lib/emitter.mjs

@ -27,7 +27,7 @@ class WeTTy extends EventEmitter {
start( start(
{ user = '', host = 'localhost', auth = 'password', port = 22 }, { user = '', host = 'localhost', auth = 'password', port = 22 },
serverPort = 3000, serverPort = 3000,
{ key, cert }, { key, cert }
) { ) {
return loadSSL(key, cert).then(ssl => { return loadSSL(key, cert).then(ssl => {
const io = server(serverPort, ssl); const io = server(serverPort, ssl);

2
lib/index.mjs

@ -71,7 +71,7 @@ export default class {
port: sshport, port: sshport,
}, },
port, port,
{ key: sslkey, cert: sslcert }, { key: sslkey, cert: sslcert }
); );
} }

5
lib/logger.mjs

@ -8,9 +8,8 @@ const logger = createLogger({
label({ label: 'Wetty' }), label({ label: 'Wetty' }),
timestamp(), timestamp(),
printf( printf(
info => info => `${info.timestamp} [${info.label}] ${info.level}: ${info.message}`
`${info.timestamp} [${info.label}] ${info.level}: ${info.message}`, )
),
), ),
transports: [ transports: [
new transports.Console({ new transports.Console({

2
lib/server.mjs

@ -33,6 +33,6 @@ export default function createServer(port, { key, cert }) {
: http.createServer(app).listen(port, () => { : http.createServer(app).listen(port, () => {
events.server(port, 'http'); events.server(port, 'http');
}), }),
{ path: '/wetty/socket.io' }, { path: '/wetty/socket.io' }
); );
} }

3
package.json

@ -30,6 +30,9 @@
"bin": { "bin": {
"wetty": "./index.js" "wetty": "./index.js"
}, },
"engines": {
"node": ">=6.9"
},
"nodemonConfig": { "nodemonConfig": {
"ignore": ["dist/*", "src/*", "*.json"] "ignore": ["dist/*", "src/*", "*.json"]
}, },

Loading…
Cancel
Save