Turn the production distribution API on by default.
Deploy Development / deploy (push) Successful in 53s
Test Suite / pytest-backend (push) Failing after 29s
Test Suite / lint-backend (push) Successful in 1s
Test Suite / build-frontend (push) Canceled after 2s
Test Suite / k6 /health Baseline (push) Canceled after 0s
Test Suite / playwright-tests (push) Canceled after 0s
Deploy Development / deploy (push) Successful in 53s
Test Suite / pytest-backend (push) Failing after 29s
Test Suite / lint-backend (push) Successful in 1s
Test Suite / build-frontend (push) Canceled after 2s
Test Suite / k6 /health Baseline (push) Canceled after 0s
Test Suite / playwright-tests (push) Canceled after 0s
The production compose file now forwards DISTRIBUTION_ENABLED into the API container and enables the catalog unless the env file turns it off. Cursor signatures fall back to the existing database password so a missing extra secret does not hide the catalog. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
ae0acf9ad2
commit
b408e8fd7a
4 files changed
+36
-3
No files matched your search
@@ -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
@@ -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",
|
||||
|
||||
@@ -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).
|
||||
|
||||
Reference in new issue
Block a user