portless 0.12.0 → 0.13.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.
Files changed (3) hide show
  1. package/README.md +33 -3
  2. package/dist/cli.js +1124 -101
  3. package/package.json +3 -3
package/README.md CHANGED
@@ -249,6 +249,23 @@ portless trust
249
249
 
250
250
  On Linux, `portless trust` supports Debian/Ubuntu, Arch, Fedora/RHEL/CentOS, and openSUSE (via `update-ca-certificates` or `update-ca-trust`). On Windows, it uses `certutil` to add the CA to the system trust store.
251
251
 
252
+ ## Start at OS startup
253
+
254
+ Install the proxy as an OS startup service so clean HTTPS URLs are available after reboot without starting the proxy from a terminal:
255
+
256
+ ```bash
257
+ portless service install
258
+ portless service install --lan
259
+ portless service install --wildcard
260
+ PORTLESS_STATE_DIR=~/.portless-lan PORTLESS_LAN=1 portless service install
261
+ portless service status
262
+ portless service uninstall
263
+ ```
264
+
265
+ The service uses portless defaults unless install options or `PORTLESS_*` environment variables are provided: HTTPS on port 443 with `.localhost` names. `service install` accepts the proxy options you would use with `proxy start`, including `--port`, `--no-tls`, `--lan`, `--ip`, `--tld`, `--wildcard`, `--cert`, and `--key`. Use `--state-dir <path>` or `PORTLESS_STATE_DIR=<path>` to choose where service state and logs are written.
266
+
267
+ The chosen service configuration is written into launchd, systemd, or Task Scheduler and reused after reboot. `portless service status` reports the installed port, HTTPS mode, TLD, LAN mode, wildcard mode, and state directory. macOS and Linux install a root-owned service so port 443 can bind at boot. Windows installs a Task Scheduler startup task that runs as SYSTEM. Installation and removal may require administrator privileges. `portless clean` automatically removes the service.
268
+
252
269
  ## LAN mode
253
270
 
254
271
  ```bash
@@ -300,9 +317,11 @@ portless myapp --funnel next dev
300
317
  # -> https://devbox.yourteam.ts.net (public)
301
318
  ```
302
319
 
320
+ Tailscale HTTPS certificates must be enabled before `--tailscale` or `--funnel` can register HTTPS URLs. Funnel must also be enabled for the tailnet and node before `--funnel` can register the public URL. If either setting is missing, portless exits before starting the child process.
321
+
303
322
  Set `PORTLESS_TAILSCALE=1` in your shell profile or `.env` to share every app by default. `portless list` shows both local and tailnet URLs. Tailscale serve registrations are cleaned up automatically when the app exits.
304
323
 
305
- Requires the Tailscale CLI to be installed and connected (`tailscale up`).
324
+ Requires the Tailscale CLI to be installed and connected (`tailscale up`), with Tailscale HTTPS certificates enabled.
306
325
 
307
326
  ## Commands
308
327
 
@@ -332,6 +351,13 @@ portless proxy start -p 1355 # Start on a custom port (no sudo)
332
351
  portless proxy start --foreground # Start in foreground (for debugging)
333
352
  portless proxy start --wildcard # Allow unregistered subdomains to fall back to parent
334
353
  portless proxy stop # Stop the proxy
354
+
355
+ # OS startup service
356
+ portless service install # Start HTTPS proxy when the OS starts
357
+ portless service install --lan # Start service in LAN mode
358
+ portless service install --wildcard # Persist wildcard routing in the service
359
+ portless service status # Show service and proxy status
360
+ portless service uninstall # Remove the startup service
335
361
  ```
336
362
 
337
363
  ### Options
@@ -347,6 +373,7 @@ portless proxy stop # Stop the proxy
347
373
  --foreground Run proxy in foreground instead of daemon
348
374
  --tld <tld> Use a custom TLD instead of .localhost (e.g. test)
349
375
  --wildcard Allow unregistered subdomains to fall back to parent route
376
+ --state-dir <path> Use a custom state directory with service install
350
377
  --script <name> Run a specific package.json script (default: dev)
351
378
  --app-port <number> Use a fixed port for the app (skip auto-assignment)
352
379
  --tailscale Share the app on your Tailscale network (tailnet)
@@ -363,6 +390,7 @@ PORTLESS_PORT=<number> Override the default proxy port
363
390
  PORTLESS_APP_PORT=<number> Use a fixed port for the app (same as --app-port)
364
391
  PORTLESS_HTTPS=0 Disable HTTPS (same as --no-tls)
365
392
  PORTLESS_LAN=1 Enable LAN mode when set to 1 (auto-detects LAN IP)
393
+ PORTLESS_LAN_IP=<address> Pin a specific LAN IP for LAN mode
366
394
  PORTLESS_TLD=<tld> Use a custom TLD (e.g. test; default: localhost)
367
395
  PORTLESS_WILDCARD=1 Allow unregistered subdomains to fall back to parent route
368
396
  PORTLESS_SYNC_HOSTS=0 Disable auto-sync of /etc/hosts (on by default)
@@ -378,7 +406,7 @@ PORTLESS_TAILSCALE_URL Tailscale URL of the app (when --tailscale is a
378
406
  NODE_EXTRA_CA_CERTS Path to the portless CA (when HTTPS is active)
379
407
  ```
380
408
 
381
- > **Reserved names:** `run`, `get`, `alias`, `hosts`, `list`, `trust`, `clean`, `prune`, and `proxy` are subcommands and cannot be used as app names directly. Use `portless run <cmd>` to infer the name from your project, or `portless --name <name> <cmd>` to force any name including reserved ones.
409
+ > **Reserved names:** `run`, `get`, `alias`, `hosts`, `list`, `trust`, `clean`, `prune`, `proxy`, and `service` are subcommands and cannot be used as app names directly. Use `portless run <cmd>` to infer the name from your project, or `portless --name <name> <cmd>` to force any name including reserved ones.
382
410
 
383
411
  ## Uninstall / reset
384
412
 
@@ -441,6 +469,8 @@ Portless detects this misconfiguration and responds with `508 Loop Detected` alo
441
469
 
442
470
  This repo is a pnpm workspace monorepo using [Turborepo](https://turbo.build). The publishable package lives in `packages/portless/`.
443
471
 
472
+ Use Node.js 24+ and pnpm 11 for repository development. The `.node-version` file pins the Node major for version managers.
473
+
444
474
  ```bash
445
475
  pnpm install # Install all dependencies
446
476
  pnpm build # Build all packages
@@ -453,6 +483,6 @@ pnpm format # Format all files with Prettier
453
483
 
454
484
  ## Requirements
455
485
 
456
- - Node.js 20+
486
+ - Node.js 24+
457
487
  - macOS, Linux, or Windows
458
488
  - Tailscale CLI (optional, for `--tailscale` and `--funnel`)