landfall 0.6.0 → 0.6.2

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
@@ -31,6 +31,7 @@ cd my-site && lf deploy -s vps # live at https://my-site.203-0-113-7.sslip.
31
31
  - [Managing servers](#managing-servers)
32
32
  - [Traffic, certificates and checks](#traffic-certificates-and-checks)
33
33
  - [Server system](#server-system)
34
+ - [Security](#security)
34
35
  - [Web UI](#web-ui)
35
36
  - [Using landfall from scripts and agents](#using-landfall-from-scripts-and-agents)
36
37
  - [Command reference](#command-reference)
@@ -40,7 +41,7 @@ cd my-site && lf deploy -s vps # live at https://my-site.203-0-113-7.sslip.
40
41
 
41
42
  ## Install
42
43
 
43
- You need Node.js 22.4+ plus `ssh`, `ssh-copy-id` and `tar` on your machine. The server must run Ubuntu or Debian
44
+ You need Node.js 22.4+ plus `ssh`, `ssh-copy-id` and `tar` on your machine (`rsync` makes redeploys faster). The server must run Ubuntu or Debian
44
45
  and accept a login as root or as a user with passwordless sudo. landfall installs Docker itself.
45
46
 
46
47
  ```sh
@@ -74,7 +75,7 @@ lf setup vps --host 203.0.113.7
74
75
  ```
75
76
 
76
77
  1. Creates `~/.ssh/landfall_vps` and installs it with `ssh-copy-id`. You type the root password once.
77
- 2. Installs Docker, ufw (allowing ssh, 80 and 443, plus 443/udp for HTTP/3), fail2ban and unattended-upgrades.
78
+ 2. Installs Docker, rsync, ufw (allowing ssh, 80 and 443, plus 443/udp for HTTP/3), fail2ban and unattended-upgrades.
78
79
  3. Creates the user `deploy` in the docker group and disables ssh password login. Root keeps key-only access.
79
80
  4. Writes `Host vps` to `~/.ssh/config`, creating the file if needed. `ssh vps` now logs in as `deploy`.
80
81
  5. Starts Traefik, which gets Let's Encrypt certificates for every site.
@@ -164,6 +165,9 @@ The first deploy writes `.landfall.json`. Commit it:
164
165
 
165
166
  Local `.env*` files are never used on the server: each site has its own `.env` there. Pass variables with
166
167
  `-e`/`--env-file`, or later with `lf env`. `--env-file -` reads the lines from stdin, so secrets stay out of `ps`.
168
+ Changed something locally? Run `lf deploy` again (or **Redeploy** in `lf ui`). When both sides have `rsync`, a redeploy sends
169
+ only the files that changed and copies the rest from the live release on the server (files you removed stay
170
+ removed); otherwise it uploads the whole folder. Either way it becomes a new release, so `lf rollback` still goes back.
167
171
  `--keep 10` keeps more releases. A deploy is refused when another Compose project on the server already uses the
168
172
  site's project name, since `docker compose` would otherwise take over its containers.
169
173
 
@@ -516,6 +520,19 @@ started service, puts a removed key back, bans an unbanned IP again or restores
516
520
  firewall does. Services work with systemd and OpenRC. The Docker log limit applies to containers created
517
521
  afterwards (and Docker restarts only with `--restart`), so redeploy or restart sites to apply it to them.
518
522
 
523
+ ## Security
524
+
525
+ ```sh
526
+ lf security # ssh passwords, root login, firewall, fail2ban, automatic updates, pending reboot
527
+ lf harden # all of: ssh (keys only), fail2ban, updates; or name the parts
528
+ lf harden ssh # asks first; refuses while a user logs in with a password only (--force)
529
+ lf keys add --generate -u anna # new pair at ~/.ssh/<server>_anna, its public key on the server
530
+ ```
531
+
532
+ `lf setup` and `lf server add` end with the same advice, and the web UI shows it on the system tab with a
533
+ button per fix. Each fix is journaled, so `lf undo` takes it back. Automatic updates know apt
534
+ (unattended-upgrades) and dnf (dnf-automatic). Without root or sudo landfall only checks sshd's settings.
535
+
519
536
  ## Web UI
520
537
 
521
538
  ```sh
@@ -612,7 +629,9 @@ lf undo -s box -y # revert the last run
612
629
  | `lf services restart\|start\|stop <service>` | Controls a service. Stopping ssh needs `--force`; stopping or restarting docker asks first. Start and stop can be undone. |
613
630
  | `lf services logs <service> [-f] [-n lines]` | Shows a service's log: journald, else its log file. |
614
631
  | `lf keys [--json]` | Lists the SSH keys in each user's `authorized_keys` (root and `/home/*`). ★ marks the key this machine logs in with. Alias: `keys ls`. |
615
- | `lf keys add <key\|file.pub> [--user u]` | Adds a public key, to the login user by default. Undoable. |
632
+ | `lf keys add <key\|file.pub> [--user u] [--generate]` | Adds a public key, to the login user by default. `--generate` makes a new pair at `~/.ssh/<server>_<user>` instead. Undoable. |
633
+ | `lf security [--json]` | Checks ssh password and root login, firewall, fail2ban, automatic updates and a pending reboot, and names the command that fixes each. |
634
+ | `lf harden [ssh\|fail2ban\|updates…] [--force]` | Turns ssh passwords off, installs and starts fail2ban, turns on automatic security updates; all three without arguments. `ssh` refuses to lock out password-only users without `--force`. Undoable. |
616
635
  | `lf keys rm <fingerprint\|comment> [--user u]` | Removes a key by comment or fingerprint prefix. Refuses the key this machine uses without `--force`. Undoable. |
617
636
  | `lf bans [--json]` | Shows banned IPs per fail2ban jail. |
618
637
  | `lf unban <ip>` | Unbans an IP in every jail that bans it. Undo bans it again. |
@@ -711,7 +730,7 @@ On the server:
711
730
  /etc/ssh/sshd_config.d/00-landfall.conf ssh hardening from `lf setup`
712
731
  ```
713
732
 
714
- `lf setup` also installs Docker with the compose plugin, ufw, fail2ban and unattended-upgrades, and creates the
733
+ `lf setup` also installs Docker with the compose plugin, rsync, ufw, fail2ban and unattended-upgrades, and creates the
715
734
  `deploy` user (group docker). Before changing a file, landfall keeps a backup next to it as
716
735
  `.<file>.landfall-<run>` (the newest 10). `lf config` and the web UI's *Overview* list all of these places.
717
736