feat(avatar): NMSR skin renderer at avatar.${BASE_DOMAIN}, Drasl-backed
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>
This commit is contained in:
33
docker/nmsr/Dockerfile
Normal file
33
docker/nmsr/Dockerfile
Normal file
@@ -0,0 +1,33 @@
|
||||
# NMSR-as-a-Service (https://github.com/NickAcPT/nmsr-rs) — built from source.
|
||||
# Upstream ships no published image, so we vendor a pinned build. Adapted from
|
||||
# the upstream Dockerfile but: pinned to a commit (reproducible), and the config
|
||||
# is bind-mounted at runtime (not COPYed) so it can change without a rebuild.
|
||||
#
|
||||
# Pin — bump deliberately:
|
||||
ARG NMSR_REF=948ba4bc027b
|
||||
|
||||
FROM rust:slim-bookworm AS builder
|
||||
ARG NMSR_REF
|
||||
WORKDIR /tmp
|
||||
RUN apt-get update -y \
|
||||
&& apt-get --no-install-recommends install -y git libssl-dev pkg-config ca-certificates
|
||||
RUN git clone https://github.com/NickAcPT/nmsr-rs/
|
||||
WORKDIR /tmp/nmsr-rs
|
||||
RUN git checkout "${NMSR_REF}"
|
||||
# target-cpu=native: this image is built on the host that runs it (self-host).
|
||||
RUN RUSTFLAGS="-Ctarget-cpu=native" \
|
||||
cargo build --release --bin nmsr-aas --features ears --package nmsr-aas
|
||||
|
||||
FROM rust:slim-bookworm
|
||||
# mesa-vulkan-drivers provides lavapipe (software Vulkan) for headless rendering.
|
||||
RUN apt-get update -y \
|
||||
&& apt-get --no-install-recommends install -y mesa-vulkan-drivers ca-certificates
|
||||
WORKDIR /nmsr
|
||||
COPY --from=builder /tmp/nmsr-rs/target/release/nmsr-aas /nmsr/nmsr-aas
|
||||
ENV NMSR_USE_SMAA=1 \
|
||||
NMSR_SAMPLE_COUNT=1 \
|
||||
WGPU_BACKEND=vulkan \
|
||||
RUST_BACKTRACE=1
|
||||
EXPOSE 8080
|
||||
# config.toml is bind-mounted by docker-compose.nmsr.yml.
|
||||
CMD ["/nmsr/nmsr-aas", "-c", "/nmsr/config.toml"]
|
||||
Reference in New Issue
Block a user