Self-hosting (Enterprise)
Nexara ships as one container with one volume. There is no external database, queue or cache.
Requirements
- Docker (or any OCI runtime), 1 GB RAM for the container (more if embeddings are on), a few GB of disk for
/data. - A public HTTPS origin if you want Claude.ai or ChatGPT to connect. Terminate TLS in a reverse proxy (Traefik, Caddy, nginx) that forwards to port 8080.
Build and run with Docker
# Enterprise customers receive the release source or image from us.
docker build --build-arg GIT_SHA=<release> -t nexara .
docker run -d --name nexara --restart unless-stopped -p 8080:8080 \
-v nexara-data:/data \
-e MASTER_KEY=... -e OWNER_EMAIL=you@example.com -e OWNER_PASSWORD='...' \
-e PUBLIC_URL=https://context.example.com \
-e SIGNUPS=invite -e REQUIRE_TOTP=true -e ALLOWED_HOSTS=context.example.com \
nexara
The image is multi-stage: the build stage installs dev dependencies and builds server/ with tsc and web/ with Vite; the runtime stage is node:22-bookworm-slim with git and tini, runs as the node user and has a HEALTHCHECK on /healthz. entrypoint.sh creates /data/ws and /data/backups and fails fast if /data is not writable.
Build and run with Coolify
Coolify is one way to run the image; any Docker host with a persistent volume works the same way.
- Create an application from the git repository (private repos: a deploy key), build pack Dockerfile, port 8080.
- Add a persistent storage mounted at
/data. - Set the environment variables below. At minimum
MASTER_KEY,PUBLIC_URL,OWNER_EMAIL,OWNER_PASSWORD. - Add the domain, keep the generated
sslip.iodomain as a fallback until DNS resolves, and deploy.
Coolify injects NODE_ENV=production into the build; the Dockerfile sets NODE_ENV=development in the build stage so dev dependencies are still installed. Coolify passes SOURCE_COMMIT as a build argument (turn on Include Source Commit in Build in the app's General settings if /readyz still says dev); it is not in the runtime environment. The final Dockerfile stage declares ARG GIT_SHA and ARG SOURCE_COMMIT and defaults GIT_SHA to SOURCE_COMMIT before ENV GIT_SHA=${GIT_SHA}, so the running server sees the commit and /readyz reports it as git_sha.
Environment variables
Every variable read by server/src/config.ts:
| Variable | Default | Meaning |
|---|---|---|
PORT | 8080 | Listen port on 0.0.0.0 |
DATA_DIR | ./data (/data in the image) | Holds core.db, master.key if generated, models/, and ws/<id>/repo plus ws/<id>/index.db |
PUBLIC_URL | derived from the request | External origin. Used for OAuth metadata, the MCP resource URI and invite links. Set it in production |
WORKSPACE | main | Id of the workspace created for the first owner |
OWNER_EMAIL | none | First boot only, and only while no human exists: creates the owner |
OWNER_PASSWORD | none | Password for that owner. Change it in the app afterwards; the variable is ignored once a human exists |
MASTER_KEY | generated into $DATA_DIR/master.key | Root secret. HKDF derives the token pepper, cookie keys and per-workspace seal keys. Losing it makes sealed secrets unreadable and invalidates every token |
SIGNUPS | invite | invite: sign-up only with a workspace invite or a waitlist invite. waitlist: public sign-up only with a waitlist invite link (3 months free); everyone else joins the waitlist. open: anyone can sign up for a 90-day trial. Every public sign-up confirms the email address (link or 6-digit code) before any account or workspace exists |
SIGNUP_POW_BITS | 16 | Proof-of-work difficulty (leading zero bits) the browser solves before public sign-up and forgot-password. 0 turns it off |
WAITLIST_CORS_ORIGINS | empty | Extra origins (comma-separated) allowed to call POST /api/v1/waitlist cross-site, for example a local dev site. https://nexara.ac and https://www.nexara.ac are always allowed |
WAITLIST_THANKS_URL | https://nexara.ac/thanks.html | Where a plain HTML form post to /api/v1/waitlist is redirected (303) |
PLATFORM_ADMINS | empty (console off) | Comma list of operator emails for the platform admin console at /admin. Matching accounts get platform_role admin at boot; access needs both the list and the role, plus two-step sign-in. Removing an email revokes access at once |
AI_PROVIDER | empty (Ask off) | Who answers "Ask the vault": anthropic, openai (any OpenAI-compatible API: OpenAI, OpenRouter, Kimi, Mistral) or fake (deterministic, for tests). Unset means the Ask screen says "AI not configured" and nothing else changes |
AI_API_KEY | empty | The provider key. Never logged, never returned by the API. Required for anthropic and openai |
AI_MODEL | provider default (claude-sonnet-4-5 / gpt-4o-mini) | Default model. The workspace owner can pick another one in Settings; the screen shows the relative cost before switching |
AI_BASE_URL | the provider's own API | Base URL for an OpenAI-compatible API or a proxy, https only (http://127.0.0.1 is allowed for a local proxy). Without it, only well-known provider hosts are contacted and redirects are refused |
AI_FALLBACK_PROVIDER | empty (no fallback) | A second provider (anthropic or openai) tried only once AI_PROVIDER's retries are exhausted (it is down or out of quota) |
AI_FALLBACK_API_KEY | empty | The fallback provider's key. Same rules as AI_API_KEY: never logged, never returned by the API |
AI_FALLBACK_MODEL | fallback provider default | Model to use on the fallback provider |
AI_FALLBACK_BASE_URL | the fallback provider's own API | Same rules as AI_BASE_URL, for the fallback provider |
AI_WINDOW_END | 2026-11-08 | The last day (UTC, YYYY-MM-DD, inclusive) of an up-front credit window on the AI_PROVIDER account. Until then the window caps below apply; from the next day the monthly caps apply on their own, with no change needed |
AI_WINDOW_BUDGET_USD | 480 | Spending cap for the whole credit window, estimated from the model price table. Once reached, Ask and Skills answer "The AI budget for this month is used up." until the window ends |
AI_DAILY_BUDGET_USD | 20 | Spending cap per UTC day during the credit window. Once reached, Ask answers that today's limit is used and starts again at midnight UTC |
AI_MONTHLY_BUDGET_USD | 50 | Spending cap per calendar month after the credit window. Once reached, Ask and Skills answer "The AI budget for this month is used up." until the next month |
AI_AFTER_WINDOW_DAILY_BUDGET_USD | 3 | Spending cap per UTC day after the credit window |
AI_RUN_MAX_TOKENS | 60000 | The most one answer, skill run or meeting summary may use (input and output together). A run stops before the call that could pass it and says what it found so far |
REQUIRE_TOTP | true | Workspace owners must set up two-factor. They get a grace period with reminders, then the app asks for setup before anything else. false turns that off |
TOTP_GRACE_DAYS | 14 | Days from an owner's first sign-in without two-factor until it is required. 0 requires it straight away. Agents keep working throughout |
RECOVERY_TEST_CLOCK_SKEW_MS | 0 | Test rigs only. Milliseconds added to the clock the workspace-recovery cooling-off and the founder handover read, so an end-to-end test can walk past the 24 hours and the 7 days. Ignored unless PUBLIC_URL is a loopback address, so it can never shorten a cooling-off on a real site |
ALLOWED_HOSTS | the PUBLIC_URL host | Comma list of Host names accepted on every route (DNS rebinding guard; others get 421). localhost and 127.0.0.1 are always allowed |
OAUTH_EXTRA_REDIRECTS | empty | Comma list of extra exact OAuth redirect URIs allowed at client registration |
EMBEDDINGS | on | off uses keyword search only. on loads Xenova/bge-small-en-v1.5 in a worker thread and falls back to keyword search if it cannot load |
LIFECYCLE_MODE | dry | Nightly 03:00 UTC job. dry lists archive candidates, apply archives them |
ERASURE | off | on turns on provable erasure (an Owner or Admin requests, a second one approves, both with step-up; held content is refused). Off: the erasure routes answer 404. Design: docs/design/ERASURE.md |
BACKUP_RETENTION_DAYS | 30 | How long your backups are kept. Used only in the erasure receipt, which says by when old backups stop holding erased content |
LOCK_WAIT_MS | 30000 | How long a write waits for the workspace writer lock before it is refused with repo_busy (503) and a Retry-After. Writes to one workspace are serialised, so under heavy writing this is the point at which Nexara tells a client to come back instead of holding its connection. The refused write never runs later |
LOCK_QUEUE_MAX | 64 | How many writes may wait for one workspace at once. A write arriving when the queue is full is refused straight away with the same repo_busy 503 |
WEB_DIST | web/dist | Folder with the built web app. Without it / serves a small status page |
APPS_DIR | the repo's apps/ folder | Folder of first-party app manifests (<APPS_DIR>/<id>/manifest.json), shown in the Apps gallery. See Apps and triggers |
APP_VERSION | 0.1.0 | Version reported by /healthz, /readyz and MCP |
GIT_SHA | SOURCE_COMMIT, else dev | Commit reported by /readyz. The image sets it from the GIT_SHA build argument, else the SOURCE_COMMIT build argument (Coolify) |
BACKUP_TOKEN | none (token path disabled) | Bearer accepted only by GET /api/v1/admin/backup and /backup/status, for automated backups. At least 24 characters, compared in constant time. See Backups and restore |
BRIDGE_TICK_MINUTES | 5 | How often the bridge scheduler checks for bridges whose interval has elapsed. See Bridges |
BRIDGE_FOLDER_ROOTS | empty (folder bridges disabled) | Comma list of absolute folders a folder bridge may read below, for example /srv/notes,/opt/data/context/projects. Symlinks are resolved before the check |
RESEND_API_KEY | empty (mail recorded, not sent) | Resend API key for outbound email: sign-up verification, password reset, waitlist invites, workspace notices |
MAIL_FROM | Nexara Connect <noreply@nexara.ac> | Sender for outbound email; the domain must be verified in Resend |
SUPPORT_EMAIL | support@nexara.ac | Where "Book a free setup call" and the help links in the app point. Must be a plain address; anything else falls back to the default |
MAIL_IN_DOMAIN | empty (mail-in disabled) | Domain of the secret mail-in addresses, for example in.nexara.ac. Its MX must point at your inbound provider. See Email-in |
MAIL_IN_RESEND_WEBHOOK_SECRET | empty | Resend webhook signing secret (whsec_...) for POST /api/v1/mail-in/resend |
MAIL_IN_RESEND_API_KEY | empty | Resend API key able to read received emails (webhooks carry metadata only). Both Resend variables are needed to enable the Resend adapter |
MAIL_IN_POSTMARK_TOKEN | empty | Password Postmark sends as Basic auth on POST /api/v1/mail-in/postmark (at least 24 characters; shorter disables Postmark) |
GDRIVE_SERVICE_ACCOUNT | empty | Google service account key for gdrive bridges: the JSON itself or a path to the JSON file. Share the Drive folders with the service account's email. With GDRIVE_SUBJECT set (Workspace domain-wide delegation) it acts as that user |
GDRIVE_CLIENT_ID, GDRIVE_CLIENT_SECRET, GDRIVE_REFRESH_TOKEN | empty | Alternative to a service account: an OAuth client from your own Google Cloud project plus a refresh token granted the drive.readonly scope. With neither set, gdrive bridges cannot be created or run |
STRIPE_SECRET_KEY | empty (billing off) | Stripe secret key. Billing needs all four Stripe variables; without them billing endpoints answer billing_not_configured and everything else works |
STRIPE_WEBHOOK_SECRET | empty | Signing secret of the Stripe webhook endpoint https://<host>/api/v1/billing/webhook (events: checkout.session.completed, customer.subscription.*, invoice.paid, invoice.payment_failed) |
STRIPE_PRICE_TEAM_MONTHLY | empty | Stripe price id of Team billed monthly (per seat) |
STRIPE_PRICE_TEAM_ANNUAL | empty | Stripe price id of Team billed yearly (per seat) |
NOTION_TOKEN | empty | Notion internal integration token (read content only), server-wide fallback for notion bridges when no token is stored for the workspace |
GOOGLE_CLIENT_ID | empty (Gmail and Calendar off) | OAuth client id of a Google Cloud "Web application" client for Connections (Gmail, Google Calendar). Add https://<host>/api/v1/connections/callback as an authorised redirect URI. Scopes asked: gmail.readonly, gmail.compose, calendar.events, calendar.calendars.readonly. See Connect Gmail and Calendar |
GOOGLE_CLIENT_SECRET | empty | Its client secret. Both must be set, or the app shows "Ask your admin to enable Gmail" |
SLACK_CLIENT_ID | empty (Slack off) | Slack app client id for Connections. Redirect URL https://<host>/api/v1/connections/callback; bot scopes channels:read, channels:history, chat:write |
SLACK_CLIENT_SECRET | empty | Its client secret |
GITHUB_CLIENT_ID | empty (GitHub off) | GitHub OAuth app client id for Connections (scope repo). Callback URL https://<host>/api/v1/connections/callback |
GITHUB_CLIENT_SECRET | empty | Its client secret |
TRUST_PROXY | NODE_ENV=production | Trust X-Forwarded-* from the rightmost hop only (H3). Set false to disable on an untrusted network |
TRUSTED_PROXIES | loopback and private ranges | Comma list of IPs or CIDRs (for example 10.0.1.0/24) whose X-Forwarded-* headers are believed when TRUST_PROXY is on. A request from any other peer uses the socket address, so a client that reaches the container directly cannot set its own IP. Set this to your proxy's address if the container has a public interface |
AUDIT_SIGNING_KEY | HKDF from MASTER_KEY | Key for signed audit anchors: an Ed25519 private key in PEM (openssl genpkey -algorithm ed25519), or any secret a key is derived from. Set it to keep the anchor key separate from MASTER_KEY |
AUDIT_ANCHOR_MINUTES | 60 | How often the audit head is signed (skipped when nothing changed). Anchors are also written at startup, shutdown and on every backup |
FCM_PROJECT_ID | empty (Android push off) | Firebase project id for push to the Nexara Mobile app on Android (FCM HTTP v1). Needed together with FCM_CLIENT_EMAIL and FCM_PRIVATE_KEY; without all three the phone falls back to polling its inbox |
FCM_CLIENT_EMAIL | empty | Client email of the Firebase service account |
FCM_PRIVATE_KEY | empty | Private key (PEM) of the Firebase service account |
APNS_KEY_ID | empty (iOS push off) | Key id of an Apple Push token-auth key (a .p8 key from your Apple Developer account). Needed together with APNS_TEAM_ID, APNS_PRIVATE_KEY and APNS_BUNDLE_ID; without all four the phone falls back to polling its inbox |
APNS_TEAM_ID | empty | Your Apple Developer team id |
APNS_PRIVATE_KEY | empty | The .p8 private key itself (PEM) |
APNS_BUNDLE_ID | empty | Nexara Mobile's iOS bundle id, used as the APNs topic |
APNS_PRODUCTION | false (sandbox gateway) | Set true once the iOS build is signed for the App Store, to send through Apple's production APNs gateway instead of the sandbox |
The spending caps above are never off: an empty or invalid value uses the default. They apply to the server's own AI_PROVIDER key only. On top of them every workspace has its plan's monthly AI allowance, of which it may use at most a tenth in one day, and every member has a daily limit (40 questions and a matching amount of AI work by default, whichever comes first) that an owner can lower for a person in Settings but never raise. At 50% and 80% of the window or monthly cap, and whenever a daily limit is reached, the platform audit records it and the addresses in PLATFORM_ADMINS get an email. Owners see the server figures in Settings. A workspace's own AI key (bring your own key) never counts toward any of these limits and is never blocked by them
Recommended production values: PUBLIC_URL=https://<your host>, an explicit MASTER_KEY, and optionally a separate AUDIT_SIGNING_KEY. SIGNUPS=invite and REQUIRE_TOTP=true are the defaults.
The volume
/data/core.db identity, grants, tokens, sessions, proposals, threads, audit (NOT rebuildable)
/data/audit-anchors.jsonl signed audit-head anchors, append-only (NOT rebuildable; see Audit anchors)
/data/master.key only if MASTER_KEY was not set
/data/ws/<id>/repo/ the workspace git repository (the content)
/data/ws/<id>/index.db search index (rebuildable with npm run reindex)
/data/models/ downloaded embedding model
/data/backups/ last-backup.json (backup status); restore.sh --force moves replaced data here
Backups and restore
core.db (accounts, grants, tokens, proposals, threads, audit) is not rebuildable, and the /data volume is only visible to the container. GET /api/v1/admin/backup returns a consistent disaster-recovery archive while the server keeps running.
What is in the archive
A gzip tar named nexara-backup-<utc timestamp>-<git_sha>.tar.gz:
| Member | What |
|---|---|
core.db | Snapshot taken with the SQLite online backup API, consistent while writes continue |
ws/<id>.bundle | git bundle create --all of each workspace repository, taken under the writer lock: full history, every branch and tag |
audit-anchors.jsonl | Every signed audit anchor up to this backup. A fresh anchor is signed just before the snapshot, so the archive proves the state of the audit log at backup time |
audit-anchor.pub | The anchor public key (base64url), to verify the archive off the host with verify-audit --public-key |
manifest.json | Format version, app version, git_sha, created_at, workspaces with their HEAD, the anchor signed for this backup (audit_anchor), byte size and sha256 of every member |
Not in the archive: ws/<id>/index.db and embeddings (rebuilt from git at boot), models/, environment variables, MASTER_KEY and master.key.
MASTER_KEY warning. Sealed secret blocks inside the git bundles, token hashes and the index keys are all derived from MASTER_KEY. The archive never contains it. Without the same key, sealed secrets in a backup are unrecoverable and every agent key and session is invalid. Keep MASTER_KEY separately from the backups (a password manager, not the same bucket). If you run without MASTER_KEY, copy $DATA_DIR/master.key out of the volume once and store it the same way.
Taking a backup
Two ways to authenticate, both only on /api/v1/admin/backup and /api/v1/admin/backup/status:
- A web session of an owner of the instance workspace (
WORKSPACE) with a step-up in the last 5 minutes (POST /api/auth/stepup). Opening the URL in the browser downloads the file. Authorization: Bearer <BACKUP_TOKEN>for automation. SetBACKUP_TOKENto a random value of at least 24 characters (openssl rand -hex 32). It is compared in constant time and refused on every other route, including/mcp. Unset means the token path is disabled.
curl -fsS -H "Authorization: Bearer $BACKUP_TOKEN" -OJ https://app.example.com/api/v1/admin/backup
curl -fsS -H "Authorization: Bearer $BACKUP_TOKEN" https://app.example.com/api/v1/admin/backup/status
# {"ok":true,"last_backup_at":"...","bytes":123456,"sha256":"...","filename":"...","via":"backup_token","fresh_within_hours":36}
The archive is built in a temp directory under the OS temp dir and deleted after it has been streamed; the response carries X-Backup-Sha256. One backup per 5 minutes per instance: a second request gets 429 with Retry-After. Every backup is written to the audit log (backup.create, with size, sha256 and requester). status.ok is false when no backup was taken in the last 36 hours: point your monitoring at it. Run the curl above from a daily cron job off the host and keep several generations.
Restore (offline)
Restore is not an endpoint. scripts/restore.sh runs inside the image (it is copied to /app/scripts/restore.sh; node, git and tar are present), with the server stopped:
docker run --rm -v nexara-data:/data -v "$PWD":/in nexara \
bash /app/scripts/restore.sh /in/nexara-backup-20260930T030000Z-abc1234.tar.gz /data
It verifies every member against the sha256 and size in manifest.json (and refuses unknown members), refuses a target that already has core.db unless --force (the old core.db and workspace folders are then moved to <target>/backups/pre-restore-<utc>/, never deleted), restores core.db and audit-anchors.jsonl, recreates each workspace with git clone <bundle> repo plus every branch and tag, checks HEAD matches the manifest, and leaves no index.db, so the index is rebuilt from git at boot. It prints each step. Then start the server with the same MASTER_KEY and check GET /readyz shows the expected node count.
Bridges
A bridge pulls content from somewhere else into a Project on a schedule. It is configured per workspace by the owner (web session) or an agent key with a workspace-wide admin grant, through /api/v1/admin/bridges (see the REST reference). There is no web UI yet.
Every BRIDGE_TICK_MINUTES (default 5) the server runs each enabled bridge whose interval_minutes (default 60) has elapsed since its last run. A run goes through the same code as POST /api/v1/import: one commit under the writer lock, pages matched by frontmatter id then path so re-runs are idempotent, source: bridge/<name>/... stamped in the frontmatter. One bridge failing is recorded (last_status: error, last_error, a row in its run history) and the others still run; the server never stops for it. Every run is audited as bridge.sync with its counts; create, change, delete and forced runs are audited as bridge.create, bridge.update, bridge.delete, bridge.run.
Types
folder:config.pathis an absolute folder on the server. Every.mdfile below it (no dotfiles, nonode_modules, 2 MB each) becomes a page, keeping the folder structure. The cursor is the newest file mtime, so only files changed since the last run are read again. The path must be inside one ofBRIDGE_FOLDER_ROOTS; with that variable empty, folder bridges cannot be created or run. Files are never modified or deleted in the source, and a file deleted in the source is not deleted in the Project.gdrive:config.folder_idis a Google Drive folder id (the last part of the folder URL);config.recursive(defaulttrue) also reads subfolders, keeping their names as folders. Google Docs are exported to markdown (HTML export converted when markdown export is refused);.md,.txt,.htmland.docxfiles are downloaded and converted. Other types (PDF, Sheets, Slides, images) are skipped and listed in the run'sskipped_paths. Frontmatter is generated (title,source= the Drive link,drive_id,sensitivity); any frontmatter in the Drive file is dropped. The cursor maps each Drive file id to its modified time and page path, so unchanged files are not downloaded and a renamed file keeps updating the same page. Files deleted or trashed in Drive are not deleted in the Project.
notion:config.database_idis a Notion database id (or its URL). Every page in the database becomes a page in the Project, named after its title (a clash gets an id suffix). Blocks are converted to markdown (headings, paragraphs, lists, to-dos, toggles, quotes, callouts, code, tables, dividers, equations, bookmarks; Notion-hosted file and image URLs expire, so only their captions are kept). Simple properties (select, status, multi-select, text, number, checkbox, date, url, email, phone) go intonotion_propsin the frontmatter. The query asks only for pages edited since the newest edit seen; a page keeps its first path across renames. Archived pages are not deleted in the Project. Create an internal integration in Notion with only the "Read content" capability, share the database with it, and store its token withPUT /api/v1/admin/bridges/credentials/notion({token}), or setNOTION_TOKEN. The client can only make Notion's two read calls (database query, block children); anything else is refused before a request is made.
Drive credentials are stored per workspace with PUT /api/v1/admin/bridges/credentials/gdrive (body {kind: "oauth", client_id, client_secret, refresh_token} or {kind: "service_account", service_account: <key JSON>, subject?}). They are sealed with AES-256-GCM under a key derived from MASTER_KEY and the workspace, are write-only (no route returns them; GET .../credentials shows only kind and when they were set) and are scrubbed from every run error, log line and audit entry. The GDRIVE_* environment variables are a server-wide fallback. The bridge config itself refuses any key except folder_id and recursive. Grant only the https://www.googleapis.com/auth/drive.readonly scope: a token that reports any other scope is refused.
url:config.urlsis a list of up to 20 https URLs. Each URL becomes one page named after its host and path. HTML is converted to markdown by a small built-in converter (headings, paragraphs, lists, links, emphasis, code, quotes; scripts, styles, nav and footer dropped);text/plainandtext/markdownare taken as is, with any frontmatter removed. The cursor keeps each URL'sETagandLast-Modified, sent back asIf-None-MatchandIf-Modified-Since, so an unchanged page costs a304.
curl -X POST https://app.example.com/api/v1/admin/bridges \
-H "Authorization: Bearer $NEXARA_KEY" -H 'content-type: application/json' \
-d '{"name":"projects","type":"folder","config":{"path":"/opt/data/context/projects"},"target_space":"hafez","mode":"dry"}'
curl -X POST https://app.example.com/api/v1/admin/bridges/<id>/run -H "Authorization: Bearer $NEXARA_KEY"
curl -X PATCH https://app.example.com/api/v1/admin/bridges/<id> -H "Authorization: Bearer $NEXARA_KEY" \
-H 'content-type: application/json' -d '{"mode":"apply"}'
Dry mode
mode: dry runs the full plan (what would be created, updated, unchanged or skipped) and records it in the run history, but writes nothing: no commit, no index change, and the cursor does not move, so the first apply run after it imports everything the dry run reported. Create new bridges in dry, check GET /api/v1/admin/bridges/<id>, then PATCH to apply. POST .../run?mode=dry does a one-off dry run of an apply bridge.
Security notes
- A bridge writes as a system principal named
bridge:<name>, only into itstarget_space(andpath_prefix). A source file whose frontmatter id belongs to a page outside that folder is skipped, so a source cannot overwrite other Projects. sensitivity_ceiling(defaultinternal) caps what a bridge may import: a file declaring a higher sensitivity, or containing a higher sensitivity block, is skipped; files without one getinternal(or the ceiling, if lower). Instruction-bearing paths (index.md,CLAUDE.md,AGENTS.md,skills/**) are never imported by a bridge. Unparseable frontmatter is skipped.folderbridges read only belowBRIDGE_FOLDER_ROOTS; the path is resolved withrealpathat creation and again on every run, so a symlink or..cannot escape.- Remote content is converted, never trusted: every converter escapes raw HTML and HTML comments (
<before a tag, comment or declaration becomes<; inside code a zero-width joiner is used), so no script or markup is passed through and a remote<!-- secret -->or<!-- /secret -->, literal or entity-encoded, cannot open, close or break out of a sensitivity block. A Drive markdown/text file (or Google Doc export) that contains a sensitivity marker is skipped and reported instead of imported. The ceiling and the owner-only path rules above apply to every imported document. - Drive bridges contact only
https://www.googleapis.comandhttps://oauth2.googleapis.com, Notion bridges onlyhttps://api.notion.com(exact origin allowlist, no redirects followed, 20 seconds and 2 MB per call, streamed bodies cut at the cap). No URL found in Drive or Notion content is ever fetched..docxfiles are read with a bounded unzip (8 MB per part), so a zip bomb is refused. urlbridges fetch https only, never URLs with credentials,localhostor.local/.internalnames. The host is resolved on every fetch and refused if any address is loopback, private, link-local (including169.254.169.254), CGNAT, multicast or reserved (IPv4 and IPv6); the connection is pinned to the checked address, so DNS rebinding cannot swap it. Redirects are followed at most 3 times and each hop is checked again. Responses are capped at 2 MB and 20 seconds.- API responses never return credentials: any config key matching
token,secret,passwordorkeyis shown as[REDACTED]. Thefolderandurltypes need no credentials.
Webhooks
Outbound webhooks need no configuration: the server delivers due events every 15 seconds (and shortly after each new event). A note filed by email-in is a node.written event with change: "mailed" (capture-key notes use "captured"). Receivers must be reachable over https at a public address. Register them with POST /api/v1/admin/webhooks (see the REST reference) and verify Nexara-Signature as described under Security. Finished deliveries are pruned after 30 days by the nightly job.
Governance alerts
Team and above, a running trial, and legacy self-hosted workspaces can subscribe existing webhooks to governance alerts in Settings > Connections > Webhooks. Choose Slack format for a Slack incoming-webhook URL. Owners and admins can opt into personal email batches using the existing mail provider configuration. No additional environment variables or schema migration are needed; preferences use core metadata and webhook deliveries use the existing durable queue. See Governance alerts for payload privacy and timing.
Upgrade
- Back up (
GET /api/v1/admin/backup, above). - Pull the new code and rebuild the image, or redeploy in Coolify.
- Start it. Numbered
core.dbmigrations inserver/src/db.tsrun at boot, and each workspace index is re-synced from git (hash-incremental) when the workspace opens. - Check
GET /readyzshows the newgit_sha, then runscripts/smoke.sh <url> <email> <password>.
Rollback: redeploy the previous commit. The content repository is forward compatible (plain markdown), but restore core.db from the backup if the newer version changed its schema.
Maintenance commands
Run inside the container (docker exec nexara ...) or from a checkout with the same DATA_DIR:
| Command | What it does |
|---|---|
node server/dist/cli/import.js <folder> --space <name> | Import a folder of markdown (npm run import -- in a checkout) |
node server/dist/cli/reindex.js | Rebuild every workspace index from git |
node server/dist/cli/verify-audit.js | Verify the audit hash chain and its signed anchors (see Audit anchors) |
Audit anchors
The audit log in core.db is hash-chained, and the server signs its head with an Ed25519 key at startup, hourly (AUDIT_ANCHOR_MINUTES), on graceful shutdown and before every backup. Anchors are appended to /data/audit-anchors.jsonl, outside core.db, and copied into each backup. Someone who rewrites the audit table and recomputes every hash cannot produce a matching signature without the key, so verification catches it.
# inside the container (uses MASTER_KEY or AUDIT_SIGNING_KEY from the environment)
node server/dist/cli/verify-audit.js
# {"ok":true,"rows":1834,"anchors":42,"latest_anchor":{"seq":1830,...},"rows_after_anchor":4}
# off the host, against an extracted backup, with only the public key
node server/dist/cli/verify-audit.js --db x/core.db --anchors x/audit-anchors.jsonl --public-key x/audit-anchor.pub
# also enforce the anchors of an older backup (catches anchors deleted from the live file)
node server/dist/cli/verify-audit.js --anchors /data/audit-anchors.jsonl --anchors old/audit-anchors.jsonl
Exit code 1 means the chain was edited, truncated below an anchored row, or rewritten and recomputed, or an anchor was forged, edited or removed, or there is no anchor at all (pass --allow-unanchored for a brand new instance). Owners can read the latest anchor and the public key at GET /api/v1/audit/anchor; authenticated /readyz shows it as audit_anchor.
Notes:
- Rows written since the last anchor are protected by the hash chain only. Take backups often and keep them off the host; each one carries an anchor.
- Keep
audit-anchors.jsonlon the volume. Deleting it makesverify-auditfail, which is the intended signal. - Rotating
MASTER_KEYorAUDIT_SIGNING_KEYchanges the anchor key, so older anchors stop verifying with the new key. Before rotating, save the old public key (GET /api/v1/audit/anchor, oraudit-anchor.pubfrom a backup) and verify old anchor files with--public-key. Then move the old file aside so new anchors start a fresh file.
Email-in
Email-in files mail into a Project. It reuses the capture key model: each mail route is a secret address <token>@<MAIL_IN_DOMAIN> bound to one Project, one folder (default inbox/mail) and a sensitivity. The token (160 random bits) is the credential: it is shown once, stored only as a peppered HMAC, revocable, and dies on lockdown or when its creator stops being an owner (or an admin agent). Routes are managed at /api/v1/admin/mail-routes.
Mail arrives through an inbound-email provider that POSTs a webhook to /api/v1/mail-in/<provider>:
resend: the Svix signature (svix-id,svix-timestamp,svix-signature, HMAC-SHA256 withMAIL_IN_RESEND_WEBHOOK_SECRET) must verify and the timestamp must be within 5 minutes. Resend webhooks carry metadata only, so the server then reads the message fromhttps://api.resend.com/emails/receiving/<id>withMAIL_IN_RESEND_API_KEY. Attachments are listed by name and size, never downloaded.postmark: Postmark does not sign inbound webhooks; configure the webhook URL ashttps://postmark:<MAIL_IN_POSTMARK_TOKEN>@<host>/api/v1/mail-in/postmark.
Each webhook id (Resend) or message id (Postmark) is accepted once; a replay answers {ok: true, duplicate: true} and files nothing. Each message becomes one page: subject as title, type: email, source: mail-in/<route name>, mail_from, sensitivity forced to the route level. The text body is used, or the HTML body reduced to plain text. All mail text is neutralised: < is escaped, so no HTML renders and no <!-- secret --> style marker or sealed block can be forged; frontmatter-looking lines are escaped; invisible characters are dropped. Attachments up to 32 KB of .txt, .md, .csv or .json with a matching text content type are inlined in a fenced block; everything else is listed by name and size only. The secret scanner applies; a refused message is acknowledged and recorded, not retried.
Optional allowed_senders (addresses or @domain) is a convenience filter, not access control. It matches the message's From header, which the sender writes and can forge freely; Nexara does not check SPF, DKIM or DMARC (neither Resend nor Postmark gives a verdict field that can be trusted without parsing forgeable headers). Use it to cut down noise, such as newsletters sent to a shared address. Treat the route address as the secret: anyone who knows the token can file into the route under any From. If an address leaks, revoke the route and create a new one (DELETE /api/v1/admin/mail-routes/:id). Limits: 30 messages per minute per route, 10 per sender, 10 MB per webhook; over a limit the webhook gets 429 with Retry-After and the provider retries later. The webhook reply is {ok: true} whatever was filed, so it reveals no addresses. Audit (mail.in, deny.mail_in) and the delivery log hold ids and status codes only, never bodies, subjects, senders or tokens.
Setup outline: pick a subdomain, point its MX at the provider, add the webhook in the provider pointing at /api/v1/mail-in/<provider>, set the variables above, restart, then create a route:
curl -X POST https://app.example.com/api/v1/admin/mail-routes -H "Authorization: Bearer ***" \
-H 'content-type: application/json' -d '{"name":"notes","space":"hafez","allowed_senders":["@example.com"]}'