https://github.com/desertbit/watchman
Simple HTTP Reverse Proxy with authentication
https://github.com/desertbit/watchman
Last synced: 6 months ago
JSON representation
Simple HTTP Reverse Proxy with authentication
- Host: GitHub
- URL: https://github.com/desertbit/watchman
- Owner: desertbit
- License: apache-2.0
- Created: 2015-05-03T10:38:35.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2022-12-19T11:23:28.000Z (over 3 years ago)
- Last Synced: 2024-06-20T06:27:28.815Z (about 2 years ago)
- Language: Go
- Homepage: https://registry.hub.docker.com/u/desertbit/watchman/
- Size: 11.7 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Watchman
Watchman is a simple HTTP Reverse Proxy with authentication.
HTTP basic authentication is used as authenticaton mechanism.
You should only provide a secure HTTPS connection to the reverse proxy!
Run watchman and set the configuration path.
```
./watchman -config="sample/watchman.conf"
```
Then go to http://localhost/ and log in as `foo`, password: `bar`.
It is also possible to pass the configuration path with an environment variable. Check the section below.
## Configuration
- `ListenHost`: The host to listen for HTTP requests. Default: empty (All hosts)
- `ListenPort`: The host port to listen on. Default: 80 (HTTP port)
- `DestinationHost`: The host to redirect requests to. Default: 127.0.0.1
- `DestinationPort`: The destination host port. Default: 8080
- `Description`: A short description of the secured area. This is optional. Default: Secured Area
- `PasswdFile`: The path to the htpasswd file.
Check the sample configuration in the sample directory.
## Environment variables
- `WATCHMAN_CONFIG` Sets the path to the watchman configuration.
- `WATCHMAN_DIR` Sets the lookup directory path. (Config and passwd files)
It is also possible to set config values through the environment variables:
- `WATCHMAN_LISTEN_HOST`
- `WATCHMAN_LISTEN_PORT`
- `WATCHMAN_DEST_HOST`
- `WATCHMAN_DEST_PORT`
- `WATCHMAN_DESC`
- `WATCHMAN_PASSWD`
If **ENV:** is added as prefix, then the value is obtained from another environment variable.
Example: `WATCHMAN_DEST_HOST="ENV:SERVICE_PORT_8080_TCP_ADDR"`
## Manage Users
Create an initial htpasswd file and add a user:
```
htpasswd -c /path/to/watchman.passwd foo
```
Add or update an user:
```
htpasswd /path/to/watchman.passwd foo
```
## Docker
Pull the docker image from desertbit/watchman
```
docker pull desertbit/watchman
```
There is one volume `/config`. Place the watchman configuration and htpasswd file to that location.
Then run the image.
```
docker run -p 80:80 -v /path/to/configdir:/config desertbit/watchman
```