Skip to content

Commit b34f1b9

Browse files
committed
chore: update README to mention docker image
1 parent 32f720b commit b34f1b9

File tree

2 files changed

+38
-7
lines changed

2 files changed

+38
-7
lines changed

README.md

+35
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,38 @@ The server binary supports various options to customize your instance. Each of t
9898
- `banned-dests` (default: `<blank>`) -- a comma separated list of destination hosts to prevent access to (feature disabled if left blank).
9999

100100
Each of these may be passed as command-line parameters so to apply these or deploy changes, simply change your invocation of the Proxyscotch server to your preferred command-line options and re-run proxyscotch.
101+
102+
#### Docker Container
103+
The Proxyscotch server is also available as a Docker container hosted in [Docker Hub](https://hub.docker.com/r/hoppscotch/proxyscotch) and as of version 0.1.2 and above you can pass environment variables to it to configure the container.
104+
The container exposes the proxy through port `9159`.
105+
106+
Environment Variables the container accepts:
107+
- `PROXYSCOTCH_TOKEN` (default: `<blank>`) -- the proxy Access Token used to restrict access to the server (feature disabled if left blank).
108+
- `PROXYSCOTCH_ALLOWED_ORIGINS` (default: `*`) -- a comma separated list of allowed origins (for the Access-Control-Allow-... (CORS) headers) (use * to permit any)
109+
- `PROXYSCOTCH_BANNED_OUTPUTS` (default: `<blank>`) -- a comma separated list of values to redact from responses (feature disabled if left blank).
110+
- `PROXYSCOTCH_BANNED_DESTS` (default: `<blank>`) -- a comma separated list of destination hosts to prevent access to (feature disabled if left blank).
111+
112+
You can provide these values to the container as follows:
113+
114+
- Via `docker run`:
115+
```sh
116+
docker run -d \
117+
-e PROXYSCOTCH_TOKEN=<token> \
118+
-e PROXYSCOTCH_ALLOWED_ORIGINS=<allowed_origins> \
119+
-e PROXYSCOTCH_BANNED_OUTPUTS=<banned_outputs> \
120+
-e PROXYSCOTCH_BANNED_DESTS=<banned_dests> \
121+
-p <host_port>:9159 \
122+
hoppscotch/proxyscotch:latest
123+
```
124+
125+
- Via `docker-commpose`:
126+
```yaml
127+
# docker-compose.yml
128+
129+
services:
130+
proxyscotch:
131+
image: hoppscotch/proxyscotch:latest
132+
environment:
133+
ports:
134+
- "<host_port>:5432"
135+
```

container_run.sh

+3-7
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
11
#!/bin/sh
22

33
# Default values
4-
DEFAULT_HOST="0.0.0.0:9159"
54
DEFAULT_TOKEN=""
65
DEFAULT_ALLOWED_ORIGINS="*"
76
DEFAULT_BANNED_OUTPUTS=""
87
DEFAULT_BANNED_DESTS=""
98

10-
# Process host
11-
if [ -n "${PROXYSCOTCH_HOST}" ]; then
12-
HOST_ARG="--host=${PROXYSCOTCH_HOST}"
13-
else
14-
HOST_ARG="--host=${DEFAULT_HOST}"
15-
fi
9+
# Proxyscotch container allows configurations through env variables
10+
# in PROXYSCOTCH_TOKEN, PROXYSCOTCH_ALLOWED_ORIGINS,
11+
# PROXYSCOTCH_BANNED_OUTPUTS and PROXYSCOTCH_BANNED_DESTS
1612

1713
# Process token (only add if env var is set or default is not blank)
1814
TOKEN_ARG=""

0 commit comments

Comments
 (0)