-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Adding Hitch #1675
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Adding Hitch #1675
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
905419d
Adding Hitch
ThijsFeryn c70ac1b
Updating Hitch docs to match the updated Docker image.
ThijsFeryn 9b23f3e
Improving the Hitch TLS certificate docs
ThijsFeryn 2575e40
Applied markdownfmt to file.
ThijsFeryn acfcec6
Apply suggestions from code review
ThijsFeryn 0d7fe82
Remove part about Varnish and make it more generic
ThijsFeryn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Hitch is a libev-based high performance SSL/TLS proxy by Varnish Software. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| # What is Hitch? | ||
|
|
||
| [Hitch](https://hitch-tls.org/) is a *libev-based* high performance *SSL/TLS proxy* by [Varnish Software](https://varnish-software.com). It is specifically built to terminate TLS connections at high scale and forwards unencrypted HTTP traffic to Varnish or any other HTTP backend. | ||
|
|
||
| # How to use this image | ||
|
|
||
| Running a Hitch Docker container can be done by using the following command: | ||
|
|
||
| ```console | ||
| $ docker run --name=hitch -p 443:443 %%IMAGE%% | ||
| ``` | ||
|
|
||
| This container will expose port `443`, which is required for HTTPS traffic. | ||
|
|
||
| ## Configuration file and extra options | ||
|
|
||
| Without any argument, the container will run `hitch --config=/etc/hitch/hitch.conf`. You can mount your own configuration file to replace the default one: | ||
|
|
||
| ```console | ||
| $ docker run -v /path/to/your/config/file:/etc/hitch/hitch.conf:ro %%IMAGE%% | ||
| ``` | ||
|
|
||
| You can also change the path of the configuration file by setting the `HITCH_CONFIG_FILE` environment variable. | ||
|
|
||
| Note that extra arguments can be added to the command line. If the first argument starts with a `-`, the arguments are added to the default command line, otherwise they are treated as a command. | ||
|
|
||
| > Our assumption is that your backend, Varnish or other, supports both *HTTP/2* and the *PROXY* protocol. | ||
|
|
||
| ## Connecting to the backend | ||
|
|
||
| By default Hitch will connect to the backend using `localhost:8843` using the [PROXY protocol](https://github.com/varnish/hitch/blob/master/docs/proxy-protocol.md). If your backend server *PROXY*, the two will be able to talk together and backend will be able to expose the true client IP. | ||
|
|
||
| But you'll probably run your backend service in a separate container. In that case, you'll want to change the backend settings. You can either do that by replacing the [`backend`](https://github.com/varnish/hitch/blob/master/hitch.conf.man.rst#backend--) configuration setting in your mounted configuration file, or by adding a *command-line option*. | ||
|
|
||
| Here's how you set the backend via a *command-line option*, assuming your backend is available through `backend.example.com` on port `8443`: | ||
|
|
||
| ```console | ||
| $ docker run %%IMAGE%% "--backend=[backend.example.com]:8443" | ||
| ``` | ||
|
|
||
| ## Setting the certificate | ||
|
|
||
| The Hitch Docker image comes with a self-signed certificate that is stored in `/etc/hitch/certs/default`. | ||
|
|
||
| This certificate is automatically created during *Hitch* package install, and is a self-signed certificate using 2048-bit RSA-encrypted cipher. It is set up for the `localhost` hostname, with an expiration date 30 years in the future. | ||
|
|
||
| This certificate is only suited for testing. Using a bind mount, you can override the value of the certificate and use your own certificate, which is advisable. | ||
|
|
||
| Here's an example: | ||
|
|
||
| ```console | ||
| $ docker run -v /path/to/your/certificate:/etc/hitch/certs/default:ro %%IMAGE%% | ||
| ``` | ||
|
|
||
| You can also override the [`pem-file`](https://github.com/varnish/hitch/blob/master/hitch.conf.man.rst#pem-file--string) configuration setting in your mounted configuration file. | ||
|
|
||
| If you prefer setting the certificate location on the command line, you can add the location as part of the `--backend` option. | ||
|
|
||
| Here's how you do this: | ||
|
|
||
| ```console | ||
| $ docker run %%IMAGE%% "--backend=[backend.example.com]:8443:/path/to/cert.pem" | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| https://github.com/varnish/docker-hitch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| View [license information](https://github.com/varnish/hitch/blob/master/LICENSE) for the software contained in this image. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| [the Hitch Docker Community](%%GITHUB-REPO%%) | ||
ThijsFeryn marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels like there's a word missing -- maybe "implements"? 😅