Skip to content

Add document_mode option and AUTH_DISABLED env var for self-hosted#2133

Open
DivMode wants to merge 5 commits intosequinstream:mainfrom
DivMode:main
Open

Add document_mode option and AUTH_DISABLED env var for self-hosted#2133
DivMode wants to merge 5 commits intosequinstream:mainfrom
DivMode:main

Conversation

@DivMode
Copy link
Copy Markdown

@DivMode DivMode commented Apr 7, 2026

document_mode for Meilisearch sink

PR #2025 changed the Meilisearch client from PUT (add or update) to POST (add or replace). This makes sense as the default — users expect documents to be fully replaced.

However, for multi-table CDC (multiple Postgres tables → one Meilisearch index), PUT partial merge is essential. Each sink sends only its table's columns, and Meilisearch merges them at document level. With POST, each sink overwrites the entire document, erasing other sinks' data.

This adds a document_mode config option:

  • :replace (default) — POST, same behavior as today
  • :updatePUT, partial merge for multi-table CDC

YAML config example

sinks:
  - name: meilisearch-auctions
    destination:
      type: meilisearch
      document_mode: update  # PUT partial merge

AUTH_DISABLED env var

Self-hosted deployments behind reverse proxies (Cloudflare Access, Authelia, Authentik, etc.) don't need Sequin's built-in login — the proxy handles authentication. Setting AUTH_DISABLED=true auto-logs in the default provisioned user, skipping the login page entirely.

Self-hosted build fixes

  • config/prod.exs — treat empty SENTRY_DSN as nil (crashes Sentry at startup)
  • Dockerfile — skip mix sentry.package_source_code when SELF_HOSTED=1
  • .gitignore — ignore sst-env.d.ts (auto-generated by SST in monorepo builds)

Changes

File Change
meilisearch_sink.ex document_mode Ecto.Enum field
client.ex Conditional Req.put vs Req.post
transforms.ex YAML parser + external representation
meilisearch_client_test.exs PUT/POST mode tests
meilisearch_sink_test.exs Field validation tests
user_auth.ex AUTH_DISABLED auto-login bypass
accounts.ex get_first_user/0 helper
config/prod.exs Empty SENTRY_DSN → nil
Dockerfile Skip sentry for SELF_HOSTED=1
.gitignore Ignore sst-env.d.ts

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Apr 7, 2026
@DivMode DivMode changed the title Add document_mode option to Meilisearch sink Add document_mode option and AUTH_DISABLED env var for self-hosted Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant