@fabioplunser/epd 0.2.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -25,7 +25,8 @@ Multiple machines, load balancing and failover are first-class: replicas are
25
25
  balanced by Traefik, and with `cross_host: true` every server's proxy balances
26
26
  across every server's replicas, so one machine can serve while another is down.
27
27
 
28
- 📖 **For the in-depth user manual and complete configuration reference, see the [Complete Guide](docs/guide.md).**
28
+ 📖 **Documentation Site:** [fabioplunser.github.io/epd](https://fabioplunser.github.io/epd/)
29
+ 📖 **User Manual & Full Reference:** [Complete Guide](docs/guide.md)
29
30
 
30
31
  ---
31
32
 
@@ -328,27 +329,78 @@ proxy:
328
329
 
329
330
  The listed variables are read from your environment and passed to Traefik.
330
331
 
331
- ### Cloudflare DNS Automation
332
+ ### Multi-Provider DNS Automation (Cloudflare & Hetzner DNS)
332
333
 
333
- `epd` can automatically manage Cloudflare DNS `A` and `AAAA` records for your application domains, pointing them to all configured servers with Cloudflare CDN/proxy (orange cloud) or DNS-only (gray cloud):
334
+ `epd` can automatically manage DNS `A` and `AAAA` records for your application domains, pointing them to all configured servers with automatic record synchronization during setup and deploy. Both **Cloudflare** and **Hetzner DNS** are supported out of the box:
334
335
 
335
336
  ```yaml
336
- cloudflare:
337
- api_token: ${CLOUDFLARE_API_TOKEN}
337
+ # Unified DNS configuration
338
+ dns:
339
+ provider: cloudflare # or hetzner
340
+ api_token: ${DNS_API_TOKEN}
338
341
  # zone_id is optional; auto-discovered from your domain name
339
- proxied: true # default: true (orange cloud CDN/DDoS)
340
- ttl: 1 # 1 = Auto
341
- auto_sync: true # sync on setup and deploy
342
+ proxied: true # Cloudflare CDN/proxy (default: true)
343
+ ttl: 300 # Hetzner default: 300; Cloudflare: 1 (auto)
344
+ auto_sync: true # automatically sync records on setup and deploy
342
345
  ```
343
346
 
344
- You can also inspect or sync DNS manually with the CLI:
347
+ *(For backward compatibility, the top-level `cloudflare:` block is also supported).*
348
+
349
+ Manage or preview DNS changes with the CLI:
350
+ ```bash
351
+ epd dns status # Compare current DNS records vs server IPs
352
+ epd dns sync # Sync A/AAAA records across all routed domains
353
+ epd dns sync --dry-run # Preview changes without modifying DNS
354
+ epd dns sync --no-proxied # Disable CDN proxying (DNS-only)
355
+ ```
356
+
357
+ ---
358
+
359
+ ### Hetzner Cloud Integration & Dynamic Provisioning
360
+
361
+ `epd` natively integrates with **Hetzner Cloud** (`hcloud`) to list, provision, and deploy directly to Hetzner servers without manually copying IP addresses.
362
+
363
+ #### 1. Managing Servers with the CLI
364
+
345
365
  ```bash
346
- epd cloudflare dns status # Compare current Cloudflare DNS vs server IPs
347
- epd cloudflare dns sync # Sync A/AAAA records to Cloudflare
348
- epd cloudflare dns sync --dry-run
349
- epd cloudflare dns sync --no-proxied # DNS-only (gray cloud)
366
+ # List all Hetzner servers with their status, public IPs, and locations
367
+ epd hetzner list
368
+
369
+ # Inspect available server types, vCPUs, RAM, and pricing
370
+ epd hetzner types
371
+
372
+ # Create and provision a new Hetzner server (default: cx22 in fsn1 with ubuntu-24.04)
373
+ epd hetzner create prod-web-1 --type cx22 --location fsn1
374
+
375
+ # Create and automatically prepare the server with Docker & Traefik:
376
+ epd hetzner create prod-web-1 --setup
377
+
378
+ # Delete a server
379
+ epd hetzner delete prod-web-1
380
+ ```
381
+
382
+ Set `HETZNER_API_TOKEN` or `HCLOUD_TOKEN` in your environment (or `hetzner.api_token` in `epd.yml`).
383
+
384
+ #### 2. Dynamic Server Targets in `epd.yml`
385
+
386
+ Instead of hardcoding IP addresses, deploy to Hetzner servers by **name** or **label selector**:
387
+
388
+ ```yaml
389
+ hetzner:
390
+ api_token: ${HETZNER_API_TOKEN}
391
+
392
+ servers:
393
+ web:
394
+ # Resolve servers by name or label selector:
395
+ hosts:
396
+ - hetzner:prod-web-1
397
+ - hetzner:label:app=web,env=prod
398
+ port: 3000
399
+ domains: [example.com]
350
400
  ```
351
401
 
402
+ When running `epd setup` or `epd deploy`, `epd` queries the Hetzner Cloud API in real time to resolve matching servers to their public IP addresses.
403
+
352
404
  ---
353
405
 
354
406
  ## Without Docker: process mode
@@ -388,6 +440,53 @@ they need Docker on their host.
388
440
 
389
441
  ---
390
442
 
443
+ ## Automated Deployments with GitHub Actions (CI/CD)
444
+
445
+ `epd` can be run directly inside GitHub Actions on push to `main`. Because your entire deployment configuration (services, replicas, ports, health probes, zero-downtime blue/green slots, accessories, domains, and DNS sync) lives in `epd.yml`, you only need a single minimal step in GitHub Actions:
446
+
447
+ ```yaml
448
+ # .github/workflows/deploy.yml
449
+ name: Deploy
450
+
451
+ on:
452
+ push:
453
+ branches: [main]
454
+
455
+ concurrency:
456
+ group: deploy-${{ github.ref }}
457
+ cancel-in-progress: false
458
+
459
+ jobs:
460
+ deploy:
461
+ runs-on: ubuntu-latest
462
+ steps:
463
+ - uses: actions/checkout@v4
464
+
465
+ - name: Configure SSH Key
466
+ uses: webfactory/ssh-agent@v0.9.0
467
+ with:
468
+ ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
469
+
470
+ - name: Deploy with EPD
471
+ run: npx @fabioplunser/epd deploy
472
+ env:
473
+ # Optional DNS and Cloud Provider Tokens
474
+ CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
475
+ HETZNER_API_TOKEN: ${{ secrets.HETZNER_API_TOKEN }}
476
+ HETZNER_DNS_API_TOKEN: ${{ secrets.HETZNER_DNS_API_TOKEN }}
477
+ # App secrets referenced in epd.yml
478
+ DATABASE_URL: ${{ secrets.DATABASE_URL }}
479
+ ```
480
+
481
+ Generate this workflow file automatically when creating your project:
482
+ ```bash
483
+ epd init --ci
484
+ ```
485
+
486
+ For detailed guides on setting up SSH deploy keys, using GitHub Container Registry (`ghcr.io`), or multi-environment deployments, see the [GitHub Actions CI/CD Guide](https://fabioplunser.github.io/epd/ci-cd).
487
+
488
+ ---
489
+
391
490
  ## Commands
392
491
 
393
492
  | Command | What it does |
@@ -405,7 +504,10 @@ they need Docker on their host.
405
504
  | `epd config` | The resolved configuration; `--traefik` for the proxy files |
406
505
  | `epd docker-command` | Print the exact `docker run` (or pm2) commands epd uses (including accessories) |
407
506
  | `epd lock status\|release` | The deploy lock |
408
- | `epd cloudflare dns [sync\|status]` | Cloudflare DNS record management and auto-sync |
507
+ | `epd dns [sync\|status]` | Unified DNS automation (Cloudflare & Hetzner DNS) |
508
+ | `epd hetzner list\|create\|delete` | Manage and provision Hetzner Cloud servers |
509
+ | `epd update [--check]` | Check for updates and upgrade epd to the latest version |
510
+ | `epd cloudflare dns [sync\|status]` | Cloudflare DNS record management (alias for `epd dns`) |
409
511
  | `epd remove` | Stop this app and delete its files from the servers |
410
512
 
411
513
  Global flags: `-c/--config`, `-d/--destination`, `-v/--verbose`.