feat(gateway): extract ChatContract service

This commit is contained in:
sam committed 2026-09-05 23:06:16 +10:00
1 parent 34cb25f130
commit 0a6496d2cd
20 files changed
+525 -79

No files matched your search

+6 -1
View File
@@ -33,7 +33,12 @@ cp deployments/single-forge-github.toml ~/.config/archie/config.toml
Edit API keys in `~/.config/archie/env` or directly in `config.toml`, then launch Archie Core:
```bash
archied
archie-gateway -config ~/.config/archie/config.toml -listen 127.0.0.1:8585 &
archied -config ~/.config/archie/config.toml
# or via systemd:
systemctl --user start archied
```
The templates use the extracted Gateway Service by default. Start
`archie-gateway` before `archied`; it owns the conversation SQLite file and
serves the `ChatContract` gRPC API on the configured target.
+4
View File
@@ -17,6 +17,10 @@ diff_cap_lines = 0
work_dir = "~/.local/share/archie/work"
db_path = "~/.local/share/archie/archie.db"
[services.gateway]
mode = "remote"
target = "127.0.0.1:8585"
[forge]
type = "gitea"
host = "https://git.example.com"
+4
View File
@@ -7,6 +7,10 @@
work_dir = "~/.local/share/archie/work"
db_path = "~/.local/share/archie/archie.db"
[services.gateway]
mode = "remote"
target = "127.0.0.1:8585"
poll_interval = "60s"
# Standalone execution: Forge polling is disabled
@@ -8,6 +8,10 @@
work_dir = "~/.local/share/archie/work"
db_path = "~/.local/share/archie/archie.db"
[services.gateway]
mode = "remote"
target = "127.0.0.1:8585"
poll_interval = "60s"
[models]
+6
View File
@@ -13,6 +13,12 @@ bot_user = "archie-bot"
bot_email = "archie-bot@users.noreply.github.com"
diff_cap_lines = 400
# The Gateway Service owns conversational state and serves ChatContract over
# gRPC. Run archie-gateway alongside archied with this address.
[services.gateway]
mode = "remote"
target = "127.0.0.1:8585"
[forge]
type = "github"
host = "https://github.com"
+20 -2
View File
@@ -4,7 +4,7 @@ This runbook describes how to manage `archied` as a background user service on L
---
## 1. Unit File (`~/.config/systemd/user/archied.service`)
## 1. Unit Files (`~/.config/systemd/user/archied.service` and `archie-gateway.service`)
Create the systemd user service file at `~/.config/systemd/user/archied.service`:
@@ -25,6 +25,24 @@ RestartSec=5s
WantedBy=default.target
```
Create the Gateway Service unit beside it:
```ini
[Unit]
Description=Archie Gateway Service
After=network.target
[Service]
Type=simple
ExecStart=%h/.local/bin/archie-gateway -config %h/.config/archie/config.toml -listen 127.0.0.1:8585
EnvironmentFile=-%h/.config/archie/env
Restart=on-failure
RestartSec=5s
[Install]
WantedBy=default.target
```
---
## 2. Enabling User Linger (`loginctl`)
@@ -52,7 +70,7 @@ systemctl --user daemon-reload
Enable and start the service immediately:
```bash
systemctl --user enable --now archied
systemctl --user enable --now archie-gateway archied
```
Check service status: