forked from ethereum/sourcify
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.ts
52 lines (49 loc) · 1.85 KB
/
config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/* eslint-disable no-useless-escape */
import * as dotenv from 'dotenv';
import path from 'path';
dotenv.config({ path: path.resolve(__dirname, "..", "environments/.env") });
export default {
monitor: {
port: process.env.MONITOR_PORT || 80
},
ui: {
port: process.env.UI_PORT || 1234
},
server: {
port: process.env.SERVER_PORT || 5000,
url: process.env.SERVER_URL || "http://localhost:5000"
},
localchain: {
port: process.env.LOCALCHAIN_PORT || 8545,
url: process.env.LOCALCHAIN_URL,
},
repository: {
port: process.env.REPOSITORY_PORT || 80,
path: process.env.MOCK_REPOSITORY || path.resolve(__dirname, process.env.REPOSITORY_PATH!) || path.resolve(__dirname, './repository'),
dbPath: process.env.MOCK_DATABASE || path.resolve(__dirname, process.env.DATABASE_PATH!) || path.resolve(__dirname, './database')
},
mq: {
username: process.env.RABBITMQUSERNAME,
password: process.env.RABBITMQPASSWORD
},
testing: process.env.TESTING || false,
tag: process.env.TAG || 'latest',
endpoint: {
infuraId: process.env.INFURA_ID,
alchemyId: process.env.ALCHEMY_ID_ETH_MAINNET,
ethereumNode: process.env.ETHEREUM_NODE
},
logging: {
dir: process.env.LOGGING_DIR || 'logs',
level: process.env.LOGGING_LEVEL || 'debug'
},
session: {
secret: process.env.SESSION_SECRET || "session top secret",
maxAge: parseInt(process.env.SESSION_MAX_AGE, 10) || (12 * 60 * 60 * 1000), // 12 hrs in millis
secure: !process.env.RUNNING_LOCALLY && !process.env.TESTING
},
corsAllowedOrigins: [
/^https?:\/\/(?:.+\.)?sourcify.dev$/, // sourcify.dev and subdomains
process.env.NODE_ENV === "development" && /^https?:\/\/localhost(?::\d+)?$/, // localhost on any port
]
}