Skip to content

Commit 95a2ef8

Browse files
Rename to kamal-proxy
1 parent b7df241 commit 95a2ef8

File tree

16 files changed

+54
-54
lines changed

16 files changed

+54
-54
lines changed

Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ RUN make
55

66
FROM ubuntu as base
77
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
8-
COPY --from=build /app/bin/parachute /usr/local/bin/
8+
COPY --from=build /app/bin/kamal-proxy /usr/local/bin/
99
EXPOSE 80 443
1010

11-
CMD [ "parachute", "run" ]
11+
CMD [ "kamal-proxy", "run" ]

Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ bench:
1010
go test -bench=. -benchmem -run=^# ./...
1111

1212
docker:
13-
docker build -t parachute .
13+
docker build -t kamal-proxy .
1414

1515
release:
1616
docker buildx build \
1717
--platform linux/amd64,linux/arm64 \
18-
--tag basecamp/parachute:latest \
19-
--label "org.opencontainers.image.title=parachute" \
18+
--tag basecamp/kamal-proxy:latest \
19+
--label "org.opencontainers.image.title=kamal-proxy" \
2020
--push .

README.md

+23-23
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
# parachute - A minimal HTTP proxy for zero-downtime deployments 🪂
1+
# kamal-proxy - A minimal HTTP proxy for zero-downtime deployments 🪂
22

33
## What it does
44

5-
`parachute` is a tiny HTTP proxy, designed to make it easy to coordinate
6-
zero-downtime deployments. By running a web application behind `parachute` you can
5+
`kamal-proxy` is a tiny HTTP proxy, designed to make it easy to coordinate
6+
zero-downtime deployments. By running a web application behind `kamal-proxy` you can
77
deploy changes to it without interruping any of the traffic that's in progress.
88
No particular cooperation from the application is required for this to work.
99

1010

1111
## A quick overview
1212

13-
To run an instance of the proxy, use the `parachute run` command. There's no
13+
To run an instance of the proxy, use the `kamal-proxy run` command. There's no
1414
configuration file, but there are some options you can specify if the defaults
1515
aren't right for your application.
1616

1717
For example, to run the proxy on a port other than 80 (the default) you could:
1818

19-
parachute run --http-port 8080
19+
kamal-proxy run --http-port 8080
2020

21-
Run `parachute help run` to see the full list of options.
21+
Run `kamal-proxy help run` to see the full list of options.
2222

2323
To route traffic through the proxy to a web application, you `deploy` instances
2424
of the application to the proxy. Deploying an instance makes it available to the
@@ -28,7 +28,7 @@ Use the format `hostname:port` when specifying the instance to deploy.
2828

2929
For example:
3030

31-
parachute deploy service1 --target web-1:3000
31+
kamal-proxy deploy service1 --target web-1:3000
3232

