lakebed 0.0.5 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -86,6 +86,26 @@ mutations: {
86
86
  }
87
87
  ```
88
88
 
89
+ ## Server Env
90
+
91
+ Server handlers can read capsule-specific environment variables through `ctx.env`.
92
+
93
+ ```txt
94
+ # .env.lakebed.server
95
+ OPENAI_API_KEY=sk-...
96
+ STRIPE_WEBHOOK_SECRET=whsec_...
97
+ ```
98
+
99
+ ```ts
100
+ queries: {
101
+ settings: query((ctx) => ({
102
+ hasOpenAiKey: Boolean(ctx.env.OPENAI_API_KEY)
103
+ }));
104
+ }
105
+ ```
106
+
107
+ `lakebed dev` loads `.env.lakebed.server` locally. For hosted apps, claim the deploy, then run `lakebed deploy` to replace the deploy's server env with the file contents. Env values are not included in anonymous artifacts or source manifests.
108
+
89
109
  ## Commands
90
110
 
91
111
  ```sh
@@ -109,6 +129,7 @@ lakebed logs [deploy-id-or-url] [--port 3000]
109
129
  - Tailwind classes in JSX are the only styling path in v0.
110
130
  - Guest auth works by default. Google sign-in is built in through Shoo and exposes verified identity on `ctx.auth`.
111
131
  - Anonymous deploys disable outbound `fetch`.
132
+ - Non-empty `.env.lakebed.server` files require a claimed deploy before they can sync to hosted server code.
112
133
 
113
134
  ## Hosted Deploys
114
135
 
@@ -142,10 +163,11 @@ Deploy responses include a claim URL. Configure GitHub OAuth on the runner, then
142
163
  LAKEBED_GITHUB_CLIENT_ID=...
143
164
  LAKEBED_GITHUB_CLIENT_SECRET=...
144
165
  LAKEBED_SESSION_SECRET=...
166
+ LAKEBED_SERVER_ENV_SECRET=...
145
167
  ```
146
168
 
147
- Claimed deploys are listed at `/deploys` on the deploy API origin. They keep the same resource limits as anonymous deploys. Anonymous deploys cannot use outbound `fetch`; after a deploy is claimed, `lakebed deploy` can update it with a source-backed server artifact that supports async handlers and server-side fetch. If the first deploy already needs server-side `fetch`, `lakebed deploy` creates a claim-required preview, saves its claim metadata, and prints the claim URL. Open that URL, then run `lakebed deploy` again to publish the real source-backed app.
169
+ Claimed deploys are listed at `/deploys` on the deploy API origin. They keep the same resource limits as anonymous deploys. Anonymous deploys cannot use outbound `fetch` or hosted server env; after a deploy is claimed, `lakebed deploy` can update it with a source-backed server artifact that supports async handlers, server-side fetch, and `.env.lakebed.server` sync. If the first deploy already needs server-side `fetch` or server env, `lakebed deploy` creates a claim-required preview, saves its claim metadata, and prints the claim URL. Open that URL, then run `lakebed deploy` again to publish the real source-backed app. Set `LAKEBED_SERVER_ENV_SECRET` on Postgres-backed runners to encrypt stored server env values.
148
170
 
149
171
  ## Admin Dashboard
150
172
 
151
- Set `LAKEBED_ADMIN_PASSWORD` on the anonymous deploy runner, then open `/admin` on the runner origin. The password is exchanged for an HttpOnly cookie so the dashboard stays unlocked until the cookie expires or the password changes. The resource table can terminate active deploys while preserving their resource history.
173
+ Set `LAKEBED_ADMIN_PASSWORD` on the anonymous deploy runner, then open `/admin` on the runner origin. The password is exchanged for an HttpOnly cookie so the dashboard stays unlocked until the cookie expires or the password changes. The resource table can terminate active deploys while preserving their resource history, and the users table can set per-user request and mutation limit overrides for claimed deploys.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lakebed",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "description": "Agent-native CLI and runtime for building and deploying Lakebed capsules.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",