mirror of
https://github.com/truespar/sentio.git
synced 2026-11-17 08:16:11 +00:00
Sentio SMTP: self-hosted, multi-tenant email infrastructure in Rust. Gives an AI agent its own real email address. Inbound mail arrives parsed, authenticated and spam-scored as a webhook; replies go out DKIM-signed over the same REST API. Full SMTP on both sides, with DKIM/SPF/DMARC/ARC, MTA-STS, DANE and a three-tier anti-spam pipeline. Apache-2.0.
45 lines
1.6 KiB
SQL
45 lines
1.6 KiB
SQL
-- =============================================================================
|
|
-- Sentio SMTP - bootstrap tenant and admin API key
|
|
-- =============================================================================
|
|
-- The minimum data needed to talk to the API at all: one system tenant and one
|
|
-- wildcard-scope key.
|
|
--
|
|
-- Tenant : 00000000-0000-0000-0000-000000000001
|
|
-- Key : sentio_bootstrap_admin_CHANGE_ME
|
|
--
|
|
-- curl -H "Authorization: Bearer sentio_bootstrap_admin_CHANGE_ME" \
|
|
-- http://localhost:8080/v1/tenants
|
|
--
|
|
-- Rotate this before the host is reachable by anything you do not trust:
|
|
-- create a replacement with POST /v1/tenants/{id}/api-keys, then delete this
|
|
-- one. It carries wildcard (*) scope.
|
|
--
|
|
-- key_hash is hex(sha256(token)), which is exactly how the API resolves a
|
|
-- bearer token (crates/sentio-api/src/auth.rs). Verify with:
|
|
-- printf %s 'sentio_bootstrap_admin_CHANGE_ME' | sha256sum
|
|
--
|
|
-- Idempotent, so re-running cannot clobber a rotated key.
|
|
-- =============================================================================
|
|
|
|
INSERT INTO tenants (id, name, tier, status, config, rate_limits)
|
|
VALUES (
|
|
'00000000-0000-0000-0000-000000000001',
|
|
'Sentio Platform',
|
|
'dedicated',
|
|
'active',
|
|
'{"system": true}',
|
|
'{}'
|
|
)
|
|
ON CONFLICT (id) DO NOTHING;
|
|
|
|
INSERT INTO api_keys (id, tenant_id, key_hash, key_prefix, name, scopes)
|
|
VALUES (
|
|
'00000000-0000-0000-0000-000000000001',
|
|
'00000000-0000-0000-0000-000000000001',
|
|
'b19cdf7c08544b51072675750216e80b6652b58ad39b7f59b20fc921352b4621',
|
|
'sentio_boot',
|
|
'Bootstrap Admin (ROTATE ME)',
|
|
'{*}'
|
|
)
|
|
ON CONFLICT (id) DO NOTHING;
|