Skip to content

Commit

Permalink
Update README.md and added SSL env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
pantsel committed Jul 24, 2018
1 parent 9779b51 commit 67f590c
Show file tree
Hide file tree
Showing 8 changed files with 90 additions and 17 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -121,3 +121,4 @@ nbproject
/config/mssqlconfig.js
/www/
/kongadata/
/certs/
22 changes: 21 additions & 1 deletion README.md
Expand Up @@ -219,7 +219,27 @@ login: demo | password: demodemodemo

This user data is populated to the database if there is not already any user data in it. [It is possible to alter the default user seed data.](./docs/DEFAULTUSERSEEDDATA.md)

You may also configure konga to authenticate via [LDAP](./docs/LDAP.md).
You may also configure Konga to authenticate via [LDAP](./docs/LDAP.md).

## Environment variables

| VAR | DESCRIPTION | VALUES | DEFAULT | |
|--------------------|----------------------------------------------------------------------------------------------------------------------------|----------------------------------------|----------------------------------------------|---|
| PORT | The port that will be used by Konga's server | - | 1337 | |
| NODE_ENV | The environment | `production`,`development` | `development` | |
| SSL_KEY_PATH | If you want to use SSL, this will be the absolute path to the .key file. Both `SSL_KEY_PATH` & `SSL_CRT_PATH` must be set. | - | null | |
| SSL_CRT_PATH | If you want to use SSL, this will be the absolute path to the .crt file. Both `SSL_KEY_PATH` & `SSL_CRT_PATH` must be set. | - | null | |
| KONGA_HOOK_TIMEOUT | The time in ms that Konga will wait for startup tasks to finish before exiting the process. | - | 60000 | |
| DB_ADAPTER | The database that Konga will use. If not set, the localDisk db will be used. | `mongo`,`mysql`,`postgres`,`sqlserver` | - |- |
| DB_URI | The full db connection string. Depends on `DB_ADAPTER`. If this is set, no other DB related var is needed. | - | - | |
| DB_HOST | If `DB_URI` is not specified, this is the database host. Depends on `DB_ADAPTER`. | - | localhost | |
| DB_PORT | If `DB_URI` is not specified, this is the database port. Depends on `DB_ADAPTER`. | - | DB default. | |
| DB_USER | If `DB_URI` is not specified, this is the database user. Depends on `DB_ADAPTER`. | - | - | |
| DB_PASSWORD | If `DB_URI` is not specified, this is the database user's password. Depends on `DB_ADAPTER`. | - | - | |
| DB_DATABASE | If `DB_URI` is not specified, this is the name of Konga's db. Depends on `DB_ADAPTER`. | - | `konga_database` | |
| DB_PG_SCHEMA | If using postgres as a database, this is the schema that will be used. | - | `public` | |
| KONGA_LOG_LEVEL | The logging level | `silly`,`debug`,`info`,`warn`,`error` | `debug` on dev environment & `warn` on prod. | |
| | | |

## Upgrading
In some cases a newer version of Konga may introduce new db tables, collections or changes in schemas.
Expand Down
11 changes: 11 additions & 0 deletions certs/server.crt
@@ -0,0 +1,11 @@
-----BEGIN CERTIFICATE-----
MIIBnzCCAQgCCQC1x1LJh4G1AzANBgkqhkiG9w0BAQUFADAUMRIwEAYDVQQDEwls
b2NhbGhvc3QwHhcNMDkxMTEwMjM0ODQ3WhcNMTkxMTA4MjM0ODQ3WjAUMRIwEAYD
VQQDEwlsb2NhbGhvc3QwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMEl0yfj
7K0Ng2pt51+adRAj4pCdoGOVjx1BmljVnGOMW3OGkHnMw9ajibh1vB6UfHxu463o
J1wLxgxq+Q8y/rPEehAjBCspKNSq+bMvZhD4p8HNYMRrKFfjZzv3ns1IItw46kgT
gDpAl1cMRzVGPXFimu5TnWMOZ3ooyaQ0/xntAgMBAAEwDQYJKoZIhvcNAQEFBQAD
gYEAavHzSWz5umhfb/MnBMa5DL2VNzS+9whmmpsDGEG+uR0kM1W2GQIdVHHJTyFd
aHXzgVJBQcWTwhp84nvHSiQTDBSaT6cQNQpvag/TaED/SEQpm0VqDFwpfFYuufBL
vVNbLkKxbK2XwUvu0RxoLdBMC/89HqrZ0ppiONuQ+X2MtxE=
-----END CERTIFICATE-----
10 changes: 10 additions & 0 deletions certs/server.csr
@@ -0,0 +1,10 @@
-----BEGIN CERTIFICATE REQUEST-----
MIIBcjCB3AIBADAUMRIwEAYDVQQDEwlsb2NhbGhvc3QwgZ8wDQYJKoZIhvcNAQEB
BQADgY0AMIGJAoGBAME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6YqcChDb7GHvewdmatAhX1ok/
Bw6KIPHXrMKdA3s9KkyLaRUbQPtVwBA6Q2brYS1Zhm/3ASQRhZbB3V9ZTSJhAkB7
72097P5Vr24VcPnZWdbTbG4twwtxWTix5dRa7RY/k55QJ6K9ipw4OBLhSvJZrPBW
Vm97NUg+wJAOMUXC30ZVAkA6pDgLbxVqkCnNgh2eNzhxQtvEGE4a8yFSUfSktS9U
bjAATRYXNv2mAms32aAVKTzgSTapEX9M1OWdk+/yJrJs
-----END RSA PRIVATE KEY-----
28 changes: 18 additions & 10 deletions config/env/development.js
Expand Up @@ -10,19 +10,27 @@
* any private information to this file!
*
*/

