From dcaded8409390f4c87bfaf68a215088608e42f68 Mon Sep 17 00:00:00 2001 From: Taylor Helsper Date: Sat, 7 Jan 2023 23:48:22 -0600 Subject: [PATCH] Add Relay URL info to nostr relay page --- .../usr/share/mynode_apps/nostrrsrelay/nostrrsrelay.json | 9 +++++++++ rootfs/standard/var/pynode/application_info.py | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/rootfs/standard/usr/share/mynode_apps/nostrrsrelay/nostrrsrelay.json b/rootfs/standard/usr/share/mynode_apps/nostrrsrelay/nostrrsrelay.json index ffa63c7c..90c645c4 100644 --- a/rootfs/standard/usr/share/mynode_apps/nostrrsrelay/nostrrsrelay.json +++ b/rootfs/standard/usr/share/mynode_apps/nostrrsrelay/nostrrsrelay.json @@ -53,6 +53,15 @@ "For example, you can add the relay to noscl via the command: noscl relay add wss://localhost:5051", "Enjoy!" ] + }, + { + "heading": "Relay Addresses", + "content": [ + "wss://{LOCAL_IP_ADDRESS}:5051", + "wss://{APP_TOR_ADDRESS}:5051", + "ws://{LOCAL_IP_ADDRESS}:5050", + "ws://{APP_TOR_ADDRESS}:5050" + ] } ], "can_uninstall": true, diff --git a/rootfs/standard/var/pynode/application_info.py b/rootfs/standard/var/pynode/application_info.py index 0eae8955..2fe7a9c8 100644 --- a/rootfs/standard/var/pynode/application_info.py +++ b/rootfs/standard/var/pynode/application_info.py @@ -169,6 +169,7 @@ def replace_app_info_variables(app_data, text): if app_data["https_port"] != None: text = text.replace("{HTTPS_PORT}", str(app_data["https_port"])) text = text.replace("{APP_TOR_ADDRESS}", get_onion_url_for_service(app_data["short_name"])) + text = text.replace("{LOCAL_IP_ADDRESS}", get_local_ip()) return text def initialize_application_defaults(app): @@ -241,6 +242,10 @@ def initialize_application_defaults(app): btn["onclick"] = replace_app_info_variables(app, btn["onclick"]) for key in app["install_env_vars"]: app["install_env_vars"][key] = replace_app_info_variables(app, app["install_env_vars"][key]) + for i,section in enumerate(app["app_page_content"]): + for j,line in enumerate(section["content"]): + section["content"][j] = replace_app_info_variables(app, line) + app["app_page_content"][i] = section return app