chore: sync up config defaults to be compatible with node 6.9.1
This commit is contained in:
parent
3aeedb2ec8
commit
2932d049af
3 changed files with 62 additions and 67 deletions
|
@ -20,6 +20,7 @@ rules:
|
||||||
object-shorthand: off
|
object-shorthand: off
|
||||||
class-methods-use-this: off
|
class-methods-use-this: off
|
||||||
semi: [2, never]
|
semi: [2, never]
|
||||||
|
strict: off
|
||||||
|
|
||||||
overrides:
|
overrides:
|
||||||
- files:
|
- files:
|
||||||
|
|
|
@ -33,13 +33,6 @@ const defaultConfig = {
|
||||||
keepaliveCountMax: 10,
|
keepaliveCountMax: 10,
|
||||||
alwaysSendKeyboardInteractivePrompts: false,
|
alwaysSendKeyboardInteractivePrompts: false,
|
||||||
algorithms: {
|
algorithms: {
|
||||||
kex: [
|
|
||||||
"ecdh-sha2-nistp256",
|
|
||||||
"ecdh-sha2-nistp384",
|
|
||||||
"ecdh-sha2-nistp521",
|
|
||||||
"diffie-hellman-group-exchange-sha256",
|
|
||||||
"diffie-hellman-group14-sha1"
|
|
||||||
],
|
|
||||||
cipher: [
|
cipher: [
|
||||||
"aes128-ctr",
|
"aes128-ctr",
|
||||||
"aes192-ctr",
|
"aes192-ctr",
|
||||||
|
@ -50,19 +43,21 @@ const defaultConfig = {
|
||||||
"aes256-gcm@openssh.com",
|
"aes256-gcm@openssh.com",
|
||||||
"aes256-cbc"
|
"aes256-cbc"
|
||||||
],
|
],
|
||||||
|
compress: ["none", "zlib@openssh.com", "zlib"],
|
||||||
hmac: ["hmac-sha2-256", "hmac-sha2-512", "hmac-sha1"],
|
hmac: ["hmac-sha2-256", "hmac-sha2-512", "hmac-sha1"],
|
||||||
|
kex: [
|
||||||
|
"ecdh-sha2-nistp256",
|
||||||
|
"ecdh-sha2-nistp384",
|
||||||
|
"ecdh-sha2-nistp521",
|
||||||
|
"diffie-hellman-group-exchange-sha256",
|
||||||
|
"diffie-hellman-group14-sha1"
|
||||||
|
],
|
||||||
serverHostKey: [
|
serverHostKey: [
|
||||||
"ssh-ed25519",
|
|
||||||
"rsa-sha2-512",
|
|
||||||
"rsa-sha2-256",
|
|
||||||
"ecdsa-sha2-nistp256",
|
"ecdsa-sha2-nistp256",
|
||||||
"ecdsa-sha2-nistp384",
|
"ecdsa-sha2-nistp384",
|
||||||
"ecdsa-sha2-nistp521",
|
"ecdsa-sha2-nistp521",
|
||||||
"rsa-sha2-512",
|
|
||||||
"rsa-sha2-256",
|
|
||||||
"ssh-rsa"
|
"ssh-rsa"
|
||||||
],
|
]
|
||||||
compress: ["none", "zlib@openssh.com", "zlib"]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
header: {
|
header: {
|
||||||
|
@ -119,41 +114,46 @@ function loadConfig() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configuration for the application.
|
* Loads and validates the WebSSH2 configuration.
|
||||||
*
|
* Merges the default configuration with user-provided config.json if it exists.
|
||||||
* @returns {Object} config
|
* Falls back to default configuration if config.json is missing or invalid.
|
||||||
* @property {Object} listen - Configuration for listening IP and port.
|
* Overrides listen.port with PORT environment variable if provided.
|
||||||
* @property {string} listen.ip - The IP address to listen on.
|
*
|
||||||
* @property {number} listen.port - The port number to listen on.
|
* @returns {Object} Configuration object with the following structure:
|
||||||
* @property {Object} http - Configuration for HTTP settings.
|
* @returns {Object} .listen - Server listening settings
|
||||||
* @property {string[]} http.origins - The allowed origins for HTTP requests.
|
* @returns {string} .listen.ip - IP address to listen on (default: "0.0.0.0")
|
||||||
* @property {Object} user - Configuration for user settings.
|
* @returns {number} .listen.port - Port number to listen on
|
||||||
* @property {string|null} user.name - The name of the user.
|
* @returns {Object} .http - HTTP server settings
|
||||||
* @property {string|null} user.password - The password of the user.
|
* @returns {string[]} .http.origins - Allowed CORS origins (default: ["*:*"])
|
||||||
* @property {Object} ssh - Configuration for SSH settings.
|
* @returns {Object} .user - Default user credentials
|
||||||
* @property {string|null} ssh.host - The SSH host.
|
* @returns {string|null} .user.name - Default username
|
||||||
* @property {number} ssh.port - The SSH port.
|
* @returns {string|null} .user.password - Default password
|
||||||
* @property {string} ssh.term - The SSH terminal type.
|
* @returns {Object} .ssh - SSH connection settings
|
||||||
* @property {number} ssh.readyTimeout - The SSH ready timeout.
|
* @returns {string|null} .ssh.host - SSH server hostname
|
||||||
* @property {number} ssh.keepaliveInterval - The SSH keepalive interval.
|
* @returns {number} .ssh.port - SSH server port
|
||||||
* @property {number} ssh.keepaliveCountMax - The SSH keepalive count maximum.
|
* @returns {string} .ssh.term - Terminal type
|
||||||
* @property {Object} header - Configuration for header settings.
|
* @returns {number} .ssh.readyTimeout - Connection timeout in ms
|
||||||
* @property {string|null} header.text - The header text.
|
* @returns {number} .ssh.keepaliveInterval - Keepalive interval in ms
|
||||||
* @property {string} header.background - The header background color.
|
* @returns {number} .ssh.keepaliveCountMax - Max keepalive count
|
||||||
* @property {Object} options - Configuration for options settings.
|
* @returns {boolean} .ssh.alwaysSendKeyboardInteractivePrompts - Force keyboard-interactive
|
||||||
* @property {boolean} options.challengeButton - Whether to show the challenge button.
|
* @returns {Object} .ssh.algorithms - Supported SSH algorithms
|
||||||
* @property {boolean} options.autoLog - Whether to automatically log.
|
* @returns {string[]} .ssh.algorithms.cipher - Supported ciphers
|
||||||
* @property {boolean} options.allowReauth - Whether to allow reauthentication.
|
* @returns {string[]} .ssh.algorithms.compress - Supported compression
|
||||||
* @property {boolean} options.allowReconnect - Whether to allow reconnection.
|
* @returns {string[]} .ssh.algorithms.hmac - Supported HMAC algorithms
|
||||||
* @property {boolean} options.allowReplay - Whether to allow replay.
|
* @returns {string[]} .ssh.algorithms.kex - Supported key exchange
|
||||||
* @property {Object} algorithms - Configuration for algorithms settings.
|
* @returns {string[]} .ssh.algorithms.serverHostKey - Supported host key types
|
||||||
* @property {string[]} algorithms.kex - The key exchange algorithms.
|
* @returns {Object} .header - UI header settings
|
||||||
* @property {string[]} algorithms.cipher - The cipher algorithms.
|
* @returns {string|null} .header.text - Header text
|
||||||
* @property {string[]} algorithms.hmac - The HMAC algorithms.
|
* @returns {string} .header.background - Header background color
|
||||||
* @property {string[]} algorithms.compress - The compression algorithms.
|
* @returns {Object} .options - Feature flags and options
|
||||||
* @property {Object} session - Configuration for session settings.
|
* @returns {boolean} .options.challengeButton - Show challenge button
|
||||||
* @property {string} session.secret - The session secret.
|
* @returns {boolean} .options.autoLog - Enable automatic logging
|
||||||
* @property {string} session.name - The session name.
|
* @returns {boolean} .options.allowReauth - Allow reauthentication
|
||||||
|
* @returns {boolean} .options.allowReconnect - Allow reconnection
|
||||||
|
* @returns {boolean} .options.allowReplay - Allow session replay
|
||||||
|
* @returns {Object} .session - Session configuration
|
||||||
|
* @returns {string} .session.secret - Session secret key
|
||||||
|
* @returns {string} .session.name - Session cookie name
|
||||||
*/
|
*/
|
||||||
const config = loadConfig()
|
const config = loadConfig()
|
||||||
|
|
||||||
|
|
|
@ -27,14 +27,6 @@
|
||||||
"allowedSubnets": [],
|
"allowedSubnets": [],
|
||||||
"alwaysSendKeyboardInteractivePrompts": false,
|
"alwaysSendKeyboardInteractivePrompts": false,
|
||||||
"algorithms": {
|
"algorithms": {
|
||||||
"kex": [
|
|
||||||
"curve25519-sha256",
|
|
||||||
"ecdh-sha2-nistp256",
|
|
||||||
"ecdh-sha2-nistp384",
|
|
||||||
"ecdh-sha2-nistp521",
|
|
||||||
"diffie-hellman-group-exchange-sha256",
|
|
||||||
"diffie-hellman-group14-sha1"
|
|
||||||
],
|
|
||||||
"cipher": [
|
"cipher": [
|
||||||
"aes128-ctr",
|
"aes128-ctr",
|
||||||
"aes192-ctr",
|
"aes192-ctr",
|
||||||
|
@ -45,25 +37,27 @@
|
||||||
"aes256-gcm@openssh.com",
|
"aes256-gcm@openssh.com",
|
||||||
"aes256-cbc"
|
"aes256-cbc"
|
||||||
],
|
],
|
||||||
"hmac": [
|
|
||||||
"hmac-sha2-256",
|
|
||||||
"hmac-sha2-512",
|
|
||||||
"hmac-sha1"
|
|
||||||
],
|
|
||||||
"compress": [
|
"compress": [
|
||||||
"none",
|
"none",
|
||||||
"zlib@openssh.com",
|
"zlib@openssh.com",
|
||||||
"zlib"
|
"zlib"
|
||||||
],
|
],
|
||||||
|
"hmac": [
|
||||||
|
"hmac-sha2-256",
|
||||||
|
"hmac-sha2-512",
|
||||||
|
"hmac-sha1"
|
||||||
|
],
|
||||||
|
"kex": [
|
||||||
|
"ecdh-sha2-nistp256",
|
||||||
|
"ecdh-sha2-nistp384",
|
||||||
|
"ecdh-sha2-nistp521",
|
||||||
|
"diffie-hellman-group-exchange-sha256",
|
||||||
|
"diffie-hellman-group14-sha1"
|
||||||
|
],
|
||||||
"serverHostKey": [
|
"serverHostKey": [
|
||||||
"ssh-ed25519",
|
|
||||||
"rsa-sha2-512",
|
|
||||||
"rsa-sha2-256",
|
|
||||||
"ecdsa-sha2-nistp256",
|
"ecdsa-sha2-nistp256",
|
||||||
"ecdsa-sha2-nistp384",
|
"ecdsa-sha2-nistp384",
|
||||||
"ecdsa-sha2-nistp521",
|
"ecdsa-sha2-nistp521",
|
||||||
"rsa-sha2-512",
|
|
||||||
"rsa-sha2-256",
|
|
||||||
"ssh-rsa"
|
"ssh-rsa"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue