mirror of
https://github.com/Redume/Kekkai.git
synced 2025-02-23 12:43:12 +03:00
Теперь у ssl отдельная колонка в конфиге
This commit is contained in:
parent
403c471db0
commit
d6491337c0
2 changed files with 7 additions and 6 deletions
|
@ -9,9 +9,10 @@ database: # Postgresql database data, for connection
|
|||
port: 5432
|
||||
server:
|
||||
host: 'localhost'
|
||||
ssl:
|
||||
private_key: '/CertSSL/private.key' # The path to the private SSL key file (String)
|
||||
cert: '/CertSSL/fullchain.pem' # The path to the SSL certificate (String)
|
||||
ssl: true # Enable or disable SSL support [Boolean]
|
||||
work: true # Enable or disable SSL support [Boolean]
|
||||
log:
|
||||
print: true # Enable or disable logging [Boolean]
|
||||
level: 'info' # Log level (Fatal/Error/Warn/Log/Debug) [String]
|
||||
|
|
|
@ -4,10 +4,10 @@ const fs = require('fs');
|
|||
|
||||
const fastify = require('fastify')({
|
||||
logger: config['server']['log']['print'] ? logger : false,
|
||||
...config['server']['ssl'] ? {
|
||||
...config['server']['ssl']['work'] ? {
|
||||
https: {
|
||||
key: fs.readFileSync(config['server']['private_key'], 'utf8'),
|
||||
cert: fs.readFileSync(config['server']['cert'], 'utf8'),
|
||||
key: fs.readFileSync(config['server']['ssl']['private_key'], 'utf8'),
|
||||
cert: fs.readFileSync(config['server']['ssl']['cert'], 'utf8'),
|
||||
}
|
||||
} : false
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue