landfall 0.3.1 → 0.4.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/README.md CHANGED
@@ -12,7 +12,7 @@ cd my-site && lf deploy -s vps # live at https://my-site.203-0-113-7.sslip.
12
12
  - **No agent on the server.** Every site is a plain Docker Compose project under `/opt/landfall`, so you can read, run and fix it by hand.
13
13
  - **Your compose.yaml is the site.** App, database, worker: `docker compose up` runs it locally, `lf deploy` runs the same file behind HTTPS.
14
14
  - **Every change is journaled** on the server and can be undone with `lf undo`.
15
- - **Three ways in:** plain commands for scripts, CI and agents; a web dashboard (`lf ui`); a terminal dashboard (`lf tui`).
15
+ - **Two ways in:** plain commands for scripts, CI and agents; a web dashboard (`lf ui`).
16
16
 
17
17
  `lf` is short for `landfall`. Both commands are installed.
18
18
 
@@ -28,7 +28,7 @@ cd my-site && lf deploy -s vps # live at https://my-site.203-0-113-7.sslip.
28
28
  - [Firewall](#firewall)
29
29
  - [History and undo](#history-and-undo)
30
30
  - [Managing servers](#managing-servers)
31
- - [Dashboards](#dashboards)
31
+ - [Dashboard](#dashboard)
32
32
  - [Using landfall from scripts and agents](#using-landfall-from-scripts-and-agents)
33
33
  - [Command reference](#command-reference)
34
34
  - [Files and config](#files-and-config)
@@ -79,6 +79,15 @@ lf setup vps --host 203.0.113.7
79
79
  Setup shows what it is about to change and asks once (`-y` skips the question). Key login is checked **before**
80
80
  password login is turned off, so a failed key setup can't lock you out.
81
81
 
82
+ Or deploy right away: a server landfall has not set up yet is set up first, then the site goes up.
83
+
84
+ ```sh
85
+ lf deploy -s vps --host 203.0.113.7 # asks the root password once (--password-stdin, $LANDFALL_PASSWORD)
86
+ ```
87
+
88
+ Without `--host`, `lf deploy` notices a configured server that isn't set up (or takes no key yet) and asks to
89
+ run setup first.
90
+
82
91
  ### A server you already reach with `ssh vps`
83
92
 
84
93
  ```sh
@@ -249,6 +258,7 @@ lf env API_KEY=abc # set env (container is recreated); -u KEY re
249
258
  lf restart | stop | start
250
259
  lf domains # where DNS points, whether HTTPS answers
251
260
  lf domains --add www.example.com # also --rm, --set (updates .landfall.json)
261
+ lf domains --rm @ # take the main domain off; the last one leaves the site running, unrouted
252
262
  lf auth -u anna # login in front of the site (asks for the password, -p passes it)
253
263
  lf auth --rm-user anna | --off
254
264
  lf open
@@ -257,7 +267,7 @@ lf logs api -s vps # another site on another server
257
267
  ```
258
268
 
259
269
  Commands that remove something ask first: `sites rm`, `domains --rm/--set`, `server domain --rm/--clear`,
260
- `auth --rm-user/--off`, `firewall rm`, `undo` and `server rm`. `sites rm` and `undo --all` want the name typed
270
+ `auth --rm-user/--off`, `firewall rm`, `undo`, `traefik rm`, `server rm` and `server uninstall`. `sites rm` and `undo --all` want the name typed
261
271
  back. Domain and login changes are journaled, so `lf undo` reverts them.
262
272
 
263
273
  ## Updates
@@ -316,6 +326,10 @@ show up in `lf ls` and the dashboard as "not deployed by landfall", with their d
316
326
  never touches them; deploying one of their domains warns, since Traefik would send visitors to only one.
317
327
  `lf adopt <project>` turns one into a site (see [Running without landfall](#running-without-landfall)).
318
328
 
329
+ **Removing Traefik.** `lf traefik rm` stops landfall's Traefik and takes out its config; sites stay but are
330
+ unreachable until `lf undo` or `lf traefik setup`. Certificates stay unless `--certs`. With `traefik use`, it only
331
+ makes sites stop using your Traefik, which keeps running.
332
+
319
333
  landfall reads the network, HTTPS entrypoint and cert resolver from the container's flags. If your Traefik is
320
334
  configured by a file, pass `--network proxy --entrypoint websecure --resolver letsencrypt`. The choice is stored
321
335
  in `/opt/landfall/proxy.env`. landfall never changes that Traefik.
@@ -351,7 +365,7 @@ lf undo --all # everything, newest first
351
365
  ```
352
366
 
353
367
  - **Undoable:** setup (packages and Docker stay installed), firewall rules and on/off, deploys and rollbacks
354
- (previous release and env), env changes, stop/start, domains, logins, Traefik setup and `traefik use`, image and
368
+ (previous release and env), env changes, stop/start, domains, logins, Traefik setup, `traefik use` and `traefik rm`, image and
355
369
  compose updates.
356
370
  - **Not undoable:** `sites rm`, restarts, package upgrades, and a firewall rule that replaced an existing one.
357
371
  - Steps revert newest first, each as the user that made it. The first failure stops the rest.
@@ -368,6 +382,7 @@ lf server config vps # landfall entry, Traefi
368
382
  lf server list --all
369
383
  lf server use vps
370
384
  lf server rm vps # forget locally
385
+ lf server uninstall vps # remove landfall from the server (type the name back)
371
386
  lf ssh vps -- docker ps
372
387
  ```
373
388
 
@@ -376,34 +391,18 @@ lf ssh vps -- docker ps
376
391
  only steps in when the key does not work. It then puts the working `IdentityFile` first, drops lines whose file is
377
392
  gone, and keeps a backup as `~/.ssh/config.landfall-bak`.
378
393
 
379
- ## Dashboards
394
+ ## Dashboard
380
395
 
381
- **Web (`lf ui`).** The dashboard listens on `127.0.0.1` and opens your browser. Servers are on the left
396
+ The web dashboard (`lf ui`) listens on `127.0.0.1` and opens your browser. Servers are on the left
382
397
  (★ marks the default). A server tab has Sites, Updates, Firewall, History and Settings. **Deploy folder…** browses
383
398
  local folders or takes a dropped folder or `.zip`. Every action streams the output of its plain command into a side
384
399
  panel. Destructive actions ask first. Login works through the printed `/login?t=…` link. The token is kept in
385
400
  `~/.config/landfall/ui-token`, and you can delete that file to rotate it. Requests with a foreign `Host` or `Origin`
386
401
  are refused. Running `lf ui` again while the dashboard is running just opens the page.
387
402
 
388
- **Terminal (`lf tui`).**
389
-
390
- ```
391
- landfall this folder: blog → vps · blog.example.com
392
- ╭ Servers ──────────╮╭ Sites on vps traefik Up 3 days ─────────────────────╮
393
- │ › ● vps default │ │ › ● blog static blog.example.com 2h ago │
394
- │ ● box │ │ ● api dockerfile api.example.com 5d ago │
395
- │ ○ nas ssh config│ │ │
396
- │ + add a server │ │ │
397
- ╰───────────────────╯╰──────────────────────────────────────────────────────╯
398
- ? help q quit ↑↓ server ↵ sites u check & set up d deploy here …
399
- ```
400
-
401
- Keys: `↵` connect/open, `d` deploy this folder, `u` check and set up, `a` add a server, `f` firewall, `h` history,
402
- `z` undo, `x` shell, `esc` stop/back, `?` all keys. Dot colors: green ready, yellow not set up, red unreachable, ○ not connected.
403
-
404
403
  ## Using landfall from scripts and agents
405
404
 
406
- Every dashboard action is a plain command, and both dashboards print the command they run (`$ lf logs blog -s vps -f`).
405
+ Every dashboard action is a plain command, and the dashboard prints the command it runs (`$ lf logs blog -s vps -f`).
407
406
 
408
407
  - **No prompts:** `-y` accepts confirmations and takes defaults. Without a terminal, prompts are never shown. A
409
408
  command that would ask then **fails** and tells you to pass `-y`. It never silently goes ahead.
@@ -444,6 +443,7 @@ lf undo -s box -y # revert the last run
444
443
  | `lf server domain [name] [domain...] [--add d] [--primary d] [--rm d] [--clear] [--json]` | Manages main domains (the first is primary) and checks their DNS. |
445
444
  | `lf server use <name>` | Sets the default server. |
446
445
  | `lf server rm <name>` | Forgets a server locally. The server is untouched. |
446
+ | `lf server uninstall <name> [--volumes] [--keep-setup] [--force]` | Deletes landfall's sites, Traefik and `/opt/landfall`, reverts setup (deploy user, ssh hardening, firewall), and forgets the server. Docker, packages and root's landfall key stay; adopted sites keep running. Alias: `uninstall`. |
447
447
  | `lf ssh [name] [-- cmd]` | Opens a shell or runs a one-off command. |
448
448
  | `lf keygen <name>` | Creates `~/.ssh/landfall_<name>` and prints the public key. |
449
449
 
@@ -452,10 +452,10 @@ lf undo -s box -y # revert the last run
452
452
  | command | what it does |
453
453
  |---|---|
454
454
  | `lf init [dir] [--postgres] [--port n]` | Writes `compose.yaml` and `compose.override.yaml` for the project, to run it locally and deploy it. |
455
- | `lf deploy [dir] [-d domain...] [-n name] [-f file] [-b cmd] [--spa] [--image img] [--port n] [-e K=V] [--env-file f] [--static] [--keep n]` | Deploys a Compose project, static folder, Dockerfile app or image. |
455
+ | `lf deploy [dir] [-d domain...] [-n name] [-f file] [-b cmd] [--spa] [--image img] [--port n] [-e K=V] [--env-file f] [--static] [--keep n] [--host ip [-u user] [--ssh-port p] [--password-stdin]]` | Deploys a Compose project, static folder, Dockerfile app or image. Sets up a server that isn't yet. |
456
456
  | `lf ls [--json] [--others]` | Lists sites on the server with their status, plus containers Traefik routes that landfall did not deploy (read only; `--json --others` gives `{sites, others}`). Alias: `sites list`. |
457
457
  | `lf sites info [name]` | Shows services, domains and release history. |
458
- | `lf domains [name] [--add d] [--rm d] [--set d] [--json]` | Lists domains with their DNS and HTTPS state, or changes them. |
458
+ | `lf domains [name] [--add d] [--rm d] [--set d] [--json]` | Lists domains with their DNS and HTTPS state, or changes them. Removing the last one leaves the site unrouted. |
459
459
  | `lf auth [name] -u user [-p pw]` / `--rm-user u` / `--off` | Puts basic-auth login in front of a site. |
460
460
  | `lf open [name]` | Opens the site in the browser. |
461
461
  | `lf logs [name] [service] [-f] [-n lines]` | Shows logs of all services, or one. |
@@ -471,6 +471,7 @@ lf undo -s box -y # revert the last run
471
471
  |---|---|
472
472
  | `lf traefik setup [--email e] [--dashboard host\|traefik\|off] [--staging] [--image img] [--host-network] [--force]` | Installs or reconfigures landfall's Traefik. `--force` overwrites hand edits. |
473
473
  | `lf traefik use [container] [--network n --entrypoint e --resolver r]` | Routes sites through a Traefik you already run. |
474
+ | `lf traefik rm [--certs]` | Removes landfall's Traefik (undoable), or stops using yours after `traefik use`. |
474
475
  | `lf traefik status` / `logs [-f]` / `restart` | Inspects or restarts Traefik. `lf traefik` alone means `status`. |
475
476
  | `lf firewall [--json]` | Lists ufw rules and, for each listening port, whether it is reachable. |
476
477
  | `lf firewall allow` / `deny <port[/proto]> [--from ip] [--comment c]` | Adds a rule. A deny goes first, so it wins. |
@@ -481,12 +482,11 @@ lf undo -s box -y # revert the last run
481
482
  | `lf history [-n 20] [--json]` | Lists what landfall changed on the server, run by run. Alias: `log`. |
482
483
  | `lf undo [n \| n.m] [--all] [--force]` | Reverts the latest run, run `n`, step `n.m`, or everything. Alias: `revert`. |
483
484
 
484
- **Dashboards**
485
+ **Dashboard**
485
486
 
486
487
  | command | what it does |
487
488
  |---|---|
488
489
  | `lf ui [--port 4777] [--no-open]` | Starts the web dashboard on 127.0.0.1 and prints a login link. |
489
- | `lf tui` | Starts the terminal dashboard. |
490
490
 
491
491
  ## Files and config
492
492
 
@@ -504,7 +504,7 @@ lf undo -s box -y # revert the last run
504
504
  |---|---|
505
505
  | `LANDFALL_CONFIG_DIR` | use another directory than `~/.config/landfall` |
506
506
  | `LANDFALL_SSH_CONFIG` | use another ssh config file (`ssh -F`) |
507
- | `LANDFALL_PASSWORD` | login password for `setup`/`server add` |
507
+ | `LANDFALL_PASSWORD` | login password for `setup`/`server add`/`deploy --host` |
508
508
 
509
509
  On the server:
510
510