Skip to content

Commit 6698261

Browse files
committed
Add docs about new features
1 parent a8021bd commit 6698261

File tree

1 file changed

+35
-18
lines changed

1 file changed

+35
-18
lines changed

README.md

Lines changed: 35 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,33 @@ Pow doesn't support rack.hijack and thus not websockets and thus not actioncable
1919
* Run `puma-dev -install` to configure puma-dev to run in the background on ports 80 and 443 with the domain `.dev`.
2020
* If you're currently using pow, puma-dev taking control of `.dev` will break it. If you want to just try out puma-dev and leave pow working, pass `-d pdev` on `-install` to use `.pdev` instead.
2121

22+
### Install on Linux
23+
24+
* Puma-dev supports linux but requires additional installation to make all the features work.
25+
* You can either build from source or download a binary from https://github.com/puma/puma-dev/releases
26+
27+
#### .dev domain
28+
29+
Install the dev-tld-resolver (https://github.com/puma/dev-tld-resolver) to make domains resolve.
30+
31+
#### Port 80/443 binding
32+
33+
There are 2 options to allow puma-dev to listen on port 80 and 443.
34+
35+
1. `sudo setcap CAP\_NET\_BIND\_SERVICE=+eip /path/to/puma-dev`
36+
2. Use `authbind`.
37+
38+
You don't need to bind to port 80/443 to use puma-dev but obviously it makes using the `.dev` domain much nicer.
39+
40+
There is a shortcut for binding to 80/443 by passing `-sysbind` which overrides `-http-port` and `-https-port`.
41+
2242
### Options
2343

2444
Run: `puma-dev -h`
2545

2646
You have the ability to configure most of the values that you'll use day-to-day.
2747

28-
### Setup
48+
### Setup (OS X only)
2949

3050
Run: `sudo puma-dev -setup`.
3151

@@ -37,7 +57,7 @@ Puma-dev v0.3 and later use launchd to access privileged ports, so if you instal
3757

3858
Run: `sudo puma-dev -cleanup`
3959

40-
### Background Install/Upgrading for port 80 access
60+
### Background Install/Upgrading for port 80 access (OS X only)
4161

4262
If you want puma-dev to run in the background while you're logged in and on a common port, then you'll need to install it.
4363

@@ -59,7 +79,7 @@ Running `puma-dev` in this way will require you to use the listed http port, whi
5979

6080
By default, puma-dev uses the domain `.dev` to manage your apps. If you want to have puma-dev look for apps in `~/.pow`, just run `puma-dev -pow`.
6181

62-
### Configuration
82+
## Configuration
6383

6484
Puma-dev supports loading environment variables before puma starts. It checks for the following files in this order:
6585

@@ -73,13 +93,13 @@ Additionally, puma-dev uses a few environment variables to control how puma is s
7393
* `THREADS`: How many threads puma should use concurrently. Defaults to 5.
7494
* `WORKERS`: How many worker processes to start. Defaults to 0, meaning only use threads.
7595

76-
### Purging
96+
## Purging
7797

7898
If you would like to have puma-dev stop all the apps (for resource issues or because an app isn't restarting properly), you can send `puma-dev` the signal `USR1`. The easiest way to do that is:
7999

80100
`pkill -USR1 puma-dev`
81101

82-
### Uninstall
102+
### Uninstall (OS X only)
83103

84104
Run: `puma-dev -uninstall`
85105

@@ -119,25 +139,22 @@ In the case of rails, you need to configure rails to allow all websockets or web
119139

120140
Or you can add something like `config.action_cable.allowed_request_origins = /(\.dev$)|^localhost$/` to allow anything under `.dev` as well as `localhost`.
121141

122-
## Linux
123-
124-
Puma-dev supports linux but requires additional installation to make all the features work.
125-
126-
### .dev domain
127-
128-
Install the dev-tld-resolver (https://github.com/puma/dev-tld-resolver) to make domains resolve.
142+
### xip.io
129143

130-
### Port 80/443 binding
144+
Puma-dev supports `xip.io` domains. It will detect them and strip them away, so that your `test` app can be accessed as `test.A.B.C.D.xip.io`.
131145

132-
There are 2 options to allow puma-dev to listen on port 80 and 443.
146+
### Static file support
133147

134-
1. `sudo setcap CAP\_NET\_BIND\_SERVICE=+eip /path/to/puma-dev`
135-
2. Use `authbind`.
148+
Like pow, puma-dev support serving static files. If an app has a `public` directory, then any urls that match files within that directory are served. The static files have priority over the app.
136149

137-
You don't need to bind to port 80/443 to use puma-dev but obviously it makes using the `.dev` domain much nicer.
150+
### Status API
138151

139-
There is a shortcut for binding to 80/443 by passing `-sysbind` which overrides `-http-port` and `-https-port`.
152+
Puma-dev is starting to evolve a status API that can be used to introspect it and the apps. To access it, send a request with the `Host: puma-dev` and the path `/status`, for example: `curl -H "Host: puma-dev" localhost/status`.
140153

154+
The status includes:
155+
* If it is booting, running, or dead
156+
* The directory of the app
157+
* The last 1024 lines the app output
141158

142159
## Development
143160

0 commit comments

Comments
 (0)