Hosting

Set up OpenBursar on Cloudflare

This guide takes you from the Deploy to Cloudflare button to a working site that your AI assistant can read. It takes about 10 minutes, plus whatever your data source needs (Plaid's Sandbox works straight away).

  • TimeAbout 10 minutes
  • CostWorkers Free plan works; Workers Paid is $5/month
  • NeedsCloudflare and GitHub accounts, a password manager, a device with a passkey
  • You'll finish withYour own site, claimed with a passkey and ready to connect a data source

Screens from other services change. If yours looks different, go by the field names in the steps.

What you need first

  • A Cloudflare account. The Workers Free plan works. Workers Paid ($5/month) gives more headroom: the free plan has a tight CPU limit per request, and a first full history import or a cold dashboard load can run into it.
  • A GitHub account. Cloudflare copies OpenBursar into it.
  • A password manager, for your passphrase.
  • A phone or computer that can hold a passkey (Face ID, Touch ID, Windows Hello, or a password manager that stores passkeys).

1. Deploy

  1. Click Deploy to Cloudflare:

    Deploy to Cloudflare

    Or open https://deploy.workers.cloudflare.com/?url=https://github.com/openbursar/openbursar.

  2. Cloudflare asks for one secret, OWNER_PASSPHRASE. Choose one long random phrase: at least 12 characters, ideally 20 or more. Save it in your password manager now. It is your setup code (you type it once, to claim the site) and the root of the key that encrypts your bank credentials.

    Cloudflare dashboard
    Cloudflare's "Set up your application" form. Git account is unselected, Create private Git repository is unchecked, and Project name, KV namespace and D1 database are set to "openbursar". The OWNER_PASSPHRASE field is empty.
    Choose your Git account, type a passphrase in OWNER_PASSPHRASE, and leave the rest as it is.Checked 3 Dec 2026
  3. Start the deploy. Cloudflare then:

    • copies the repository into your GitHub account,
    • creates a D1 database (DB) and a KV namespace (OAUTH_KV) and connects them to the Worker,
    • sets up Workers Builds, so every push to your copy redeploys it. The build command is npm run build; the deploy command is npm run deploy, which deploys the Worker and applies database migrations.

Want your own domain? Add it before you create your passkey in step 2. Passkeys are tied to the site's address, so moving later means claiming the site again and reconnecting your AI assistant.

What you should see now: a finished build, and a Worker URL such as https://openbursar.<your-subdomain>.workers.dev.

Cloudflare dashboard
Cloudflare Worker overview for "openbursar" after a finished deploy, with the Overview, Metrics, Deployments, Observability, Issues, Domains, Access and Settings tabs, and the public workers.dev address (subdomain hidden).
Your site address is shown here. To use your own domain, add it under Domains before you claim the site.Checked 3 Dec 2026

2. Claim the site

  1. Open your Worker's URL. Because nobody owns the site yet, it shows a sign-in page that asks for your setup code.
  2. Enter your OWNER_PASSPHRASE and create a passkey when your browser asks.
OpenBursar
OpenBursar first-run claim page showing the Setup code input (empty) and the Create passkey button.
Enter your OWNER_PASSPHRASE as the Setup code to claim the site and create your first passkey.

After that, your passkey signs you in. You can add more passkeys, or remove one, in Settings → Security; the last one can't be removed. The setup code stops working once the site is claimed. Wrong codes are limited to 5 tries every 15 minutes, counted for everyone together, so claim your site soon after deploying.

What you should see now: the Overview page with a setup checklist. The first four steps (secret, database, encryption key, sign-in) are already ticked.

OpenBursar
OpenBursar setup checklist with the first four steps checked and step 5 ("Choose a data source") open, showing the Plaid keys form, SimpleFIN + SnapTrade toggle, Try it with demo data, and Skip for now.
Steps 1 to 4 are done. Choose a data source, load demo data, or skip for now.

Lost your passkey? In the Cloudflare dashboard, open Workers & Pages → your Worker → Settings → Variables and Secrets, and add or change the secret RESET_OWNER to any new value. Then open your site straight away and claim it again with your setup code: the reset happens on the first page load, and until you claim it, anyone who knows your setup code could. (If you think your passphrase leaked, change OWNER_PASSPHRASE first.) Your accounts, history and stored credentials are kept. Passkeys, dashboard sessions and connected AI apps are removed, so approve each assistant again. MCP_TOKEN is not affected. Setting the same value again does nothing.

Cloudflare dashboard
Cloudflare Worker Settings showing Runtime variables and secrets, with OWNER_PASSPHRASE saved as a Secret (value encrypted) and the Add variable button.
Variables and secrets live here. Add RESET_OWNER as a Secret.Checked 3 Dec 2026

3. Choose a data source

The setup checklist offers:

  • Plaid (default): banks, cards and brokerages in one, with up to 24 months of history and categories. Paste your keys from dashboard.plaid.com and click Test and save keys. Sandbox works right away; for real accounts, apply for Plaid's free Trial plan (US and Canada, up to 10 bank connections). Approval is usually quick. See Plaid: from Sandbox to Production.
  • SimpleFIN + SnapTrade: no approval needed. SimpleFIN costs about $15/year and covers banks and cards (SimpleFIN); SnapTrade Personal is free and covers brokerages (SnapTrade (investments)). You paste each one's token or keys in Settings → Data sources.
  • Demo data: a fictional household with 13 months of history, to try everything before you connect a bank. Remove it in Settings whenever you like.

You can also bring in CSV exports from a bank, Mint, YNAB or Quicken anytime from Import (or Settings → Data sources); see Importing CSV files.

Not ready to connect yet? Click Skip for now at the bottom of the data-source step to open the dashboard anyway. Until you connect an account, the top bar shows Setup N of 7 and Overview shows a Continue setup button so you can come back to the checklist whenever you're ready.

4. Connect an account

  • Plaid Sandbox: click add a test bank instantly, or use Connect a bank or card with user_good / pass_good.
  • Plaid Production: paste your Production secret on the setup page or in Settings → Data sources. No redeploy is needed. Banks that sign you in on their own site (Chase, Bank of America, and others) need the redirect address https://<your-site>/plaid/oauth-return registered in Plaid; the setup page shows it with a copy button. Details in Plaid: from Sandbox to Production.
  • SimpleFIN: paste the setup token from the SimpleFIN Bridge. Connect SnapTrade in Settings → Data sources.

Your data then syncs once a day (a Cron Trigger at 11:17 UTC) and whenever Plaid reports new data.

What you should see now: your accounts on the Overview page, and the "connect your first account" step ticked.

5. Connect your AI assistant

Add https://<your-site>/api/mcp to your AI assistant as a custom connector and approve it with your passkey. Steps for Claude Duet, dots in ChatGPT, Muse, Claude, ChatGPT, terminal agents and other MCP clients are in Connect your AI assistant. There is nothing to configure on the Cloudflare side.

Optional: put Cloudflare Access in front

Cloudflare Access can add a second sign-in in front of the dashboard. If you use it, leave these paths open, because your AI assistant, your data provider and the daily sync call them without a browser session:

  • /api/mcp, /token, /register and /.well-known/* (your AI assistant),
  • /api/webhooks/* (Plaid),
  • /api/cron/* (the daily sync calls your own site; if this is blocked, the sync quietly falls back to running in one request, which can hit Cloudflare's per-request limits when you have many connections),
  • /healthz (optional, for uptime checks).

Most of these check their own credentials: /api/mcp needs an OAuth token or MCP_TOKEN, /token needs a valid authorization code, /api/webhooks/* needs Plaid's signature, and /api/cron/* needs a token derived from OWNER_PASSPHRASE. /register, /.well-known/* and /healthz are public by design and show no financial data. Keep everything else, including /login and /authorize, behind Access: the consent page opens in your own browser, which is already signed in to Access.

Updating OpenBursar

Cloudflare's Deploy button creates a standalone copy of OpenBursar in your GitHub account, not a GitHub fork, so GitHub's Sync fork button isn't available. It also leaves out the repository's .github/ folder, so your copy starts without the Update OpenBursar GitHub Action. The first update adds it back. Later updates take one click.

Your data in D1 is never touched by an update. Pushing triggers Workers Builds, and npm run deploy applies any new database migrations.

First update (Deploy-button copies)

This is a one-time step on your own computer. It takes about 5 minutes.

You need: git installed, and a git sign-in to GitHub that can push to your repository (for example GitHub Desktop or the GitHub CLI, or an access token). A token needs the workflow scope, because this step adds .github/workflows/.

  1. Clone your repository and open it:

    git clone https://github.com/<your-username>/<your-repo>.git
    cd <your-repo>
  2. Preview the change. This is a dry run: it changes nothing and pushes nothing.

    bash scripts/update-upstream.sh

    It prints Bootstrap dry-run: Cloudflare Deploy-button import detected and lists the files it will keep, the workflows it will add under .github/workflows/, and any Blocking user-edited or user-only files. If it says No blocking files found., continue. If it lists blocking files, it will not overwrite or delete them. Save or move those files (or merge by hand), commit, and run the preview again.

  3. Apply it. This links your copy to OpenBursar's history, adds the workflows, and pushes to your repository:

    bash scripts/update-upstream.sh --apply

    It ends with Linked main to openbursar/openbursar release. It never force-pushes. If something goes wrong, it rolls back and tells you nothing was pushed.

    If it says Push failed: workflow permission required, your local commit is fine, but your git sign-in can't push workflow files. Give your credentials the workflow scope, then run git push origin main. Don't run --apply again.

    If it says Bootstrap stopped: pull first, your repository has newer commits than your clone. Run the two commands it prints.

  4. Check that Workers Builds redeployed your site (Cloudflare dashboard → Workers & Pages → your Worker → Deployments).

The script needs a clean working tree and a full clone (not --depth). It tells you if either is a problem.

Later updates

  1. In your GitHub repository, open Actions → Update OpenBursar.
  2. Click Run workflow, then Run workflow again.
  3. When the run finishes, Workers Builds redeploys your site. The run's summary says what happened.

If the summary says Already up to date, you have the latest release. If it says Update paused: merge conflict, you edited a file that OpenBursar owns. The summary lists the files and the commands to resolve them on your computer.

You can also update from your computer: git pull, then bash scripts/update-upstream.sh.

To check for updates on a schedule, edit .github/workflows/update.yml and uncomment the schedule: lines.

When the Action says it needs workflow permission

Sometimes a new release changes files under .github/workflows/. GitHub does not let the Action's default token change those files, so the run stops with Update needs workflow permission. Nothing is broken and nothing was pushed. Pick one:

  • Update from your computer (quickest): git pull, then bash scripts/update-upstream.sh. Your git sign-in needs the workflow scope, as in the first update.
  • Let the Action do it: create a personal access token with the workflow scope, add it to your repository as a secret named UPDATE_TOKEN (Settings → Secrets and variables → Actions), then run Update OpenBursar again.

What an update keeps

  • wrangler.jsonc is kept as it is, with your Worker name and your D1 and KV IDs. Your own plugins/ files are kept too, and the update never conflicts with them. The first update also keeps any other file you added that OpenBursar doesn't have.
  • New bindings are not merged for you. The first update does not apply OpenBursar's own wrangler.jsonc. If a release adds a binding or setting, copy it into your wrangler.jsonc by hand. The script prints the command to see the difference, git diff <commit> -- wrangler.jsonc, and the release notes in Announcements say when you need to.
  • If you changed other files OpenBursar owns, the first update stops and lists them, and later updates can hit a merge conflict. Put your changes in plugins/ instead.

Reverting the v1 transfer backfill

When you update to a version with improved transfer detection, the first sync runs a one-time backfill (v1) that reclassifies older transactions and saves every changed transaction ID in fin_settings (transfer_backfill_v1_log:*). Any transaction whose transfer flag is controlled by one of your own rules (is_transfer_rule) is never touched.

If you want to undo the v1 backfill:

  1. Check that no sync or backfill is running, and preview how many transactions v1 flipped. Avoid running this near the daily Cloudflare cron (11:17 UTC) or while triggering a sync. (On Docker, you can pause automatic syncs by setting OB_SYNC=off and running docker compose up -d.)

    Run these read-only queries first:

    SELECT key, value FROM fin_settings
    WHERE key = 'transfer_backfill_lease'
      AND json_valid(value)
      AND CAST(json_extract(value, '$.until') AS INTEGER) > unixepoch() * 1000;
    SELECT count(*) AS active_syncs FROM fin_connections WHERE sync_lease_until > unixepoch() * 1000;
    SELECT key,
           json_array_length(value, '$.to_transfer') AS to_xfer,
           json_array_length(value, '$.to_spending') AS to_spend
    FROM fin_settings
    WHERE (key = 'transfer_backfill_v1_log' OR key GLOB 'transfer_backfill_v1_log:*')
      AND json_valid(value);
    • Cloudflare: run each query with npx wrangler d1 execute DB --remote --command "...".
    • Docker: run all three at once inside the running container:

      docker compose exec openbursar node -e '
      const { DatabaseSync } = require("node:sqlite");
      const db = new DatabaseSync(process.env.OB_DB_PATH || "/data/openbursar.db");
      try {
        console.log("active lease:", db.prepare("SELECT key, value FROM fin_settings WHERE key = '\''transfer_backfill_lease'\'' AND json_valid(value) AND CAST(json_extract(value, '\''$.until'\'') AS INTEGER) > unixepoch() * 1000").all());
        console.log("active syncs:", db.prepare("SELECT count(*) AS active_syncs FROM fin_connections WHERE sync_lease_until > unixepoch() * 1000").all());
        console.log("v1 shards:", db.prepare("SELECT key, json_array_length(value, '\''$.to_transfer'\'') AS to_xfer, json_array_length(value, '\''$.to_spending'\'') AS to_spend FROM fin_settings WHERE (key = '\''transfer_backfill_v1_log'\'' OR key GLOB '\''transfer_backfill_v1_log:*'\'') AND json_valid(value)").all());
      } finally { db.close(); }
      '

    If an active lease is returned (leases expire after 2 minutes) or active_syncs is non-zero, wait for the sync to finish before continuing.

  2. Back up your database first:

    • Cloudflare: npx wrangler d1 export DB --remote --output=before-revert.sql
    • Docker: docker compose exec openbursar node dist/server.mjs backup (see Running OpenBursar in Docker)
  3. Save the SQL below as revert-transfer-backfill.sql. It sets transfer_classifier_v to 1 first (so a new v1 run can't start mid-revert and future syncs won't re-apply v1, without downgrading any newer version), restores every transaction flipped by v1 while preserving your rules (is_transfer_rule IS NULL), and removes the v1 audit shards and v1 cursor:

    INSERT INTO fin_settings (key, value) VALUES ('transfer_classifier_v', '1')
    ON CONFLICT (key) DO UPDATE SET value = '1', updated_at = strftime('%Y-%m-%dT%H:%M:%fZ','now')
    WHERE fin_settings.value IS NULL
       OR NOT json_valid(fin_settings.value)
       OR json_type(fin_settings.value, '$') NOT IN ('integer', 'real')
       OR CAST(json_extract(fin_settings.value, '$') AS INTEGER) < 1;
    
    UPDATE fin_transactions
    SET is_transfer = 0
    WHERE is_transfer_rule IS NULL
      AND is_transfer = 1
      AND id IN (
        SELECT j.value
        FROM fin_settings s,
             json_each(CASE WHEN json_valid(s.value) THEN s.value ELSE '{}' END, '$.to_transfer') j
        WHERE (s.key = 'transfer_backfill_v1_log' OR s.key GLOB 'transfer_backfill_v1_log:*')
          AND json_valid(s.value)
          AND json_extract(s.value, '$.version') = 1
          AND json_type(s.value, '$.to_transfer') = 'array'
          AND j.type = 'text'
      );
    
    UPDATE fin_transactions
    SET is_transfer = 1
    WHERE is_transfer_rule IS NULL
      AND is_transfer = 0
      AND id IN (
        SELECT j.value
        FROM fin_settings s,
             json_each(CASE WHEN json_valid(s.value) THEN s.value ELSE '{}' END, '$.to_spending') j
        WHERE (s.key = 'transfer_backfill_v1_log' OR s.key GLOB 'transfer_backfill_v1_log:*')
          AND json_valid(s.value)
          AND json_extract(s.value, '$.version') = 1
          AND json_type(s.value, '$.to_spending') = 'array'
          AND j.type = 'text'
      );
    
    DELETE FROM fin_settings
    WHERE (key = 'transfer_backfill_cursor' AND (value IS NULL OR NOT json_valid(value) OR json_extract(value, '$.version') = 1))
       OR key = 'transfer_backfill_v1_log'
       OR key GLOB 'transfer_backfill_v1_log:*';
  4. Run the SQL file against your database (on Cloudflare, re-run Step 1 first if the backup took a while, because wrangler d1 execute --file runs statements sequentially without an outer transaction):

    • Cloudflare (D1):

      npx wrangler d1 execute DB --remote --file=revert-transfer-backfill.sql

      (Don't add BEGIN/COMMIT to the file; D1 rejects explicit transaction statements in SQL files.)

    • Docker (SQLite, using the container's built-in node:sqlite):

      docker compose exec -T openbursar node -e '
      const fs = require("node:fs");
      const { DatabaseSync } = require("node:sqlite");
      const db = new DatabaseSync(process.env.OB_DB_PATH || "/data/openbursar.db");
      try {
        db.exec("PRAGMA busy_timeout = 5000;\nBEGIN IMMEDIATE;\n" + fs.readFileSync(0, "utf8") + "\nCOMMIT;");
      } finally {
        db.close();
      }
      ' < revert-transfer-backfill.sql

Want the next sync to re-run v1 instead? After running the revert above (so the old v1 audit shards are cleared first), run DELETE FROM fin_settings WHERE key = 'transfer_classifier_v' AND (value IS NULL OR NOT json_valid(value) OR json_type(value, '$') NOT IN ('integer', 'real') OR CAST(json_extract(value, '$') AS INTEGER) <= 1);. Only do this if you're rolling back to an older app version or deliberately re-running the backfill.

Environment variables

Set these under Workers & Pages → your Worker → Settings → Variables and Secrets. Cloudflare deploys a new version of the Worker when you save; if it doesn't, trigger a deploy from the dashboard.

NamePurpose
OWNER_PASSPHRASERequired. Setup code and encryption root (see below). At least 12 characters.
RESET_OWNERRecovery: a new value removes the owner and passkeys so you can claim the site again.
MCP_TOKENA fixed bearer token (16+ characters) for scripts and clients without OAuth. See Connect your AI assistant.
PLAID_CLIENT_ID, PLAID_SECRET, PLAID_ENVSet Plaid keys here instead of in the app. Used only when both the client ID and the secret are set; they then override saved keys.
PLAID_REDIRECT_URIOverride the bank sign-in return address (default https://<your-site>/plaid/oauth-return). Register it in Plaid too.
PLAID_COUNTRY_CODESDefaults to US.
PLAID_LANGUAGELanguage for Plaid Link. Defaults to en.
BASE_URLYour public address. Recommended once you've settled on one. Without it, the site uses the address of your last dashboard visit for webhooks and the daily sync.

Important: the passphrase

Provider keys and bank tokens are encrypted with keys derived from OWNER_PASSPHRASE. If you change it:

  • every dashboard session is signed out,
  • stored provider credentials can't be decrypted, so re-enter your provider keys and reconnect your accounts (your history is kept),
  • your passkeys still work,
  • connected AI apps and MCP_TOKEN keep working. To cut them off, revoke them in Settings → AI access (MCP) and change MCP_TOKEN,
  • nothing is re-encrypted, so a database export made earlier can still be read with the old passphrase, and putting the old passphrase back restores access.

If you are changing it because it may have leaked, also rotate your keys at Plaid, SimpleFIN and SnapTrade. To reset your passkeys, use RESET_OWNER instead.

Local development

npm install
cp .dev.vars.example .dev.vars   # set OWNER_PASSPHRASE to any 12+ character string
npm run migrate:local            # apply migrations to a local D1
npm run dev                      # build the client bundle and run in the local Workers runtime
Stuck, or found a mistake?

Ask in the Q&A and someone who runs OpenBursar will answer. If the guide itself is wrong or out of date, report it and we will fix the page.