Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

settings: add variable PLOTLY_CONNECTOR_BASE_URL #514

Merged
merged 1 commit into from
Aug 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions backend/persistent/QueryScheduler.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ class QueryScheduler {
metadata: {
query,
connectionId,
connectorUrl: `https://${getSetting('CONNECTOR_HTTPS_DOMAIN')}:${getSetting('PORT_HTTPS')}`
connectorUrl: getSetting('BASE_URL')
},
refresh_interval: formattedRefresh
}
Expand Down Expand Up @@ -377,7 +377,7 @@ class QueryScheduler {
metadata: {
query,
connectionId,
connectorUrl: `https://${getSetting('CONNECTOR_HTTPS_DOMAIN')}:${getSetting('PORT_HTTPS')}`
connectorUrl: getSetting('BASE_URL')
},
refresh_interval: formattedRefresh
}
Expand Down
6 changes: 6 additions & 0 deletions backend/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ const DEFAULT_SETTINGS = {

// Settings that depend on other settings are described here
const derivedSettingsNames = [
'BASE_URL',
'PLOTLY_API_URL',
'PLOTLY_URL',
'CONNECTIONS_PATH',
Expand All @@ -84,6 +85,11 @@ const derivedSettingsNames = [

function getDerivedSetting(settingName) {
switch (settingName) {
case 'BASE_URL':
return getSetting('IS_RUNNING_INSIDE_ON_PREM') ?
process.env.PLOTLY_CONNECTOR_BASE_URL :
`https://${getSetting('CONNECTOR_HTTPS_DOMAIN')}:${getSetting('PORT_HTTPS')}`;

case 'PLOTLY_URL': {
if (getSetting('PLOTLY_API_DOMAIN') ===
DEFAULT_SETTINGS.PLOTLY_API_DOMAIN) {
Expand Down