Browse Source

Merge remote-tracking branch 'upstream/master' into relative

pull/175/head
Henri 6 years ago
parent
commit
98aa36f9ff
  1. 6
      index.js
  2. 5
      src/server/index.ts
  3. 6
      src/server/server.ts

6
index.js

@ -41,6 +41,12 @@ if (require.main === module) {
type: 'string',
default: process.env.SSHUSER || '',
},
title: {
demand: false,
description: 'window title',
type: 'string',
default: process.env.TITLE || 'WeTTy - The Web Terminal Emulator',
},
sshauth: {
demand: false,
description:

5
src/server/index.ts

@ -15,6 +15,7 @@ export interface Options {
base: string;
host: string;
port: number;
title: string;
command?: string;
}
@ -33,6 +34,7 @@ export default class Server {
base,
host,
port,
title,
command,
sslkey,
sslcert,
@ -54,10 +56,11 @@ export default class Server {
host: sshhost,
auth: sshauth,
port: sshport,
title: title,
pass: sshpass,
key: sshkey,
},
{ base, host, port },
{ base, host, port, title },
command,
{ key: sslkey, cert: sslcert }
);

6
src/server/server.ts

@ -17,13 +17,13 @@ const distDir = path.join(__dirname, 'client');
const trim = (str: string): string => str.replace(/\/*$/, '');
export default function createServer(
{ base, port, host }: Server,
{ base, port, host, title }: Server,
{ key, cert }: SSLBuffer
): SocketIO.Server {
const basePath = trim(base);
events.emit(
'debug',
`key: ${key}, cert: ${cert}, port: ${port}, base: ${base}`
`key: ${key}, cert: ${cert}, port: ${port}, base: ${base}, title: ${title}`
);
const html = (
@ -37,7 +37,7 @@ export default function createServer(
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<title>WeTTy - The Web Terminal Emulator</title>
<title>${title}</title>
<link rel="stylesheet" href="${resourcePath}public/index.css" />
</head>
<body>

Loading…
Cancel
Save