aienos.com
Source of www.aienos.com, served from my own hardware
Brought by drakestapleton
aienos.com / scripts / allen / memory / cortex-visitors-run
| 1 | #!/bin/sh |
| 2 | # cortex-visitors launcher: isolated Cortex for public Allen visitor memory. |
| 3 | # Runs as user cortex-visitors (started via setpriv; see /opt/cortex-visitors/README). |
| 4 | set -eu |
| 5 | umask 077 |
| 6 | DB=/var/lib/cortex-visitors/cortex.db |
| 7 | set -a |
| 8 | . /etc/cortex-visitors/env |
| 9 | set +a |
| 10 | # Compact on start so forgotten rows do not linger in free pages or the WAL. |
| 11 | if [ -f "$DB" ]; then |
| 12 | /usr/bin/sqlite3 "$DB" 'PRAGMA wal_checkpoint(TRUNCATE); VACUUM;' >/dev/null |
| 13 | fi |
| 14 | exec /opt/cortex-visitors/cortex-rs --host 127.0.0.1 --port 18096 --db-path "$DB" --encoder-url http://127.0.0.1:9 |