Remove SSL directory
This commit is contained in:
parent
b9d9a584b3
commit
b337e5748f
4
.gitignore
vendored
4
.gitignore
vendored
@ -143,3 +143,7 @@ test/
|
|||||||
# .npmrc
|
# .npmrc
|
||||||
|
|
||||||
/dump
|
/dump
|
||||||
|
ssl
|
||||||
|
ssl*
|
||||||
|
*ssl
|
||||||
|
/ssl
|
||||||
|
@ -21,8 +21,7 @@
|
|||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
const mysql = require("mysql");
|
const mysql = require("mysql");
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
|
const grabDbSSL = require("../../../package-shared/utils/backend/grabDbSSL");
|
||||||
const SSL_PATH = path.resolve(__dirname, "../../../ssl");
|
|
||||||
|
|
||||||
const connection = mysql.createConnection({
|
const connection = mysql.createConnection({
|
||||||
host: process.env.DSQL_HOST,
|
host: process.env.DSQL_HOST,
|
||||||
@ -34,21 +33,7 @@ const connection = mysql.createConnection({
|
|||||||
? parseInt(process.env.DSQL_PORT)
|
? parseInt(process.env.DSQL_PORT)
|
||||||
: undefined,
|
: undefined,
|
||||||
timeout: 5000,
|
timeout: 5000,
|
||||||
ssl: {
|
ssl: grabDbSSL(),
|
||||||
ca: fs.readFileSync(`${SSL_PATH}/ca-cert.pem`),
|
|
||||||
},
|
|
||||||
// ssl: {
|
|
||||||
// ca: (() => {
|
|
||||||
// try {
|
|
||||||
// if (process.env.DSQL_SSL_CA_PATH) {
|
|
||||||
// return fs.readFileSync(process.env.DSQL_SSL_CA_PATH);
|
|
||||||
// }
|
|
||||||
// return undefined;
|
|
||||||
// } catch (error) {
|
|
||||||
// return undefined;
|
|
||||||
// }
|
|
||||||
// })(),
|
|
||||||
// },
|
|
||||||
});
|
});
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -3,8 +3,7 @@
|
|||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
const mysql = require("mysql");
|
const mysql = require("mysql");
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
|
const grabDbSSL = require("../../../package-shared/utils/backend/grabDbSSL");
|
||||||
const SSL_PATH = path.resolve(__dirname, "../../../ssl");
|
|
||||||
|
|
||||||
const connection = mysql.createConnection({
|
const connection = mysql.createConnection({
|
||||||
host: process.env.DSQL_HOST,
|
host: process.env.DSQL_HOST,
|
||||||
@ -15,9 +14,7 @@ const connection = mysql.createConnection({
|
|||||||
? parseInt(process.env.DSQL_PORT)
|
? parseInt(process.env.DSQL_PORT)
|
||||||
: undefined,
|
: undefined,
|
||||||
timeout: 5000,
|
timeout: 5000,
|
||||||
ssl: {
|
ssl: grabDbSSL(),
|
||||||
ca: fs.readFileSync(`${SSL_PATH}/ca-cert.pem`),
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -7,12 +7,17 @@ const fs = require("fs");
|
|||||||
*/
|
*/
|
||||||
module.exports = function grabDbSSL() {
|
module.exports = function grabDbSSL() {
|
||||||
const SSL_DIR = process.env.DSQL_SSL_DIR;
|
const SSL_DIR = process.env.DSQL_SSL_DIR;
|
||||||
if (!SSL_DIR?.match(/./)) return undefined;
|
if (!SSL_DIR?.match(/./)) {
|
||||||
|
console.log(
|
||||||
|
"No SSL certificate provided. Query will run in normal mode. To add SSL add an env path dir `DSQL_SSL_DIR` with a file named `ca-cert.pem`"
|
||||||
|
);
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
const caFilePath = `${SSL_DIR}/ca-cert.pem`;
|
const caFilePath = `${SSL_DIR}/ca-cert.pem`;
|
||||||
|
|
||||||
if (!fs.existsSync(caFilePath)) {
|
if (!fs.existsSync(caFilePath)) {
|
||||||
console.log(`${caFilePath} does not exist`);
|
console.log(`${caFilePath} does not exist`);
|
||||||
|
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "datasquirel",
|
"name": "datasquirel",
|
||||||
"version": "2.5.0",
|
"version": "2.5.1",
|
||||||
"description": "Cloud-based SQL data management tool",
|
"description": "Cloud-based SQL data management tool",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"bin": {
|
"bin": {
|
||||||
@ -9,7 +9,7 @@
|
|||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"compile": "tsc --declaration --allowJs --emitDeclarationOnly --resolveJsonModule index.js",
|
"compile": "tsc --declaration --allowJs --emitDeclarationOnly --resolveJsonModule index.js",
|
||||||
"compile-tsc": "rm -rf dist && tsc --declaration --allowJs --outDir dist --emitDeclarationOnly --resolveJsonModule index.js && cat ./dist/index.d.ts > ./index.d.ts"
|
"compile:full": "rm -rf dist && tsc --declaration --allowJs --outDir dist --emitDeclarationOnly --resolveJsonModule index.js && cat ./dist/index.d.ts > ./index.d.ts"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
@ -1,22 +0,0 @@
|
|||||||
-----BEGIN CERTIFICATE-----
|
|
||||||
MIIDnTCCAoWgAwIBAgIUVruYX02DdRIrbHXkrlz1LkntCYowDQYJKoZIhvcNAQEL
|
|
||||||
BQAwXTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM
|
|
||||||
GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDEWMBQGA1UEAwwNTWFyaWFEQiBhZG1p
|
|
||||||
bjAgFw0yNDAxMDkxNTAxMjFaGA8zMDIzMDUxMjE1MDEyMVowXTELMAkGA1UEBhMC
|
|
||||||
QVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0IFdpZGdp
|
|
||||||
dHMgUHR5IEx0ZDEWMBQGA1UEAwwNTWFyaWFEQiBhZG1pbjCCASIwDQYJKoZIhvcN
|
|
||||||
AQEBBQADggEPADCCAQoCggEBAMIpgpOT66kqbr4AS3BKlEFY6U+OtGuWmC2RPLYq
|
|
||||||
moZ3WXNrgqL4ymhe/mdIJgr4PPjVnuwgDElRw0v1Vrnf9Gg4Dy1zWIXIGKxF4Cu9
|
|
||||||
UGK546xtVnn8f7DPjdPKSmZN0iZh3Z+1Pu/P3a62dJ30c+rcUw/pPq2aGWNY/iWo
|
|
||||||
MtCVxTjTl92+gR1tRfXw88xHW/v4ly+GeijC6v5WX3qad8sTZR6CNLzGXQRe8hU+
|
|
||||||
pYrXURGTb5YZTaDe9SuvYZtflfl8AtSlMwGX7Bk6BJI9ROTLbgb9zp2zzC8TvDWu
|
|
||||||
dXvnaIJyCwHo43iONw2KK67IAp2Q2Z6acFqQVOUsqoD7wi8CAwEAAaNTMFEwHQYD
|
|
||||||
VR0OBBYEFBlkPD5aW+FrgzCF0AypGvTvEPmEMB8GA1UdIwQYMBaAFBlkPD5aW+Fr
|
|
||||||
gzCF0AypGvTvEPmEMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEB
|
|
||||||
ABG2VxjUjnokr0oQPKO0ovfogPFsNYfA2C6pKa0stjMOX8sDIOepWVCWHqM54SwN
|
|
||||||
pxf9TDkeKmlb2617Xa+j1D0qjXUM8ErTy4tz6eJvNlitQmUotiHDzSUwl/yy5fIF
|
|
||||||
WprgbdGbeS6wzF32zcKBus4eJi8Acq8K/1lG4aM7qluU3oXzSEIfnAbGvkpzBmlR
|
|
||||||
r28TU0NJf8p7NgcfQZApeCqOjNa14upsfgIZ83BP3VDmP5Q46MAdCxv5FmGcOReS
|
|
||||||
Xs0O5YuvQKP27Wbai5qxdNDOaXLKSkplhGcsuzFeg7Wrrn5CpIKulm4WCj8FhSWe
|
|
||||||
flBIqewYWu64vvlW17MYeRk=
|
|
||||||
-----END CERTIFICATE-----
|
|
Loading…
Reference in New Issue
Block a user