Skip to content

Commit

Permalink
chore: add support for plugins in proxy configuration, add back domains
Browse files Browse the repository at this point in the history
  • Loading branch information
mgiancola9 committed Nov 12, 2024
1 parent a268dff commit 3af99fd
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions proxy.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
"urlShortener": "",
"contactEmail": "",
"csrfProtection": true,
"plugins": [],
"tls": {
"enabled": true,
"key": "certs/key.pem",
Expand Down
18 changes: 18 additions & 0 deletions src/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ let _sessionMaxAgeHours = defaultSettings.sessionMaxAgeHours;
let _tlsEnabled = defaultSettings.tls.enabled;
let _tlsKeyPath = defaultSettings.tls.key;
let _tlsCertPath = defaultSettings.tls.cert;
let _plugins = defaultSettings.plugins;
let _commitConfig = defaultSettings.commitConfig;
let _attestationConfig = defaultSettings.attestationConfig;
let _privateOrganizations = defaultSettings.privateOrganizations;
Expand Down Expand Up @@ -162,6 +163,14 @@ const getCSRFProtection = () => {
return _csrfProtection;
};

// Get loadable push plugins
const getPlugins = () => {
if (_userSettings && _userSettings.plugins) {
_plugins = _userSettings.plugins;
}
return _plugins;
};

const getTLSKeyPath = () => {
if (_userSettings && _userSettings.tlsKeyPemPath) {
console.log(
Expand Down Expand Up @@ -198,6 +207,13 @@ const getTLSEnabled = () => {
return _tlsEnabled;
};

const getDomains = () => {
if (_userSettings && _userSettings.domains) {
_domains = _userSettings.domains;
}
return _domains;
};

exports.getAPIs = getAPIs;
exports.getProxyUrl = getProxyUrl;
exports.getAuthorisedList = getAuthorisedList;
Expand All @@ -213,6 +229,8 @@ exports.getPrivateOrganizations = getPrivateOrganizations;
exports.getURLShortener = getURLShortener;
exports.getContactEmail = getContactEmail;
exports.getCSRFProtection = getCSRFProtection;
exports.getPlugins = getPlugins;
exports.getTLSKeyPath = getTLSKeyPath;
exports.getTLSCertPath = getTLSCertPath;
exports.getTLSEnabled = getTLSEnabled;
exports.getDomains = getDomains;

0 comments on commit 3af99fd

Please sign in to comment.