@fabioplunser/epd 0.5.18 → 0.5.20

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.
@@ -1,124 +0,0 @@
1
- # Prerequisites & Installation
2
-
3
- Everything you need to prepare your development environment and target servers for `epd`.
4
-
5
- ---
6
-
7
- ## Local System Requirements
8
-
9
- `epd` runs on your local development machine or inside a CI runner (such as GitHub Actions).
10
-
11
- - **Operating System**: Linux, macOS, or Windows x64. Windows shell steps require Git Bash from Git for Windows; WSL2 is also an option.
12
- - **Standalone Binary**: No local runtimes (Node.js, Bun, Python) are required when using the standalone installer.
13
- - **Tools**:
14
- - OpenSSH client (`ssh`).
15
- - Docker Desktop or Docker Engine (required locally only if using `mode: docker` to build images).
16
- - `rsync` (required if using `mode: process`).
17
-
18
- ---
19
-
20
- ## Server Requirements
21
-
22
- `epd` communicates over standard SSH. No custom agent daemons or background control planes need to run on the server.
23
-
24
- - **Operating System**: Any 64-bit Linux distribution:
25
- - Ubuntu 20.04 / 22.04 / 24.04 LTS *(recommended)*
26
- - Debian 11 / 12
27
- - Fedora 39+ / AlmaLinux / Rocky Linux
28
- - Arch Linux / Alpine Linux
29
- - **SSH Access**:
30
- - Open SSH port (default: 22).
31
- - Root login or a user allowed to run `sudo`.
32
- - Password or SSH key authentication.
33
- - **Firewall & Ports**:
34
- - **Port 80 (HTTP)**: Required for Let's Encrypt HTTP-01 challenge and HTTP traffic redirection.
35
- - **Port 443 (HTTPS)**: Required for encrypted TLS/SSL traffic.
36
- - **Port 22 (SSH)**: Required for deployment and server management.
37
-
38
- ::: tip Automatic Server Provisioning
39
- `epd setup` automatically installs Docker, Traefik, curl, and necessary host utilities. You only need a clean server with SSH access!
40
- :::
41
-
42
- ---
43
-
44
- ## Installing EPD
45
-
46
- ### Option 1: Zero-Dependency Standalone Installer (Recommended)
47
-
48
- Installs the pre-compiled, self-contained standalone executable directly for Linux (`x64` / `arm64`) or macOS (`Apple Silicon` / `Intel`). **Requires no Node.js or Bun runtime:**
49
-
50
- ```bash
51
- curl -fsSL https://raw.githubusercontent.com/FabioPlunser/epd/main/install.sh | bash
52
- ```
53
-
54
- For Windows x64, run in PowerShell (no administrator access needed):
55
-
56
- ```powershell
57
- irm https://raw.githubusercontent.com/FabioPlunser/epd/main/install.ps1 | iex
58
- epd --help
59
- ```
60
-
61
- The installer checks the release SHA256 checksum and adds `%LOCALAPPDATA%\epd\bin` to your user PATH. Install Git for Windows and the Windows OpenSSH client. Use Docker Desktop with Linux containers for Docker deployments. Process deployments require `rsync`; use WSL2 if you do not have a Windows-compatible installation. Remote servers and the self-hosted dashboard stack require Linux.
62
-
63
- To select a version or directory, download `install.ps1` and run `./install.ps1 -Version v0.5.14 -InstallDir C:\Tools\epd`. Pass `-NoPath` to skip PATH changes.
64
-
65
- ### Option 2: Bun
66
-
67
- ```bash
68
- bun install -g @fabioplunser/epd
69
- ```
70
-
71
- ### Option 3: NPM / PNPM / Yarn
72
-
73
- ::: code-group
74
-
75
- ```bash [npm]
76
- npm install -g @fabioplunser/epd
77
- ```
78
-
79
- ```bash [pnpm]
80
- pnpm add -g @fabioplunser/epd
81
- ```
82
-
83
- ```bash [yarn]
84
- yarn global add @fabioplunser/epd
85
- ```
86
-
87
- :::
88
-
89
- ### Option 4: Run via `npx` / `bunx` Without Installation
90
-
91
- ```bash
92
- npx @fabioplunser/epd deploy
93
- # or
94
- bunx @fabioplunser/epd deploy
95
- ```
96
-
97
- ---
98
-
99
- ## Automated Server & SSH Setup
100
-
101
- `epd` makes server onboarding effortless:
102
-
103
- When running `epd setup` against a fresh server:
104
- 1. **Key Detection**: EPD checks for existing local keys (`~/.ssh/id_ed25519`, `~/.ssh/gh_deploy`, etc.) or loads keys from your active `ssh-agent`. If none exist, it generates a secure Ed25519 key for you.
105
- 2. **One-Time Password Authentication**: If key authentication is not yet authorized on the remote server, EPD interactively prompts for the server password in your terminal.
106
- 3. **Automated Key Installation**: EPD installs the public key to `~/.ssh/authorized_keys` with secure permissions (`0700` / `0600`).
107
- 4. **Passwordless Sudo Configuration**: If deploying with a non-root user (e.g. `fabio`), EPD uses the provided password to configure passwordless sudo rules in `/etc/sudoers.d/epd`.
108
- 5. **Never Asked Again**: From that point on, all deploys, rollbacks, and log streams run completely passwordless and non-interactively!
109
-
110
- ---
111
-
112
- ## Pre-flight Diagnostics
113
-
114
- Before deploying, you can run `epd doctor` to verify your entire local and remote setup:
115
-
116
- ```bash
117
- epd doctor
118
- ```
119
-
120
- It validates:
121
- - Local runtime, Git working tree, and Docker engine status
122
- - SSH client and private key permissions (`0600`)
123
- - `epd.yml` schema and required `.env` secret availability
124
- - Remote server connectivity, passwordless sudo, Docker health, disk space, and deploy locks
@@ -1,101 +0,0 @@
1
- # Multi-Site Hosting on a Single VPS
2
-
3
- Learn how `epd` lets you run multiple independent applications on a single $5 VPS without port collisions, conflicting SSL certificates, or downtime.
4
-
5
- ---
6
-
7
- ## The Problem with Other Deployment Tools
8
-
9
- Many deployment tools (like Kamal or basic Docker Compose setups) assume that one application owns the host's ports 80 and 443.
10
-
11
- When you try to deploy a second application on the same machine:
12
- - The second proxy container fails to bind to port 80/443.
13
- - Or you have to manually configure an external Nginx or Traefik reverse proxy outside of your deployment tooling.
14
- - SSL certificates for different domains collide.
15
-
16
- ---
17
-
18
- ## How EPD Solves Multi-Site Hosting
19
-
20
- `epd` provisions a **single, shared Traefik proxy** on the host. Every application deployed with `epd` writes its own isolated dynamic routing file:
21
-
22
- ```
23
- /var/lib/epd/proxy/dynamic/
24
- ├── blog.yml # Managed by App 1 (blog.example.com)
25
- ├── store.yml # Managed by App 2 (store.example.com)
26
- └── docs.yml # Managed by App 3 (docs.example.com)
27
- ```
28
-
29
- Each app specifies its own domains and routes in its own `epd.yml`. When you deploy `blog`:
30
- 1. `epd` only updates `/var/lib/epd/proxy/dynamic/blog.yml`.
31
- 2. Traefik hot-reloads the changes in milliseconds.
32
- 3. `store` and `docs` remain completely unaffected!
33
-
34
- ---
35
-
36
- ## Example: Deploying Two Apps to One Server
37
-
38
- ### App 1: Blog (`epd.yml`)
39
-
40
- ```yaml
41
- name: blog
42
- mode: docker
43
- image: my-dockerhub-user/blog
44
-
45
- servers:
46
- web:
47
- hosts: [203.0.113.10]
48
- port: 3000
49
- domains: [blog.example.com]
50
-
51
- proxy:
52
- email: admin@example.com
53
- ```
54
-
55
- ### App 2: Store (`epd.yml`)
56
-
57
- ```yaml
58
- name: store
59
- mode: process
60
-
61
- process:
62
- install: bun install
63
- build: bun run build
64
- start: bun run start
65
-
66
- servers:
67
- web:
68
- hosts: [203.0.113.10]
69
- port: 4000
70
- domains: [store.example.com]
71
-
72
- proxy:
73
- email: admin@example.com
74
- ```
75
-
76
- Both apps can be deployed, updated, or rolled back independently.
77
-
78
- ---
79
-
80
- ## Isolated Decommissioning
81
-
82
- If you ever want to permanently decommission an app:
83
-
84
- ```bash
85
- cd my-store-repo
86
- epd remove
87
- ```
88
-
89
- `epd remove`:
90
- - Stops and removes all containers or PM2 processes for `store`.
91
- - Deletes `/var/lib/epd/proxy/dynamic/store.yml`.
92
- - Traefik ceases routing traffic for `store.example.com`.
93
- - **`blog` and all other applications continue running without interruption.**
94
-
95
- ---
96
-
97
- ## Next Steps
98
-
99
- - Explore **[Advanced Routing & Traefik Features](/guide/routing)**
100
- - Configure **[Persistent Accessories & Databases](/guide/accessories)**
101
- - Learn how to scale across multiple nodes with **[High Availability](/guide/high-availability)**
@@ -1,44 +0,0 @@
1
- # Private repositories in the dashboard
2
-
3
- Organization administrators can connect a GitHub App installation or a GitLab OAuth account at **Settings → Repository connections**. Create projects using HTTPS clone URLs without passwords, tokens, query strings or `/tree/` browser paths. Public repositories work without a connection. SSH clones use the control plane's SSH configuration.
4
-
5
- These flows require a registered provider application. EPD cannot create or validate your provider registration without its credentials. Until the variables below are present, settings show the missing configuration and connection attempts fail without saving credentials.
6
-
7
- ## Shared configuration
8
-
9
- Set `UI_ENCRYPTION_KEY` to a stable secret kept outside database backups. Set `EPD_PUBLIC_URL` to the dashboard origin, for example `https://epd.example.com`. Callback URLs use this configured origin, never incoming request headers. HTTPS is required outside localhost development. Register callback URLs exactly as shown below and restart the dashboard after changing configuration.
10
-
11
- OAuth state is encrypted and authenticated in a ten-minute HttpOnly cookie, bound to the provider, organization and signed-in administrator. Both providers use PKCE. Callbacks reject expired, altered or mismatched state. Provider response bodies, tokens and client secrets are never included in error messages.
12
-
13
- ## GitHub App
14
-
15
- 1. Register a GitHub App in your account or organization. Grant repository **Contents: Read-only** and the automatically required Metadata permission. Enable user authorization and set the callback URL to `https://epd.example.com/settings/repositories/github/callback`.
16
- 2. Generate a client secret and App private key. Configure `EPD_GITHUB_CLIENT_ID`, `EPD_GITHUB_CLIENT_SECRET`, `EPD_GITHUB_APP_ID`, `EPD_GITHUB_APP_SLUG` and `EPD_GITHUB_APP_PRIVATE_KEY`. The private key can contain actual newlines or literal `\n` separators. Keep it outside the repository and database.
17
- 3. Open Repository connections, install the App on selected repositories, then connect GitHub and authorize your account. Choose an installation returned by GitHub for that account. The dashboard independently verifies this selection; an installation ID supplied by a browser never grants access by itself.
18
- 4. Only repositories visible to the authorizing user at connection time are allowed. Reconnect after adding repositories. Select fewer than 500 repositories in one installation. EPD stores the installation ID and repository allowlist encrypted. The temporary user authorization token is discarded after selection and its pending cookie expires after ten minutes.
19
-
20
- For each checkout EPD verifies that the requested repository belongs to the saved installation, then requests a short-lived installation token restricted to that repository and read-only Contents permission. Suspended installations and repositories outside the saved allowlist fail before cloning. GitHub Enterprise is not currently supported.
21
-
22
- If push-triggered deployment is needed, configure the App webhook URL as `https://epd.example.com/api/webhooks/github`, subscribe to Push, and set its secret to `EPD_GITHUB_WEBHOOK_SECRET`. Existing webhook verification rejects missing or incorrect HMAC signatures. OAuth and webhook secrets are separate.
23
-
24
- See [GitHub user authorization](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app) and [installation tokens](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-an-installation-access-token-for-a-github-app).
25
-
26
- ## GitLab OAuth
27
-
28
- 1. Register a confidential OAuth application on GitLab with callback URL `https://epd.example.com/settings/repositories/gitlab/callback` and scopes `read_user` and `read_repository`.
29
- 2. Set `EPD_GITLAB_CLIENT_ID` and `EPD_GITLAB_CLIENT_SECRET`. For a self-managed instance set `EPD_GITLAB_URL` to its HTTPS origin, for example `https://gitlab.example.com`; otherwise GitLab.com is used. Nonstandard HTTPS ports are not supported for clone credential delivery.
30
- 3. Connect GitLab from Repository connections. EPD exchanges the authorization code with its PKCE verifier, reads the account identity and encrypts its access and refresh tokens. It refreshes expiring tokens during checkout and saves rotated refresh tokens. Refreshes are serialized within the dashboard executor process. Run one dashboard process against the SQLite database.
31
-
32
- GitLab grants the authorized user's read access to repositories; choose a dedicated account if a narrower sharing boundary is required. Changing the configured GitLab host requires reconnection. For push-triggered deployment configure `https://epd.example.com/api/webhooks/gitlab` and a secret token matching `EPD_GITLAB_WEBHOOK_TOKEN`.
33
-
34
- See [GitLab OAuth and PKCE documentation](https://docs.gitlab.com/api/oauth2/).
35
-
36
- ## Credential handling and removal
37
-
38
- Checkout credentials exist only in the git subprocess environment through an exact repository URL-scoped HTTP Authorization header. HTTP redirects are disabled, inherited git config injection and tracing variables are removed, and credentials are excluded from repository URLs, persistent git configuration and application runtime variables. Git output redacts the token, URL-encoded token and Basic authentication value. A failed checkout removes its verified project workspace; deployment event history stays in the database.
39
-
40
- Disconnect removes EPD's saved credentials. Also revoke the OAuth authorization or uninstall the App at the provider to remove upstream access. Existing in-progress checkout requests can finish with already-issued short-lived credentials. A disconnected or revoked provider must not be treated as a successful private-repository deployment.
41
-
42
- ## Verification still required with your accounts
43
-
44
- Automated tests cover OAuth state/PKCE, organization and role boundaries, installation/repository matching, refresh responses, host restrictions and git credential redaction using mocked provider responses. Complete a real GitHub App and GitLab authorization, private clone and revoked-access failure with your own registered apps before enabling production deployments. No external account registration or live provider authorization is performed by the implementation.
@@ -1,129 +0,0 @@
1
- # Advanced Routing & Traefik Features
2
-
3
- Configure path-based routing, subdomain dispatch, HTTP redirects, basic authentication, sticky sessions, custom response headers, and wildcard SSL certificates.
4
-
5
- ---
6
-
7
- ## The `routes:` Block
8
-
9
- For simple applications, specifying `domains: [myapp.example.com]` is all you need. For fine-grained control, use the `routes:` block under any service in `epd.yml`:
10
-
11
- ```yaml
12
- servers:
13
- web:
14
- hosts: [203.0.113.10]
15
- port: 3000
16
- routes:
17
- # 1. Standard Domain
18
- - host: example.com
19
-
20
- # 2. Subdomain Routed to a Different Container Port
21
- - host: api.example.com
22
- port: 8080
23
-
24
- # 3. Path-Based Routing with Prefix Stripping
25
- - host: example.com
26
- path: /api/v1
27
- port: 5000
28
- strip_path: true
29
-
30
- # 4. HTTP Basic Authentication Protection
31
- - host: admin.example.com
32
- basic_auth:
33
- - "admin:$apr1$xyz$0123456789abcdefghijk."
34
-
35
- # 5. Permanent Domain Redirect (HTTP 301)
36
- - host: www.example.com
37
- redirect: https://example.com
38
-
39
- # 6. Temporary Redirect (HTTP 302)
40
- - host: promo.example.com
41
- redirect: https://example.com/summer-sale
42
- permanent: false
43
-
44
- # 7. Sticky Sessions for WebSockets
45
- - host: chat.example.com
46
- sticky: true
47
-
48
- # 8. Security & Custom Headers
49
- - host: secure.example.com
50
- headers:
51
- X-Frame-Options: "DENY"
52
- X-Content-Type-Options: "nosniff"
53
- Referrer-Policy: "strict-origin-when-cross-origin"
54
- ```
55
-
56
- ---
57
-
58
- ## Route Features Breakdown
59
-
60
- ### Path Routing & Prefix Stripping
61
- Direct requests matching `/docs` or `/api` to different container ports or backend microservices. Setting `strip_path: true` removes the prefix before the request reaches the container:
62
- ```yaml
63
- - host: example.com
64
- path: /blog
65
- port: 8080
66
- strip_path: true # Request for /blog/post-1 becomes /post-1 inside container
67
- ```
68
-
69
- ### Basic Authentication
70
- Protect staging environments or internal admin panels with HTTP Basic Auth:
71
- ```yaml
72
- - host: staging.example.com
73
- basic_auth:
74
- - "admin:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/"
75
- ```
76
-
77
- ::: tip Generating Basic Auth Hashes
78
- Generate password hashes using Apache's `htpasswd`:
79
- ```bash
80
- htpasswd -nb admin mypassword
81
- ```
82
- :::
83
-
84
- ### Sticky Sessions (Cookie-Based Load Balancing)
85
- When running multiple replicas, sticky sessions ensure an individual visitor remains connected to the same replica container (essential for in-memory socket state or stateful sessions):
86
- ```yaml
87
- - host: socket.example.com
88
- sticky: true
89
- ```
90
-
91
- ---
92
-
93
- ## Wildcard Certificates & DNS Challenges
94
-
95
- Standard Let's Encrypt certificates use the `http` challenge on port 80. For wildcard domains (`*.example.com`), configure the DNS-01 challenge:
96
-
97
- ```yaml
98
- proxy:
99
- challenge: dns
100
- dns_provider: cloudflare # or hetzner
101
- dns_env:
102
- - CF_DNS_API_TOKEN
103
-
104
- servers:
105
- web:
106
- hosts: [203.0.113.10]
107
- port: 3000
108
- routes:
109
- - host: "*.example.com"
110
- priority: 1
111
- ```
112
-
113
- ---
114
-
115
- ## Inspecting Live Routes
116
-
117
- To view the exact Traefik dynamic routing YAML generated on the server:
118
-
119
- ```bash
120
- epd proxy routes
121
- ```
122
-
123
- ---
124
-
125
- ## Next Steps
126
-
127
- - Manage **[Secrets & Environment Variables](/guide/secrets)**
128
- - Set up **[Persistent Accessories & Databases](/guide/accessories)**
129
- - Learn about **[Multi-Provider DNS Automation](/hetzner-dns)**
@@ -1,132 +0,0 @@
1
- # Secrets & Environment Management
2
-
3
- Learn how `epd` securely manages environment variables, protects production secrets from git, and supports multi-environment staging overlays.
4
-
5
- ---
6
-
7
- ## The Core Principle
8
-
9
- `epd` ensures secrets are:
10
- - **Never committed to git.**
11
- - **Never baked into Docker image layers.**
12
- - **Never printed in shell histories or CI logs.**
13
- - **Saved as restricted root-owned `0600` files on the host server.**
14
-
15
- ---
16
-
17
- ## 1. Declaring Variables in `epd.yml`
18
-
19
- Separate non-sensitive public configuration from private credentials:
20
-
21
- ```yaml
22
- env:
23
- # Public, non-sensitive variables (safe to commit to git)
24
- clear:
25
- NODE_ENV: production
26
- PORT: "3000"
27
- LOG_LEVEL: info
28
-
29
- # Sensitive secrets (read from your local environment or .env at deploy time)
30
- secret:
31
- - DATABASE_URL
32
- - STRIPE_SECRET_KEY
33
- - JWT_SECRET
34
- ```
35
-
36
- ---
37
-
38
- ## 2. How Secret Resolution Works
39
-
40
- When you run `epd deploy`:
41
- 1. `epd` reads each secret named in `env.secret` from:
42
- - Your local shell environment (`export DATABASE_URL=...`)
43
- - `.env` or `.env.local` in your project root
44
- - Destination-specific files like `.env.staging` (when using `-d staging`)
45
- 2. `epd` uploads these key-value pairs to the remote server as `0600` files under `/var/lib/epd/apps/<app>/`.
46
- 3. During startup:
47
- - **Docker Mode**: Written to a `0600` file and passed to `docker run` via `--env-file`. The file is removed right after the containers start. Docker keeps the values in the container config.
48
- - **Process Mode**: Written to a `0600` file and handed to PM2 when the processes start. The file is removed right after `pm2 start`. PM2 keeps the environment it was started with, and saves it to its dump.
49
-
50
- ::: warning Missing Secrets
51
- If a variable listed in `env.secret` is not found in your environment or `.env` file, `epd` halts deployment with a helpful error before modifying any remote state.
52
- :::
53
-
54
- ### Where secrets live on the server
55
-
56
- epd writes secret values to files under `/var/lib/epd/apps/<app>/`. Every such file is `0600`, and each one is removed as soon as the step that reads it is done, including when that step fails. Nothing is kept for later use:
57
-
58
- | File (under `/var/lib/epd/apps/<app>/`) | Mode | Written | Removed |
59
- | --- | --- | --- | --- |
60
- | `env.<service>` | docker | every service start (deploy, rollback) | right after `docker run`, also when it fails |
61
- | `env.acc.<name>` | docker, accessories | every accessory start | right after `docker run`, also when it fails |
62
- | `exec-env.<random>` | docker, process | every `epd exec` (docker: not with `--accessory` or `--reuse`) and `epd shell` in process mode | after the command, also when it fails |
63
- | `env` | process | every build that has an install or build step | after the build, also when it fails |
64
- | `pm2.<service>.<slot>.json` | process | every start | right after `pm2 start`, also when it fails |
65
-
66
- The proxy keeps its DNS-challenge tokens in the same way, under `/var/lib/epd/proxy/`: `env` for docker mode and `pm2.json` for process mode, when `proxy.dns_env` is set. Each one is written right before the proxy starts and removed right after.
67
-
68
- Older epd versions kept some of these files on the server. The next deploy deletes them: every `env.*` file (service and accessory files) under docker, and `pm2.*.json` and `env` under process mode.
69
-
70
- After a deploy, two copies of the secret values remain on the server, and both need protecting:
71
-
72
- - **The container config** (`docker inspect`): anyone who can run `docker inspect` on the server can read the values of every container, including the proxy.
73
- - **The pm2 dump** (`~/.pm2/dump.pm2` of the SSH user): `pm2 save` records each process's environment there, so the values of every process started by pm2, including the proxy in process mode.
74
-
75
- Restrict access to the server, not only to the files above.
76
-
77
- ---
78
-
79
- ## 3. Service-Specific Environments
80
-
81
- You can also override environment variables for a specific server service:
82
-
83
- ```yaml
84
- servers:
85
- web:
86
- hosts: [203.0.113.10]
87
- port: 3000
88
- env:
89
- clear:
90
- SERVICE_NAME: web-frontend
91
-
92
- worker:
93
- hosts: [203.0.113.10]
94
- command: bun run worker.ts
95
- env:
96
- clear:
97
- CONCURRENCY: "10"
98
- secret:
99
- - REDIS_PASSWORD
100
- ```
101
-
102
- ---
103
-
104
- ## 4. Multi-Environment Overlays (Staging vs. Production)
105
-
106
- Manage multiple environments without duplicating configuration files:
107
-
108
- ```bash
109
- # Deploys using epd.yml + merges epd.staging.yml + loads .env.staging
110
- epd deploy -d staging
111
- ```
112
-
113
- In `epd.staging.yml`:
114
- ```yaml
115
- # Only specify fields you want to override for staging:
116
- servers:
117
- web:
118
- hosts: [staging-server-ip]
119
- domains: [staging.example.com]
120
-
121
- env:
122
- clear:
123
- NODE_ENV: staging
124
- ```
125
-
126
- ---
127
-
128
- ## Next Steps
129
-
130
- - Set up **[Persistent Accessories & Databases](/guide/accessories)**
131
- - Automate in CI/CD with **[GitHub Actions](/ci-cd)**
132
- - Review the **[CLI Commands Reference](/reference/cli)**
@@ -1,104 +0,0 @@
1
- # What epd setup installs
2
-
3
- `epd setup` prepares Docker or the PM2 runtime, starts Traefik, and deploys your
4
- app. On Debian and Ubuntu servers running systemd, it also configures a secure
5
- host baseline. Other distributions and containers without systemd emit a warning
6
- and skip the baseline.
7
-
8
- To apply it without deploying:
9
-
10
- ```bash
11
- epd setup --skip-deploy
12
- epd doctor
13
- ```
14
-
15
- ## Defaults
16
-
17
- ```yaml
18
- server:
19
- auto_updates: true
20
- firewall: true
21
- allow: []
22
- ssh_hardening: true
23
- log_rotation: true
24
- reboot_window: "03:00"
25
- ```
26
-
27
- All settings describe the host, so use consistent settings across projects that
28
- share a server. Setting a protection to `false` stops EPD from managing it. It
29
- does not undo changes from an earlier setup.
30
-
31
- ## Security updates and time
32
-
33
- EPD installs unattended-upgrades, enables the daily APT timers, and limits
34
- unattended upgrades to security origins. Security updates that require a reboot
35
- can reboot the host at 03:00 in the server's time zone. To require manual reboots,
36
- set `reboot_window: false`. A single server's reboot interrupts its applications.
37
-
38
- EPD enables an existing chrony or systemd-timesyncd service, or installs chrony
39
- if neither is available.
40
-
41
- ## Firewall and SSH access
42
-
43
- EPD owns the `inet epd_baseline` nftables table. It never flushes the whole
44
- ruleset or edits Docker's tables. Host input defaults to drop, with exceptions
45
- for established traffic, loopback, ICMP including IPv6 discovery, DHCP replies,
46
- SSH, TCP 80/443, configured Traefik entrypoints, and `server.allow` TCP ports.
47
-
48
- A separate forwarding chain blocks new connections to other DNAT-published
49
- ports, including Docker ports that bypass the host input chain. Docker outbound
50
- traffic keeps its existing forwarding behavior. Cross-host replica ports are
51
- allowed from the configured proxy peers. For hostname-based cross-host peers,
52
- set `proxy.private_ips` to their source IP addresses.
53
-
54
- Add every extra public TCP port needed by applications on the same host to
55
- `server.allow`. UDP-published services other than DHCP replies are not opened by
56
- this baseline. Existing firewall rules can still impose additional restrictions.
57
-
58
- Before changing access, EPD verifies a new SSH connection using public-key
59
- authentication. It saves the previous EPD firewall table and SSH configuration,
60
- then arms an independent systemd rollback timer. A second fresh key connection
61
- must succeed before EPD confirms the change. Failed checks restore the previous
62
- policy immediately. If the CLI terminates or loses connectivity, the timer
63
- restores access after 60 seconds. Recovery files are root-only under
64
- `/var/lib/epd-baseline/epd-baseline-*`.
65
-
66
- The SSH policy disables password and keyboard-interactive authentication,
67
- enables public-key authentication, and allows root login only with a key. An
68
- existing `PermitRootLogin no` remains disabled. EPD
69
- validates the configuration before reloading SSH. It does not create a
70
- passwordless sudo rule. Non-root users need existing sudo authorization, an
71
- interactive sudo password, or `EPD_SUDO_PASSWORD` for unattended runs.
72
-
73
- The confirmed firewall is loaded on boot by `epd-firewall.service`. Repeated
74
- setup checks the current rules and avoids reapplying an unchanged policy.
75
-
76
- ## Docker log limits
77
-
78
- EPD merges `json-file` logging with `max-size: 10m` and `max-file: 3` into
79
- `/etc/docker/daemon.json`, preserving unrelated daemon options. It does not
80
- restart Docker during setup. Restart Docker in a maintenance window, then
81
- recreate existing containers to apply the limits. Process-mode PM2 logs are not
82
- managed by this setting.
83
-
84
- ## Verification
85
-
86
- `epd doctor` reports missing or changed firewall, SSH, update, and Docker log
87
- configuration. Docker checks cover configuration on disk, not whether existing
88
- containers have adopted it.
89
-
90
- ```bash
91
- bun run typecheck
92
- bun test
93
- bash test/e2e/baseline.sh
94
- bash test/e2e/run.sh
95
- ```
96
-
97
- The baseline test runs a disposable privileged Ubuntu 24.04 systemd container.
98
- It checks repeat setup, diagnostics, preservation of an unrelated nftables table,
99
- immediate recovery from an SSH-blocking policy, and timer recovery after CLI
100
- termination. A real VM remains useful for validating boot ordering and provider
101
- networking before rolling this out to production servers.
102
-
103
- The implementation follows [OpenSSH's configuration rules](https://manpages.debian.org/unstable/openssh-server/sshd_config.5.en.html)
104
- and [Docker's guidance on separate nftables tables and forwarding hooks](https://docs.docker.com/engine/network/firewall-nftables/).
@@ -1,40 +0,0 @@
1
- # Local S3 wire validation
2
-
3
- Run the actual dashboard S3 transport against a signature-validating local S3 server:
4
-
5
- ```sh
6
- bun scripts/storage-e2e.ts
7
- ```
8
-
9
- Docker must provide a Linux engine. The script starts one UUID-named SeaweedFS container, publishes only a random `127.0.0.1` S3 port, and uses temporary credentials generated for that run. Credentials remain in a private temporary JSON configuration, copied into the disposable container with its restrictive file permissions. Using `docker cp` supports a Docker daemon whose filesystem differs from the invoking WSL filesystem. Data uses container tmpfs; no shared Docker volumes or production buckets are involved. The script removes its own container and temporary files in `finally`; it does not prune shared Docker resources. The pulled image remains in the Docker cache.
10
-
11
- The fixture uses the official `chrislusf/seaweedfs:3.85` release pinned to:
12
-
13
- ```text
14
- sha256:49312939c00c01e5ee6afbd7d728b18027821d3764c35a797a72acd4fdf3296a
15
- ```
16
-
17
- Primary references are the [SeaweedFS 3.85 release](https://github.com/seaweedfs/seaweedfs/releases/tag/3.85), its [Docker instructions](https://github.com/seaweedfs/seaweedfs/blob/3.85/docker/README.md), and the project's [S3 credential configuration](https://github.com/seaweedfs/seaweedfs/blob/master/docker/compose/s3.json). The fixture config enables credential-based access and contains no anonymous identity. It verifies rejection by the running server rather than assuming that authentication is enabled.
18
-
19
- The assertions use `database-storage.ts` directly:
20
-
21
- - Signed streaming PUT and GET preserve 2,097,169 random bytes and their SHA256 checksum.
22
- - A request signed with the wrong secret returns HTTP 403 `SignatureDoesNotMatch`.
23
- - A mismatched expected checksum is rejected before a caller can restore the downloaded file.
24
- - Signed DELETE removes the object; a subsequent signed GET returns HTTP 404.
25
-
26
- The local HTTP exemption is enabled only for the fixture process and restored afterward. Deployed storage integrations require HTTPS.
27
-
28
- ## PostgreSQL through stored objects
29
-
30
- The disposable Docker dashboard harness includes the storage fixture:
31
-
32
- ```sh
33
- bun test/web-e2e/run.ts --storage-only
34
- ```
35
-
36
- It supplies its temporary pinned SSH transport to `storage-e2e.ts` with `EPD_STORAGE_E2E_PG=1`. The fixture then calls the PostgreSQL drill with a temporary `EPD_STORAGE_FIXTURE_CONFIG` file. The drill provisions PostgreSQL on the disposable host, writes known rows, creates a CLI archive, uploads it through the actual S3 adapter, and downloads and checks the stored archive. It corrupts a separate archive to verify rejection before mutation, then restores from the downloaded S3 object. Restored row count, row checksum and removal of post-snapshot objects must all pass. The harness also runs the named-volume archive restoration drill.
37
-
38
- Artifacts include `database-storage-restore-drill.log`, `volume-archive-drill.log` and the harness scenario log in its reported temporary artifact directory.
39
-
40
- This validates the local SigV4 wire format and stored-object restore path. It does not verify a real R2 or Wasabi account, provider-specific permissions, lifecycle policies or regional behavior. Run the integration's explicit storage verification job with an authorized test bucket before claiming that provider account works.