-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconfig.js
More file actions
57 lines (51 loc) · 1.64 KB
/
config.js
File metadata and controls
57 lines (51 loc) · 1.64 KB
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
53
54
55
56
57
'use strict';
const keys = process.env.REST_ON_COUCH_APP_KEYS;
if (!keys) {
throw new Error(
'There must be at least one app key defined in REST_ON_COUCH_APP_KEYS',
);
}
const appKeys = keys.split(',');
const origins = process.env.REST_ON_COUCH_ORIGINS;
if (origins === '') {
throw new Error(
'There must be at least one origin defined in REST_ON_COUCH_ORIGINS',
);
}
const allowedOrigins = origins.split(',');
const adminUsers = process.env.REST_ON_COUCH_ADMIN_USERS;
let administrators = ['admin@cheminfo.org'];
if (adminUsers) {
administrators.push(...adminUsers.split(','));
}
const proxyPrefix = process.env.REST_ON_COUCH_PROXY_PATH || '';
module.exports = {
allowedOrigins, // ['https://server1.example.com', 'https://server2.example.com', ...]
keys: appKeys, // ['key1', 'key2', ...]
administrators, // ['admin1@example.com', 'admin2@example.com', ...]
port: 4000,
url: 'http://couchdb:5984',
username: 'rest-on-couch',
superAdministrators: ['admin@goodyear.com'],
password: process.env.COUCHDB_ROC_SERVER_PASSWORD,
adminPassword: process.env.COUCHDB_ROC_ADMIN_PASSWORD,
logLevel: 'TRACE',
// Make sure logged audit actions get the ip address from 'X-Forwarded-For' header
proxy: true,
proxyPrefix: proxyPrefix + '/roc/',
publicAddress: allowedOrigins[0],
auth: {
// do not disable couchdb login. You can enable "showLogin" if necessary
couchdb: {
showLogin: false,
},
},
// Default database rights
// Any logged in user can create documents. Only owners can read and write their own documents
rights: {
read: [],
write: [],
create: ['anyuser'],
createGroup: ['anyuser'],
},
};