diff --git a/plan.md b/docs/plan.md similarity index 100% rename from plan.md rename to docs/plan.md diff --git a/docs/setup.md b/docs/setup.md index 4100634..6db01e5 100644 --- a/docs/setup.md +++ b/docs/setup.md @@ -74,6 +74,7 @@ sudo nano /etc/ssh/sshd_config ``` Set / verify: + ``` PasswordAuthentication no PermitRootLogin no @@ -160,16 +161,16 @@ Forward the following ports on your router to the Pi's static IP. to Let's Encrypt before issuing the HTTPS certificate. | External | Internal | -|---|---| -| 80/tcp | 80 | -| 443/tcp | 443 | +|----------|----------| +| 80/tcp | 80 | +| 443/tcp | 443 | --- ## 7. Clone the platform ```bash -git clone https://github.com/YOUR_USER/Hostityourself.git ~/hiy-platform +git clone https://github.com/shautvast/Hostityourself.git ~/hiy-platform cd ~/hiy-platform ``` @@ -180,8 +181,8 @@ cd ~/hiy-platform Copy and edit the environment file: ```bash -cp infra/.env.example infra/.env # if it doesn't exist, create it -nano infra/.env +cp .env.example .env # if it doesn't exist, create it +nano .env ``` Minimum required variables: @@ -211,17 +212,11 @@ and that ports 80 and 443 are forwarded to the Pi (see step 6). ```bash cd ~/hiy-platform -docker compose --env-file infra/.env up -d --build -docker compose logs -f # watch startup +./infra/start.sh ``` -When ready you should see: -``` -hiy-server | Listening on http://0.0.0.0:3000 -``` - -Open the dashboard: **https://hiy.yourdomain.com** +Open the dashboard: **https://yourdomain.com** --- @@ -231,10 +226,10 @@ Open the dashboard: **https://hiy.yourdomain.com** 1. Open `https://hiy.yourdomain.com` 2. Fill in the **Add App** form: - - **Name** — a URL-safe slug, e.g. `my-api` - - **GitHub Repo URL** — `https://github.com/you/my-api.git` - - **Branch** — `main` - - **Container Port** — the port your app listens on (e.g. `3000`) + - **Name** — a URL-safe slug, e.g. `my-api` + - **GitHub Repo URL** — `https://github.com/you/my-api.git` + - **Branch** — `main` + - **Container Port** — the port your app listens on (e.g. `3000`) 3. Click **Create App**, then **Deploy** on the new row. 4. Watch the build log in the app detail page. 5. Once done, your app is live at `https://my-api.yourdomain.com`. @@ -243,13 +238,13 @@ Open the dashboard: **https://hiy.yourdomain.com** The build engine picks a strategy automatically: -| What's in the repo | Strategy | -|---|---| -| `Dockerfile` | `docker build` | -| `package.json` / `yarn.lock` | Cloud Native Buildpack (Node) | +| What's in the repo | Strategy | +|---------------------------------------|---------------------------------| +| `Dockerfile` | `docker build` | +| `package.json` / `yarn.lock` | Cloud Native Buildpack (Node) | | `requirements.txt` / `pyproject.toml` | Cloud Native Buildpack (Python) | -| `go.mod` | Cloud Native Buildpack (Go) | -| `static/` or `public/` directory | Caddy static file server | +| `go.mod` | Cloud Native Buildpack (Go) | +| `static/` or `public/` directory | Caddy static file server | A `Dockerfile` always takes precedence. For buildpack strategies, the `pack` CLI must be installed on the Pi (see below). @@ -274,7 +269,7 @@ For each app: 2. Open the GitHub repo → **Settings → Webhooks → Add webhook**: | Field | Value | - |---|---| + |---|---| | Payload URL | `https://hiy.yourdomain.com/webhook/` | | Content type | `application/json` | | Secret | *(from the app detail page)* | diff --git a/infra/Dockerfile.server b/infra/Dockerfile.server index 1ecea45..13d8fdf 100644 --- a/infra/Dockerfile.server +++ b/infra/Dockerfile.server @@ -1,7 +1,7 @@ # syntax=docker/dockerfile:1 # ── Build stage ─────────────────────────────────────────────────────────────── # Run the compiler on the *build* host; cross-compile to target when needed. -FROM --platform=$BUILDPLATFORM rust:1.86-slim-bookworm AS builder +FROM --platform=$BUILDPLATFORM rust:1.94-slim-bookworm AS builder ARG BUILDPLATFORM ARG TARGETPLATFORM