3333
This will instruct the proxy to register `web-1:3000` to receive traffic under
3434
the service name `service1. It will immediately begin running HTTP health checks
@@ -40,7 +40,7 @@ command will stop the deployment and return a non-zero exit code, so that
4040
deployment scripts can handle the failure appropriately.
4141

4242
Each deployment takes over traffic from the previously deployed instance. As
43-
soon as parachute determines that the new instance is healthy, it will route all
43+
soon as kamal-proxy determines that the new instance is healthy, it will route all
4444
new traffic to that instance.
4545

4646
The `deploy` command will wait for traffic to drain from the old instance before
@@ -54,36 +54,36 @@ with zero downtime.
5454
### Host-based routing
5555

5656
Host-based routing allows you to run multiple applications on the same server,
57-
using a single instance of `parachute` to route traffic to all of them.
57+
using a single instance of `kamal-proxy` to route traffic to all of them.
5858

5959
When deploying an instance, you can specify a host that it should serve traffic
6060
for:
6161

62-
parachute deploy service1 --target web-1:3000 --host app1.example.com
62+
kamal-proxy deploy service1 --target web-1:3000 --host app1.example.com
6363

6464
When deployed in this way, the instance will only receive traffic for the
6565
specified host. By deploying multiple instances, each with their own host, you
6666
can run multiple applications on the same server without port conflicts.
6767

6868
Only one service at a time can route a specific host:
6969

70-
parachute deploy service1 --target web-1:3000 --host app1.example.com
71-
parachute deploy service2 --target web-2:3000 --host app1.example.com # returns "Error: host is used by another service"
72-
parachute remove service1
73-
parachute deploy service2 --target web-2:3000 --host app1.example.com # suceeds
70+
kamal-proxy deploy service1 --target web-1:3000 --host app1.example.com
71+
kamal-proxy deploy service2 --target web-2:3000 --host app1.example.com # returns "Error: host is used by another service"
72+
kamal-proxy remove service1
73+
kamal-proxy deploy service2 --target web-2:3000 --host app1.example.com # suceeds
7474

7575

7676
### Automatic TLS
7777

78-
`parachute` can automatically obtain and renew TLS certificates for your
78+
`kamal-proxy` can automatically obtain and renew TLS certificates for your
7979
applications. To enable this, add the `--tls` flag when deploying an instance:
8080

81-
parachute deploy service1 --target web-1:3000 --host app1.example.com --tls
81+
kamal-proxy deploy service1 --target web-1:3000 --host app1.example.com --tls
8282

8383

8484
## Building
8585

86-
To build `parachute` locally, if you have a working Go environment you can:
86+
To build `kamal-proxy` locally, if you have a working Go environment you can:
8787

8888
make
8989

@@ -101,7 +101,7 @@ You can start up a sample environment to try it out using Docker Compose:
101101
This will start the proxy, and 4 instances of a simple web server. You can run
102102
proxy commands with `docker compose exec proxy ...`, for example:
103103

104-
docker compose exec proxy parachute deploy service1 --target parachute-web-1:3000
104+
docker compose exec proxy kamal-proxy deploy service1 --target kamal-proxy-web-1:3000
105105

106106
And then access the proxy from a browser at http://localhost/.
107107

@@ -110,17 +110,17 @@ And then access the proxy from a browser at http://localhost/.
110110
In some environments, like when running a Docker container, it can be convenient
111111
to specify `run` options using environment variables. This avoids having to
112112
update the `CMD` in the Dockerfile to change the options. To support this,
113-
`parachute run` will read each of its options from environment variables if they
113+
`kamal-proxy run` will read each of its options from environment variables if they
114114
are set. For example, setting the HTTP port can be done with either:
115115

116-
parachute run --http-port 8080
116+
kamal-proxy run --http-port 8080
117117

118118
or:
119119

120-
HTTP_PORT=8080 parachute run
120+
HTTP_PORT=8080 kamal-proxy run
121121

122122
If any of the environment variables conflict with something else in your
123-
environment, you can prefix them with `PARACHUTE_` to disambiguate them. For
123+
environment, you can prefix them with `KAMAL_PROXY_` to disambiguate them. For
124124
example:
125125

126-
PARACHUTE_HTTP_PORT=8080 parachute run
126+
KAMAL_PROXY_HTTP_PORT=8080 kamal-proxy run

cmd/kamal-proxy/main.go

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package main
2+
3+
import "github.com/basecamp/kamal-proxy/internal/cmd"
4+
5+
func main() {
6+
cmd.Execute()
7+
}

cmd/parachute/main.go

-7
This file was deleted.

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module github.com/basecamp/parachute
1+
module github.com/basecamp/kamal-proxy
22

33
go 1.22.1
44

internal/cmd/deploy.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66

77
"github.com/spf13/cobra"
88

9-
"github.com/basecamp/parachute/internal/server"
9+
"github.com/basecamp/kamal-proxy/internal/server"
1010
)
1111

1212
type deployCommand struct {
@@ -63,6 +63,6 @@ func (c *deployCommand) deploy(cmd *cobra.Command, args []string) error {
6363
return withRPCClient(globalConfig.SocketPath(), func(client *rpc.Client) error {
6464
var response bool
6565

66-
return client.Call("parachute.Deploy", c.args, &response)
66+
return client.Call("kamal-proxy.Deploy", c.args, &response)
6767
})
6868
}

internal/cmd/list.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77

88
"github.com/spf13/cobra"
99

10-
"github.com/basecamp/parachute/internal/server"
10+
"github.com/basecamp/kamal-proxy/internal/server"
1111
)
1212

1313
type listCommand struct {
@@ -30,7 +30,7 @@ func (c *listCommand) run(cmd *cobra.Command, args []string) error {
3030
return withRPCClient(globalConfig.SocketPath(), func(client *rpc.Client) error {
3131
var response server.ListResponse
3232

33-
err := client.Call("parachute.List", true, &response)
33+
err := client.Call("kamal-proxy.List", true, &response)
3434
if err != nil {
3535
return err
3636
}

internal/cmd/pause.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55

66
"github.com/spf13/cobra"
77

8-
"github.com/basecamp/parachute/internal/server"
8+
"github.com/basecamp/kamal-proxy/internal/server"
99
)
1010

1111
type pauseCommand struct {
@@ -35,6 +35,6 @@ func (c *pauseCommand) run(cmd *cobra.Command, args []string) error {
3535
c.args.Service = args[0]
3636

3737
return withRPCClient(globalConfig.SocketPath(), func(client *rpc.Client) error {
38-
return client.Call("parachute.Pause", c.args, &response)
38+
return client.Call("kamal-proxy.Pause", c.args, &response)
3939
})
4040
}

internal/cmd/remove.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55

66
"github.com/spf13/cobra"
77

8-
"github.com/basecamp/parachute/internal/server"
8+
"github.com/basecamp/kamal-proxy/internal/server"
99
)
1010

1111
type removeCommand struct {
@@ -32,6 +32,6 @@ func (c *removeCommand) run(cmd *cobra.Command, args []string) error {
3232
c.args.Service = args[0]
3333

3434
return withRPCClient(globalConfig.SocketPath(), func(client *rpc.Client) error {
35-
return client.Call("parachute.Remove", c.args, &response)
35+
return client.Call("kamal-proxy.Remove", c.args, &response)
3636
})
3737
}

internal/cmd/resume.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55

66
"github.com/spf13/cobra"
77

8-
"github.com/basecamp/parachute/internal/server"
8+
"github.com/basecamp/kamal-proxy/internal/server"
99
)
1010

1111
type resumeCommand struct {
@@ -32,6 +32,6 @@ func (c *resumeCommand) run(cmd *cobra.Command, args []string) error {
3232
c.args.Service = args[0]
3333

3434
return withRPCClient(globalConfig.SocketPath(), func(client *rpc.Client) error {
35-
return client.Call("parachute.Resume", c.args, &response)
35+
return client.Call("kamal-proxy.Resume", c.args, &response)
3636
})
3737
}

internal/cmd/root.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ import (
77

88
"github.com/spf13/cobra"
99

10-
"github.com/basecamp/parachute/internal/server"
10+
"github.com/basecamp/kamal-proxy/internal/server"
1111
)
1212

1313
var globalConfig server.Config
1414

1515
// rootCmd represents the base command when called without any subcommands
1616
var rootCmd = &cobra.Command{
17-
Use: "parachute",
17+
Use: "kamal-proxy",
1818
Short: "HTTP proxy for zero downtime deployments",
1919
SilenceUsage: true,
2020
}
@@ -42,7 +42,7 @@ func defaultConfigLocation() string {
4242
home = os.TempDir()
4343
}
4444

45-
folder := path.Join(home, "parachute")
45+
folder := path.Join(home, "kamal-proxy")
4646
err = os.MkdirAll(folder, syscall.S_IRUSR|syscall.S_IWUSR|syscall.S_IXUSR)
4747
if err != nil {
4848
folder = os.TempDir()

internal/cmd/run.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88

99
"github.com/spf13/cobra"
1010

11-
"github.com/basecamp/parachute/internal/server"
11+
"github.com/basecamp/kamal-proxy/internal/server"
1212
)
1313

1414
type runCommand struct {

internal/cmd/util.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
)
88

99
const (
10-
ENV_PREFIX = "PARACHUTE_"
10+
ENV_PREFIX = "KAMAL_PROXY_"
1111
)
1212

1313
func withRPCClient(socketPath string, fn func(client *rpc.Client) error) error {

internal/server/commands.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func NewCommandHandler(router *Router) *CommandHandler {
5252
func (h *CommandHandler) Start(socketPath string) error {
5353
var err error
5454
registered.Do(func() {
55-
err = rpc.RegisterName("parachute", h)
55+
err = rpc.RegisterName("kamal-proxy", h)
5656
})
5757
if err != nil {
5858
slog.Error("Failed to register RPC handler", "error", err)

internal/server/config.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ type Config struct {
1717
}
1818

1919
func (c Config) SocketPath() string {
20-
return path.Join(c.ConfigDir, "parachute.sock")
20+
return path.Join(c.ConfigDir, "kamal-proxy.sock")
2121
}
2222

2323
func (c Config) StatePath() string {
24-
return path.Join(c.ConfigDir, "parachute.state")
24+
return path.Join(c.ConfigDir, "kamal-proxy.state")
2525
}
2626

2727
func (c Config) CertificatePath() string {

0 commit comments

Comments
 (0)