From 96872ec37256d3ea5f0222af3e95bbfa6e93e20a Mon Sep 17 00:00:00 2001
From: Wade Barnes
Date: Fri, 24 Nov 2023 14:29:32 -0800
Subject: [PATCH 1/2] Add support for linking to an IndyScan instance.
Signed-off-by: Wade Barnes
---
README.md | 4 +++-
docker-compose.yml | 2 ++
server/server.py | 4 ++++
server/static/index.html | 31 ++++---------------------------
server/static/ledger_state.html | 31 +++++++++++++++++++++++++++++++
5 files changed, 44 insertions(+), 28 deletions(-)
create mode 100644 server/static/ledger_state.html
diff --git a/README.md b/README.md
index 7eaef9e..d1a7a07 100644
--- a/README.md
+++ b/README.md
@@ -258,11 +258,13 @@ The node pool can have a trust anchor write a did for you. That feature is avail
It is possible to customize some of the aspects of the Ledger Browser at run-time, by using the following environment variables:
- `REGISTER_NEW_DIDS`: if set to `True`, it will enable the user interface allowing new identity owners to write a DID to the ledger. It defaults to `False`.
-- `LEDGER_INSTANCE_NAME`: the name of the ledger instance the Ledger Brwoser is connected to. Defaults to `Ledger Browser`.
+- `LEDGER_INSTANCE_NAME`: the name of the ledger instance the Ledger Browser is connected to. Defaults to `Ledger Browser`.
- `INFO_SITE_URL`: a URL that will be displayed in the header, and can be used to reference another external website containing details/resources on the current ledger browser instance.
- `INFO_SITE_TEXT`: the display text used for the `INFO_SITE_URL`. If not specified, it will default to the value set for `INFO_SITE_URL`.
- `WEB_ANALYTICS_SCRIPT`: the JavaScript code used by web analytics servers. Populate this environment variable if you want to track the usage of your site with Matomo, Google Analytics or any other JavaScript based trackers. Include the whole `````` tag, ensuring quotes are escaped properly for your command-line interpreter (e.g.: bash, git bash, etc.).
- `LEDGER_CACHE_PATH`: if set, it will instruct the ledger to create an on-disk cache, rather than in-memory. The image supplies a folder for this purpose; `$HOME/.indy_client/ledger-cache`. The file should be placed into this directory (e.g.: `/home/indy/.indy-client/ledger-cache/ledger_cache_file` or `$HOME/.indy_client/ledger-cache/ledger_cache_file`).
+- `INDY_SCAN_URL`: the URL to the external IndyScan ledger browser instance for the network. This will replace the links to the builtin ledger browser tools.
+- `INDY_SCAN_TEXT`: the display text used for the `INDY_SCAN_URL`. If not specified, it will default to the value set for `INDY_SCAN_URL`.
## Contributing
diff --git a/docker-compose.yml b/docker-compose.yml
index 7674d93..5566a03 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -41,6 +41,8 @@ services:
- WEB_ANALYTICS_SCRIPT=${WEB_ANALYTICS_SCRIPT}
- INFO_SITE_TEXT=${INFO_SITE_TEXT}
- INFO_SITE_URL=${INFO_SITE_URL}
+ - INDY_SCAN_URL=${INDY_SCAN_URL}
+ - INDY_SCAN_TEXT=${INDY_SCAN_TEXT}
networks:
- von
ports:
diff --git a/server/server.py b/server/server.py
index 01203e1..54a9613 100644
--- a/server/server.py
+++ b/server/server.py
@@ -39,6 +39,8 @@
INFO_SITE_URL = os.getenv("INFO_SITE_URL")
INFO_SITE_TEXT = os.getenv("INFO_SITE_TEXT") or os.getenv("INFO_SITE_URL")
+INDY_SCAN_URL = os.getenv("INDY_SCAN_URL")
+INDY_SCAN_TEXT = os.getenv("INDY_SCAN_TEXT") or os.getenv("INDY_SCAN_URL")
APP = web.Application()
aiohttp_jinja2.setup(APP, loader=jinja2.FileSystemLoader("./static"))
@@ -56,6 +58,8 @@ async def index(request):
"WEB_ANALYTICS_SCRIPT": WEB_ANALYTICS_SCRIPT,
"INFO_SITE_TEXT": INFO_SITE_TEXT,
"INFO_SITE_URL": INFO_SITE_URL,
+ "INDY_SCAN_URL": INDY_SCAN_URL,
+ "INDY_SCAN_TEXT": INDY_SCAN_TEXT,
}
diff --git a/server/static/index.html b/server/static/index.html
index a59820c..9f0ade1 100644
--- a/server/static/index.html
+++ b/server/static/index.html
@@ -93,34 +93,11 @@
+ {% endraw %}
-
-
-
-
- Ledger State
-
-
-
-
-
-
- Fetching transactions
-
-
-
-
- View the state of the ledgers:
-
-
- Domain
-
- Pool
-
- Config
-
-
-
+ {% include 'ledger_state.html' %}
+
+ {% raw %}