This guide verifies the packaged tg-search service, embedded admin console, setup flow, Telegram sync path, search/resource surfaces, task operations, backup, and restart behavior.
- A local
config.yamlor/data/tg-search/config.yamlwhen overriding the startup host, port, or data path. The packaged image includes a minimal default. - Valid Telegram API credentials entered through the setup flow or Settings page.
- Writable storage path.
curlfor script checks.sqlite3for local backup scripts.
Run from source:
go run ./cmd/tg-search -config config.yamlOr run the packaged service:
mkdir -p data
docker compose pull
docker compose up -dURLs:
Service: http://127.0.0.1:9900
Run:
BASE_URL=http://127.0.0.1:9900 scripts/smoke.shThe script checks:
GET /api/healthGET /api/readyGET /api/setup/statusGET /
Start from empty data:
rm -rf data
mkdir -p data
docker compose up -dConfirm runtime health:
curl -s http://127.0.0.1:9900/api/health
curl -s http://127.0.0.1:9900/api/ready
curl -s http://127.0.0.1:9900/api/storage/usageOpen http://127.0.0.1:9900 and verify the embedded admin console appears.
Create admin:
curl -s -X POST http://127.0.0.1:9900/api/setup/admin \
-H 'content-type: application/json' \
-d '{"username":"admin","password":"secret123"}'Login:
curl -i -X POST http://127.0.0.1:9900/api/auth/login \
-H 'content-type: application/json' \
-d '{"username":"admin","password":"secret123"}'Expected:
- Login response sets
tg_search_sessionwithHttpOnly. /api/auth/mereturns the admin user when the cookie is sent./api/storage/usageincludesdb_bytes,index_bytes,media_cache_bytes, and quota flags.- Runtime directories exist under
/data/tg-search.
Complete the setup wizard:
- Save Telegram API settings.
- Log in to Telegram with a test account.
- Confirm metadata sync creates accounts and channels.
- Confirm channel control can run
Quickhistory sync. - Confirm Telegram Web Access Detection can be triggered for channels with usernames.
Verify search and resources:
- Run Global Search and confirm Messages, Links, Files, and Channels groups render.
- Open Resources and confirm resource groups such as
cloud_drive,magnet,ed2k,http, andfiles. - Confirm a never-synced channel with remote search enabled can create a display-only remote search task.
Verify task operations:
- Open Tasks and confirm queued/running/succeeded rows render.
- Retry a failed task if one exists.
- Pause, resume, or cancel a running task when available.
- Confirm
/api/eventskeeps a Server-Sent Events connection open.
Verify backup and restart:
DATA_DIR=./data scripts/backup.sh
docker compose restart tg-search
BASE_URL=http://127.0.0.1:9900 scripts/smoke.shFor restore drills, stop the service before replacing the database:
docker compose stop tg-search
DATA_DIR=./data scripts/restore.sh ./data/backup/tg-search-YYYYMMDDTHHMMSSZ.db
docker compose up -d