Compare commits

...

6 Commits

Author SHA1 Message Date
gitea a802b90617 conjurer: pin the model Ollama actually has, and raise the AI timeout
Probing the real server (192.168.1.72:11434) after it was opened to the LAN:
/v1/models returns exactly one model, gemma4:e2b. Without pinning it the
bot would request the built-in default llama3.1:8b and every reply would
fail with "model not found", so set it explicitly on both bots.

Also raise CONJURER_AI_TIMEOUT_SECONDS to 240. Self-hosted generation is far
slower than a hosted API, particularly the first request after the model is
evicted from VRAM. It applies to every backend, so it is deliberately not
set higher than needed.

Caveat recorded honestly: at the time of writing, generation on that server
does not complete. /v1/models answers instantly, but both /v1/chat/
completions (180s) and native /api/generate with num_predict=5 (60s) return
nothing, and /api/ps shows no model ever becomes resident - so the model
never finishes loading. Ollama is 0.32.14 and gemma4:e2b is 5.1B Q4_K_M
(~3.5GB) despite the "e2b" name. That is a server-side problem, not a
configuration one; these values are correct and take effect once it loads.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-24 14:54:32 +02:00
gitea aeb9bb5940 conjurer: point both bots at the Ollama server (192.168.1.72:11434)
Wires CONJURER_OLLAMA_URL into the test bot and the deploy bot so the
self-hosted backend from conjurer#25 is selectable. No API key exists for
Ollama - the endpoint is the whole configuration - and until it is set the
backend refuses to be selected, so this is what turns it on.

NOTE, verified from the LAN before committing: 192.168.1.72 answers ping
(0.4ms) but only port 22 is open - 11434 refuses. Ollama binds to
127.0.0.1:11434 by default, so it is not reachable off-host yet. This env
var is correct but inert until the server listens on the network:

  sudo systemctl edit ollama.service
    [Service]
    Environment="OLLAMA_HOST=0.0.0.0:11434"
  sudo systemctl daemon-reload && sudo systemctl restart ollama

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-24 14:43:01 +02:00
argocd-image-updater f968eb0340 build: automatic update of astrololo
updates image gitea/astrololo-data tag '71bb3b9c' to 'f0d07ee8'
updates image gitea/astrololo-logic tag '71bb3b9c' to 'f0d07ee8'
updates image gitea/astrololo-presentation tag '71bb3b9c' to 'f0d07ee8'
2026-08-21 10:49:32 +00:00
gitea f754831f54 feat(prezentacja): klucz podpisu sesji (LOG-34)
SESSION_SECRET w sekrecie astrololo-auth. Pod bez niego CELOWO nie wstaje:
usługa z kontami, ale bez klucza, nie odróżniłaby ważnej sesji od podrobionej.

W README dopisana rotacja klucza jako awaryjny wyłącznik — podmiana unieważnia
wszystkie sesje naraz, co jest właściwą reakcją na podejrzenie przechwycenia
cudzej sesji.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-21 10:47:46 +00:00
gitea ff0a1c8256 docs(węzły): klient NFS jako jawny wymóg wdrożenia
Pody przestały wstawać z komunikatem „bad option ... you might need
a /sbin/mount.<type> helper program". To NIE jest problem z udziałem ani
z uprawnieniami — serwer w ogóle nie został zapytany; jądro nie znalazło programu
pomocniczego, bo na węźle brakowało nfs-common.

Wymogu klienta NFS nie było w żadnym runbooku, choć wszystkie trzy warstwy
montują udziały z NAS-a. Luka była uśpiona: wszystko stało na jednym węźle, który
klienta miał, więc braku na pozostałych nie było jak zauważyć. Ujawniło się
dopiero, gdy zejście do zera replik — przy zupełnie innej naprawie —
przeplanowało pody gdzie indziej.

