Page MenuHomePhabricator

D5274.id17256.diff
No OneTemporary

D5274.id17256.diff

diff --git a/nix/dev-shell.nix b/nix/dev-shell.nix
--- a/nix/dev-shell.nix
+++ b/nix/dev-shell.nix
@@ -105,6 +105,8 @@
# shell commands to be ran upon entering shell
shellHook = ''
+ PRJ_ROOT=$(git rev-parse --show-toplevel)
+
# Set development environment variable defaults
source "${../scripts/source_development_defaults.sh}"
@@ -121,6 +123,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,6 @@
+{
+ "baseDomain": "http://localhost:3000",
+ "basePath": "/comm/",
+ "baseRoutePath": "/",
+ "https": false
+}
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,6 @@
+{
+ "baseDomain": "http://localhost:3000",
+ "basePath": "/commlanding/",
+ "baseRoutePath": "/commlanding/",
+ "https": false
+}

File Metadata

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

Event Timeline