diff --git a/nix/dev-shell.nix b/nix/dev-shell.nix --- a/nix/dev-shell.nix +++ b/nix/dev-shell.nix @@ -132,6 +132,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 test ! -d "$KEYSERVER_FACTS_DIR"; then + mkdir -p "$KEYSERVER_FACTS_DIR" +fi + +if test ! -f "$COMMAPP_URL_PATH"; then + cp "$SCRIPT_DIR/templates/commapp_url.json" "$COMMAPP_URL_PATH" +fi + +if test ! -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,6 @@ +{ + "baseDomain": "http://localhost:3000", + "basePath": "/commlanding/", + "baseRoutePath": "/commlanding/", + "https": false +}