Skip to content

aniftyco/concierge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

concierge

A local development site manager backed by Caddy and dnsmasq.

Caution

Not yet released. See the issue tracker for status.

What it does

concierge is a single command that registers a project as a site on *.dev.local and keeps Caddy and dnsmasq in sync with the result.

  • cd ~/Code/myproject && concierge add registers the directory as myproject.dev.local (and *.myproject.dev.local) with a Caddy-issued internal certificate
  • Three site types out of the box: laravel (php_fastcgi + Reverb), static (file_server with optional SPA fallback), and proxy (reverse_proxy to a dev server)
  • Per-site state lives as TOML in $(brew --prefix)/etc/concierge/sites/ — one file per site, grep-able and editable
  • Every mutation re-renders the full Caddyfile and pushes it to Caddy's admin API on :2019 so the change is live without a reload
  • concierge init writes the Caddyfile, dnsmasq.conf, /etc/resolver/dev.local, and trusts Caddy's internal CA in the system keychain

dnsmasq resolves *.dev.local to 127.0.0.1; Caddy terminates TLS with its internal CA and dispatches to your project per the site's type.

Install

brew install aniftyco/tap/concierge
concierge init

caddy and dnsmasq are declared dependencies and will be installed automatically. concierge init is interactive and prompts for sudo to write /etc/resolver/dev.local, start dnsmasq (which binds port 53), and trust the Caddy CA.

Usage

Add sites

concierge add                                    # Laravel site, name from cwd basename
concierge add mysite                             # Laravel site, explicit name, cwd as path
concierge add mysite ~/Code/myproject            # Laravel site, name + path
concierge add api --ip 73.93.46.100              # forward this IP as X-Forwarded-For / X-Real-IP

concierge add docs --type static --root dist     # serve <path>/dist as static files
concierge add app  --type static --spa           # SPA fallback to /index.html

concierge add vite --type proxy --port 5173      # reverse-proxy to 127.0.0.1:5173
concierge add api  --type proxy --upstream 192.168.1.50:8080

Inspect

concierge list             # every registered site with URL and path
concierge status           # service + admin API + site summary
concierge doctor           # diagnose: services, resolver, admin port

Manage

concierge edit mysite      # open the site's TOML in $EDITOR, then re-sync
concierge remove mysite    # remove the site (aliases: rm, delete)
concierge sync             # re-render the Caddyfile and push to admin API

Services

concierge start            # brew services start caddy + dnsmasq
concierge stop
concierge restart
concierge trust            # sudo caddy trust (re-add the CA to the system keychain)
concierge logs             # tail Caddy's log

Configuration

Per-site TOML at $(brew --prefix)/etc/concierge/sites/<name>.toml:

name = "saas-starter"
path = "/Users/josh/Code/aniftyco/saas-starter"
type = "laravel"

[laravel]
forwarded_ip = "73.93.46.100"   # optional
name = "docs"
path = "/Users/josh/Code/docs"
type = "static"

[static]
root = "dist"                    # optional, relative to path or absolute
spa = true                       # optional
name = "vite"
path = "/Users/josh/Code/vite"
type = "proxy"

[proxy]
upstream = "127.0.0.1:5173"

Global config at $(brew --prefix)/etc/concierge/concierge.toml:

tld        = "dev.local"
admin_addr = "localhost:2019"
php_fpm    = "127.0.0.1:9000"
reverb     = "127.0.0.1:8081"

Requirements

  • macOS (Apple Silicon or Intel)
  • caddy — declared Homebrew dependency
  • dnsmasq — declared Homebrew dependency

License

concierge is open-source software licensed under the MIT license.

About

Local development manager for macOS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages