@percher/core 0.4.28 → 1.0.0

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.
Files changed (349) hide show
  1. package/LICENSE +132 -0
  2. package/dist/appstore-artifacts.d.ts +8 -0
  3. package/dist/appstore-artifacts.d.ts.map +1 -1
  4. package/dist/appstore-artifacts.js +11 -15
  5. package/dist/appstore-artifacts.js.map +1 -1
  6. package/dist/commands/account.d.ts +1 -1
  7. package/dist/commands/account.js +3 -3
  8. package/dist/commands/account.js.map +1 -1
  9. package/dist/commands/admin-legacy-audit.d.ts +40 -0
  10. package/dist/commands/admin-legacy-audit.d.ts.map +1 -0
  11. package/dist/commands/admin-legacy-audit.js +57 -0
  12. package/dist/commands/admin-legacy-audit.js.map +1 -0
  13. package/dist/commands/admin-legacy-inventory.d.ts +27 -0
  14. package/dist/commands/admin-legacy-inventory.d.ts.map +1 -0
  15. package/dist/commands/admin-legacy-inventory.js +37 -0
  16. package/dist/commands/admin-legacy-inventory.js.map +1 -0
  17. package/dist/commands/admin-migrate-networks.d.ts +15 -0
  18. package/dist/commands/admin-migrate-networks.d.ts.map +1 -0
  19. package/dist/commands/admin-migrate-networks.js +15 -0
  20. package/dist/commands/admin-migrate-networks.js.map +1 -0
  21. package/dist/commands/alerts.js.map +1 -1
  22. package/dist/commands/analytics.js.map +1 -1
  23. package/dist/commands/app-resources.d.ts +1 -1
  24. package/dist/commands/app-resources.js.map +1 -1
  25. package/dist/commands/app-topology.js.map +1 -1
  26. package/dist/commands/appstore-kit.d.ts +1 -1
  27. package/dist/commands/appstore-kit.js +1 -1
  28. package/dist/commands/appstore-kit.js.map +1 -1
  29. package/dist/commands/billing.d.ts +1 -1
  30. package/dist/commands/billing.js.map +1 -1
  31. package/dist/commands/cache.js.map +1 -1
  32. package/dist/commands/capabilities.js.map +1 -1
  33. package/dist/commands/claim.js.map +1 -1
  34. package/dist/commands/dashboard.js.map +1 -1
  35. package/dist/commands/data-export.d.ts.map +1 -1
  36. package/dist/commands/data-export.js +5 -4
  37. package/dist/commands/data-export.js.map +1 -1
  38. package/dist/commands/data-oauth.js.map +1 -1
  39. package/dist/commands/data.js.map +1 -1
  40. package/dist/commands/deploy-repo.js.map +1 -1
  41. package/dist/commands/deploys.js.map +1 -1
  42. package/dist/commands/diagnose.js.map +1 -1
  43. package/dist/commands/diff.js.map +1 -1
  44. package/dist/commands/doctor.d.ts +23 -4
  45. package/dist/commands/doctor.d.ts.map +1 -1
  46. package/dist/commands/doctor.js +58 -9
  47. package/dist/commands/doctor.js.map +1 -1
  48. package/dist/commands/domains.js.map +1 -1
  49. package/dist/commands/env-scan.js.map +1 -1
  50. package/dist/commands/env.d.ts +3 -3
  51. package/dist/commands/env.js.map +1 -1
  52. package/dist/commands/export.d.ts +1 -1
  53. package/dist/commands/generate.js.map +1 -1
  54. package/dist/commands/hooks.js.map +1 -1
  55. package/dist/commands/import-project.d.ts +1 -1
  56. package/dist/commands/import-project.js.map +1 -1
  57. package/dist/commands/init.d.ts +1 -1
  58. package/dist/commands/init.js.map +1 -1
  59. package/dist/commands/insights.d.ts +28 -0
  60. package/dist/commands/insights.d.ts.map +1 -1
  61. package/dist/commands/insights.js.map +1 -1
  62. package/dist/commands/inspect-link.d.ts +1 -1
  63. package/dist/commands/inspect-link.js.map +1 -1
  64. package/dist/commands/login.js.map +1 -1
  65. package/dist/commands/logs.d.ts +3 -3
  66. package/dist/commands/logs.js.map +1 -1
  67. package/dist/commands/mcp.d.ts +4 -4
  68. package/dist/commands/mcp.d.ts.map +1 -1
  69. package/dist/commands/mcp.js +28 -8
  70. package/dist/commands/mcp.js.map +1 -1
  71. package/dist/commands/migrate-supabase-map.d.ts +1 -1
  72. package/dist/commands/migrate-supabase-map.js.map +1 -1
  73. package/dist/commands/migrate-supabase-schema.d.ts +4 -1
  74. package/dist/commands/migrate-supabase-schema.d.ts.map +1 -1
  75. package/dist/commands/migrate-supabase-schema.js +4 -1
  76. package/dist/commands/migrate-supabase-schema.js.map +1 -1
  77. package/dist/commands/migrate-supabase-scripts.d.ts.map +1 -1
  78. package/dist/commands/migrate-supabase-sdk.d.ts +1 -1
  79. package/dist/commands/migrate-supabase-sdk.js.map +1 -1
  80. package/dist/commands/migrate-supabase-status.js.map +1 -1
  81. package/dist/commands/migrate-supabase.d.ts +1 -1
  82. package/dist/commands/migrate-supabase.js +1 -1
  83. package/dist/commands/open.js.map +1 -1
  84. package/dist/commands/preview-branch.js.map +1 -1
  85. package/dist/commands/publish-api-error.d.ts +12 -2
  86. package/dist/commands/publish-api-error.d.ts.map +1 -1
  87. package/dist/commands/publish-api-error.js +128 -5
  88. package/dist/commands/publish-api-error.js.map +1 -1
  89. package/dist/commands/publish-failure.d.ts.map +1 -1
  90. package/dist/commands/publish-failure.js +47 -32
  91. package/dist/commands/publish-failure.js.map +1 -1
  92. package/dist/commands/publish-inline.d.ts +1 -1
  93. package/dist/commands/publish-inline.js +1 -1
  94. package/dist/commands/publish.d.ts.map +1 -1
  95. package/dist/commands/publish.js +48 -10
  96. package/dist/commands/publish.js.map +1 -1
  97. package/dist/commands/push.d.ts.map +1 -1
  98. package/dist/commands/push.js +11 -1
  99. package/dist/commands/push.js.map +1 -1
  100. package/dist/commands/redeploy.js.map +1 -1
  101. package/dist/commands/reproduce.js.map +1 -1
  102. package/dist/commands/reset-superuser.js.map +1 -1
  103. package/dist/commands/restore.d.ts +1 -1
  104. package/dist/commands/restore.js.map +1 -1
  105. package/dist/commands/resume.js.map +1 -1
  106. package/dist/commands/rollback.d.ts +2 -1
  107. package/dist/commands/rollback.d.ts.map +1 -1
  108. package/dist/commands/rollback.js +74 -4
  109. package/dist/commands/rollback.js.map +1 -1
  110. package/dist/commands/sharing.js.map +1 -1
  111. package/dist/commands/status.js.map +1 -1
  112. package/dist/commands/token.d.ts +2 -2
  113. package/dist/commands/transfers.js.map +1 -1
  114. package/dist/commands/versions.d.ts +12 -0
  115. package/dist/commands/versions.d.ts.map +1 -1
  116. package/dist/commands/versions.js.map +1 -1
  117. package/dist/commands/wait-deploy.d.ts +1 -1
  118. package/dist/error-classifier.d.ts +1 -1
  119. package/dist/error-classifier.d.ts.map +1 -1
  120. package/dist/error-classifier.js +66 -0
  121. package/dist/error-classifier.js.map +1 -1
  122. package/dist/errors.d.ts +1 -1
  123. package/dist/errors.d.ts.map +1 -1
  124. package/dist/errors.js.map +1 -1
  125. package/dist/event-renderer.d.ts.map +1 -1
  126. package/dist/event-renderer.js +12 -2
  127. package/dist/event-renderer.js.map +1 -1
  128. package/dist/index.d.ts +5 -1
  129. package/dist/index.d.ts.map +1 -1
  130. package/dist/index.js +8 -1
  131. package/dist/index.js.map +1 -1
  132. package/dist/plans.d.ts +23 -1
  133. package/dist/plans.d.ts.map +1 -1
  134. package/dist/plans.js +26 -1
  135. package/dist/plans.js.map +1 -1
  136. package/dist/publish-retry.d.ts.map +1 -1
  137. package/dist/publish-retry.js +26 -1
  138. package/dist/publish-retry.js.map +1 -1
  139. package/dist/recovery.d.ts +25 -2
  140. package/dist/recovery.d.ts.map +1 -1
  141. package/dist/recovery.js +59 -4
  142. package/dist/recovery.js.map +1 -1
  143. package/dist/static-docker.d.ts +8 -13
  144. package/dist/static-docker.d.ts.map +1 -1
  145. package/dist/static-docker.js +38 -27
  146. package/dist/static-docker.js.map +1 -1
  147. package/dist/stream-utils.d.ts +9 -14
  148. package/dist/stream-utils.d.ts.map +1 -1
  149. package/dist/stream-utils.js +164 -0
  150. package/dist/stream-utils.js.map +1 -1
  151. package/dist/structured-error-codes.d.ts +1 -1
  152. package/dist/structured-error-codes.d.ts.map +1 -1
  153. package/dist/structured-error-codes.js +123 -0
  154. package/dist/structured-error-codes.js.map +1 -1
  155. package/dist/templates/ai-files/claude-md.d.ts.map +1 -1
  156. package/dist/templates/ai-files/claude-md.js +18 -1
  157. package/dist/templates/ai-files/claude-md.js.map +1 -1
  158. package/dist/templates/ai-files/cursor-percher-mdc.d.ts.map +1 -1
  159. package/dist/templates/ai-files/cursor-percher-mdc.js +18 -1
  160. package/dist/templates/ai-files/cursor-percher-mdc.js.map +1 -1
  161. package/dist/templates.js.map +1 -1
  162. package/dist/untrusted.js.map +1 -1
  163. package/package.json +9 -8
  164. package/templates/LICENSE +14 -0
  165. package/templates/astro/Caddyfile +6 -0
  166. package/templates/astro/Dockerfile +51 -0
  167. package/templates/astro/PERCHER-TEMPLATE-LICENSE.txt +14 -0
  168. package/templates/astro/astro.config.mjs +3 -0
  169. package/templates/astro/package.json +14 -0
  170. package/templates/astro/percher.toml +11 -0
  171. package/templates/astro/src/pages/index.astro +15 -0
  172. package/templates/bun/PERCHER-TEMPLATE-LICENSE.txt +14 -0
  173. package/templates/bun/index.ts +23 -0
  174. package/templates/bun/package.json +8 -0
  175. package/templates/bun/percher.toml +10 -0
  176. package/templates/capsule/Caddyfile +7 -0
  177. package/templates/capsule/Dockerfile +57 -0
  178. package/templates/capsule/PERCHER-TEMPLATE-LICENSE.txt +14 -0
  179. package/templates/capsule/index.html +12 -0
  180. package/templates/capsule/package.json +20 -0
  181. package/templates/capsule/pb/schema.json +18 -0
  182. package/templates/capsule/percher.toml +13 -0
  183. package/templates/capsule/src/App.tsx +65 -0
  184. package/templates/capsule/src/components/Auth.tsx +75 -0
  185. package/templates/capsule/src/components/SignInWithGoogle.tsx +27 -0
  186. package/templates/capsule/src/lib/ai-client.ts +193 -0
  187. package/templates/capsule/src/lib/ai.ts +15 -0
  188. package/templates/capsule/src/lib/db.ts +14 -0
  189. package/templates/capsule/src/lib/realtime.ts +16 -0
  190. package/templates/capsule/src/main.tsx +5 -0
  191. package/templates/capsule/tsconfig.json +15 -0
  192. package/templates/capsule/vite.config.ts +6 -0
  193. package/templates/django/PERCHER-TEMPLATE-LICENSE.txt +14 -0
  194. package/templates/django/Procfile +1 -0
  195. package/templates/django/app/__init__.py +0 -0
  196. package/templates/django/app/settings.py +44 -0
  197. package/templates/django/app/urls.py +21 -0
  198. package/templates/django/app/wsgi.py +5 -0
  199. package/templates/django/manage.py +19 -0
  200. package/templates/django/percher.toml +12 -0
  201. package/templates/django/requirements.txt +2 -0
  202. package/templates/dotnet/Dockerfile +18 -0
  203. package/templates/dotnet/PERCHER-TEMPLATE-LICENSE.txt +14 -0
  204. package/templates/dotnet/Program.cs +23 -0
  205. package/templates/dotnet/app.csproj +9 -0
  206. package/templates/dotnet/percher.toml +11 -0
  207. package/templates/eleventy/.eleventy.js +12 -0
  208. package/templates/eleventy/Caddyfile +6 -0
  209. package/templates/eleventy/Dockerfile +51 -0
  210. package/templates/eleventy/PERCHER-TEMPLATE-LICENSE.txt +14 -0
  211. package/templates/eleventy/package.json +12 -0
  212. package/templates/eleventy/percher.toml +11 -0
  213. package/templates/eleventy/src/_includes/base.njk +12 -0
  214. package/templates/eleventy/src/assets/style.css +12 -0
  215. package/templates/eleventy/src/index.md +10 -0
  216. package/templates/elysia/PERCHER-TEMPLATE-LICENSE.txt +14 -0
  217. package/templates/elysia/index.ts +8 -0
  218. package/templates/elysia/package.json +12 -0
  219. package/templates/elysia/percher.toml +11 -0
  220. package/templates/express/PERCHER-TEMPLATE-LICENSE.txt +14 -0
  221. package/templates/express/index.ts +16 -0
  222. package/templates/express/package.json +12 -0
  223. package/templates/express/percher.toml +11 -0
  224. package/templates/fastify/PERCHER-TEMPLATE-LICENSE.txt +14 -0
  225. package/templates/fastify/index.ts +13 -0
  226. package/templates/fastify/package.json +12 -0
  227. package/templates/fastify/percher.toml +11 -0
  228. package/templates/flask/PERCHER-TEMPLATE-LICENSE.txt +14 -0
  229. package/templates/flask/main.py +23 -0
  230. package/templates/flask/percher.toml +12 -0
  231. package/templates/flask/requirements.txt +2 -0
  232. package/templates/go/Dockerfile +11 -0
  233. package/templates/go/PERCHER-TEMPLATE-LICENSE.txt +14 -0
  234. package/templates/go/go.mod +3 -0
  235. package/templates/go/main.go +53 -0
  236. package/templates/go/percher.toml +11 -0
  237. package/templates/hono/PERCHER-TEMPLATE-LICENSE.txt +14 -0
  238. package/templates/hono/index.ts +14 -0
  239. package/templates/hono/package.json +13 -0
  240. package/templates/hono/percher.toml +11 -0
  241. package/templates/htmx/PERCHER-TEMPLATE-LICENSE.txt +14 -0
  242. package/templates/htmx/index.ts +32 -0
  243. package/templates/htmx/package.json +15 -0
  244. package/templates/htmx/percher.toml +11 -0
  245. package/templates/hugo/Caddyfile +6 -0
  246. package/templates/hugo/Dockerfile +49 -0
  247. package/templates/hugo/PERCHER-TEMPLATE-LICENSE.txt +14 -0
  248. package/templates/hugo/content/_index.md +7 -0
  249. package/templates/hugo/hugo.toml +11 -0
  250. package/templates/hugo/layouts/index.html +22 -0
  251. package/templates/hugo/percher.toml +11 -0
  252. package/templates/java/Dockerfile +15 -0
  253. package/templates/java/Main.java +77 -0
  254. package/templates/java/PERCHER-TEMPLATE-LICENSE.txt +14 -0
  255. package/templates/java/percher.toml +11 -0
  256. package/templates/laravel/Dockerfile +19 -0
  257. package/templates/laravel/PERCHER-TEMPLATE-LICENSE.txt +14 -0
  258. package/templates/laravel/composer.json +15 -0
  259. package/templates/laravel/percher.toml +11 -0
  260. package/templates/laravel/public/index.php +37 -0
  261. package/templates/nextjs/PERCHER-TEMPLATE-LICENSE.txt +14 -0
  262. package/templates/nextjs/app/api/health/route.ts +3 -0
  263. package/templates/nextjs/app/layout.tsx +11 -0
  264. package/templates/nextjs/app/page.tsx +10 -0
  265. package/templates/nextjs/next.config.mjs +8 -0
  266. package/templates/nextjs/package.json +21 -0
  267. package/templates/nextjs/percher.toml +15 -0
  268. package/templates/node/PERCHER-TEMPLATE-LICENSE.txt +14 -0
  269. package/templates/node/index.js +26 -0
  270. package/templates/node/package.json +8 -0
  271. package/templates/node/percher.toml +10 -0
  272. package/templates/nuxt/PERCHER-TEMPLATE-LICENSE.txt +14 -0
  273. package/templates/nuxt/app.vue +6 -0
  274. package/templates/nuxt/nuxt.config.ts +4 -0
  275. package/templates/nuxt/package.json +15 -0
  276. package/templates/nuxt/percher.toml +15 -0
  277. package/templates/nuxt/server/api/health.ts +1 -0
  278. package/templates/phoenix/Dockerfile +15 -0
  279. package/templates/phoenix/PERCHER-TEMPLATE-LICENSE.txt +14 -0
  280. package/templates/phoenix/lib/application.ex +15 -0
  281. package/templates/phoenix/lib/router.ex +39 -0
  282. package/templates/phoenix/mix.exs +30 -0
  283. package/templates/phoenix/percher.toml +11 -0
  284. package/templates/preact/Caddyfile +7 -0
  285. package/templates/preact/Dockerfile +51 -0
  286. package/templates/preact/PERCHER-TEMPLATE-LICENSE.txt +14 -0
  287. package/templates/preact/index.html +12 -0
  288. package/templates/preact/package.json +19 -0
  289. package/templates/preact/percher.toml +11 -0
  290. package/templates/preact/src/main.tsx +13 -0
  291. package/templates/preact/vite.config.ts +6 -0
  292. package/templates/python/PERCHER-TEMPLATE-LICENSE.txt +14 -0
  293. package/templates/python/main.py +13 -0
  294. package/templates/python/nixpacks.toml +8 -0
  295. package/templates/python/percher.toml +12 -0
  296. package/templates/python/requirements.txt +2 -0
  297. package/templates/rails/Dockerfile +11 -0
  298. package/templates/rails/Gemfile +12 -0
  299. package/templates/rails/PERCHER-TEMPLATE-LICENSE.txt +14 -0
  300. package/templates/rails/config.ru +32 -0
  301. package/templates/rails/percher.toml +11 -0
  302. package/templates/remix/PERCHER-TEMPLATE-LICENSE.txt +14 -0
  303. package/templates/remix/app/root.tsx +19 -0
  304. package/templates/remix/app/routes/_index.tsx +10 -0
  305. package/templates/remix/app/routes/health.tsx +5 -0
  306. package/templates/remix/package.json +30 -0
  307. package/templates/remix/percher.toml +15 -0
  308. package/templates/remix/vite.config.ts +7 -0
  309. package/templates/rust/Cargo.toml +19 -0
  310. package/templates/rust/Dockerfile +18 -0
  311. package/templates/rust/PERCHER-TEMPLATE-LICENSE.txt +14 -0
  312. package/templates/rust/percher.toml +11 -0
  313. package/templates/rust/src/main.rs +45 -0
  314. package/templates/solid/Caddyfile +7 -0
  315. package/templates/solid/Dockerfile +51 -0
  316. package/templates/solid/PERCHER-TEMPLATE-LICENSE.txt +14 -0
  317. package/templates/solid/index.html +12 -0
  318. package/templates/solid/package.json +19 -0
  319. package/templates/solid/percher.toml +11 -0
  320. package/templates/solid/src/main.tsx +13 -0
  321. package/templates/solid/vite.config.ts +6 -0
  322. package/templates/static/PERCHER-TEMPLATE-LICENSE.txt +14 -0
  323. package/templates/static/index.html +15 -0
  324. package/templates/static/percher.toml +6 -0
  325. package/templates/static/style.css +32 -0
  326. package/templates/sveltekit/PERCHER-TEMPLATE-LICENSE.txt +14 -0
  327. package/templates/sveltekit/package.json +19 -0
  328. package/templates/sveltekit/percher.toml +15 -0
  329. package/templates/sveltekit/src/app.html +12 -0
  330. package/templates/sveltekit/src/routes/+page.svelte +2 -0
  331. package/templates/sveltekit/src/routes/health/+server.ts +5 -0
  332. package/templates/sveltekit/svelte.config.js +8 -0
  333. package/templates/sveltekit/vite.config.js +6 -0
  334. package/templates/vite-react/Caddyfile +7 -0
  335. package/templates/vite-react/Dockerfile +51 -0
  336. package/templates/vite-react/PERCHER-TEMPLATE-LICENSE.txt +14 -0
  337. package/templates/vite-react/index.html +12 -0
  338. package/templates/vite-react/package.json +22 -0
  339. package/templates/vite-react/percher.toml +11 -0
  340. package/templates/vite-react/src/main.tsx +20 -0
  341. package/templates/vite-react/vite.config.ts +6 -0
  342. package/templates/vite-vue/Caddyfile +7 -0
  343. package/templates/vite-vue/Dockerfile +51 -0
  344. package/templates/vite-vue/PERCHER-TEMPLATE-LICENSE.txt +14 -0
  345. package/templates/vite-vue/index.html +12 -0
  346. package/templates/vite-vue/package.json +19 -0
  347. package/templates/vite-vue/percher.toml +11 -0
  348. package/templates/vite-vue/src/main.ts +12 -0
  349. package/templates/vite-vue/vite.config.ts +6 -0