Dopisana tabela odróżniająca trzy komunikaty, które łatwo pomylić, bo wszystkie
kończą się niewstającym podem: brak klienta na węźle, odmowa serwera i brak praw
do zapisu. Każdy ma inną przyczynę i inne miejsce naprawy.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-21 12:40:24 +02:00
argocd-image-updater ffeb639d62 build: automatic update of astrololo
updates image gitea/astrololo-data tag 'ee3c515d' to '71bb3b9c'
updates image gitea/astrololo-logic tag 'ee3c515d' to '71bb3b9c'
updates image gitea/astrololo-presentation tag 'ee3c515d' to '71bb3b9c'
2026-08-20 23:56:37 +00:00
5 changed files with 95 additions and 4 deletions
+59 -1
View File
@@ -29,6 +29,49 @@ Runbook: **[README-pliki.md](README-pliki.md)**. Ekran „Pliki" wymaga zapisu d
udziału z bazami, więc znosi gwarancję z DAN-25, że baz nie da się zmienić przez udziału z bazami, więc znosi gwarancję z DAN-25, że baz nie da się zmienić przez
NFS. Co zostaje z zabezpieczeń i jak to wdrożyć — w runbooku. NFS. Co zostaje z zabezpieczeń i jak to wdrożyć — w runbooku.
## ⚠️ Wymóg węzłów: klient NFS
Wszystkie warstwy montują udziały z NAS-a, więc **każdy węzeł, na którym może
wylądować pod, musi mieć klienta NFS**. Bez niego kubelet nie zamontuje wolumenu:
```
mount: ... bad option; for several filesystems (e.g. nfs, cifs) you might need
a /sbin/mount.<type> helper program
```
Ten komunikat **nie oznacza problemu z udziałem ani z uprawnieniami** — serwer
w ogóle nie został zapytany. Jądro nie znalazło programu pomocniczego
`/sbin/mount.nfs`.
### Sprawdzenie
```bash
for N in 192.168.1.73 192.168.1.80 192.168.1.81; do
printf "%-15s " "$N"
ssh hammer@$N 'test -x /sbin/mount.nfs && echo MA-KLIENTA || echo BRAK-KLIENTA'
done
```
### Instalacja
```bash
ssh hammer@<węzeł> 'sudo apt-get update && sudo apt-get install -y nfs-common'
```
> **Na WSZYSTKICH węzłach, nie tylko na tym, gdzie pod stoi teraz.** Braku na
> pozostałych nie widać, dopóki scheduler tam czegoś nie przeniesie — a wtedy
> awaria wygląda na nagłą, choć przyczyna leżała od dawna. Dokładnie tak wyszło
> za pierwszym razem: pody działały miesiącami na jednym węźle, aż zejście do
> zera replik przy innej naprawie przeplanowało je gdzie indziej.
### Skąd wiadomo, że to TO
| komunikat | co znaczy |
|---|---|
| `bad option ... mount.<type> helper program` | **brak `nfs-common` na węźle** — serwer niepytany |
| `access denied by server while mounting` | serwer odmawia: eksport nieprzeładowany, węzła nie ma na liście `hosts`, albo udział wyłączony |
| `Permission denied` przy zapisie | montowanie działa, brakuje praw — patrz `mapall_user` i właściciel katalogu |
## ⚠️ Sekret `astrololo-auth` — utwórz PRZED wdrożeniem ## ⚠️ Sekret `astrololo-auth` — utwórz PRZED wdrożeniem
Aplikacja wystawia treść **oryginalnych baz interpretacyjnych**, dlatego wymaga Aplikacja wystawia treść **oryginalnych baz interpretacyjnych**, dlatego wymaga
@@ -47,11 +90,26 @@ read -rs -p "Hasło do aplikacji (APP_PASSWORD): " APP_PASSWORD; echo
kubectl -n astrololo create secret generic astrololo-auth \ kubectl -n astrololo create secret generic astrololo-auth \
--from-literal=APP_PASSWORD="$APP_PASSWORD" \ --from-literal=APP_PASSWORD="$APP_PASSWORD" \
--from-literal=INTERNAL_TOKEN="$(openssl rand -hex 32)" --from-literal=INTERNAL_TOKEN="$(openssl rand -hex 32)" \
--from-literal=SESSION_SECRET="$(openssl rand -hex 32)"
unset APP_PASSWORD unset APP_PASSWORD
``` ```
`SESSION_SECRET` podpisuje ciasteczka sesji (LOG-34). **Pod bez niego celowo nie
wstanie**: usługa z kontami, ale bez klucza, nie odróżniłaby ważnej sesji od
podrobionej. Nikt go nigdy nie musi oglądać.
> **Rotacja tego klucza wylogowuje WSZYSTKICH.** To nie usterka, tylko awaryjny
> wyłącznik: gdy podejrzewasz, że ktoś przechwycił cudzą sesję, podmiana klucza
> unieważnia je wszystkie naraz.
>
> ```bash
> kubectl -n astrololo patch secret astrololo-auth --type=json \
> -p="[{\"op\":\"replace\",\"path\":\"/data/SESSION_SECRET\",\"value\":\"$(openssl rand -hex 32 | base64 | tr -d '\n')\"}]"
> kubectl -n astrololo rollout restart deploy/presentation
> ```
`INTERNAL_TOKEN` jest losowany i **nikt go nigdy nie musi oglądać** — służy tylko `INTERNAL_TOKEN` jest losowany i **nikt go nigdy nie musi oglądać** — służy tylko
usługom do rozmowy między sobą. `APP_PASSWORD` wpisujesz w przeglądarce usługom do rozmowy między sobą. `APP_PASSWORD` wpisujesz w przeglądarce
(użytkownik: `astrololo`, zmienny przez `APP_USER` w `presentation.yaml`). (użytkownik: `astrololo`, zmienny przez `APP_USER` w `presentation.yaml`).
+3 -3
View File
@@ -11,10 +11,10 @@ resources:
- ingress.yaml # wejście po https + przekierowanie z http - ingress.yaml # wejście po https + przekierowanie z http
images: images:
- name: gitea.czernobog.pl/gitea/astrololo-data - name: gitea.czernobog.pl/gitea/astrololo-data
newTag: ee3c515d newTag: f0d07ee8
- name: gitea.czernobog.pl/gitea/astrololo-logic - name: gitea.czernobog.pl/gitea/astrololo-logic
newTag: ee3c515d newTag: f0d07ee8
- name: gitea.czernobog.pl/gitea/astrololo-render - name: gitea.czernobog.pl/gitea/astrololo-render
newTag: latest newTag: latest
- name: gitea.czernobog.pl/gitea/astrololo-presentation - name: gitea.czernobog.pl/gitea/astrololo-presentation
newTag: ee3c515d newTag: f0d07ee8
+7
View File
@@ -32,6 +32,13 @@ spec:
secretKeyRef: { name: astrololo-auth, key: INTERNAL_TOKEN } secretKeyRef: { name: astrololo-auth, key: INTERNAL_TOKEN }
- name: APP_USER - name: APP_USER
value: "astrololo" value: "astrololo"
# Klucz podpisu ciasteczek sesji (LOG-34). WYMAGANY — pod bez niego
# celowo nie wstaje: usługa z kontami, ale bez klucza, nie umiałaby
# odróżnić ważnej sesji od podrobionej. Rotacja tego klucza WYLOGOWUJE
# WSZYSTKICH, i tak ma być — to jest awaryjny wyłącznik.
- name: SESSION_SECRET
valueFrom:
secretKeyRef: { name: astrololo-auth, key: SESSION_SECRET }
- name: RATE_LIMIT_PER_MIN - name: RATE_LIMIT_PER_MIN
value: "120" # 0 = bez limitu value: "120" # 0 = bez limitu
# Aplikacja stoi za Ingressem, więc bezpośrednim rozmówcą jest zawsze # Aplikacja stoi za Ingressem, więc bezpośrednim rozmówcą jest zawsze
+13
View File
@@ -31,6 +31,19 @@ spec:
# Where the librarian sends THIS bot's results/pongs back to (its own # Where the librarian sends THIS bot's results/pongs back to (its own
# NodePort). Lets one librarian serve both bots - see deploy-bot.yaml. # NodePort). Lets one librarian serve both bots - see deploy-bot.yaml.
- { name: CONJURER_SELF_CALLBACK, value: "http://192.168.1.73:32442" } - { name: CONJURER_SELF_CALLBACK, value: "http://192.168.1.73:32442" }
# Self-hosted models (Ollama). No API key - the endpoint IS the
# configuration, and the backend stays unselectable while unset.
# Pick a model at runtime with: $gadaj_teraz ollama <model>
# ($modele_ai lists what the server actually has pulled).
- { name: CONJURER_OLLAMA_URL, value: "http://192.168.1.72:11434" }
# The server currently has exactly one model pulled (verified via
# /v1/models): gemma4:e2b. Without this the built-in default
# (llama3.1:8b) would be requested and every reply would fail.
- { name: CONJURER_OLLAMA_MODEL, value: "gemma4:e2b" }
# Self-hosted generation is far slower than a hosted API, especially
# the first request after the model is evicted from VRAM. Applies to
# every backend, so keep it only as high as you actually need.
- { name: CONJURER_AI_TIMEOUT_SECONDS, value: "240" }
volumeMounts: volumeMounts:
- { name: data, mountPath: /data } - { name: data, mountPath: /data }
- { name: netrc, mountPath: /secrets, readOnly: true } - { name: netrc, mountPath: /secrets, readOnly: true }
+13
View File
@@ -51,6 +51,19 @@ spec:
# query and answers results/pongs HERE - so it serves this bot AND the # query and answers results/pongs HERE - so it serves this bot AND the
# test bot from one instance, no CONJURER_MAIN_BOT repointing needed. # test bot from one instance, no CONJURER_MAIN_BOT repointing needed.
- { name: CONJURER_SELF_CALLBACK, value: "http://192.168.1.73:32443" } - { name: CONJURER_SELF_CALLBACK, value: "http://192.168.1.73:32443" }
# Self-hosted models (Ollama). No API key - the endpoint IS the
# configuration, and the backend stays unselectable while unset.
# Pick a model at runtime with: $gadaj_teraz ollama <model>
# ($modele_ai lists what the server actually has pulled).
- { name: CONJURER_OLLAMA_URL, value: "http://192.168.1.72:11434" }
# The server currently has exactly one model pulled (verified via
# /v1/models): gemma4:e2b. Without this the built-in default
# (llama3.1:8b) would be requested and every reply would fail.
- { name: CONJURER_OLLAMA_MODEL, value: "gemma4:e2b" }
# Self-hosted generation is far slower than a hosted API, especially
# the first request after the model is evicted from VRAM. Applies to
# every backend, so keep it only as high as you actually need.
- { name: CONJURER_AI_TIMEOUT_SECONDS, value: "240" }
volumeMounts: volumeMounts:
- { name: data, mountPath: /data } - { name: data, mountPath: /data }
- { name: netrc, mountPath: /secrets, readOnly: true } - { name: netrc, mountPath: /secrets, readOnly: true }