From 5a32b94da1bf875ce73f73f8ced270e7e8a04352 Mon Sep 17 00:00:00 2001 From: Disassembler Date: Wed, 18 Jul 2018 12:32:40 +0200 Subject: [PATCH] Show proper external URL in Pandora, fixes #264 --- pandora.sh | 1 + pandora/srv/pandora/conf/config.jsonc | 2 +- pandora/srv/pandora/update-url.sh | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100755 pandora/srv/pandora/update-url.sh diff --git a/pandora.sh b/pandora.sh index ddce635..845df6f 100755 --- a/pandora.sh +++ b/pandora.sh @@ -37,6 +37,7 @@ else fi cp ${SOURCE_DIR}/srv/pandora/conf/gunicorn_config.py /srv/pandora/conf/gunicorn_config.py envsubst <${SOURCE_DIR}/srv/pandora/conf/local_settings.py >/srv/pandora/conf/local_settings.py +cp ${SOURCE_DIR}/srv/pandora/update-url.sh /srv/pandora/update-url.sh # Set "production values" (increases performance) only if the DEBUG environment variable is not set if [ ${DEBUG:-0} -eq 0 ]; then diff --git a/pandora/srv/pandora/conf/config.jsonc b/pandora/srv/pandora/conf/config.jsonc index 953c4b7..89fe7de 100644 --- a/pandora/srv/pandora/conf/config.jsonc +++ b/pandora/srv/pandora/conf/config.jsonc @@ -1033,7 +1033,7 @@ examples (config.SITENAME.jsonc) that are part of this pan.do/ra distribution. "id": "pandora", "name": "pan.do/ra", "sendReferrer": true, - "url": "pandora.local" + "url": "pandora.spotter.vm" }, /* "sitePages" defines the sections of the main site dialog. If "news" is diff --git a/pandora/srv/pandora/update-url.sh b/pandora/srv/pandora/update-url.sh new file mode 100755 index 0000000..061597f --- /dev/null +++ b/pandora/srv/pandora/update-url.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +HOST="${1}" +[ "${2}" != "443" ] && HOST="${1}:${2}" + +sed -i "s|^ \"url\":.*| \"url\": \"pandora.${HOST}\"|" /srv/pandora/conf/config.jsonc