mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-28 04:56:00 +00:00
use gist secret
This commit is contained in:
@@ -60,7 +60,7 @@
|
|||||||
"tar": "^6.0.5"
|
"tar": "^6.0.5"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "env-cmd node src/index.js --listen-api",
|
"start": "env-cmd -f .env.local node src/index.js --listen-api",
|
||||||
"start:portal": "env-cmd -f env/portal/.env node src/index.js --listen-api",
|
"start:portal": "env-cmd -f env/portal/.env node src/index.js --listen-api",
|
||||||
"start:singledb": "env-cmd -f env/singledb/.env node src/index.js --listen-api",
|
"start:singledb": "env-cmd -f env/singledb/.env node src/index.js --listen-api",
|
||||||
"start:auth": "env-cmd -f env/auth/.env node src/index.js --listen-api",
|
"start:auth": "env-cmd -f env/auth/.env node src/index.js --listen-api",
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ const { read } = require('./queryHistory');
|
|||||||
const platformInfo = require('../utility/platformInfo');
|
const platformInfo = require('../utility/platformInfo');
|
||||||
const _ = require('lodash');
|
const _ = require('lodash');
|
||||||
const serverConnections = require('./serverConnections');
|
const serverConnections = require('./serverConnections');
|
||||||
|
const gistSecret = require('../gistSecret');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
upload_meta: {
|
upload_meta: {
|
||||||
@@ -45,6 +46,7 @@ module.exports = {
|
|||||||
|
|
||||||
uploadErrorToGist_meta: true,
|
uploadErrorToGist_meta: true,
|
||||||
async uploadErrorToGist() {
|
async uploadErrorToGist() {
|
||||||
|
console.log('&&&SECRET', gistSecret);
|
||||||
const logs = await fs.readFile(getLogsFilePath(), { encoding: 'utf-8' });
|
const logs = await fs.readFile(getLogsFilePath(), { encoding: 'utf-8' });
|
||||||
const connections = await serverConnections.getOpenedConnectionReport();
|
const connections = await serverConnections.getOpenedConnectionReport();
|
||||||
try {
|
try {
|
||||||
@@ -89,7 +91,7 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: `token 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`,
|
Authorization: `token ${gistSecret}`,
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
Accept: 'application/vnd.github.v3+json',
|
Accept: 'application/vnd.github.v3+json',
|
||||||
},
|
},
|
||||||
@@ -111,7 +113,7 @@ module.exports = {
|
|||||||
async deleteGist({ url }) {
|
async deleteGist({ url }) {
|
||||||
const response = await axios.default.delete(url, {
|
const response = await axios.default.delete(url, {
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: `token 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`,
|
Authorization: `token ${gistSecret}`,
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
Accept: 'application/vnd.github.v3+json',
|
Accept: 'application/vnd.github.v3+json',
|
||||||
},
|
},
|
||||||
|
|||||||
1
packages/api/src/gistSecret.js
Normal file
1
packages/api/src/gistSecret.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
module.exports = process.env.GIST_UPLOAD_SECRET;
|
||||||
Reference in New Issue
Block a user