Commit Graph

54 Commits

Author SHA1 Message Date
Chris Tate 5940d3cb88 Prepare v0.15.1 release (#345)
* Prepare v0.15.1 release

- Bump the portless package version to 0.15.1
- Add release notes for multi-TLD proxy support
- Move release markers to the latest changelog entry

* Fix Windows route lock contention

- Extend route lock acquisition under heavy contention
- Reduce retry backoff cap for more frequent lock checks
- Give the concurrent route test enough time on hosted Windows
2026-06-30 11:15:53 -05:00
Chris Tate 527578e155 Add multi-TLD proxy support (#344)
* Add multi-TLD proxy support

- Allow repeated --tld flags and comma separated PORTLESS_TLD values

- Register routes, service state, and TLS handling across configured TLDs

- Update docs, CLI help, and tests for multi-TLD behavior

* Fix multi-TLD workspace env handling
2026-06-30 10:58:42 -05:00
Chris Tate 8404575c30 Prepare v0.15.0 release (#338)
- Bump the portless package version to 0.15.0

- Add release notes for doctor diagnostics and proxy fixes

- Mirror the changelog entry in the docs site
2026-06-24 14:14:34 -05:00
Chris Tate a112baef25 feat: add portless doctor (#337)
* feat: add portless doctor

- Add read-only health diagnostics for proxy, routes, DNS, CA trust, and LAN prerequisites

- Document the doctor command in CLI help, README, docs, and the portless skill

- Cover doctor behavior with focused CLI tests

* fix: harden doctor diagnostics

* fix: handle custom certs in doctor

* Fix doctor diagnostics edge cases

* Fix doctor nested state directory check
2026-06-24 12:55:52 -05:00
Chris Tate 8cf5440504 Prepare v0.14.0 release (#324)
- Bump portless package version to 0.14.0

- Add release notes for ngrok sharing and tunnel lifecycle

- Add matching docs changelog entry
2026-06-04 15:44:12 -05:00
Chris Tate cd0329dd84 Add ngrok sharing support (#323)
* Add ngrok sharing support

- Add an ngrok tunnel provider with CLI preflight, URL capture, and cleanup.

- Wire --ngrok, PORTLESS_NGROK, route metadata, and child URL env support.

- Document usage and cover behavior with provider, route, and CLI tests.

* Fix ngrok tunnel lifecycle
2026-06-04 14:49:51 -05:00
Chris Tate 551434f0e2 Prepare v0.13.1 release (#316)
* feat(service): support configurable startup services

* Persist service install proxy options across launchd, systemd, and Task Scheduler.
* Report installed service port, TLS, LAN, TLD, wildcard, and state directory in status.
* Document configurable service installs in CLI help, README, docs, and agent skill.

Co-authored-by: Houssam Elbadissi <35589610+skaldebane@users.noreply.github.com>
Co-authored-by: Romeo Scagliarini <22684678+ItalianScallian@users.noreply.github.com>
Co-authored-by: Neef Rehman <29544565+neefrehman@users.noreply.github.com>

* Fix service install config handling

* fix(service): reject unsupported LAN service installs

* fix(service): stop existing proxy on port changes

* fix windows ci failures

* Prepare v0.13.1 release

---------

Co-authored-by: Houssam Elbadissi <35589610+skaldebane@users.noreply.github.com>
Co-authored-by: Romeo Scagliarini <22684678+ItalianScallian@users.noreply.github.com>
Co-authored-by: Neef Rehman <29544565+neefrehman@users.noreply.github.com>
2026-05-27 18:04:28 -05:00
Chris Tate cd26f70a69 feat(service): support configurable startup services (#315)
* feat(service): support configurable startup services

* Persist service install proxy options across launchd, systemd, and Task Scheduler.
* Report installed service port, TLS, LAN, TLD, wildcard, and state directory in status.
* Document configurable service installs in CLI help, README, docs, and agent skill.

Co-authored-by: Houssam Elbadissi <35589610+skaldebane@users.noreply.github.com>
Co-authored-by: Romeo Scagliarini <22684678+ItalianScallian@users.noreply.github.com>
Co-authored-by: Neef Rehman <29544565+neefrehman@users.noreply.github.com>

* Fix service install config handling

* fix(service): reject unsupported LAN service installs

* fix(service): stop existing proxy on port changes

* fix windows ci failures

---------

Co-authored-by: Houssam Elbadissi <35589610+skaldebane@users.noreply.github.com>
Co-authored-by: Romeo Scagliarini <22684678+ItalianScallian@users.noreply.github.com>
Co-authored-by: Neef Rehman <29544565+neefrehman@users.noreply.github.com>
2026-05-27 17:48:34 -05:00
Chris Tate 974ae781cb chore: require pnpm release age policy (#307)
* chore: require pnpm release age policy

- Add pnpm minimum release age 2880 and deny dependency build scripts.

- Require Node 24 and pnpm 11 across engines, CI, and version files.

- Refresh docs and lockfile for the runtime upgrade.

* ci: install pnpm after node setup

- Put Node 24 on PATH before pnpm/action-setup installs pnpm 11.

- Keep setup-node cache restore after pnpm is installed.

* ci: run javascript actions on node 24

- Opt CI and release workflows into GitHub JavaScript action execution on Node 24.

- Unblock pnpm/action-setup from installing pnpm 11.

* ci: avoid engine strict pnpm setup

- Remove the root engine-strict npm config.

- Drop the temporary Node 24 JavaScript action runtime override.

* test: use valid ca pem fixture

- Replace the fake CA text used in NODE_EXTRA_CA_CERTS tests with a valid PEM.

- Avoid Windows Node 24 aborting before the capture script runs.
2026-05-20 16:51:31 -05:00
Chris Tate d564c2c097 Prepare v0.13.0 release (#290) 2026-05-07 19:17:39 -05:00
Chris Tate 402e19ddc8 Add OS startup service support (#289)
* Add OS startup service support

Install a native startup service for the HTTPS proxy so clean localhost URLs are available after reboot without repeated sudo prompts.

* Harden service support and integrate with portless clean

- Change requireUnixElevation return type from boolean to void
- Switch macOS KeepAlive to unconditional restart
- Wrap ensureCerts with actionable error message mentioning OpenSSL
- Escape percent signs in Windows batch env values
- Make portless clean uninstall the startup service before removing state
- Add tests for KeepAlive, percent escaping, and tryUninstallService
- Document that portless clean removes the service automatically

* Fix hardcoded task name in tryUninstallService and add handleService tests

Use spec.taskName instead of a literal string in the Windows branch of
tryUninstallService so the query stays consistent if the constant changes.

Add unit tests for handleService dispatch: help output, no-subcommand
help, and unknown subcommand error exit.

* Fix implicit any in service test mock.calls map callbacks

* Fix flaky tryUninstallService test on machines without service installed

Mock fs.existsSync so the runner is actually invoked regardless of
whether the service file exists on the test machine.

* Fix Windows CI failures in service tests

Use path.posix.join for macOS/Linux paths so they produce forward
slashes regardless of the build platform. Fix the "not installed" test
to use a non-zero runner status so it works on win32 (where the code
path checks schtasks query status rather than fs.existsSync).

* Fix startup service lifecycle ownership

Ensure service installation takes over any existing proxy and make clean elevate when protected service entries need removal.

* Fix service uninstall runner error test

* Fix service clean elevation and Windows PATH

Keep clean running in the original user context after elevated service removal, and preserve PATH for Windows startup tasks so runtime OpenSSL lookups work.
2026-05-07 19:02:08 -05:00
Chris Tate 4522cf70c9 Prepare v0.12.0 release (#265)
Bump version to 0.12.0 and add changelog entries for Tailscale sharing
and Funnel support.
2026-04-29 11:05:17 -05:00
Chris Tate b4f89a5031 Prepare v0.11.1 release (#256)
* Fix zombie process orphaning on CLI crash

Spawn child processes with detached:true on Unix so they get their own
process group. Signal handlers now kill the entire group via
process.kill(-pid) instead of just the immediate child, preventing
orphaned dev servers from surviving CLI crashes or kill -9.

Add `portless prune` command as a safety net to find and kill orphaned
dev servers left behind by dead CLI sessions. It reads stale route
entries, checks if something is still listening on each port, and
terminates the orphan.

Add e2e tests covering both the SIGKILL cleanup path and the prune
command.

* Prepare v0.11.1 release
2026-04-28 01:19:14 -05:00
Chris Tate 8252927d7e Fix zombie process orphaning on CLI crash (#255)
Spawn child processes with detached:true on Unix so they get their own
process group. Signal handlers now kill the entire group via
process.kill(-pid) instead of just the immediate child, preventing
orphaned dev servers from surviving CLI crashes or kill -9.

Add `portless prune` command as a safety net to find and kill orphaned
dev servers left behind by dead CLI sessions. It reads stale route
entries, checks if something is still listening on each port, and
terminates the orphan.

Add e2e tests covering both the SIGKILL cleanup path and the prune
command.
2026-04-28 01:07:09 -05:00
Chris Tate 3dfcb3cb5a Prepare v0.11.0 release (#253)
Bump version to 0.11.0 and add changelog entries for config file
support, zero-arg mode, multi-app orchestration, turborepo
integration, Rsbuild support, and the state directory security fix.
2026-04-27 15:34:21 -05:00
Chris Tate a183e394a8 Config file support, zero-arg mode, and multi-app orchestration (#251)
* Add portless.json config file and zero-arg mode

Adds an optional portless.json for configuring app name, script, and
port without embedding portless in package.json scripts. Running bare
`portless` from a workspace root auto-discovers pnpm packages and
starts all dev scripts concurrently through the proxy. The --script
flag overrides the default "dev" script for a single invocation.

* Use npm scope as project base for multi-app names

In multi-app mode, package names are now composed as subdomains of the
npm scope (e.g., @og-sdk/docs becomes docs.og-sdk.localhost). Falls
back to inferring the project name from the workspace root when
packages are unscoped.

* Pass through scripts that already invoke portless

In multi-app mode, if a package's dev script starts with `portless`,
run it as-is without registering a route or injecting PORT/HOST. The
embedded portless invocation handles its own name and routing.

* Fix multi-app PATH and deduplicate project name

Augment PATH with node_modules/.bin from each package's directory so
local binaries (tsup, next, vite, etc.) are found. Skip the project
suffix when the package name already matches it (avoids names like
portless.portless).

* Fix proxy start prompting for trust on every launch

Cache the CA fingerprint in a marker file (ca.trusted) after a
successful trust so subsequent proxy starts skip the OS security
check and avoid re-triggering the macOS authentication dialog.
Also switch docs and example dev scripts to clean "next dev".

* Skip proxy route for build-only tools, support portless config in package.json

Non-server commands (tsup, tsc, esbuild, etc.) are auto-detected and
run without a proxy route. Adds "proxy" config field for explicit
control. Also supports a "portless" key in package.json — either as
an object or a string shorthand for the app name.

* Address PR review: config fixes, proxy auto-start, and refactors

- Rewrite splitCommand to respect quoted arguments
- Use frequency count for commonScope instead of first match
- Extract ensureProxyRunning helper; call from multi-app mode
- Remove loadConfig directory walk-up (check cwd only)
- Deduplicate clearTrustMarker call in generateCA
- Remove proxy field from config (system-level, not app-level)
- Fix early script filter to respect per-app overrides
- Add portless key to google-oauth example
- Replace invalid JSON comments with markdown headings in docs
- Extract spawnProxiedApp/spawnTaskApp helpers from handleDefaultMulti

* Address PR review: docs fixes, config precedence, proxy option

- Fix docs claiming config walks up directories (it does not)
- Clean up resolveAppConfig to use explicit field return
- Add JSDoc to isServerCommand explaining denylist design
- Add comment on sequential proxy spawning (port collision)
- Handle backslash escapes in splitCommand
- Remove non-null assertion on discovered proxy state
- Pass appConfig through to avoid redundant disk read
- Fix config precedence: package.json portless key wins (closest)
- Implement proxy: false config option for non-server scripts

* Add package manager delegation, turborepo support, and fix TLS state discovery

- Add detectPackageManager and resolveScriptCommand to delegate script
  execution to the correct package manager (pnpm/yarn/bun/npm) instead
  of parsing shell scripts directly. This enables reliable turborepo
  integration where `portless` is the dev script.
- Fix discoverState inferring tls=false when the proxy is running on
  port 443 but state files in /tmp were cleaned by the OS.
- Re-discover proxy state in multi-app mode when proxy is already running.
- Add turborepo integration docs and tests.

* Address PR 251 review: child lifecycle, shell safety, line buffering, proxy dedup, multi-PM workspaces, config errors

- Log exit codes per child and print summary in multi-app mode
- Spawn child processes directly without shell for PM-delegated commands
- Buffer partial lines in prefixed output streams, flush on end
- Extract resolveProxyDesiredState helper to deduplicate proxy config
- Support npm/yarn/bun workspaces via package.json "workspaces" field
- Replace process.exit in config validation with ConfigValidationError

* Address PR review: SIGKILL fallback, YAML flow sequences, glob wildcards, stream fixes

- Add 5s SIGKILL timeout after SIGTERM in multi-app cleanup to prevent
  hanging when children ignore SIGTERM
- Handle YAML flow sequence syntax (packages: [a, b]) in pnpm workspace
  parser, with JSDoc documenting the supported YAML subset
- Fall through from multi-app to single-app mode when no workspace
  packages have the target script, so workspace roots with their own
  portless.json still work
- Refactor expandSingleGlob into recursive expandSegments to support
  mid-path wildcards (packages/*/src) and prefix wildcards (apps/team-*)
- Use StringDecoder in prefixStream for correct multi-byte UTF-8 handling
  across chunk boundaries, and preserve empty lines from child output

* Eliminate /tmp state dir, fix symlink LPE, and clean up multi-app output

Move all proxy state from /tmp/portless to ~/.portless, fixing both the
macOS /tmp cleanup problem (repeated trust prompts) and the symlink LPE
vulnerability (GHSA-p67g-wf2j-g3h5). Add lstatSync symlink guard in
fixOwnership as defense-in-depth. Remove the interactive "Start proxy?"
prompt in favor of auto-starting. Rewrite multi-app startup output so
URLs stand out clearly. Also addresses PR 251 review items: re-throw
ConfigValidationError, fix splitCommand backslash handling in single
quotes, warn on unknown config keys, and remove unused export.

* Fix macOS CA cleanup when multiple certs share the same CN

Loop delete-certificate calls to remove all matching "portless Local CA"
entries from each keychain. The previous single call failed with
"is ambiguous, matches more than one certificate" when duplicate CAs
had accumulated from repeated trust prompts.

* Auto-trust CA after proxy auto-start

When the proxy is auto-started in single-app or multi-app mode and the
CA is not yet trusted, run handleTrust which has proper sudo elevation
logic. This prevents the scenario where a new user cancels the trust
dialog during proxy start and is left with browser cert errors and no
clear recovery path.

* Fix prettier formatting in configuration docs

* Use turbo for multi-app orchestration

When turbo.json is present, portless delegates to `turbo run <script>`
instead of spawning each app individually. Per-app PORT, HOST, and
PORTLESS_URL are injected via a lightweight --require loader so turbo
retains dependency ordering, output grouping, and task graph awareness.

Falls back to direct spawning when turbo is absent or when the config
sets `"turbo": false`.

* Fix turbo loader double-escape, cleanup guards, and direct-spawn route cleanup

- Remove redundant manual backslash escape in loaderSource; JSON.stringify
  already handles escaping for JS string literals
- Quote loader path in buildNodeOptions when it contains spaces
- Add cleanedUp guard to runWithTurbo and runWithDirectSpawn cleanup
  functions to prevent double execution on signal + explicit call
- Strip trailing \r in prefixStream so Windows \r\n output renders cleanly
- Track routes in runWithDirectSpawn and remove them in the signal handler,
  matching the pattern already used by runWithTurbo

* Fix doc gaps: state dir, CA path, turbo field, pkg portless key, hostname convention

- State directory docs still showed the old 3-tier table (port < 1024
  -> /tmp/portless). All state now lives in ~/.portless; updated
  SKILL.md and docs configuration page.
- CA path references in README and SKILL.md still mentioned
  /tmp/portless/ca.pem; simplified to ~/.portless/ca.pem.
- Added the `turbo` config field to all three config tables.
- Documented the package.json "portless" key as a standalone feature
  (was only shown in the Turborepo section).
- Documented the multi-app hostname convention
  (<package>.<project>.localhost derived from common npm scope).

* Make bare portless just work everywhere, monochrome output

- Remove config gates: bare `portless` and `portless run` resolve the
  dev script from package.json without requiring portless.json
- Extend PORTLESS=0 skip path to handle zero-arg mode
- Monochrome CLI output: bold for headers/errors, dim for warnings/muted,
  no color codes
- Multi-app display: show full package name (with scope), alphabetized,
  URLs dimmed
- Update docs, help text, and tests to reflect zero-config defaults

* Improve multi-app output and turbo integration

- Show full scoped package names in startup list, alphabetized
- Hide task-only packages from output (they still run)
- Use root package.json dev script for turbo when available,
  preserving user's flags like --concurrency and --filter
- Pass extra args after -- through to turbo

* Restore red/yellow ANSI colors for errors and warnings
2026-04-27 15:21:57 -05:00
Chris Tate 0ddac0f995 Prepare v0.10.3 (#236) 2026-04-15 23:55:47 -05:00
Chris Tate aec0dd7e16 Prepare v0.10.2 release (#234) 2026-04-13 18:16:47 -05:00
Chris Tate 9413976bd3 Fetch GitHub star count dynamically in docs header (#219)
Replace the hardcoded "6k" star count with a server-side fetch from
the GitHub API, revalidated every 24 hours. Gracefully hides the
count if the fetch fails.
2026-04-09 02:08:45 -05:00
Chris Tate f9af69fbfb Prepare v0.10.1 release (#214) 2026-04-07 10:40:18 -05:00
Chris Tate 591ad871b0 feat: default hosts sync with opt-out; add portless clean (#213)
* auto-sync by default

* clean
2026-04-07 10:31:52 -05:00
Chris Tate b5a71d9490 Prepare v0.10.0 (#210)
* Prepare v0.10.0 release

* Remove old release markers, document the practice in AGENTS.md
2026-04-07 02:22:14 -05:00
gabimoncha 4aa42753ab Enhance portless with local network --lan mode (#168)
* update expo injected args, implement --lan flag for portless using mDNS

* enhance expo docs and add --lan flag docs

* update skills and readme

* fix nextjs allowedDevOrigins example

* persist proxy config, follow LAN IP changes, and fix Expo host handling

* implement proxy.lan for sticky lan config

* implement PR review

* fix lan-ip.test.ts type check
2026-04-07 01:50:38 -05:00
Chris Tate 468d2d05e9 Prepare v0.9.6 release (#209) 2026-04-04 11:59:36 -05:00
Chris Tate 2357a5da7a v0.9.5 (#205) 2026-04-04 09:19:41 -05:00
Chris Tate 3b4f907e5e prepare v0.9.4 release (#198) 2026-04-02 17:59:32 -05:00
Chris Tate 2b964b7cf5 prepare v0.9.3 release (#196) 2026-04-02 17:37:36 -05:00
Chris Tate 73a30a6cd2 prepare v0.9.2 release (#193) 2026-04-01 19:01:12 -05:00
Chris Tate fa1a5a698b update domain (#191)
* update domain

* fix header
2026-04-01 18:27:34 -05:00
Chris Tate 3729c2aba1 v0.9.1 (#180) 2026-03-31 14:56:57 -05:00
Chris Tate b4e7938785 feat: support installation as a project dev dependency (#135) (#179)
portless already works as a local dev dependency (state lives in
~/.portless, not relative to the install path, and there are no
postinstall hooks), but the docs said "don't do this" and the CLI
blocked npx/dlx even for locally-installed packages.

- Add isLocallyInstalled() helper that walks up from cwd looking for
  node_modules/portless; the npx/dlx block now only fires for one-off
  downloads, not project dependencies
- Update install sections in README, docs site, CLI --help, and agent
  skill to show both global and project dev dependency options
- Note the pre-1.0 state-format caveat for per-project installs

Closes #135
2026-03-31 14:52:02 -05:00
Chris Tate 04e7d6bd3c v0.9.0 (#175) 2026-03-31 11:35:00 -05:00
Chris Tate fee2c47d17 Default to HTTPS on port 443, with auto-sudo and HTTP-to-HTTPS redirect (#172)
* portless

Fixes #123 and #145

* https

* redirect

* fixes

* fixes

* fixes

* fixes

* fixes

* fixes

* tests

* fix tests

* fixes

* fixes

* fixes

* fixes

* fixes

* fixes

* fixes

* fixes

* fixes

* fixes

* fixes

* fixes

* fixes

* fixes
2026-03-31 11:27:23 -05:00
Chris Tate 6f1aff253a prepare v0.8.0 release (#171) 2026-03-31 00:18:48 -05:00
Chris Tate 7e20d36712 v0.7.2 (#156) 2026-03-21 12:59:19 -05:00
Chris Tate 003090863a adds search (#143)
* adds search

* fix format

* og

* fix e2e tests
2026-03-19 02:29:21 -05:00
DICKY IBROHIM 2376f9ace1 fix(docs): add missing Expo and React Native to framework lists (#138)
The documentation lists only four frameworks that need --port/--host
injection (Vite, Astro, React Router, Angular), but the code in
FRAMEWORKS_NEEDING_PORT (cli-utils.ts) and the --help output both
include six: Expo and React Native were dropped during the README
rewrite in #93.
2026-03-19 02:23:45 -05:00
Augie f08e3872eb fix(docs): add Windows to docs requirements (#122)
- update docs requirements to match README
2026-03-16 17:28:43 -05:00
Chris Tate 79f1472ed7 update header (#118) 2026-03-15 21:15:40 -05:00
Chris Tate 558190e78f v0.7.0 (#117) 2026-03-15 21:12:45 -05:00
Chris Tate 6e48d2e339 prepare v0.6 (#99) 2026-03-10 18:00:28 -05:00
Gerard Balaoro da7d5d6fb7 feat(cli): add --name flag to run command for setting base name (#89)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Chris Tate <chris@ctate.dev>
2026-03-10 17:48:14 -05:00
Chris Tate ae9e3b5d00 custom tld (#93)
* custom tld

* auto-sync

* fixes

* fixes

* docs

* fixes

* fixes

* fixes

* fixes
2026-03-10 17:28:01 -05:00
Chris Tate 28b3f6d807 release: v0.5.2 (#82) 2026-03-04 01:11:54 -06:00
Chris Tate 988c868d5b docs: add git worktree documentation (#81)
Document automatic worktree detection in portless run -- branch name
is prepended as a subdomain prefix so each worktree gets a unique URL
with no config changes. Added to README, SKILL.md, docs site getting
started page, and changelog.
2026-03-04 01:08:06 -06:00
Chris Tate 6625b55343 feat(docs): replace mobile nav with slide-in sheet drawer (#80)
* feat(docs): replace mobile pill nav with slide-in sheet drawer

Use a sticky trigger bar (shows current page title + list icon) that
opens a Radix Sheet from the left. Matches the webreel docs pattern.
The sidebar now hides below lg instead of md.

* style: fix prettier formatting in sheet.tsx
2026-03-04 01:01:30 -06:00
Chris Tate 8fb96f2a03 docs: add 0.5.1 to changelog (#79) 2026-03-04 00:50:16 -06:00
Chris Tate 7e59c9e1ea fix: add changelog to docs nav and update star count to 3k (#78)
The docs-nav component had a hardcoded nav array missing the changelog
entry. Also update the GitHub star count in the header from 2k to 3k.
2026-03-04 00:46:42 -06:00
Chris Tate 4d23deff14 release: v0.5.0 (#76)
Bump version to 0.5.0 and add changelog for the release.
2026-03-04 00:36:44 -06:00
Chris Tate 8af66c334e v0.4.2 (#54) 2026-02-25 00:31:17 -06:00