slate/node_common/environment.js

44 lines
1.9 KiB
JavaScript
Raw Normal View History

export const NODE = process.env.NODE_ENV || "development";
export const IS_PRODUCTION = NODE === "production";
2020-07-21 22:53:49 +03:00
export const PORT = process.env.PORT || 1337;
export const SOURCE = process.env.SOURCE;
2020-07-21 21:01:12 +03:00
2020-07-23 04:25:19 +03:00
// NOTE(jim):
// In production we don't use .env and manage secrets another way.
if (!IS_PRODUCTION) {
require("dotenv").config();
}
2020-10-24 23:05:13 +03:00
// NOTE(jim):
// Slate
export const POSTGRES_ADMIN_PASSWORD = process.env.POSTGRES_ADMIN_PASSWORD;
export const POSTGRES_ADMIN_USERNAME = process.env.POSTGRES_ADMIN_USERNAME;
export const POSTGRES_HOSTNAME = process.env.POSTGRES_HOSTNAME;
export const POSTGRES_DATABASE = process.env.POSTGRES_DATABASE;
export const JWT_SECRET = process.env.JWT_SECRET;
export const PUBSUB_SECRET = process.env.PUBSUB_SECRET;
2020-10-29 21:39:40 +03:00
export const ALLOWED_HOST = process.env.ALLOWED_HOST;
export const LOCAL_PASSWORD_ROUNDS_MANUAL = process.env.LOCAL_PASSWORD_ROUNDS_MANUAL;
2020-08-11 08:15:39 +03:00
export const LOCAL_PASSWORD_ROUNDS = process.env.LOCAL_PASSWORD_ROUNDS;
2020-09-16 21:44:18 +03:00
export const LOCAL_PASSWORD_SECRET = `$2b$${LOCAL_PASSWORD_ROUNDS}$${
process.env.LOCAL_PASSWORD_SECRET
}`;
2020-07-21 21:01:12 +03:00
2020-10-24 23:05:13 +03:00
// NOTE(jim): Custom avatars
2020-10-06 01:33:37 +03:00
export const AVATAR_SLATE_ID = process.env.AVATAR_SLATE_ID;
2020-10-24 23:05:13 +03:00
// NOTE(jim): Textile secrets
export const TEXTILE_HUB_KEY = process.env.TEXTILE_HUB_KEY;
export const TEXTILE_HUB_SECRET = process.env.TEXTILE_HUB_SECRET;
export const TEXTILE_HUB_STAGING_HOST = process.env.TEXTILE_HUB_STAGING_HOST;
2020-10-24 23:05:13 +03:00
// NOTE(jim): Slack updates
export const SOCIAL_SLACK_WEBHOOK_KEY = process.env.SOCIAL_SLACK_WEBHOOK_KEY;
2020-09-16 21:44:18 +03:00
export const SUPPORT_SLACK_WEBHOOK_KEY = process.env.SUPPORT_SLACK_WEBHOOK_KEY;
export const TEXTILE_SLACK_WEBHOOK_KEY = process.env.TEXTILE_SLACK_WEBHOOK_KEY;
2020-10-24 23:05:13 +03:00
// NOTE(jim): External servers
export const RESOURCE_URI_UPLOAD = process.env.RESOURCE_URI_UPLOAD;
export const RESOURCE_URI_STORAGE_UPLOAD = process.env.RESOURCE_URI_STORAGE_UPLOAD;
2020-10-24 23:05:13 +03:00
export const RESOURCE_URI_PUBSUB = process.env.RESOURCE_URI_PUBSUB;
2020-10-31 02:12:20 +03:00
export const RESOURCE_URI_SEARCH = process.env.RESOURCE_URI_SEARCH;