From 5fde56c3e1d367bc17c37d89edb4e0352e804757 Mon Sep 17 00:00:00 2001 From: Bruno Besson Date: Tue, 18 Oct 2022 15:52:08 +0200 Subject: [PATCH] build: allow to use docker production build with demo configuration If hostname is that of the demo, then use demo urls. --- src/js/config.js | 6 +++++- src/views/Navigation.vue | 4 ++-- src/views/document/utils/boxes/CommentsBox.vue | 2 +- vue.config.js | 4 ++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/js/config.js b/src/js/config.js index 48e4700972..6a564ed9f5 100644 --- a/src/js/config.js +++ b/src/js/config.js @@ -12,8 +12,12 @@ config.setUrlsName = function (name) { const urlsName = window.localStorage.getItem(LOCAL_STORAGE_KEY) ?? config.urls.name; -if (!config.isProduction) { +if (config.isBackendSelectable) { config.urls = config.urlsConfigurations[urlsName]; +} else if (location.hostname === 'www.demov6.camptocamp.org') { + // production builds use production urls by default. + // use hostname to set urls for demo + config.urls = config.urlsConfigurations['demo']; } export default config; diff --git a/src/views/Navigation.vue b/src/views/Navigation.vue index 0bce127439..bf4087f167 100644 --- a/src/views/Navigation.vue +++ b/src/views/Navigation.vue @@ -38,14 +38,14 @@ -