@@ -0,0 +1,51 @@
1
+ # Multi-stage build: a Bun stage compiles the static bundle, then a
2
+ # minimal Caddy image serves it. This project uses runtime = "docker"
3
+ # (not "static") because Percher's static runtime serves pre-built
4
+ # files only — it does not run a build command. Generated by Percher;
5
+ # safe to edit and own.
6
+
7
+ # --- Build stage: install deps and build the static bundle -----------
8
+ FROM oven/bun:1-alpine AS build
9
+ WORKDIR /app
10
+ COPY . .
11
+ RUN bun install && bun run build
12
+
13
+ # --- Serve stage: minimal Caddy image --------------------------------
14
+ # Build pinned Caddy source with refreshed security modules. The scratch
15
+ # runtime carries no shell, package manager, or file capabilities and listens
16
+ # on the unprivileged port :8080.
17
+ FROM golang:1.26.7-alpine3.23@sha256:b17af760035fc2f338eed92d448a6c67f2d45438844fc6c60678fa5f99e44b57 AS caddy-source
18
+ ADD --checksum=sha256:78e660d838e45c0b8c89338b325946238f153641aa9925df9ef2ad5e8eced31b \
19
+ https://github.com/caddyserver/caddy/commit/b2693fb63a30e6d7be0972c3645e9a2c0a500e93.patch /tmp/caddy-cel-go.patch
20
+ RUN go mod download github.com/caddyserver/caddy/v2@v2.11.4 \
21
+ && cp -R /go/pkg/mod/github.com/caddyserver/caddy/v2@v2.11.4 /src \
22
+ && chmod -R u+w /src
23
+ WORKDIR /src
24
+ RUN apk add --no-cache patch \
25
+ && patch -p1 < /tmp/caddy-cel-go.patch \
26
+ && go get github.com/go-chi/chi/v5@v5.3.0 github.com/google/cel-go@v0.29.2 \
27
+ github.com/klauspost/compress@v1.18.7 go.opentelemetry.io/otel@v1.44.0 \
28
+ golang.org/x/crypto@v0.55.0 golang.org/x/net@v0.58.0 \
29
+ golang.org/x/text@v0.41.0 google.golang.org/grpc@v1.83.2 \
30
+ && go mod tidy \
31
+ && CGO_ENABLED=0 go build -trimpath -ldflags "-s -w" -o /out/caddy ./cmd/caddy \
32
+ && printf '%s\n' \
33
+ 'package main' \
34
+ 'import ("net/http"; "os"; "time")' \
35
+ 'func main(){ if len(os.Args)!=2 { os.Exit(2) }; c:=http.Client{Timeout:2500*time.Millisecond,Transport:&http.Transport{Proxy:nil},CheckRedirect:func(_ *http.Request,_ []*http.Request) error{return http.ErrUseLastResponse}}; r,e:=c.Get(os.Args[1]); if e!=nil { os.Exit(1) }; defer r.Body.Close(); if r.StatusCode!=http.StatusOK { os.Exit(1) } }' \
36
+ > /tmp/percher-healthcheck.go \
37
+ && CGO_ENABLED=0 go build -trimpath -ldflags "-s -w" -o /out/percher-healthcheck /tmp/percher-healthcheck.go
38
+ FROM scratch
39
+ COPY --from=caddy-source /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
40
+ COPY --from=caddy-source /out/caddy /usr/bin/caddy
41
+ COPY --from=caddy-source /out/percher-healthcheck /usr/bin/percher-healthcheck
42
+ COPY Caddyfile /etc/caddy/Caddyfile
43
+ COPY --from=build /app/dist /srv
44
+ LABEL dev.percher.health-client="static-http-v1"
45
+ # HOME points at the writable tmpfs so non-root Caddy can persist its
46
+ # XDG state (storage-clean lock, config autosave) under Percher's
47
+ # read-only root filesystem.
48
+ ENV HOME=/tmp
49
+ USER 10001:10001
50
+ EXPOSE 8080
51
+ CMD ["caddy", "run", "--config", "/etc/caddy/Caddyfile", "--adapter", "caddyfile"]
@@ -0,0 +1,14 @@
1
+ BSD Zero Clause License (0BSD)
2
+
3
+ Copyright (c) 2026 Mattias Malmborg
4
+
5
+ Permission to use, copy, modify, and/or distribute this software for any
6
+ purpose with or without fee is hereby granted.
7
+
8
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
+ PERFORMANCE OF THIS SOFTWARE.
@@ -0,0 +1,3 @@
1
+ import { defineConfig } from "astro/config";
2
+
3
+ export default defineConfig({});
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "__APP_NAME__",
3
+ "version": "0.1.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "astro dev",
8
+ "build": "astro build",
9
+ "preview": "astro preview"
10
+ },
11
+ "dependencies": {
12
+ "astro": "^5.0.0"
13
+ }
14
+ }
@@ -0,0 +1,11 @@
1
+ [app]
2
+ name = "__APP_NAME__"
3
+ runtime = "docker"
4
+ framework = "astro"
5
+
6
+ [web]
7
+ port = 8080
8
+ health = "/"
9
+
10
+ [data]
11
+ mode = "none"
@@ -0,0 +1,15 @@
1
+ ---
2
+ const title = "__APP_NAME__";
3
+ ---
4
+
5
+ <html lang="en">
6
+ <head>
7
+ <meta charset="utf-8" />
8
+ <meta name="viewport" content="width=device-width" />
9
+ <title>{title}</title>
10
+ </head>
11
+ <body>
12
+ <h1>Hello from {title}!</h1>
13
+ <p>Built with Astro on Percher.</p>
14
+ </body>
15
+ </html>
@@ -0,0 +1,14 @@
1
+ BSD Zero Clause License (0BSD)
2
+
3
+ Copyright (c) 2026 Mattias Malmborg
4
+
5
+ Permission to use, copy, modify, and/or distribute this software for any
6
+ purpose with or without fee is hereby granted.
7
+
8
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
+ PERFORMANCE OF THIS SOFTWARE.
@@ -0,0 +1,23 @@
1
+ const port = Number(process.env.PORT ?? 3000);
2
+
3
+ Bun.serve({
4
+ port,
5
+ hostname: "0.0.0.0",
6
+ fetch(req) {
7
+ const url = new URL(req.url);
8
+
9
+ if (url.pathname === "/health") {
10
+ return Response.json({ status: "ok" });
11
+ }
12
+
13
+ if (url.pathname === "/") {
14
+ return new Response("Hello from __APP_NAME__!", {
15
+ headers: { "Content-Type": "text/plain" },
16
+ });
17
+ }
18
+
19
+ return new Response("Not found", { status: 404 });
20
+ },
21
+ });
22
+
23
+ console.log(`[__APP_NAME__] listening on http://0.0.0.0:${port}`);
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "__APP_NAME__",
3
+ "version": "0.1.0",
4
+ "private": true,
5
+ "scripts": {
6
+ "start": "bun run index.ts"
7
+ }
8
+ }
@@ -0,0 +1,10 @@
1
+ [app]
2
+ name = "__APP_NAME__"
3
+ runtime = "bun"
4
+
5
+ [web]
6
+ port = 3000
7
+ health = "/health"
8
+
9
+ [data]
10
+ mode = "none"
@@ -0,0 +1,7 @@
1
+ :8080 {
2
+ bind 0.0.0.0
3
+ root * /srv
4
+ encode gzip zstd
5
+ try_files {path} /index.html
6
+ file_server
7
+ }
@@ -0,0 +1,57 @@
1
+ # Capsule build: a Bun stage compiles the static Preact bundle, then a minimal
2
+ # Caddy image serves it. runtime = "docker" (not "static") because the static
3
+ # runtime serves pre-built files only — it does not run a build command.
4
+ # Generated by Percher; safe to edit and own.
5
+
6
+ # --- Build stage: install deps and build the static bundle -----------
7
+ FROM oven/bun:1-alpine AS build
8
+ WORKDIR /app
9
+ COPY . .
10
+ # Percher injects VITE_POCKETBASE_URL (the app's own pb-<app>.<suffix> origin)
11
+ # as a build-arg. A runtime=docker build only sees it if the Dockerfile DECLARES
12
+ # the ARG before the build — without this, db.ts compiles against `undefined`.
13
+ ARG VITE_POCKETBASE_URL
14
+ ENV VITE_POCKETBASE_URL=$VITE_POCKETBASE_URL
15
+ # Managed inference endpoint (Slice 3) — also a public URL, baked in the same way.
16
+ ARG VITE_PERCHER_AI_URL
17
+ ENV VITE_PERCHER_AI_URL=$VITE_PERCHER_AI_URL
18
+ RUN bun install && bun run build
19
+
20
+ # --- Serve stage: minimal Caddy image --------------------------------
21
+ # Build pinned Caddy source with refreshed security modules. The scratch
22
+ # runtime carries no shell, package manager, or file capabilities and listens
23
+ # on the unprivileged port :8080.
24
+ FROM golang:1.26.7-alpine3.23@sha256:b17af760035fc2f338eed92d448a6c67f2d45438844fc6c60678fa5f99e44b57 AS caddy-source
25
+ ADD --checksum=sha256:78e660d838e45c0b8c89338b325946238f153641aa9925df9ef2ad5e8eced31b \
26
+ https://github.com/caddyserver/caddy/commit/b2693fb63a30e6d7be0972c3645e9a2c0a500e93.patch /tmp/caddy-cel-go.patch
27
+ RUN go mod download github.com/caddyserver/caddy/v2@v2.11.4 \
28
+ && cp -R /go/pkg/mod/github.com/caddyserver/caddy/v2@v2.11.4 /src \
29
+ && chmod -R u+w /src
30
+ WORKDIR /src
31
+ RUN apk add --no-cache patch \
32
+ && patch -p1 < /tmp/caddy-cel-go.patch \
33
+ && go get github.com/go-chi/chi/v5@v5.3.0 github.com/google/cel-go@v0.29.2 \
34
+ github.com/klauspost/compress@v1.18.7 go.opentelemetry.io/otel@v1.44.0 \
35
+ golang.org/x/crypto@v0.55.0 golang.org/x/net@v0.58.0 \
36
+ golang.org/x/text@v0.41.0 google.golang.org/grpc@v1.83.2 \
37
+ && go mod tidy \
38
+ && CGO_ENABLED=0 go build -trimpath -ldflags "-s -w" -o /out/caddy ./cmd/caddy \
39
+ && printf '%s\n' \
40
+ 'package main' \
41
+ 'import ("net/http"; "os"; "time")' \
42
+ 'func main(){ if len(os.Args)!=2 { os.Exit(2) }; c:=http.Client{Timeout:2500*time.Millisecond,Transport:&http.Transport{Proxy:nil},CheckRedirect:func(_ *http.Request,_ []*http.Request) error{return http.ErrUseLastResponse}}; r,e:=c.Get(os.Args[1]); if e!=nil { os.Exit(1) }; defer r.Body.Close(); if r.StatusCode!=http.StatusOK { os.Exit(1) } }' \
43
+ > /tmp/percher-healthcheck.go \
44
+ && CGO_ENABLED=0 go build -trimpath -ldflags "-s -w" -o /out/percher-healthcheck /tmp/percher-healthcheck.go
45
+ FROM scratch
46
+ COPY --from=caddy-source /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
47
+ COPY --from=caddy-source /out/caddy /usr/bin/caddy
48
+ COPY --from=caddy-source /out/percher-healthcheck /usr/bin/percher-healthcheck
49
+ COPY Caddyfile /etc/caddy/Caddyfile
50
+ COPY --from=build /app/dist /srv
51
+ LABEL dev.percher.health-client="static-http-v1"
52
+ # HOME points at the writable tmpfs so non-root Caddy can persist its XDG state
53
+ # under Percher's read-only root filesystem.
54
+ ENV HOME=/tmp
55
+ USER 10001:10001
56
+ EXPOSE 8080
57
+ CMD ["caddy", "run", "--config", "/etc/caddy/Caddyfile", "--adapter", "caddyfile"]
@@ -0,0 +1,14 @@
1
+ BSD Zero Clause License (0BSD)
2
+
3
+ Copyright (c) 2026 Mattias Malmborg
4
+
5
+ Permission to use, copy, modify, and/or distribute this software for any
6
+ purpose with or without fee is hereby granted.
7
+
8
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
+ PERFORMANCE OF THIS SOFTWARE.
@@ -0,0 +1,12 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>__APP_NAME__</title>
7
+ </head>
8
+ <body>
9
+ <div id="app"></div>
10
+ <script type="module" src="/src/main.tsx"></script>
11
+ </body>
12
+ </html>
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "__APP_NAME__",
3
+ "version": "0.1.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "vite",
8
+ "build": "vite build",
9
+ "preview": "vite preview"
10
+ },
11
+ "dependencies": {
12
+ "pocketbase": "^0.26.0",
13
+ "preact": "^10.22.0"
14
+ },
15
+ "devDependencies": {
16
+ "@preact/preset-vite": "^2.9.0",
17
+ "typescript": "^5.5.0",
18
+ "vite": "^5.3.0"
19
+ }
20
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "version": 1,
3
+ "collections": [
4
+ {
5
+ "name": "messages",
6
+ "type": "base",
7
+ "fields": [
8
+ { "name": "text", "type": "text", "required": true, "max": 500 },
9
+ { "name": "author", "type": "text", "required": true }
10
+ ],
11
+ "listRule": "",
12
+ "viewRule": "",
13
+ "createRule": "@request.auth.id != \"\"",
14
+ "updateRule": "author = @request.auth.id",
15
+ "deleteRule": "author = @request.auth.id"
16
+ }
17
+ ]
18
+ }
@@ -0,0 +1,13 @@
1
+ [app]
2
+ name = "__APP_NAME__"
3
+ runtime = "docker"
4
+ framework = "vite"
5
+
6
+ [web]
7
+ port = 8080
8
+ health = "/"
9
+
10
+ # A capsule auto-provisions a PocketBase sidecar (db + auth + realtime + file
11
+ # storage). Percher applies pb/schema.json before the app goes live.
12
+ [data]
13
+ mode = "pocketbase"
@@ -0,0 +1,65 @@
1
+ import { useEffect, useState } from "preact/hooks";
2
+ import { Auth } from "./components/Auth";
3
+ import { db, pb } from "./lib/db";
4
+ import { subscribe } from "./lib/realtime";
5
+
6
+ interface Message {
7
+ id: string;
8
+ text: string;
9
+ author: string;
10
+ }
11
+
12
+ // The guestbook demo — email/password sign-in + db + realtime, working the
13
+ // moment `scaffold → publish` finishes (Percher provisions the schema before
14
+ // the app goes live). Only signed-in users can post (pb/schema.json createRule);
15
+ // each row is owner-editable (updateRule/deleteRule key off author).
16
+ export function App() {
17
+ const [messages, setMessages] = useState<Message[]>([]);
18
+ const [text, setText] = useState("");
19
+ // Force a re-render when auth state changes (sign in/out).
20
+ const [, bump] = useState(0);
21
+
22
+ async function load() {
23
+ setMessages(await db.collection<Message>("messages").getFullList());
24
+ }
25
+
26
+ useEffect(() => {
27
+ load();
28
+ const off = subscribe<Message>("messages", () => load());
29
+ return () => {
30
+ void off.then((fn) => fn());
31
+ };
32
+ }, []);
33
+
34
+ async function post() {
35
+ const author = pb.authStore.record?.id;
36
+ if (!author || !text.trim()) return;
37
+ await db.collection("messages").create({ text, author });
38
+ setText("");
39
+ }
40
+
41
+ return (
42
+ <main style={{ fontFamily: "system-ui", padding: 40, maxWidth: 640, margin: "0 auto" }}>
43
+ <h1>__APP_NAME__</h1>
44
+ <p>A Percher capsule — PocketBase db + auth + realtime, pre-wired.</p>
45
+ <Auth onChange={() => bump((n) => n + 1)} />
46
+ {pb.authStore.isValid && (
47
+ <div style={{ display: "flex", gap: 8, margin: "16px 0" }}>
48
+ <input
49
+ value={text}
50
+ placeholder="Leave a message"
51
+ onInput={(e) => setText((e.target as HTMLInputElement).value)}
52
+ />
53
+ <button type="button" onClick={post}>
54
+ Post
55
+ </button>
56
+ </div>
57
+ )}
58
+ <ul>
59
+ {messages.map((m) => (
60
+ <li key={m.id}>{m.text}</li>
61
+ ))}
62
+ </ul>
63
+ </main>
64
+ );
65
+ }
@@ -0,0 +1,75 @@
1
+ import { useState } from "preact/hooks";
2
+ import { pb } from "../lib/db";
3
+ import { SignInWithGoogle } from "./SignInWithGoogle";
4
+
5
+ /**
6
+ * Email/password sign-up + sign-in against PocketBase's built-in `users` auth
7
+ * collection — works on day one with ZERO provider config. Google sign-in is a
8
+ * convenience added on top (Slice 2), never a prerequisite.
9
+ */
10
+ export function Auth({ onChange }: { onChange?: () => void }) {
11
+ const [email, setEmail] = useState("");
12
+ const [password, setPassword] = useState("");
13
+ const [error, setError] = useState("");
14
+
15
+ async function signIn() {
16
+ setError("");
17
+ try {
18
+ await pb.collection("users").authWithPassword(email, password);
19
+ onChange?.();
20
+ } catch (e) {
21
+ setError((e as Error).message);
22
+ }
23
+ }
24
+ async function signUp() {
25
+ setError("");
26
+ try {
27
+ await pb.collection("users").create({ email, password, passwordConfirm: password });
28
+ await signIn();
29
+ } catch (e) {
30
+ setError((e as Error).message);
31
+ }
32
+ }
33
+ function signOut() {
34
+ pb.authStore.clear();
35
+ onChange?.();
36
+ }
37
+
38
+ if (pb.authStore.isValid) {
39
+ return (
40
+ <div>
41
+ <span>Signed in as {pb.authStore.record?.email}</span>{" "}
42
+ <button type="button" onClick={signOut}>
43
+ Sign out
44
+ </button>
45
+ </div>
46
+ );
47
+ }
48
+
49
+ return (
50
+ <div style={{ display: "grid", gap: 8, maxWidth: 280 }}>
51
+ <input
52
+ type="email"
53
+ placeholder="Email"
54
+ value={email}
55
+ onInput={(e) => setEmail((e.target as HTMLInputElement).value)}
56
+ />
57
+ <input
58
+ type="password"
59
+ placeholder="Password"
60
+ value={password}
61
+ onInput={(e) => setPassword((e.target as HTMLInputElement).value)}
62
+ />
63
+ <div style={{ display: "flex", gap: 8 }}>
64
+ <button type="button" onClick={signIn}>
65
+ Sign in
66
+ </button>
67
+ <button type="button" onClick={signUp}>
68
+ Sign up
69
+ </button>
70
+ </div>
71
+ <SignInWithGoogle onChange={onChange} />
72
+ {error && <p style={{ color: "crimson" }}>{error}</p>}
73
+ </div>
74
+ );
75
+ }
@@ -0,0 +1,27 @@
1
+ import { pb } from "../lib/db";
2
+
3
+ /**
4
+ * One-click Google sign-in — the bonus path on top of email/password. It lights
5
+ * up once an operator runs `percher data oauth google` (Slice 2) to configure the
6
+ * provider in this app's PocketBase. Until then it renders disabled with a hint;
7
+ * the disabled state never blocks the email/password path.
8
+ */
9
+ export function SignInWithGoogle({ onChange }: { onChange?: () => void }) {
10
+ async function signIn() {
11
+ await pb.collection("users").authWithOAuth2({ provider: "google" });
12
+ onChange?.();
13
+ }
14
+
15
+ // Flip to true once `percher data oauth google` has configured the provider.
16
+ const enabled = false;
17
+ return (
18
+ <button
19
+ type="button"
20
+ disabled={!enabled}
21
+ onClick={enabled ? signIn : undefined}
22
+ title="Run `percher data oauth google` to enable Google sign-in"
23
+ >
24
+ Sign in with Google
25
+ </button>
26
+ );
27
+ }