diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5656fad..4bd75bb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -71,7 +71,7 @@ env: # Operatorun ayar dosyasi; deploy yalniz varligini kontrol eder, yazmaz. ENV_FILE_NAME: hezarfen_zeka.env # compose.yaml'daki `container_name` (bkz. service/compose.yaml:11). - CONTAINER_NAME: hezarfen-zeka-bridge + CONTAINER_NAME: hezarfen_zeka # Saglik kapisinin on kosulu: backend'in HTTP sertifika ucu. Backend'in host # loopback portu (README: `127.0.0.1:7656:7656`). CERT_PATH: /ai/certificate diff --git a/deploy/hezarfen_zeka.env.example b/deploy/hezarfen_zeka.env.example index 499a09a..9c462ad 100644 --- a/deploy/hezarfen_zeka.env.example +++ b/deploy/hezarfen_zeka.env.example @@ -52,12 +52,12 @@ DEEPSEEK_API_KEY= # Backend'in QUIC dinleyicisi (konteyner aginda). Backend tarafinda # AI_QUIC_ADDR=0.0.0.0:8090 OLMALI -- 127.0.0.1 yaziliysa backend yalniz kendi # konteyner loopback'ine baglanir ve HICBIR servis dial-in edemez. -AI_BRIDGE_HOST=hezarfen-backend +AI_BRIDGE_HOST=hezarfen_backend AI_BRIDGE_PORT=8090 # Sertifikanin cekildigi HTTP koku. Varsayilan backend konteynerinin kendi # adresi; backend'in yayimlanan host portu ise 127.0.0.1:7656'dir. -AI_BACKEND_URL=http://hezarfen-backend:8080 +AI_BACKEND_URL=http://hezarfen_backend:7656 AI_TLS_SERVER_NAME=localhost AI_SERVICE_NAME=zeka diff --git a/scripts/ci-konteyner-kanit.sh b/scripts/ci-konteyner-kanit.sh index 342d25c..5b7d9b1 100644 --- a/scripts/ci-konteyner-kanit.sh +++ b/scripts/ci-konteyner-kanit.sh @@ -107,7 +107,7 @@ MSYS_NO_PATHCONV=1 "$MOTOR" run -d --name "$KAP" \ -e ZEKA_REFRESH_INTERVAL_SECS=3600 \ -e ZEKA_SCHOOLS=hezarfen-demo \ -e AI_BRIDGE_HOST=ulasilamaz.gecersiz \ - -e AI_BACKEND_URL=http://ulasilamaz.gecersiz:8080 \ + -e AI_BACKEND_URL=http://ulasilamaz.gecersiz:7656 \ -e AI_RECONNECT_SECS=1 \ -e AI_RECONNECT_MAX_SECS=8 \ -e LOG_LEVEL=debug \ diff --git a/service/.env.example b/service/.env.example index ece804b..6efaf3b 100644 --- a/service/.env.example +++ b/service/.env.example @@ -35,9 +35,9 @@ DEEPSEEK_API_KEY= # KOPRU # ============================================================================ -AI_BRIDGE_HOST=hezarfen-backend +AI_BRIDGE_HOST=hezarfen_backend AI_BRIDGE_PORT=8090 -AI_BACKEND_URL=http://hezarfen-backend:8080 +AI_BACKEND_URL=http://hezarfen_backend:7656 AI_TLS_SERVER_NAME=localhost AI_SERVICE_NAME=zeka diff --git a/service/compose.yaml b/service/compose.yaml index 4a417f6..9b39712 100644 --- a/service/compose.yaml +++ b/service/compose.yaml @@ -13,14 +13,14 @@ services: # yazilsaydi deploy yeni imaji yukleyip ESKI imaji kosmaya devam ederdi -- # tag rotasyonu ve geri donus (previous_tag) bu satira baglidir. image: localhost/hezarfen-zeka:${HEZARFEN_TAG:-current} - container_name: hezarfen-zeka-bridge + container_name: hezarfen_zeka init: true command: ["python", "-m", "src.bridge"] environment: # --- kopru adresi --- - AI_BRIDGE_HOST: ${AI_BRIDGE_HOST:-hezarfen-backend} + AI_BRIDGE_HOST: ${AI_BRIDGE_HOST:-hezarfen_backend} AI_BRIDGE_PORT: ${AI_BRIDGE_PORT:-8090} - AI_BACKEND_URL: ${AI_BACKEND_URL:-http://hezarfen-backend:8080} + AI_BACKEND_URL: ${AI_BACKEND_URL:-http://hezarfen_backend:7656} AI_TLS_SERVER_NAME: ${AI_TLS_SERVER_NAME:-localhost} # --- kimlik --- # Zorunlu. Interpolasyon kullanilir, literal sir YAZILMAZ. @@ -126,5 +126,5 @@ networks: backend_net: external: true # PARAMETRIK: ag adi dagitimdan dagitima degisir (podcast'in deseni). - # Celebi bunu sabit yaziyor ve ag baska adla kuruldugunda compose patliyor. + # Kardes servisler (podcast, Celebi) de ayni deseni kullanir. name: ${HEZARFEN_NET:-hezarfen_backend_default} diff --git a/service/docs/DAGITIM.md b/service/docs/DAGITIM.md index cfc548a..e5b0a30 100644 --- a/service/docs/DAGITIM.md +++ b/service/docs/DAGITIM.md @@ -91,7 +91,7 @@ podman compose up -d ### tek kap olarak ```bash -podman run -d --name hezarfen-zeka-bridge \ +podman run -d --name hezarfen_zeka \ --network hezarfen_backend_default \ -e AI_SHARED_TOKEN=... \ -e ZEKA_PG_DSN=postgres://:@:5432/ \ @@ -159,8 +159,8 @@ bir `.env` dosyasindan gelir. CI her kosuda bu bicimi denetler. | Degisken | Varsayilan | Not | |---|---|---| | `HEZARFEN_NET` | `hezarfen_backend_default` | Katilinacak **dis** agin adi. | -| `AI_BRIDGE_HOST` / `AI_BRIDGE_PORT` | `hezarfen-backend` / `8090` | QUIC ucu. | -| `AI_BACKEND_URL` | `http://hezarfen-backend:8080` | Sertifika cekilen HTTP ucu. | +| `AI_BRIDGE_HOST` / `AI_BRIDGE_PORT` | `hezarfen_backend` / `8090` | QUIC ucu. | +| `AI_BACKEND_URL` | `http://hezarfen_backend:7656` | Sertifika cekilen HTTP ucu. | | `AI_TLS_FINGERPRINT` | *(bos)* | **Bos = TOFU.** Asagiya bakin. | | `AI_MAX_CONCURRENT` | `4` | Backend clamp'i: `1..=AI_MAX_CONCURRENT_PER_WORKER`. | | `AI_RECONNECT_SECS` / `AI_RECONNECT_MAX_SECS` | `3` / `120` | Geri cekilme taban ve tavani. | @@ -193,9 +193,9 @@ networks: name: ${HEZARFEN_NET:-hezarfen_backend_default} ``` -Ag adi **parametriktir**. Kardes servis Celebi bunu sabit yaziyor ve ag baska -bir adla kuruldugunda compose patliyor. CI, `HEZARFEN_NET`'in gercekten -gecersiz kilinabildigini kosturarak dogrular. +Ag adi **parametriktir**. Kardes servisler (podcast, Celebi) de ayni deseni +kullanir; ag farkli adla kurulduysa `HEZARFEN_NET` ile verilir. CI, bunun +gercekten gecersiz kilinabildigini kosturarak dogrular. Ag mevcut degilse once olusturun: diff --git a/service/src/config.py b/service/src/config.py index 605f548..78e91e5 100644 --- a/service/src/config.py +++ b/service/src/config.py @@ -139,10 +139,10 @@ class Config: # --- kopru adresi -------------------------------------------------- # Backend QUIC *sunucusudur*, servis ona dial-out eder # (`ai/protocol.rs:5-7`). Bu yuzden ZEKA port acmaz. - self.host = env_str("AI_BRIDGE_HOST", "hezarfen-backend") + self.host = env_str("AI_BRIDGE_HOST", "hezarfen_backend") self.port = env_int("AI_BRIDGE_PORT", 8090, 1, 65535) # Sertifikayi cektigimiz HTTP adresi; QUIC adresinden ayridir. - self.backend_url = env_str("AI_BACKEND_URL", "http://hezarfen-backend:8080").rstrip("/") + self.backend_url = env_str("AI_BACKEND_URL", "http://hezarfen_backend:7656").rstrip("/") self.server_name = env_str("AI_TLS_SERVER_NAME", "localhost") # --- kimlik --------------------------------------------------------- diff --git a/service/tests/test_config.py b/service/tests/test_config.py index 3fcc4cf..7379911 100644 --- a/service/tests/test_config.py +++ b/service/tests/test_config.py @@ -98,7 +98,7 @@ class ParsingTests(unittest.TestCase): def test_defaults_are_the_documented_ones(self): with _env(AI_SHARED_TOKEN="t"): settings = config.Config() - self.assertEqual(settings.host, "hezarfen-backend") + self.assertEqual(settings.host, "hezarfen_backend") self.assertEqual(settings.port, 8090) self.assertEqual(settings.service, "zeka") self.assertEqual(settings.source_mode, "bridge")