kutt
kutt copied to clipboard
Error: self signed certificate in certificate chain
I start docker from hum and I get this issue. Is there a way to disable self-signed certificates?
> [email protected] start /usr/src/app
> npm run migrate && cross-env NODE_ENV=production node production-server/server.js
> [email protected] migrate /usr/src/app
> knex migrate:latest --env production
Requiring external module @babel/register
Using environment: production
Error: self signed certificate in certificate chain
at TLSSocket.onConnectSecure (_tls_wrap.js:1501:34)
at TLSSocket.emit (events.js:315:20)
at TLSSocket._finishInit (_tls_wrap.js:936:8)
at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:710:12)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] migrate: `knex migrate:latest --env production`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] migrate script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-08-01T08_57_08_269Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `npm run migrate && cross-env NODE_ENV=production node production-server/server.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
In order to ignore self-signed certificates, the SSL option needs to be changed here: https://github.com/thedevs-network/kutt/blob/e9ea8091af8d3b805e3bd978a41baf937c1aa22c/server/knex.ts#L13
"ssl": {
"rejectUnauthorized": false
},
Since most things (including knex) support passing a 'database URL', it would be handy if kutt allowed passing a DATABASE_URL environment variable isntead of splitting it out into DB_HOST, DB_PORT, DB_NAME, DB_USER, DB_PASSWORD, and DB_SSL.
For now you pretty much have to clone the repo, make the change yourself, build the docker image, and deploy from that.