Merge develop: enable the production distribution API by default.
Deploy Production llm-node / deploy (push) Successful in 1m1s

This commit is contained in:
Lars committed 2026-11-23 18:40:51 +01:00
commit 213a7d00f8
4 files changed
+36 -3

No files matched your search

+5 -1
View File
@@ -68,7 +68,11 @@ def cursor_secret() -> str:
if secret:
return secret
if os.getenv("ENVIRONMENT", "development").strip().lower() in ("production", "prod"):
raise RuntimeError("DISTRIBUTION_CURSOR_SECRET fehlt")
material = os.getenv("DB_PASSWORD", "").strip()
if not material:
raise RuntimeError("DISTRIBUTION_CURSOR_SECRET fehlt")
digest = hashlib.sha256(f"shinkan-distribution-cursor:{material}".encode()).hexdigest()
return digest
return "shinkan-distribution-dev-cursor"
@@ -242,6 +242,26 @@ def test_distribution_read_is_hidden_while_disabled(client: TestClient, monkeypa
assert response.headers.get("cache-control") == "private, no-store"
def test_cursor_secret_uses_database_password_in_production(monkeypatch: pytest.MonkeyPatch) -> None:
monkeypatch.setenv("ENVIRONMENT", "production")
monkeypatch.delenv("DISTRIBUTION_CURSOR_SECRET", raising=False)
monkeypatch.setenv("DB_PASSWORD", "prod-db-secret")
first = cursor_secret()
assert first != "shinkan-distribution-dev-cursor"
assert "prod-db-secret" not in first
assert cursor_secret() == first
monkeypatch.setenv("DISTRIBUTION_CURSOR_SECRET", "explicit")
assert cursor_secret() == "explicit"
def test_cursor_secret_requires_material_in_production(monkeypatch: pytest.MonkeyPatch) -> None:
monkeypatch.setenv("ENVIRONMENT", "production")
monkeypatch.delenv("DISTRIBUTION_CURSOR_SECRET", raising=False)
monkeypatch.delenv("DB_PASSWORD", raising=False)
with pytest.raises(RuntimeError):
cursor_secret()
class _DroppingCursor:
"""Ein neues execute verwirft ein noch nicht gelesenes Ergebnis, wie psycopg2."""
+9 -2
View File
@@ -1,6 +1,6 @@
# Shinkan Jinkendo Version Information
APP_VERSION = "0.8.258"
APP_VERSION = "0.8.259"
BUILD_DATE = "2026-11-23"
DB_SCHEMA_VERSION = "20261123101"
@@ -39,7 +39,7 @@ MODULE_VERSIONS = {
"skill_profiles": "1.0.0", # Phase 3: gewichtetes Fähigkeiten-Profil + skill-discovery/suggestions
"methods": "0.1.0",
"exercises": "2.39.0", # API-Bereitstellung je Übung, einzeln und als Auswahl
"distribution": "1.5.0", # Aktueller Katalogabruf mit Änderung seit dem letzten Cursor
"distribution": "1.5.1", # Produktivabruf standardmäßig an; Cursor-Signatur aus dem vorhandenen DB-Geheimnis
"planning_exercise_suggest": "0.23.8", # Progressionsgraph: Katalog-Kontext (Fokus/Stil/TT/ZG) im Match-Profil
"training_units": "0.4.0", # POST .../publish-to-framework: Ablauf aus geplanter Einheit → Rahmen-Slot-Blueprint
"training_programs": "0.1.0",
@@ -55,6 +55,13 @@ MODULE_VERSIONS = {
}
CHANGELOG = [
{
"version": "0.8.259",
"date": "2026-11-23",
"changes": [
"Der Distributionsabruf ist auf der Produktion standardmäßig an. Die Compose-Datei reicht den Schalter an den API-Container weiter.",
],
},
{
"version": "0.8.258",
"date": "2026-11-23",
+2
View File
@@ -45,6 +45,8 @@ services:
APP_URL: "${APP_URL:-https://shinkan.jinkendo.de}"
ALLOWED_ORIGINS: "${ALLOWED_ORIGINS:-https://shinkan.jinkendo.de}"
ENVIRONMENT: "${ENVIRONMENT:-production}"
DISTRIBUTION_ENABLED: "${DISTRIBUTION_ENABLED:-1}"
DISTRIBUTION_CURSOR_SECRET: "${DISTRIBUTION_CURSOR_SECRET:-}"
CLUB_FEATURE_ENFORCE: "${CLUB_FEATURE_ENFORCE:-1}"
# MediaWiki/SMW Import — in dev-env.yml bereits gesetzt; Prod brauchte diese Zeilen ebenfalls,
# sonst: leere MEDIAWIKI_API_URL im Container → Import bricht ab (auf Test/Dev war es immer gesetzt).