From 3af99fdc08da77ae5f553449d5460e06a7389a81 Mon Sep 17 00:00:00 2001 From: Michael Giancola Date: Tue, 12 Nov 2024 14:14:00 -0500 Subject: [PATCH] chore: add support for plugins in proxy configuration, add back domains --- proxy.config.json | 1 + src/config/index.js | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/proxy.config.json b/proxy.config.json index 5f4106b6..fdb32a0d 100644 --- a/proxy.config.json +++ b/proxy.config.json @@ -97,6 +97,7 @@ "urlShortener": "", "contactEmail": "", "csrfProtection": true, + "plugins": [], "tls": { "enabled": true, "key": "certs/key.pem", diff --git a/src/config/index.js b/src/config/index.js index c311fa26..bf461f7d 100644 --- a/src/config/index.js +++ b/src/config/index.js @@ -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; @@ -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( @@ -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; @@ -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;