@percher/core 0.4.29 → 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.
- package/LICENSE +132 -0
- package/dist/appstore-artifacts.d.ts +8 -0
- package/dist/appstore-artifacts.d.ts.map +1 -1
- package/dist/appstore-artifacts.js +11 -15
- package/dist/appstore-artifacts.js.map +1 -1
- package/dist/commands/account.d.ts +1 -1
- package/dist/commands/account.js +3 -3
- package/dist/commands/account.js.map +1 -1
- package/dist/commands/admin-legacy-audit.d.ts +40 -0
- package/dist/commands/admin-legacy-audit.d.ts.map +1 -0
- package/dist/commands/admin-legacy-audit.js +57 -0
- package/dist/commands/admin-legacy-audit.js.map +1 -0
- package/dist/commands/admin-legacy-inventory.d.ts +27 -0
- package/dist/commands/admin-legacy-inventory.d.ts.map +1 -0
- package/dist/commands/admin-legacy-inventory.js +37 -0
- package/dist/commands/admin-legacy-inventory.js.map +1 -0
- package/dist/commands/admin-migrate-networks.d.ts +15 -0
- package/dist/commands/admin-migrate-networks.d.ts.map +1 -0
- package/dist/commands/admin-migrate-networks.js +15 -0
- package/dist/commands/admin-migrate-networks.js.map +1 -0
- package/dist/commands/appstore-kit.d.ts +1 -1
- package/dist/commands/appstore-kit.js +1 -1
- package/dist/commands/data-export.d.ts.map +1 -1
- package/dist/commands/data-export.js +5 -4
- package/dist/commands/data-export.js.map +1 -1
- package/dist/commands/doctor.d.ts +19 -0
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +58 -9
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/mcp.d.ts +4 -4
- package/dist/commands/mcp.d.ts.map +1 -1
- package/dist/commands/mcp.js +28 -8
- package/dist/commands/mcp.js.map +1 -1
- package/dist/commands/migrate-supabase-map.d.ts +1 -1
- package/dist/commands/migrate-supabase-schema.d.ts +4 -1
- package/dist/commands/migrate-supabase-schema.d.ts.map +1 -1
- package/dist/commands/migrate-supabase-schema.js +4 -1
- package/dist/commands/migrate-supabase-schema.js.map +1 -1
- package/dist/commands/migrate-supabase-sdk.d.ts +1 -1
- package/dist/commands/migrate-supabase.d.ts +1 -1
- package/dist/commands/migrate-supabase.js +1 -1
- package/dist/commands/publish-api-error.d.ts +12 -2
- package/dist/commands/publish-api-error.d.ts.map +1 -1
- package/dist/commands/publish-api-error.js +128 -5
- package/dist/commands/publish-api-error.js.map +1 -1
- package/dist/commands/publish-failure.d.ts.map +1 -1
- package/dist/commands/publish-failure.js +47 -32
- package/dist/commands/publish-failure.js.map +1 -1
- package/dist/commands/publish-inline.js +1 -1
- package/dist/commands/publish.d.ts.map +1 -1
- package/dist/commands/publish.js +48 -10
- package/dist/commands/publish.js.map +1 -1
- package/dist/commands/push.d.ts.map +1 -1
- package/dist/commands/push.js +11 -1
- package/dist/commands/push.js.map +1 -1
- package/dist/commands/rollback.d.ts +2 -1
- package/dist/commands/rollback.d.ts.map +1 -1
- package/dist/commands/rollback.js +74 -4
- package/dist/commands/rollback.js.map +1 -1
- package/dist/commands/versions.d.ts +12 -0
- package/dist/commands/versions.d.ts.map +1 -1
- package/dist/commands/versions.js.map +1 -1
- package/dist/commands/wait-deploy.d.ts +1 -1
- package/dist/error-classifier.d.ts +1 -1
- package/dist/error-classifier.d.ts.map +1 -1
- package/dist/error-classifier.js +66 -0
- package/dist/error-classifier.js.map +1 -1
- package/dist/errors.d.ts +1 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js.map +1 -1
- package/dist/event-renderer.d.ts.map +1 -1
- package/dist/event-renderer.js +12 -2
- package/dist/event-renderer.js.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -1
- package/dist/index.js.map +1 -1
- package/dist/plans.d.ts +23 -1
- package/dist/plans.d.ts.map +1 -1
- package/dist/plans.js +26 -1
- package/dist/plans.js.map +1 -1
- package/dist/publish-retry.d.ts.map +1 -1
- package/dist/publish-retry.js +26 -1
- package/dist/publish-retry.js.map +1 -1
- package/dist/recovery.d.ts +25 -2
- package/dist/recovery.d.ts.map +1 -1
- package/dist/recovery.js +59 -4
- package/dist/recovery.js.map +1 -1
- package/dist/static-docker.d.ts +8 -13
- package/dist/static-docker.d.ts.map +1 -1
- package/dist/static-docker.js +38 -27
- package/dist/static-docker.js.map +1 -1
- package/dist/stream-utils.d.ts +9 -14
- package/dist/stream-utils.d.ts.map +1 -1
- package/dist/stream-utils.js +164 -0
- package/dist/stream-utils.js.map +1 -1
- package/dist/structured-error-codes.d.ts +1 -1
- package/dist/structured-error-codes.d.ts.map +1 -1
- package/dist/structured-error-codes.js +123 -0
- package/dist/structured-error-codes.js.map +1 -1
- package/dist/templates/ai-files/claude-md.d.ts.map +1 -1
- package/dist/templates/ai-files/claude-md.js +18 -1
- package/dist/templates/ai-files/claude-md.js.map +1 -1
- package/dist/templates/ai-files/cursor-percher-mdc.d.ts.map +1 -1
- package/dist/templates/ai-files/cursor-percher-mdc.js +18 -1
- package/dist/templates/ai-files/cursor-percher-mdc.js.map +1 -1
- package/package.json +8 -7
- package/templates/LICENSE +14 -0
- package/templates/astro/Caddyfile +6 -0
- package/templates/astro/Dockerfile +51 -0
- package/templates/astro/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/astro/astro.config.mjs +3 -0
- package/templates/astro/package.json +14 -0
- package/templates/astro/percher.toml +11 -0
- package/templates/astro/src/pages/index.astro +15 -0
- package/templates/bun/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/bun/index.ts +23 -0
- package/templates/bun/package.json +8 -0
- package/templates/bun/percher.toml +10 -0
- package/templates/capsule/Caddyfile +7 -0
- package/templates/capsule/Dockerfile +57 -0
- package/templates/capsule/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/capsule/index.html +12 -0
- package/templates/capsule/package.json +20 -0
- package/templates/capsule/pb/schema.json +18 -0
- package/templates/capsule/percher.toml +13 -0
- package/templates/capsule/src/App.tsx +65 -0
- package/templates/capsule/src/components/Auth.tsx +75 -0
- package/templates/capsule/src/components/SignInWithGoogle.tsx +27 -0
- package/templates/capsule/src/lib/ai-client.ts +193 -0
- package/templates/capsule/src/lib/ai.ts +15 -0
- package/templates/capsule/src/lib/db.ts +14 -0
- package/templates/capsule/src/lib/realtime.ts +16 -0
- package/templates/capsule/src/main.tsx +5 -0
- package/templates/capsule/tsconfig.json +15 -0
- package/templates/capsule/vite.config.ts +6 -0
- package/templates/django/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/django/Procfile +1 -0
- package/templates/django/app/__init__.py +0 -0
- package/templates/django/app/settings.py +44 -0
- package/templates/django/app/urls.py +21 -0
- package/templates/django/app/wsgi.py +5 -0
- package/templates/django/manage.py +19 -0
- package/templates/django/percher.toml +12 -0
- package/templates/django/requirements.txt +2 -0
- package/templates/dotnet/Dockerfile +18 -0
- package/templates/dotnet/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/dotnet/Program.cs +23 -0
- package/templates/dotnet/app.csproj +9 -0
- package/templates/dotnet/percher.toml +11 -0
- package/templates/eleventy/.eleventy.js +12 -0
- package/templates/eleventy/Caddyfile +6 -0
- package/templates/eleventy/Dockerfile +51 -0
- package/templates/eleventy/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/eleventy/package.json +12 -0
- package/templates/eleventy/percher.toml +11 -0
- package/templates/eleventy/src/_includes/base.njk +12 -0
- package/templates/eleventy/src/assets/style.css +12 -0
- package/templates/eleventy/src/index.md +10 -0
- package/templates/elysia/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/elysia/index.ts +8 -0
- package/templates/elysia/package.json +12 -0
- package/templates/elysia/percher.toml +11 -0
- package/templates/express/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/express/index.ts +16 -0
- package/templates/express/package.json +12 -0
- package/templates/express/percher.toml +11 -0
- package/templates/fastify/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/fastify/index.ts +13 -0
- package/templates/fastify/package.json +12 -0
- package/templates/fastify/percher.toml +11 -0
- package/templates/flask/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/flask/main.py +23 -0
- package/templates/flask/percher.toml +12 -0
- package/templates/flask/requirements.txt +2 -0
- package/templates/go/Dockerfile +11 -0
- package/templates/go/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/go/go.mod +3 -0
- package/templates/go/main.go +53 -0
- package/templates/go/percher.toml +11 -0
- package/templates/hono/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/hono/index.ts +14 -0
- package/templates/hono/package.json +13 -0
- package/templates/hono/percher.toml +11 -0
- package/templates/htmx/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/htmx/index.ts +32 -0
- package/templates/htmx/package.json +15 -0
- package/templates/htmx/percher.toml +11 -0
- package/templates/hugo/Caddyfile +6 -0
- package/templates/hugo/Dockerfile +49 -0
- package/templates/hugo/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/hugo/content/_index.md +7 -0
- package/templates/hugo/hugo.toml +11 -0
- package/templates/hugo/layouts/index.html +22 -0
- package/templates/hugo/percher.toml +11 -0
- package/templates/java/Dockerfile +15 -0
- package/templates/java/Main.java +77 -0
- package/templates/java/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/java/percher.toml +11 -0
- package/templates/laravel/Dockerfile +19 -0
- package/templates/laravel/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/laravel/composer.json +15 -0
- package/templates/laravel/percher.toml +11 -0
- package/templates/laravel/public/index.php +37 -0
- package/templates/nextjs/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/nextjs/app/api/health/route.ts +3 -0
- package/templates/nextjs/app/layout.tsx +11 -0
- package/templates/nextjs/app/page.tsx +10 -0
- package/templates/nextjs/next.config.mjs +8 -0
- package/templates/nextjs/package.json +21 -0
- package/templates/nextjs/percher.toml +15 -0
- package/templates/node/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/node/index.js +26 -0
- package/templates/node/package.json +8 -0
- package/templates/node/percher.toml +10 -0
- package/templates/nuxt/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/nuxt/app.vue +6 -0
- package/templates/nuxt/nuxt.config.ts +4 -0
- package/templates/nuxt/package.json +15 -0
- package/templates/nuxt/percher.toml +15 -0
- package/templates/nuxt/server/api/health.ts +1 -0
- package/templates/phoenix/Dockerfile +15 -0
- package/templates/phoenix/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/phoenix/lib/application.ex +15 -0
- package/templates/phoenix/lib/router.ex +39 -0
- package/templates/phoenix/mix.exs +30 -0
- package/templates/phoenix/percher.toml +11 -0
- package/templates/preact/Caddyfile +7 -0
- package/templates/preact/Dockerfile +51 -0
- package/templates/preact/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/preact/index.html +12 -0
- package/templates/preact/package.json +19 -0
- package/templates/preact/percher.toml +11 -0
- package/templates/preact/src/main.tsx +13 -0
- package/templates/preact/vite.config.ts +6 -0
- package/templates/python/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/python/main.py +13 -0
- package/templates/python/nixpacks.toml +8 -0
- package/templates/python/percher.toml +12 -0
- package/templates/python/requirements.txt +2 -0
- package/templates/rails/Dockerfile +11 -0
- package/templates/rails/Gemfile +12 -0
- package/templates/rails/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/rails/config.ru +32 -0
- package/templates/rails/percher.toml +11 -0
- package/templates/remix/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/remix/app/root.tsx +19 -0
- package/templates/remix/app/routes/_index.tsx +10 -0
- package/templates/remix/app/routes/health.tsx +5 -0
- package/templates/remix/package.json +30 -0
- package/templates/remix/percher.toml +15 -0
- package/templates/remix/vite.config.ts +7 -0
- package/templates/rust/Cargo.toml +19 -0
- package/templates/rust/Dockerfile +18 -0
- package/templates/rust/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/rust/percher.toml +11 -0
- package/templates/rust/src/main.rs +45 -0
- package/templates/solid/Caddyfile +7 -0
- package/templates/solid/Dockerfile +51 -0
- package/templates/solid/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/solid/index.html +12 -0
- package/templates/solid/package.json +19 -0
- package/templates/solid/percher.toml +11 -0
- package/templates/solid/src/main.tsx +13 -0
- package/templates/solid/vite.config.ts +6 -0
- package/templates/static/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/static/index.html +15 -0
- package/templates/static/percher.toml +6 -0
- package/templates/static/style.css +32 -0
- package/templates/sveltekit/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/sveltekit/package.json +19 -0
- package/templates/sveltekit/percher.toml +15 -0
- package/templates/sveltekit/src/app.html +12 -0
- package/templates/sveltekit/src/routes/+page.svelte +2 -0
- package/templates/sveltekit/src/routes/health/+server.ts +5 -0
- package/templates/sveltekit/svelte.config.js +8 -0
- package/templates/sveltekit/vite.config.js +6 -0
- package/templates/vite-react/Caddyfile +7 -0
- package/templates/vite-react/Dockerfile +51 -0
- package/templates/vite-react/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/vite-react/index.html +12 -0
- package/templates/vite-react/package.json +22 -0
- package/templates/vite-react/percher.toml +11 -0
- package/templates/vite-react/src/main.tsx +20 -0
- package/templates/vite-react/vite.config.ts +6 -0
- package/templates/vite-vue/Caddyfile +7 -0
- package/templates/vite-vue/Dockerfile +51 -0
- package/templates/vite-vue/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/vite-vue/index.html +12 -0
- package/templates/vite-vue/package.json +19 -0
- package/templates/vite-vue/percher.toml +11 -0
- package/templates/vite-vue/src/main.ts +12 -0
- package/templates/vite-vue/vite.config.ts +6 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
defmodule PercherApp.Router do
|
|
2
|
+
use Plug.Router
|
|
3
|
+
|
|
4
|
+
plug(:match)
|
|
5
|
+
plug(:dispatch)
|
|
6
|
+
|
|
7
|
+
get "/health" do
|
|
8
|
+
send_resp(conn, 200, Jason.encode!(%{ok: true}))
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
get "/" do
|
|
12
|
+
html = """
|
|
13
|
+
<!doctype html>
|
|
14
|
+
<html lang="en">
|
|
15
|
+
<head>
|
|
16
|
+
<meta charset="utf-8" />
|
|
17
|
+
<title>__APP_NAME__</title>
|
|
18
|
+
<style>
|
|
19
|
+
body { font-family: system-ui, sans-serif; max-width: 640px; margin: 48px auto; padding: 0 24px; line-height: 1.6; }
|
|
20
|
+
h1 { letter-spacing: -0.5px; }
|
|
21
|
+
</style>
|
|
22
|
+
</head>
|
|
23
|
+
<body>
|
|
24
|
+
<h1>__APP_NAME__</h1>
|
|
25
|
+
<p>An Elixir app deployed on Percher.</p>
|
|
26
|
+
<p>To upgrade to full Phoenix, run <code>mix phx.new .</code> in this directory (replaces the current skeleton).</p>
|
|
27
|
+
</body>
|
|
28
|
+
</html>
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
conn
|
|
32
|
+
|> put_resp_content_type("text/html; charset=utf-8")
|
|
33
|
+
|> send_resp(200, html)
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
match _ do
|
|
37
|
+
send_resp(conn, 404, "Not found")
|
|
38
|
+
end
|
|
39
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
defmodule PercherApp.MixProject do
|
|
2
|
+
use Mix.Project
|
|
3
|
+
|
|
4
|
+
def project do
|
|
5
|
+
[
|
|
6
|
+
app: :percher_app,
|
|
7
|
+
version: "0.1.0",
|
|
8
|
+
elixir: "~> 1.17",
|
|
9
|
+
start_permanent: Mix.env() == :prod,
|
|
10
|
+
deps: deps()
|
|
11
|
+
]
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def application do
|
|
15
|
+
[
|
|
16
|
+
extra_applications: [:logger],
|
|
17
|
+
mod: {PercherApp.Application, []}
|
|
18
|
+
]
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# Minimal Plug + Bandit. Run `mix phx.new .` once you're ready to upgrade
|
|
22
|
+
# to the full Phoenix framework — you'll replace this project skeleton.
|
|
23
|
+
defp deps do
|
|
24
|
+
[
|
|
25
|
+
{:plug, "~> 1.16"},
|
|
26
|
+
{:bandit, "~> 1.5"},
|
|
27
|
+
{:jason, "~> 1.4"}
|
|
28
|
+
]
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -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,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,19 @@
|
|
|
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
|
+
"preact": "^10.22.0"
|
|
13
|
+
},
|
|
14
|
+
"devDependencies": {
|
|
15
|
+
"@preact/preset-vite": "^2.9.0",
|
|
16
|
+
"vite": "^5.3.0",
|
|
17
|
+
"typescript": "^5.5.0"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { render } from "preact";
|
|
2
|
+
|
|
3
|
+
function App() {
|
|
4
|
+
return (
|
|
5
|
+
<main style={{ fontFamily: "system-ui", padding: 40 }}>
|
|
6
|
+
<h1>Hello from __APP_NAME__</h1>
|
|
7
|
+
<p>Preact + Vite, served as static from Percher.</p>
|
|
8
|
+
</main>
|
|
9
|
+
);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const root = document.getElementById("app");
|
|
13
|
+
if (root) render(<App />, root);
|
|
@@ -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,8 @@
|
|
|
1
|
+
# Pin the start command for the default nixpacks build path. Without this,
|
|
2
|
+
# nixpacks' Python provider can default to `python main.py`, which imports the
|
|
3
|
+
# FastAPI app and exits without serving — the container exits immediately and
|
|
4
|
+
# the health check fails. `python -m uvicorn` doesn't depend on `uvicorn` being
|
|
5
|
+
# on PATH. Mirrors `[web].command` in percher.toml (used by the Percher-owned
|
|
6
|
+
# python build bypass).
|
|
7
|
+
[start]
|
|
8
|
+
cmd = "python -m uvicorn main:app --host 0.0.0.0 --port 8000"
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
FROM ruby:3.3-alpine
|
|
2
|
+
WORKDIR /app
|
|
3
|
+
RUN apk add --no-cache build-base \
|
|
4
|
+
&& addgroup -S app && adduser -S app -G app
|
|
5
|
+
COPY --chown=app:app Gemfile ./
|
|
6
|
+
RUN bundle install --jobs 4 --retry 3
|
|
7
|
+
COPY --chown=app:app . .
|
|
8
|
+
RUN chown -R app:app /app /usr/local/bundle
|
|
9
|
+
USER app
|
|
10
|
+
EXPOSE 3000
|
|
11
|
+
CMD ["bundle", "exec", "rackup", "-o", "0.0.0.0", "-p", "3000"]
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
source "https://rubygems.org"
|
|
2
|
+
|
|
3
|
+
ruby "~> 3.3"
|
|
4
|
+
|
|
5
|
+
# Minimal Rack app — run `rails new . --force` (with rails + sqlite3 gems added)
|
|
6
|
+
# to upgrade to a full Rails project once you're ready.
|
|
7
|
+
gem "rack", "~> 3.1"
|
|
8
|
+
gem "rackup", "~> 2.1"
|
|
9
|
+
# rackup 2.x no longer ships a default handler — pick one explicitly.
|
|
10
|
+
# webrick is the lightest stdlib option for the starter; swap to puma
|
|
11
|
+
# / falcon when scaling.
|
|
12
|
+
gem "webrick", "~> 1.8"
|
|
@@ -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,32 @@
|
|
|
1
|
+
require "json"
|
|
2
|
+
|
|
3
|
+
app = lambda do |env|
|
|
4
|
+
case env["PATH_INFO"]
|
|
5
|
+
when "/health"
|
|
6
|
+
[200, { "content-type" => "application/json" }, [JSON.generate({ ok: true })]]
|
|
7
|
+
when "/"
|
|
8
|
+
html = <<~HTML
|
|
9
|
+
<!doctype html>
|
|
10
|
+
<html lang="en">
|
|
11
|
+
<head>
|
|
12
|
+
<meta charset="utf-8" />
|
|
13
|
+
<title>__APP_NAME__</title>
|
|
14
|
+
<style>
|
|
15
|
+
body { font-family: system-ui, sans-serif; max-width: 640px; margin: 48px auto; padding: 0 24px; line-height: 1.6; }
|
|
16
|
+
h1 { letter-spacing: -0.5px; }
|
|
17
|
+
</style>
|
|
18
|
+
</head>
|
|
19
|
+
<body>
|
|
20
|
+
<h1>__APP_NAME__</h1>
|
|
21
|
+
<p>A Ruby app deployed on Percher.</p>
|
|
22
|
+
<p>To upgrade to full Rails, add <code>rails</code> to the Gemfile and run <code>bundle install && rails new . --force --skip-bundle</code>.</p>
|
|
23
|
+
</body>
|
|
24
|
+
</html>
|
|
25
|
+
HTML
|
|
26
|
+
[200, { "content-type" => "text/html; charset=utf-8" }, [html]]
|
|
27
|
+
else
|
|
28
|
+
[404, { "content-type" => "text/plain" }, ["Not found"]]
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
run app
|
|
@@ -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,19 @@
|
|
|
1
|
+
import { Links, Meta, Outlet, Scripts, ScrollRestoration } from "@remix-run/react";
|
|
2
|
+
|
|
3
|
+
export default function App() {
|
|
4
|
+
return (
|
|
5
|
+
<html lang="en">
|
|
6
|
+
<head>
|
|
7
|
+
<meta charSet="utf-8" />
|
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
9
|
+
<Meta />
|
|
10
|
+
<Links />
|
|
11
|
+
</head>
|
|
12
|
+
<body>
|
|
13
|
+
<Outlet />
|
|
14
|
+
<ScrollRestoration />
|
|
15
|
+
<Scripts />
|
|
16
|
+
</body>
|
|
17
|
+
</html>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "__APP_NAME__",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "remix vite:build",
|
|
8
|
+
"dev": "remix vite:dev",
|
|
9
|
+
"start": "remix-serve ./build/server/index.js"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@remix-run/node": "^2.13.0",
|
|
13
|
+
"@remix-run/react": "^2.13.0",
|
|
14
|
+
"@remix-run/serve": "^2.13.0",
|
|
15
|
+
"isbot": "^5.1.0",
|
|
16
|
+
"react": "^18.3.0",
|
|
17
|
+
"react-dom": "^18.3.0"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@remix-run/dev": "^2.13.0",
|
|
21
|
+
"@types/react": "^18.3.0",
|
|
22
|
+
"@types/react-dom": "^18.3.0",
|
|
23
|
+
"typescript": "^5.5.0",
|
|
24
|
+
"vite": "^5.3.0",
|
|
25
|
+
"vite-tsconfig-paths": "^5.0.0"
|
|
26
|
+
},
|
|
27
|
+
"engines": {
|
|
28
|
+
"node": ">=22.0.0"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
[package]
|
|
2
|
+
name = "app"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
edition = "2021"
|
|
5
|
+
description = "__APP_NAME__ on Percher"
|
|
6
|
+
|
|
7
|
+
[[bin]]
|
|
8
|
+
name = "app"
|
|
9
|
+
path = "src/main.rs"
|
|
10
|
+
|
|
11
|
+
[dependencies]
|
|
12
|
+
axum = "0.7"
|
|
13
|
+
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
|
|
14
|
+
|
|
15
|
+
[profile.release]
|
|
16
|
+
opt-level = "z"
|
|
17
|
+
lto = true
|
|
18
|
+
codegen-units = 1
|
|
19
|
+
strip = true
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
FROM rust:1.82-alpine AS build
|
|
2
|
+
RUN apk add --no-cache musl-dev
|
|
3
|
+
WORKDIR /src
|
|
4
|
+
COPY Cargo.toml Cargo.lock* ./
|
|
5
|
+
COPY src ./src
|
|
6
|
+
RUN cargo build --release --bin app
|
|
7
|
+
|
|
8
|
+
FROM alpine:3.20
|
|
9
|
+
# tini as PID 1 forwards SIGTERM to the app; without it the bare binary as PID 1
|
|
10
|
+
# ignores SIGTERM (Linux PID-1 special case) and the container is SIGKILLed on
|
|
11
|
+
# every stop/redeploy instead of shutting down cleanly.
|
|
12
|
+
RUN apk add --no-cache ca-certificates tini \
|
|
13
|
+
&& addgroup -S app && adduser -S app -G app
|
|
14
|
+
COPY --from=build --chown=app:app /src/target/release/app /app
|
|
15
|
+
USER app
|
|
16
|
+
EXPOSE 8080
|
|
17
|
+
ENTRYPOINT ["/sbin/tini", "--"]
|
|
18
|
+
CMD ["/app"]
|
|
@@ -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,45 @@
|
|
|
1
|
+
use axum::{http::header, response::Html, response::IntoResponse, routing::get, Router};
|
|
2
|
+
use std::env;
|
|
3
|
+
|
|
4
|
+
#[tokio::main]
|
|
5
|
+
async fn main() {
|
|
6
|
+
let app = Router::new()
|
|
7
|
+
.route("/", get(root))
|
|
8
|
+
.route("/health", get(health));
|
|
9
|
+
|
|
10
|
+
let port: u16 = env::var("PORT")
|
|
11
|
+
.ok()
|
|
12
|
+
.and_then(|s| s.parse().ok())
|
|
13
|
+
.unwrap_or(8080);
|
|
14
|
+
|
|
15
|
+
let listener = tokio::net::TcpListener::bind(("0.0.0.0", port))
|
|
16
|
+
.await
|
|
17
|
+
.expect("bind");
|
|
18
|
+
println!("listening on :{port}");
|
|
19
|
+
axum::serve(listener, app).await.expect("serve");
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
async fn root() -> Html<&'static str> {
|
|
23
|
+
Html(
|
|
24
|
+
r#"<!doctype html>
|
|
25
|
+
<html lang="en">
|
|
26
|
+
<head>
|
|
27
|
+
<meta charset="utf-8" />
|
|
28
|
+
<title>__APP_NAME__</title>
|
|
29
|
+
<style>
|
|
30
|
+
body { font-family: system-ui, sans-serif; max-width: 640px; margin: 48px auto; padding: 0 24px; line-height: 1.6; }
|
|
31
|
+
h1 { letter-spacing: -0.5px; }
|
|
32
|
+
</style>
|
|
33
|
+
</head>
|
|
34
|
+
<body>
|
|
35
|
+
<h1>__APP_NAME__</h1>
|
|
36
|
+
<p>A Rust app deployed on Percher.</p>
|
|
37
|
+
<p>Add routes in <code>src/main.rs</code> and push to redeploy.</p>
|
|
38
|
+
</body>
|
|
39
|
+
</html>"#,
|
|
40
|
+
)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
async fn health() -> impl IntoResponse {
|
|
44
|
+
([(header::CONTENT_TYPE, "application/json")], r#"{"ok":true}"#)
|
|
45
|
+
}
|