From 2c30c7e6c95b8b5e4ee72ffea053d95e123f1405 Mon Sep 17 00:00:00 2001 From: Andrew Plummer Date: Tue, 10 Dec 2024 12:44:27 -0500 Subject: [PATCH] final removal of @bedrockio/config --- services/api/.env.production | 63 ++--------------------------------- services/api/.env.staging | 63 ++--------------------------------- services/api/package.json | 6 ++-- services/api/src/utils/csv.js | 3 +- services/api/yarn.lock | 14 +++----- 5 files changed, 12 insertions(+), 137 deletions(-) diff --git a/services/api/.env.production b/services/api/.env.production index c37cd376..e998a5a3 100644 --- a/services/api/.env.production +++ b/services/api/.env.production @@ -1,62 +1,3 @@ -# Note that changing the variables here will require a restart of the app server - -SERVER_HOST=0.0.0.0 -SERVER_PORT=2300 - -# Main DB Config +# This file is for local use only. Do NOT put secrets in here. MONGO_URI=mongodb://localhost/bedrock_production -MONGO_DEBUG= - -# Default admin account for dashboard login -ADMIN_NAME=Marlon Brando -ADMIN_EMAIL=admin@bedrock.foundation -ADMIN_PASSWORD=development.now - -# JWT Secret to sign and encrypt tokens -JWT_SECRET=m6bv7!m|E:7:*X3Mx7I)2+Y>B70+&K - -# App details for emails -APP_NAME=Bedrock -APP_URL=http://localhost:2200 -APP_SUPPORT_EMAIL=support@bedrock.foundation -APP_COMPANY_ADDRESS=Bedrock Inc, 3 Abbey Road, San Francisco CA 94102 -APP_COMPANY_NAME=The Bedrock foundation -APP_PRIMARY_COLOR=#3869d4 -# Needs to be a public url that points to png/jpeg (no svg) -APP_LOGO_URL= - -API_URL=http://localhost:2300 - -# Uploads (local|gcs) -UPLOADS_STORE=local -UPLOADS_GCS_BUCKET=bedrock-production-uploads - -# Multi-Tenancy -DEFAULT_ORGANIZATION_NAME= - -# Sentry Error Tracking -SENTRY_DSN= - -ENV_NAME=development - -# Postmark mail delivery -POSTMARK_FROM=no-reply@bedrock.foundation -POSTMARK_API_KEY= -POSTMARK_DEV_EMAIL= -POSTMARK_WEBHOOK_KEY= - -# Twilio Messaging -TWILIO_ACCOUNT_SID=ACf9d16ca86a15882e24627571601d77a6 -TWILIO_FROM_NUMBER=+16467224582 -TWILIO_TEST_NUMBER= -TWILIO_WEBHOOK_URL= -# Note this must be the PRIMARY token to validate webhook signatures. -# This is the test token which will not actually work but is needed -# for the test environment. -TWILIO_AUTH_TOKEN=AC21717619d8cf45502cc2f7cd7aee139d - -# Sign in with Google -GOOGLE_CLIENT_ID= - -# Sign in with Apple -APPLE_SERVICE_ID= \ No newline at end of file +UPLOADS_GCS_BUCKET=bedrock-production-uploads \ No newline at end of file diff --git a/services/api/.env.staging b/services/api/.env.staging index 0744798d..a4bb5c10 100644 --- a/services/api/.env.staging +++ b/services/api/.env.staging @@ -1,62 +1,3 @@ -# Note that changing the variables here will require a restart of the app server - -SERVER_HOST=0.0.0.0 -SERVER_PORT=2300 - -# Main DB Config +# This file is for local use only. Do NOT put secrets in here. MONGO_URI=mongodb://localhost/bedrock_staging -MONGO_DEBUG= - -# Default admin account for dashboard login -ADMIN_NAME=Marlon Brando -ADMIN_EMAIL=admin@bedrock.foundation -ADMIN_PASSWORD=development.now - -# JWT Secret to sign and encrypt tokens -JWT_SECRET=m6bv7!m|E:7:*X3Mx7I)2+Y>B70+&K - -# App details for emails -APP_NAME=Bedrock -APP_URL=http://localhost:2200 -APP_SUPPORT_EMAIL=support@bedrock.foundation -APP_COMPANY_ADDRESS=Bedrock Inc, 3 Abbey Road, San Francisco CA 94102 -APP_COMPANY_NAME=The Bedrock foundation -APP_PRIMARY_COLOR=#3869d4 -# Needs to be a public url that points to png/jpeg (no svg) -APP_LOGO_URL= - -API_URL=http://localhost:2300 - -# Uploads (local|gcs) -UPLOADS_STORE=local -UPLOADS_GCS_BUCKET=bedrock-staging-uploads - -# Multi-Tenancy -DEFAULT_ORGANIZATION_NAME= - -# Sentry Error Tracking -SENTRY_DSN= - -ENV_NAME=development - -# Postmark mail delivery -POSTMARK_FROM=no-reply@bedrock.foundation -POSTMARK_API_KEY= -POSTMARK_DEV_EMAIL= -POSTMARK_WEBHOOK_KEY= - -# Twilio Messaging -TWILIO_ACCOUNT_SID=ACf9d16ca86a15882e24627571601d77a6 -TWILIO_FROM_NUMBER=+16467224582 -TWILIO_TEST_NUMBER= -TWILIO_WEBHOOK_URL= -# Note this must be the PRIMARY token to validate webhook signatures. -# This is the test token which will not actually work but is needed -# for the test environment. -TWILIO_AUTH_TOKEN=AC21717619d8cf45502cc2f7cd7aee139d - -# Sign in with Google -GOOGLE_CLIENT_ID= - -# Sign in with Apple -APPLE_SERVICE_ID= \ No newline at end of file +UPLOADS_GCS_BUCKET=bedrock-staging-uploads \ No newline at end of file diff --git a/services/api/package.json b/services/api/package.json index 0b7ba859..c73e6b34 100644 --- a/services/api/package.json +++ b/services/api/package.json @@ -9,8 +9,8 @@ "scripts": { "start": "node --env-file=.env --watch src/index.js", "debug": "MONGO_DEBUG=true yarn start", - "staging": "node --env-file=.env.staging --watch src/index.js", - "production": "node --env-file=.env.production --watch src/index.js", + "staging": "node --env-file=.env --env-file=.env.staging --watch src/index.js", + "production": "node --env-file=.env --env-file=.env.production --watch src/index.js", "start:production": "node --env-file=.env src/index", "lint": "eslint", "test": "jest", @@ -21,7 +21,7 @@ "docs:generate": "./scripts/docs/generate" }, "dependencies": { - "@bedrockio/fixtures": "^1.2.5", + "@bedrockio/fixtures": "^1.3.0", "@bedrockio/logger": "^1.0.8", "@bedrockio/model": "^0.7.3", "@bedrockio/yada": "^1.2.3", diff --git a/services/api/src/utils/csv.js b/services/api/src/utils/csv.js index 0db34e7c..68898d49 100644 --- a/services/api/src/utils/csv.js +++ b/services/api/src/utils/csv.js @@ -2,7 +2,6 @@ const { PassThrough } = require('stream'); const csv = require('fast-csv'); const yd = require('@bedrockio/yada'); -const config = require('@bedrockio/config'); const mongoose = require('mongoose'); const { get, startCase } = require('lodash'); @@ -10,7 +9,7 @@ const { serializeObject } = require('./serialize'); const formatter = Intl.NumberFormat('us'); -const API_URL = config.get('API_URL'); +const { API_URL } = process.env; const DEFAULT_OPTIONS = { readableHeaders: true, diff --git a/services/api/yarn.lock b/services/api/yarn.lock index 3a9f42e7..9f5302de 100644 --- a/services/api/yarn.lock +++ b/services/api/yarn.lock @@ -298,17 +298,11 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@bedrockio/config@^2.2.2": - version "2.2.3" - resolved "https://registry.yarnpkg.com/@bedrockio/config/-/config-2.2.3.tgz#bac37d12e36a99ec16668c8b5d1e05dec9658fa9" - integrity sha512-jfOcZIs63S0GaWQjh5vVIISr4b2vA0CWgm630N0FDB6wlW+O0Fsjox92Agx5nggVpSnNYWqzjuKaUb5RY3/ECw== - -"@bedrockio/fixtures@^1.2.5": - version "1.2.5" - resolved "https://registry.yarnpkg.com/@bedrockio/fixtures/-/fixtures-1.2.5.tgz#43aed9428d49bcec25a60a0fb39cb70643db7025" - integrity sha512-4gt5dZQuDT8Eu2IJK92XbhpCpL/9Vyc1esypjuB5O8Mt/SEKwL8R4Hjj50WcJ8qfAohLJIU7KIQOFUDR/9YVkg== +"@bedrockio/fixtures@^1.3.0": + version "1.3.0" + resolved "https://registry.yarnpkg.com/@bedrockio/fixtures/-/fixtures-1.3.0.tgz#80b2154a0c4f858b2628c4f708caf846e6ab4f2d" + integrity sha512-JrJEsIULg+0nXVZZyFAE4DKsMxz3MMbXvNXJowoC8rDwVK2ZBXdT+pe7biDlKoNmsRGdzosIBM24EUgFEo1vmg== dependencies: - "@bedrockio/config" "^2.2.2" "@bedrockio/logger" "^1.0.3" glob "^8.1.0" jszip "^3.10.1"