From caa6a65f999f2480df0e72b871f159b90936f087 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Mon, 3 Jun 2019 18:47:00 +0200 Subject: [PATCH] removed dotenv.config calls --- backend/src/activitypub/ActivityPub.js | 1 - backend/src/activitypub/security/index.js | 7 ++++--- backend/src/bootstrap/neo4j.js | 3 --- backend/src/middleware/activityPubMiddleware.js | 2 -- backend/src/middleware/userMiddleware.js | 4 ---- backend/src/seed/reset-db.js | 3 --- 6 files changed, 4 insertions(+), 16 deletions(-) diff --git a/backend/src/activitypub/ActivityPub.js b/backend/src/activitypub/ActivityPub.js index aa447a2d7..2667fd572 100644 --- a/backend/src/activitypub/ActivityPub.js +++ b/backend/src/activitypub/ActivityPub.js @@ -23,7 +23,6 @@ export default class ActivityPub { static init(server) { if (!activityPub) { - dotenv.config() activityPub = new ActivityPub(CONFIG.CLIENT_URI, CONFIG.GRAPHQL_URI) // integrate into running graphql express server diff --git a/backend/src/activitypub/security/index.js b/backend/src/activitypub/security/index.js index 2ecdec022..9b48b7ed9 100644 --- a/backend/src/activitypub/security/index.js +++ b/backend/src/activitypub/security/index.js @@ -1,11 +1,12 @@ -import dotenv from 'dotenv' -import { resolve } from 'path' +// import dotenv from 'dotenv' +// import { resolve } from 'path' import crypto from 'crypto' import request from 'request' import CONFIG from './../../config' const debug = require('debug')('ea:security') -dotenv.config({ path: resolve('src', 'activitypub', '.env') }) +// TODO Does this reference a local config? Why? +// dotenv.config({ path: resolve('src', 'activitypub', '.env') }) export function generateRsaKeyPair(options = {}) { const { passphrase = CONFIG.PRIVATE_KEY_PASSPHRASE } = options diff --git a/backend/src/bootstrap/neo4j.js b/backend/src/bootstrap/neo4j.js index 15c9c4533..bfa68acf3 100644 --- a/backend/src/bootstrap/neo4j.js +++ b/backend/src/bootstrap/neo4j.js @@ -1,9 +1,6 @@ import { v1 as neo4j } from 'neo4j-driver' -import dotenv from 'dotenv' import CONFIG from './../config' -dotenv.config() - let driver export function getDriver(options = {}) { diff --git a/backend/src/middleware/activityPubMiddleware.js b/backend/src/middleware/activityPubMiddleware.js index 43da21e26..f3ced42f9 100644 --- a/backend/src/middleware/activityPubMiddleware.js +++ b/backend/src/middleware/activityPubMiddleware.js @@ -1,10 +1,8 @@ import { generateRsaKeyPair } from '../activitypub/security' import { activityPub } from '../activitypub/ActivityPub' import as from 'activitystrea.ms' -import dotenv from 'dotenv' const debug = require('debug')('backend:schema') -dotenv.config() export default { Mutation: { diff --git a/backend/src/middleware/userMiddleware.js b/backend/src/middleware/userMiddleware.js index 079ba310a..29e512ebd 100644 --- a/backend/src/middleware/userMiddleware.js +++ b/backend/src/middleware/userMiddleware.js @@ -1,9 +1,5 @@ -import dotenv from 'dotenv' - import createOrUpdateLocations from './nodes/locations' -dotenv.config() - export default { Mutation: { CreateUser: async (resolve, root, args, context, info) => { diff --git a/backend/src/seed/reset-db.js b/backend/src/seed/reset-db.js index 095db240c..bcc29d78f 100644 --- a/backend/src/seed/reset-db.js +++ b/backend/src/seed/reset-db.js @@ -1,9 +1,6 @@ import { cleanDatabase } from './factories' -import dotenv from 'dotenv' import CONFIG from './config' -dotenv.config() - if (!CONFIG.DEBUG) { throw new Error(`YOU CAN'T CLEAN THE DATABASE WITH DEBUG=${CONFIG.DEBUG}`) }