From da96b77b0b576b2d6ad8241c460c4bed14cf2959 Mon Sep 17 00:00:00 2001
From: cgeek <cem.moreau@gmail.com>
Date: Wed, 19 Feb 2025 23:18:03 +0100
Subject: [PATCH] fix: Docker config + documentation

---
 docker/README.md         |  3 +++
 docker/docker-entrypoint | 15 +++++++++++++++
 2 files changed, 18 insertions(+)

diff --git a/docker/README.md b/docker/README.md
index 0110be191..f346b5cb7 100644
--- a/docker/README.md
+++ b/docker/README.md
@@ -68,6 +68,9 @@ volumes:
 | `DUNITER_DISABLE_PROMETHEUS` | Boolean to disable the Prometheus endpoint on port 9615.                                                                                                                                                                                                                                                                                             | `false`                                                                                     |
 | `DUNITER_DISABLE_TELEMETRY`  | Boolean to disable connecting to the Substrate telemetry server.                                                                                                                                                                                                                                                                                     | `false`                                                                                     |
 | `DUNITER_PRUNING_PROFILE`    | _ `default`<br> _ `archive`: keep all blocks and state blocks<br> \* `light`: keep only last 256 state blocks and last 14400 blocks (one day duration)                                                                                                                                                                                               | `default`                                                                                   |
+| `DUNITER_PUBLIC_RPC`         | The public RPC endpoint to gossip on the network and make available in the apps. | None |
+| `DUNITER_PUBLIC_SQUID`       | The public Squid graphql endpoint to gossip on the network and make available in the apps. | None |
+| `DUNITER_PUBLIC_ENDPOINTS`   | Path to a JSON file containing public endpoints to gossip on the network. The file should use the following format:<br>```{"endpoints": [  { "protocol": "rpc", "address": "wss://gdev.example.com" },  { "protocol": "squid", "address": "gdev.example.com/graphql/v1" }]}``` | None |
 
 ## Other Duniter options
 
diff --git a/docker/docker-entrypoint b/docker/docker-entrypoint
index 3666aad0e..1e064d757 100755
--- a/docker/docker-entrypoint
+++ b/docker/docker-entrypoint
@@ -59,6 +59,21 @@ if [ -n "$DUNITER_PUBLIC_ADDR" ]; then
   set -- "$@" --public-addr "$DUNITER_PUBLIC_ADDR"
 fi
 
+# Define public RPC endpoint (gossiped on the network)
+if [ -n "$DUNITER_PUBLIC_RPC" ]; then
+  set -- "$@" --public-rpc "$DUNITER_PUBLIC_RPC"
+fi
+
+# Define public Squid endpoint (gossiped on the network)  
+if [ -n "$DUNITER_PUBLIC_SQUID" ]; then
+  set -- "$@" --public-squid "$DUNITER_PUBLIC_SQUID"
+fi
+
+# Define public endpoints from JSON file (gossiped on the network)
+if [ -n "$DUNITER_PUBLIC_ENDPOINTS" ]; then
+  set -- "$@" --public-endpoints "$DUNITER_PUBLIC_ENDPOINTS"
+fi
+
 # Define listen address (inside docker)
 if [ -n "$DUNITER_LISTEN_ADDR" ]; then
   set -- "$@" --listen-addr "$DUNITER_LISTEN_ADDR"
-- 
GitLab