f1-circuits: become a nox mesh module
The mesh builds the CDN from this repository and a commit (novox/hq ADR 0069); registry-api.novox.be, where HAL's image came from, is retired, so the running container can no longer be re-pulled. The HAL module.yml and service/docker-compose.yml retire with HAL. The Kometa metadata links every poster to this service's own address, which was the literal https://f1-circuits.zurag.be. It is now F1_CIRCUITS_BASE_URL, written by the mesh from the route's name (${bound:route:name}, mesh-controller #149) - falling back to the old address, so HAL's deployment behaves as before. The tile user agent follows it. The poster cache is a placed directory mounted at /app/cache, as HAL's /services/f1-circuits/cache was. The image was built from unpinned pip installs; service/requirements.txt now pins the exact set the running container has (pip freeze), and the base is python 3.12.13-alpine3.24 by digest (a later alpine 3.24 patch than the running build's 3.24.0 - the older digest is no longer tagged). The slug "f1" keeps the route login within 20 characters on any machine. Verified: the manifest parses on mesh-controller main and #149 and renders for a zurag.be node (F1_CIRCUITS_BASE_URL=https://f1-circuits. zurag.be). Built from this commit and run on an empty cache: /circuits, /circuits/<country> and a rendered Spa track are byte-identical to what ace serves today; the base URL comes from the variable, and without it falls back to the old address. Depends on mesh-controller #149.
This commit is contained in:
+8
-2
@@ -16,6 +16,7 @@ import io
|
||||
import json
|
||||
import logging
|
||||
import math
|
||||
import os
|
||||
import urllib.request
|
||||
from enum import Enum
|
||||
from pathlib import Path
|
||||
@@ -61,8 +62,13 @@ TILE_PROVIDERS = {
|
||||
},
|
||||
}
|
||||
|
||||
# The address this service is reached at, which the Kometa metadata links every poster to. The
|
||||
# mesh writes it from the name the route is served under (F1_CIRCUITS_BASE_URL); the fallback is
|
||||
# the address HAL served it at, so a deployment that sets nothing behaves as before.
|
||||
PUBLIC_BASE_URL = os.environ.get("F1_CIRCUITS_BASE_URL", "https://f1-circuits.zurag.be").rstrip("/")
|
||||
|
||||
# Polite UA — both providers expect one and Esri throttles aggressively without it.
|
||||
TILE_USER_AGENT = "f1-circuits-posters/1.0 (+https://f1-circuits.zurag.be)"
|
||||
TILE_USER_AGENT = f"f1-circuits-posters/1.0 (+{PUBLIC_BASE_URL})"
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -641,7 +647,7 @@ class PostersService:
|
||||
|
||||
# ------------------------------------------------------------------ kometa metadata
|
||||
|
||||
BASE_URL = "https://f1-circuits.zurag.be"
|
||||
BASE_URL = PUBLIC_BASE_URL
|
||||
|
||||
def render_kometa_metadata(self, first_season: int = 1950, last_offset: int = 1) -> str:
|
||||
"""Emit the Kometa metadata YAML for the Formula 1 library, covering
|
||||
|
||||
Reference in New Issue
Block a user