Page MenuHomePhabricator

D5274.id17900.diff
No OneTemporary

D5274.id17900.diff

diff --git a/nix/dev-shell.nix b/nix/dev-shell.nix
--- a/nix/dev-shell.nix
+++ b/nix/dev-shell.nix
@@ -134,6 +134,9 @@
wait "$mariadb_pid" "$redis_pid"
'' + ''
+ # Render default configuration for keyserver
+ $PRJ_ROOT/scripts/create_url_facts.sh
+
# Provide decent bash prompt
source "${better-prompt}/bin/better-prompt"
diff --git a/scripts/create_url_facts.sh b/scripts/create_url_facts.sh
new file mode 100755
--- /dev/null
+++ b/scripts/create_url_facts.sh
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+
+set -euo pipefail
+
+SCRIPT_DIR=$(cd "$(dirname "$0")" || true; pwd -P)
+ROOT_DIR="${SCRIPT_DIR}/.."
+KEYSERVER_FACTS_DIR="${ROOT_DIR}/keyserver/facts"
+COMMAPP_URL_PATH="${KEYSERVER_FACTS_DIR}/commapp_url.json"
+LANDING_URL_PATH="${KEYSERVER_FACTS_DIR}/landing_url.json"
+
+if [[ ! -d "$KEYSERVER_FACTS_DIR" ]]; then
+ mkdir -p "$KEYSERVER_FACTS_DIR"
+fi
+
+if [[ ! -f "$COMMAPP_URL_PATH" ]]; then
+ cp "$SCRIPT_DIR/templates/commapp_url.json" "$COMMAPP_URL_PATH"
+fi
+
+if [[ ! -f "$LANDING_URL_PATH" ]]; then
+ cp "$SCRIPT_DIR/templates/landing_url.json" "$LANDING_URL_PATH"
+fi
diff --git a/scripts/templates/commapp_url.json b/scripts/templates/commapp_url.json
new file mode 100644
--- /dev/null
+++ b/scripts/templates/commapp_url.json
@@ -0,0 +1,7 @@
+{
+ "baseDomain": "http://localhost:3000",
+ "basePath": "/comm/",
+ "baseRoutePath": "/comm/",
+ "https": false,
+ "proxy": "none"
+}
diff --git a/scripts/templates/landing_url.json b/scripts/templates/landing_url.json
new file mode 100644
--- /dev/null
+++ b/scripts/templates/landing_url.json
@@ -0,0 +1,7 @@
+{
+ "baseDomain": "http://localhost:3000",
+ "basePath": "/commlanding/",
+ "baseRoutePath": "/commlanding/",
+ "https": false,
+ "proxy": "none"
+}

File Metadata

Mime Type
text/plain
Expires
Thu, Dec 5, 6:57 AM (15 h, 28 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2614577
Default Alt Text
D5274.id17900.diff (1 KB)

Event Timeline