From cc9f156c3903c485e3eea56e871c7842a4d7f9ef Mon Sep 17 00:00:00 2001 From: Marc Durdin Date: Tue, 14 Oct 2025 14:15:48 +0200 Subject: [PATCH 1/2] feat: add Javascript version of KeymanHosts Allows building of hostnames directly into scripts that respect the current tier of the website. Test-bot: skip --- _common/KeymanHosts.php | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/_common/KeymanHosts.php b/_common/KeymanHosts.php index 651270d..0a1fc36 100644 --- a/_common/KeymanHosts.php +++ b/_common/KeymanHosts.php @@ -83,6 +83,36 @@ public function fixupHostReferences($contents) { return $contents; } + /** + * Return a Javascript snippet that defines the Keyman website hostnames for + * the current environment, which should be injected into a SCRIPT element + * near the top of the document. + */ + public function emitJavascriptConst() { + echo <<s_keyman_com", + ['api.keyman.com']: "$this->api_keyman_com", + ['help.keyman.com']: "$this->help_keyman_com", + ['keyman.com']: "$this->keyman_com", + ['keymanweb.com']: "$this->keymanweb_com", + ['downloads.keyman.com']: "$this->downloads_keyman_com", + ['blog.keyman.com']: "$this->blog_keyman_com", + ['translate.keyman.com']: "$this->translate_keyman_com", + ['r.keymanweb.com']: "$this->r_keymanweb_com", + s: "$this->s_keyman_com", + api: "$this->api_keyman_com", + help: "$this->help_keyman_com", + keyman: "$this->keyman_com", + keymanweb: "$this->keymanweb_com", + downloads: "$this->downloads_keyman_com", + blog: "$this->blog_keyman_com", + translate: "$this->translate_keyman_com", + r_keymanweb: "$this->r_keymanweb_com", + }; +END; + } + public function overrideHost($host, $value) { if(empty($this->$host)) { // If there's no value set, then we must be overriding something invalid From e6967e0148eae87f814446e361a03b57acba2b5d Mon Sep 17 00:00:00 2001 From: Marc Durdin Date: Tue, 14 Oct 2025 15:15:51 +0200 Subject: [PATCH 2/2] fix: don't attempt to start container if already started --- _common/docker.inc.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/_common/docker.inc.sh b/_common/docker.inc.sh index 40bd966..f52764b 100644 --- a/_common/docker.inc.sh +++ b/_common/docker.inc.sh @@ -82,6 +82,7 @@ function start_docker_container() { local CONTAINER_ID=$(get_docker_container_id $CONTAINER_NAME) if [ ! -z "$CONTAINER_ID" ]; then builder_echo green "Container $CONTAINER_ID has already been started, listening on http://$HOST:$PORT" + return 0 fi # Start the Docker container