var fs = require('fs');

module.exports = {
/***************************************************************************
* Set the default database connection for models in the development *
* environment (see config/connections.js and config/models.js ) *
***************************************************************************/
/***************************************************************************
* Set the default database connection for models in the development *
* environment (see config/connections.js and config/models.js ) *
***************************************************************************/

hookTimeout: process.env.KONGA_HOOK_TIMEOUT || 60000,

hookTimeout: process.env.KONGA_HOOK_TIMEOUT || 60000,
port: process.env.PORT || 1337,

port: process.env.KONGA_BACKEND_PORT || 1337,
// kong_admin_url: process.env.KONG_ADMIN_URL || 'http://127.0.0.1:8001',

kong_admin_url: process.env.KONG_ADMIN_URL || 'http://127.0.0.1:8001',
ssl: {
key: process.env.SSL_KEY_PATH ? fs.readFileSync(process.env.SSL_KEY_PATH) : null,
cert: process.env.SSL_CRT_PATH ? fs.readFileSync(process.env.SSL_CRT_PATH) : null
},

log: {
level: process.env.KONGA_LOG_LEVEL || "debug"
}
log: {
level: process.env.KONGA_LOG_LEVEL || "debug"
}
};
14 changes: 11 additions & 3 deletions config/env/production.js
Expand Up @@ -10,6 +10,9 @@
* any private information to this file!
*
*/

var fs = require('fs');

module.exports = {
/***************************************************************************
* Set the default database connection for models in the production *
Expand All @@ -18,7 +21,7 @@ module.exports = {

hookTimeout: process.env.KONGA_HOOK_TIMEOUT || 60000,

kong_admin_url : process.env.KONG_ADMIN_URL || 'http://127.0.0.1:8001',
// kong_admin_url : process.env.KONG_ADMIN_URL || 'http://127.0.0.1:8001',

// models: {
// connection: 'someMysqlServer'
Expand All @@ -28,13 +31,18 @@ module.exports = {
* Set the port in the production environment to 80 *
***************************************************************************/

port: process.env.KONGA_BACKEND_PORT || 1337,
port: process.env.PORT || 1337,

ssl: {
key: process.env.SSL_KEY_PATH ? fs.readFileSync(process.env.SSL_KEY_PATH) : null,
cert: process.env.SSL_CRT_PATH ? fs.readFileSync(process.env.SSL_CRT_PATH) : null
},

/***************************************************************************
* Set the log level in production environment to "warn" *
***************************************************************************/
log: {
level: process.env.KONGA_LOG_LEVEL || "info"
level: process.env.KONGA_LOG_LEVEL || "warn"
},

// Keep data of response errors in production mode
Expand Down
6 changes: 3 additions & 3 deletions config/local_example.js
Expand Up @@ -31,7 +31,7 @@ module.exports = {
/**
* The default fallback URL to Kong's admin API.
*/
kong_admin_url : process.env.KONG_ADMIN_URL || 'http://127.0.0.1:8001',
// kong_admin_url : process.env.KONG_ADMIN_URL || 'http://127.0.0.1:8001',


connections: {
Expand All @@ -45,8 +45,8 @@ module.exports = {
session: {
secret: '' // Add your own SECRET string here
},
port: 1338,
environment: 'development',
port: process.env.PORT || 1338,
environment: process.env.NODE_ENV || 'development',
log: {
level: 'info'
}
Expand Down

0 comments on commit 67f590c

Please sign in to comment.