@@ -17,12 +17,12 @@ let _cookieSecret = defaultSettings.cookieSecret;
17
17
let _sessionMaxAgeHours = defaultSettings . sessionMaxAgeHours ;
18
18
let _sslKeyPath = defaultSettings . sslKeyPemPath ;
19
19
let _sslCertPath = defaultSettings . sslCertPemPath ;
20
- const _commitConfig = defaultSettings . commitConfig ;
21
- const _attestationConfig = defaultSettings . attestationConfig ;
22
- const _privateOrganizations = defaultSettings . privateOrganizations ;
23
- const _urlShortener = defaultSettings . urlShortener ;
24
- const _contactEmail = defaultSettings . contactEmail ;
25
- const _csrfProtection = defaultSettings . csrfProtection ;
20
+ let _commitConfig = defaultSettings . commitConfig ;
21
+ let _attestationConfig = defaultSettings . attestationConfig ;
22
+ let _privateOrganizations = defaultSettings . privateOrganizations ;
23
+ let _urlShortener = defaultSettings . urlShortener ;
24
+ let _contactEmail = defaultSettings . contactEmail ;
25
+ let _csrfProtection = defaultSettings . csrfProtection ;
26
26
27
27
// Get configured proxy URL
28
28
const getProxyUrl = ( ) => {
@@ -114,31 +114,49 @@ const getSessionMaxAgeHours = () => {
114
114
115
115
// Get commit related configuration
116
116
const getCommitConfig = ( ) => {
117
+ if ( _userSettings && _userSettings . commitConfig ) {
118
+ _commitConfig = _userSettings . commitConfig ;
119
+ }
117
120
return _commitConfig ;
118
121
} ;
119
122
120
123
// Get attestation related configuration
121
124
const getAttestationConfig = ( ) => {
125
+ if ( _userSettings && _userSettings . attestationConfig ) {
126
+ _attestationConfig = _userSettings . attestationConfig ;
127
+ }
122
128
return _attestationConfig ;
123
129
} ;
124
130
125
131
// Get private organizations related configuration
126
132
const getPrivateOrganizations = ( ) => {
133
+ if ( _userSettings && _userSettings . privateOrganizations ) {
134
+ _privateOrganizations = _userSettings . privateOrganizations ;
135
+ }
127
136
return _privateOrganizations ;
128
137
} ;
129
138
130
139
// Get URL shortener
131
140
const getURLShortener = ( ) => {
141
+ if ( _userSettings && _userSettings . urlShortener ) {
142
+ _urlShortener = _userSettings . urlShortener ;
143
+ }
132
144
return _urlShortener ;
133
145
} ;
134
146
135
147
// Get contact e-mail address
136
148
const getContactEmail = ( ) => {
149
+ if ( _userSettings && _userSettings . contactEmail ) {
150
+ _contactEmail = _userSettings . contactEmail ;
151
+ }
137
152
return _contactEmail ;
138
153
} ;
139
154
140
155
// Get CSRF protection flag
141
156
const getCSRFProtection = ( ) => {
157
+ if ( _userSettings && _userSettings . csrfProtection ) {
158
+ _csrfProtection = _userSettings . csrfProtection ;
159
+ }
142
160
return _csrfProtection ;
143
161
} ;
144
162
@@ -147,7 +165,7 @@ const getSSLKeyPath = () => {
147
165
_sslKeyPath = _userSettings . sslKeyPemPath ;
148
166
}
149
167
if ( ! _sslKeyPath ) {
150
- return " ../../certs/key.pem" ;
168
+ return ' ../../certs/key.pem' ;
151
169
}
152
170
return _sslKeyPath ;
153
171
} ;
@@ -157,7 +175,7 @@ const getSSLCertPath = () => {
157
175
_sslCertPath = _userSettings . sslCertPemPath ;
158
176
}
159
177
if ( ! _sslCertPath ) {
160
- return " ../../certs/cert.pem" ;
178
+ return ' ../../certs/cert.pem' ;
161
179
}
162
180
return _sslCertPath ;
163
181
} ;
@@ -178,4 +196,4 @@ exports.getURLShortener = getURLShortener;
178
196
exports . getContactEmail = getContactEmail ;
179
197
exports . getCSRFProtection = getCSRFProtection ;
180
198
exports . getSSLKeyPath = getSSLKeyPath ;
181
- exports . getSSLCertPath = getSSLCertPath ;
199
+ exports . getSSLCertPath = getSSLCertPath ;
0 commit comments