-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathsettings.js
77 lines (73 loc) · 1.92 KB
/
settings.js
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
var path = require('path')
var when = require('when')
var userDir = path.resolve(__dirname)
var settings = {
debugMaxLength: 10000000,
autoInstallModules: true,
httpAdminRoot: '/red',
httpNodeRoot: '/',
nodesDir: path.join(__dirname, 'nodes'),
functionGlobalContext: {}, // enables global context
httpNodeCors: {
origin: '*',
methods: 'GET,PUT,POST,DELETE'
},
editorTheme: {
userMenu: false,
tours: false,
page: {
title: '',
favicon: path.join(userDir, 'node-red', 'img', 'favicon.ico'),
css: path.join(userDir, 'node-red', 'css', 'index.css')
},
header: {
title: '',
image: path.join(userDir, 'node-red', 'img', 'enebular_logo.svg')
},
httpNodeCors: {
origin: '*',
methods: 'GET,PUT,POST,DELETE'
},
menu: {
'menu-item-import-library': true,
'menu-item-export-library': true
},
codeEditor: {
lib: 'monaco'
}
},
externalModules: {
autoInstall: true
},
adminAuth: {
type: 'credentials',
users: function (username) {
if (process.env.USERNAME == username) {
return when.resolve({ username: username, permissions: '*' })
} else {
return when.resolve(null)
}
},
authenticate: function (username, password) {
if (
process.env.USERNAME == username &&
process.env.PASSWORD == password
) {
return when.resolve({ username: username, permissions: '*' })
} else {
return when.resolve(null)
}
}
}
}
if (process.env.ISSUER) {
settings.storageModule = require('./pgstorage')
settings.enebularHost = process.env.ISSUER || 'http://localhost:7000'
settings.enebularUrl = settings.enebularHost
settings.secure_link = process.env.SECURE_LINK
settings.flow_expired = Number(process.env.FLOW_EXPIRED)
settings.pgAppname = 'enebular'
} else {
settings.userDir = path.join(__dirname)
}
module.exports = settings