Add NMSR-as-a-Service (NickAcPT/nmsr-rs) rendering players' skins/avatars,
sourced from Drasl instead of Mojang.
- docker/nmsr/Dockerfile build from source, pinned to commit 948ba4bc027b
(ears feature, lavapipe software Vulkan)
- nmsr/config.toml.tmpl [mojank] -> http://auth.${BASE_DOMAIN}; Drasl
serves the Mojang-compatible routes at its bare
BaseURL and embeds absolute skin URLs that NMSR
fetches directly. allow_offline_mode_uuids=true.
- docker-compose.nmsr.yml nmsr service (build), host bind 127.0.0.1:9898
only, config mount; mounts the caddy avatar snippet
- caddy/conf.d/40-avatar.caddy avatar.${BASE_DOMAIN} -> reverse_proxy nmsr:8080
- nginx-front + LE_SUBDOMAINS public TLS vhost (HSTS) + cert for avatar
- render-config.sh / .gitignore render + ignore nmsr/config.toml
Skin resolution stays internal over mcnet (caddy alias -> drasl), no public
round-trip.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
27 lines
1.0 KiB
Bash
Executable File
27 lines
1.0 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# render-config.sh — turn *.tmpl files into real configs via envsubst.
|
|
# Substitutes ONLY ${BASE_DOMAIN} and ${HOST_LAN_IP} so literal $-syntax that
|
|
# belongs to the target file (dnsmasq, caddy, toml) is left untouched.
|
|
# Halts on any unset var or missing template (cautious: no half-rendered output).
|
|
set -euo pipefail
|
|
|
|
cd "$(dirname "$0")/.." # repo root
|
|
|
|
[ -f .env ] && { set -a; . ./.env; set +a; }
|
|
: "${BASE_DOMAIN:?BASE_DOMAIN unset (set in .env)}"
|
|
: "${HOST_LAN_IP:?HOST_LAN_IP unset (set in .env)}"
|
|
|
|
render() { # $1=template $2=output
|
|
[ -f "$1" ] || { echo "missing template: $1" >&2; exit 1; }
|
|
envsubst '${BASE_DOMAIN} ${HOST_LAN_IP}' < "$1" > "$2"
|
|
echo "rendered $2"
|
|
}
|
|
|
|
render drasl/config/config.toml.tmpl drasl/config/config.toml
|
|
render nmsr/config.toml.tmpl nmsr/config.toml
|
|
render dnsmasq/dnsmasq.conf.tmpl dnsmasq/dnsmasq.conf
|
|
|
|
# pack templates (mods/*.pw.toml.tmpl, CustomSkinLoader, …) + packwiz index.
|
|
# Delegated to render-pack.sh (BASE_DOMAIN only — single source of pack render).
|
|
tooling/render-pack.sh
|