Skip to content

feat(dev-server): Allow overriding host for dev server up#11

Merged
markshust merged 5 commits intomarko-php:developfrom
renanmedina:feat/allow-override-dev-server-host
Apr 15, 2026
Merged

feat(dev-server): Allow overriding host for dev server up#11
markshust merged 5 commits intomarko-php:developfrom
renanmedina:feat/allow-override-dev-server-host

Conversation

@renanmedina
Copy link
Copy Markdown
Contributor

@renanmedina renanmedina commented Apr 3, 2026

Summary

  • Adds configurable host option to dev:up command for devcontainer/Codespaces support
  • Reads host from --host CLI option, then falls back to dev.host config (default: localhost)
  • Validates host input to prevent command injection
  • No short flag (-h was removed to avoid conflict with --help)

Related Issues

Closes #9

Checklist

  • Tests pass (./vendor/bin/pest packages/dev-server/tests)
  • Lint passes (./vendor/bin/phpcs)
  • Follows code standards

@github-actions github-actions bot added the enhancement New feature or request label Apr 3, 2026
@renanmedina renanmedina force-pushed the feat/allow-override-dev-server-host branch from 95a94da to 010ba9d Compare April 3, 2026 23:45
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Apr 3, 2026
renanmedina and others added 3 commits April 3, 2026 21:30
- Remove -h short flag for host (conflicts with --help convention)
- Add input validation to prevent command injection via --host
- Add test for --host long option override
- Add test for invalid host rejection
- Revert unrelated style changes (fn spacing, anonymous class spacing)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@markshust
Copy link
Copy Markdown
Collaborator

Thanks for the contribution @renanmedina and @artmuscode! Pushed some follow-up fixes directly to the branch:

  • Removed -h short flag — conflicts with the universal --help convention. Host is available via --host or dev.host config only.
  • Added host input validation — prevents command injection via --host by validating against a safe character pattern.
  • Added --host override test — the original PR was missing a test for the long --host flag.
  • Added invalid host rejection test — covers the new validation.
  • Reverted unrelated style changesfn($e)fn ($e) and new class()new class () to match project standards.
  • Merged latest from develop — resolved merge conflicts and ensured all tests pass.

All 129 dev-server tests pass, lint is clean.

@github-actions github-actions bot removed the enhancement New feature or request label Apr 15, 2026
@markshust markshust merged commit 81fc1ac into marko-php:develop Apr 15, 2026
1 check passed
@github-actions github-actions bot added the enhancement New feature or request label Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dev-server — Configurable Host Binding

2 participants