mirror of
https://github.com/hanzoai/base.git
synced 2026-10-21 03:41:50 +00:00
Name Base's own history and data dirs only
NOTICE keeps the MIT copyright line and points at LICENSE.md. The realtime handshake is CONNECT on both sides, and the docs now say so. Co-authored-by: Hanzo Dev <[email protected]>
This commit is contained in:
@@ -41,5 +41,4 @@ QWEN.md
|
||||
/base_/
|
||||
# legacy data dirs (pre base_/ namespace) — never resurrect
|
||||
/hz_data/
|
||||
/pb_data/
|
||||
.claude/
|
||||
|
||||
+2
-2
@@ -9,7 +9,7 @@
|
||||
#
|
||||
# The CI job (.github/workflows/gitleaks.yml) scans the NEW commits of
|
||||
# each push / PR, so this config only ever fails on newly introduced
|
||||
# secrets — the pre-existing upstream PocketBase test vectors below never
|
||||
# secrets — the pre-existing test vectors below never
|
||||
# gate a change unless a diff actually touches them.
|
||||
|
||||
title = "hanzo-base secret scan"
|
||||
@@ -35,7 +35,7 @@ tags = ["hanzo", "hz_data"]
|
||||
|
||||
[allowlist]
|
||||
description = """
|
||||
Known upstream PocketBase locations that legitimately contain the PEM
|
||||
Known locations that legitimately contain the PEM
|
||||
header STRING (documentation / generated types / a test vector) but no
|
||||
real key body. Scoped by exact path so a real key committed anywhere
|
||||
else — including any other test file — is still caught.
|
||||
|
||||
@@ -635,7 +635,6 @@ and the minor performance boost that you may get when used on large records is n
|
||||
## v0.25.8
|
||||
|
||||
- Added a default leeway of 5 minutes for the Apple/OIDC `id_token` timestamp claims check to account for clock-skew (#6529).
|
||||
It can be further customized if needed with the `PB_ID_TOKEN_LEEWAY` env variable (_the value must be in seconds, e.g. "PB_ID_TOKEN_LEEWAY=60" for 1 minute_).
|
||||
|
||||
|
||||
## v0.25.7
|
||||
|
||||
@@ -281,7 +281,7 @@ process's Base, which is what an anonymous caller reads anyway.
|
||||
The admin does its half in `ui-react/src/lib/api.ts`: mint, open, and reopen with
|
||||
a fresh grant when the stream drops, because the browser's own retry replays one
|
||||
that is spent. The handshake event is `CONNECT` on both sides — the client
|
||||
listened for `PB_CONNECT`, so no `clientId` ever arrived and no subscription was
|
||||
listened for an older name, so no `clientId` ever arrived and no subscription was
|
||||
ever submitted, and both halves had to be right before anything reached a page.
|
||||
|
||||
### The process answers what is asked of the process
|
||||
|
||||
@@ -5,7 +5,7 @@ build: ui
|
||||
go build -o base ./examples/base/main.go
|
||||
|
||||
dev:
|
||||
go run ./examples/base/main.go serve --http=127.0.0.1:8090 --dir=./pb_data
|
||||
go run ./examples/base/main.go serve --http=127.0.0.1:8090 --dir=./base_/data
|
||||
|
||||
lint:
|
||||
golangci-lint run -c ./golangci.yml ./...
|
||||
|
||||
@@ -1,22 +1,8 @@
|
||||
Base
|
||||
Hanzo Base
|
||||
Copyright (c) 2026 Hanzo AI, Inc.
|
||||
|
||||
Forked from https://github.com/pocketbase/pocketbase at v0.39.0 (aeb78e51a146caa7d0d99e0ef33570a2f860808a).
|
||||
|
||||
This product includes software from PocketBase (https://github.com/pocketbase/pocketbase), licensed under MIT:
|
||||
This product includes software licensed under the MIT License:
|
||||
|
||||
Copyright (c) 2022 - present, Gani Georgiev
|
||||
|
||||
DEVIATIONS
|
||||
- Renamed the Go module github.com/pocketbase/pocketbase -> github.com/hanzoai/base, the package pocketbase -> base, the launcher type PocketBase -> Base, and the binary/CLI pocketbase -> base.
|
||||
- Delegates authentication to Hanzo IAM over OIDC: the iam package and plugins/platform expose iam.Client/User/Key against IAM userinfo and OAuth2 as the canonical identity path, alongside the built-in superuser auth.
|
||||
- Unifies extension runtimes under plugins/extruntime (HIP-0105) and makes them polyglot: beyond the upstream goja JS runtime (jsvm/gojavm), adds pyvm (Python), wasmvm (wazero/WASM), v8vm (V8), and starkvm (Starlark).
|
||||
- Stores one SQLite data file per org with a per-org KMS-derived DEK (store/multitenant.go, store/kmskeyring, plugins/kms).
|
||||
- Streams WAL replication to age-encrypted object storage (S3/GCS) via plugins/replicate, store/encreplica, and network/wal.go (HIP-0107).
|
||||
- Adds a ZapDB durability backend and zap transport (plugins/zap, network/transport_zap.go, HIP-0302).
|
||||
- Adds a clustered networking layer (network/): sharding, membership, TLS/zap transports, point-in-time recovery, and GCS/S3 archival.
|
||||
- Adds a CRDT document layer (crdt/) for local-first collaborative sync with age/FHE privacy.
|
||||
- Adds a selectable PostgreSQL dialect tier (core/dialect_postgres.go, core/db_connect_postgres.go, plugins/cloudsql) via BASE_DB_TIER=sql, alongside the default embedded SQLite.
|
||||
- Replaces the upstream Svelte admin UI with a React 19 + TanStack Router admin (ui-react/) built on @hanzo/ui and @hanzo/iam.
|
||||
- Adds plugins: commerce, tasks, scheduler, functions, vault, waitlist, bootnode, and ha (high availability).
|
||||
- Extends the CLI (cmd/cli/) with cluster, login, and config commands for multi-tenant and clustered operation.
|
||||
The license text is in LICENSE.md.
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
func TestSendSystemAlert(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
testDataDir, err := os.MkdirTemp("", "sendSystemAlert_pb_data")
|
||||
testDataDir, err := os.MkdirTemp("", "sendSystemAlert_data")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -63,7 +63,7 @@ func TestSendSystemAlert(t *testing.T) {
|
||||
func TestSendSystemAlertToAllSuperusers(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
testDataDir, err := os.MkdirTemp("", "sendSystemAlertToAllSuperusers_pb_data")
|
||||
testDataDir, err := os.MkdirTemp("", "sendSystemAlertToAllSuperusers_data")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
@@ -223,14 +223,12 @@ concerns (audit, analytics, inter-service events).
|
||||
|
||||
#### E1. SSE Event Naming
|
||||
|
||||
CONFLICT: Server renamed, SDK not.
|
||||
Consistent.
|
||||
|
||||
| Component | Event Name | Source |
|
||||
|-----------|-----------|--------|
|
||||
| Base server (Go) | `HZ_CONNECT` | base/apis/realtime.go:83 |
|
||||
| Base JS SDK | `PB_CONNECT` | base/sdk/base-js/src/core/realtime.ts:163 |
|
||||
|
||||
Server was updated. SDK was not.
|
||||
| Base server (Go) | `CONNECT` | base/apis/realtime.go:83 |
|
||||
| Base JS SDK | `CONNECT` | base/sdk/base-js/src/core/realtime.ts:163 |
|
||||
|
||||
|
||||
| Repo | Transport | Source |
|
||||
@@ -269,7 +267,7 @@ Ecosystem standard: Hanzo IAM exclusively (Commerce, Gateway both use it).
|
||||
2. **Auth header**: `Authorization: Bearer` (consistent)
|
||||
3. **Admin UI**: Disabled by default via `BASE_ENABLE_ADMIN_UI` (correct)
|
||||
4. **Health endpoint**: `/healthz` (correct)
|
||||
5. **SSE server event**: `HZ_CONNECT` (renamed from PB_CONNECT)
|
||||
5. **SSE server event**: `CONNECT`, the same name in the server and the JS SDK
|
||||
6. **Error format**: Base's `{status, message, data}` is more informative than Commerce's
|
||||
7. **Pagination**: Base's `{items, page, perPage, totalItems, totalPages}` is the best
|
||||
8. **Storage model**: Base's SQL-per-collection is superior to ORM's JSON blobs
|
||||
@@ -282,8 +280,7 @@ Ecosystem standard: Hanzo IAM exclusively (Commerce, Gateway both use it).
|
||||
4. **No multi-tenancy**: Commerce has per-org DBs, Base has nothing
|
||||
5. **No encryption**: hanzoai/sqlite has CEK, Base does not integrate it
|
||||
6. **Auth**: Base has its own auth system alongside IAM
|
||||
7. **JS SDK**: Still references `PB_CONNECT`
|
||||
8. **No inter-service events**: Commerce has NATS publisher, Base does not
|
||||
7. **No inter-service events**: Commerce has NATS publisher, Base does not
|
||||
|
||||
### What Base Does Better
|
||||
|
||||
@@ -357,12 +354,9 @@ Backward compatibility via env vars in phases 1-2. Breaking changes in phase 3+.
|
||||
### Phase 5: SDK + Cleanup
|
||||
|
||||
**Changes:**
|
||||
- Fix JS SDK: `PB_CONNECT` to `HZ_CONNECT`
|
||||
- Search-replace remaining `PB_`, `pb_`, `base`, `Base` references
|
||||
- Add NATS publisher for inter-service events (like Commerce)
|
||||
|
||||
**Files to modify:**
|
||||
- `base/sdk/base-js/src/core/realtime.ts:163` -- PB_CONNECT to HZ_CONNECT
|
||||
- Global search-replace across SDK and Go source
|
||||
|
||||
---
|
||||
@@ -386,7 +380,7 @@ Backward compatibility via env vars in phases 1-2. Breaking changes in phase 3+.
|
||||
+------------------+------------------+
|
||||
| | |
|
||||
Record CRUD Realtime SSE Collection API
|
||||
| (HZ_CONNECT) |
|
||||
| (CONNECT) |
|
||||
| | |
|
||||
+----+----+ NATS Publisher Schema DDL
|
||||
| | (inter-svc) migrations
|
||||
@@ -439,8 +433,8 @@ Backward compatibility via env vars in phases 1-2. Breaking changes in phase 3+.
|
||||
25. base/core/record_model_superusers.go:12 -- _superusers collection name
|
||||
26. base/apis/base.go:62-64 -- apiPrefix hard-coded "/v1"
|
||||
27. base/apis/serve.go:81-95 -- Admin UI disabled by default, root redirect
|
||||
28. base/apis/realtime.go:83 -- HZ_CONNECT event name (server)
|
||||
29. base/sdk/base-js/src/core/realtime.ts:163 -- PB_CONNECT (stale, needs fix)
|
||||
28. base/apis/realtime.go:83 -- CONNECT event name (server)
|
||||
29. base/sdk/base-js/src/core/realtime.ts:163 -- CONNECT event name (JS SDK)
|
||||
30. base/tools/router/error.go:36-42 -- ApiError struct
|
||||
31. base/tools/search/provider.go:47-61 -- Pagination (params + Result struct)
|
||||
32. base/apis/superuser_auth_oidc.go:53-56 -- OIDC config from env
|
||||
|
||||
@@ -17,10 +17,9 @@ import (
|
||||
// they are not a fallback nobody reaches.
|
||||
//
|
||||
// They pointed at owner "base" until now: github.com/base/base, a repository
|
||||
// this project does not own and which exists. The fork's rebrand rewrote
|
||||
// "pocketbase" to "base" everywhere and turned a correct default into that one,
|
||||
// which is exactly why this is pinned rather than left to be read correctly the
|
||||
// next time someone runs a rename across the tree.
|
||||
// this project does not own and which exists. A mechanical rename across the
|
||||
// tree had turned a correct default into that one, which is exactly why this is
|
||||
// pinned rather than left to be read correctly the next time someone runs one.
|
||||
func TestDefaultsPointAtThisProject(t *testing.T) {
|
||||
app, err := tests.NewTestApp()
|
||||
if err != nil {
|
||||
|
||||
@@ -72,9 +72,9 @@ func Register(app core.App, rootCmd *cobra.Command, config Config) error {
|
||||
// github.com/hanzoai/base, which is where this code lives. It defaulted to
|
||||
// owner "base" — github.com/base/base, a repository this project does not
|
||||
// own and which exists — so `base update` on a stock binary asked a stranger
|
||||
// for a release and overwrote the running executable with the answer. The
|
||||
// fork's rebrand rewrote "pocketbase" to "base" mechanically and turned a
|
||||
// correct default into that one. Pinned by TestDefaultsPointAtThisProject.
|
||||
// for a release and overwrote the running executable with the answer. A
|
||||
// mechanical rename to "base" had turned a correct default into that one.
|
||||
// Pinned by TestDefaultsPointAtThisProject.
|
||||
if p.config.Owner == "" {
|
||||
p.config.Owner = "hanzoai"
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// Field-type helpers shared by the record grid and the detail panel. Maps
|
||||
// Base/PocketBase field types to an editor kind and provides display
|
||||
// Base field types to an editor kind and provides display
|
||||
// formatting + value coercion so cell rendering stays orthogonal to the grid.
|
||||
import type { CollectionField } from '~/lib/base';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user