Rootstock: include $DOMAIN in http hosts whitelist

rskj's hosts whitelist is exact-match (no wildcards). Use HOCON env-var
substitution ${?DOMAIN} to inject the per-host public domain into the
allowed list. Pass DOMAIN env var into the container via the rskj
template.

Allowed hosts list: [localhost, 127.0.0.1, ::1, ${?DOMAIN}]
- localhost variants for direct/internal access
- DOMAIN for traefik-forwarded requests (Host header = public domain)
This commit is contained in:
2026-05-05 19:25:57 +00:00
parent bbb6205cb4
commit 7dc379dd05
4 changed files with 8 additions and 2 deletions

View File

@@ -11,7 +11,9 @@ rpc {
http = {
enabled = true
bind_address = "0.0.0.0"
hosts = ["*"]
# Whitelist: include localhost variants AND the public domain.
# ${?DOMAIN} is HOCON env-var sub: skipped if env var is unset.
hosts = ["localhost", "127.0.0.1", "::1", ${?DOMAIN}]
port = 8545
}
ws = {

View File

@@ -11,7 +11,9 @@ rpc {
http = {
enabled = true
bind_address = "0.0.0.0"
hosts = ["*"]
# Whitelist: include localhost variants AND the public domain.
# ${?DOMAIN} is HOCON env-var sub: skipped if env var is unset.
hosts = ["localhost", "127.0.0.1", "::1", ${?DOMAIN}]
port = 8545
}
ws = {

View File

@@ -52,6 +52,7 @@ services:
- 8545
- 8546
environment:
DOMAIN: ${DOMAIN}
RSKJ_SYS_PROPS: -Drpc.providers.web.http.bind_address=0.0.0.0
restart: unless-stopped
stop_grace_period: 5m

View File

@@ -52,6 +52,7 @@ services:
- 8545
- 8546
environment:
DOMAIN: ${DOMAIN}
RSKJ_SYS_PROPS: -Drpc.providers.web.http.bind_address=0.0.0.0
restart: unless-stopped
stop_grace_period: 5m