Skip to content

Commit f4074c8

Browse files
authored
feat: Add reverse proxy setup with Caddy for Capture service (#124)
Signed-off-by: Mert Şişmanoğlu <[email protected]>
1 parent ac0f516 commit f4074c8

File tree

3 files changed

+80
-0
lines changed

3 files changed

+80
-0
lines changed

README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,20 @@
1616

1717
Capture is a hardware monitoring agent that collects hardware information from the host machine and exposes it through a RESTful API. The agent is designed to be lightweight and easy to use.
1818

19+
- [Features](#features)
20+
- [Quick Start (Docker)](#quick-start-docker)
21+
- [Quick Start (Docker Compose)](#quick-start-docker-compose)
22+
- [Configuration](#configuration)
23+
- [Installation Options](#installation-options)
24+
- [Docker (Recommended)](#docker-recommended)
25+
- [System Installation](#system-installation)
26+
- [Reverse Proxy and SSL](#reverse-proxy-and-ssl)
27+
- [Caddy](#caddy)
28+
- [API Documentation](#api-documentation)
29+
- [Contributing](#contributing)
30+
- [Star History](#star-history)
31+
- [License](#license)
32+
1933
## Features
2034

2135
- CPU Monitoring
@@ -127,6 +141,36 @@ Choose one of these methods:
127141
just build # or: go build -o dist/capture ./cmd/capture/
128142
```
129143

144+
## Reverse Proxy and SSL
145+
146+
You can use a reverse proxy in front of the Capture service to handle HTTPS requests and SSL termination.
147+
148+
### Caddy
149+
150+
```lua
151+
├deployment/reverse-proxy-compose/
152+
├── caddy/
153+
│ └── Caddyfile
154+
└── caddy.compose.yml
155+
```
156+
157+
1. Go to the `deployment/reverse-proxy-compose` directory
158+
159+
```shell
160+
cd deployment/reverse-proxy-compose
161+
```
162+
163+
2. Replace `replacewithyourdomain.com` with your actual domain in [deployment/reverse-proxy-compose/caddy/Caddyfile](./deployment/reverse-proxy-compose/caddy/Caddyfile)
164+
3. Set `API_SECRET` environment variable for the Capture service in [deployment/reverse-proxy-compose/caddy.compose.yml](./deployment/reverse-proxy-compose/caddy.compose.yml).
165+
4. Ensure your domain’s DNS A/AAAA records point to this server’s IP.
166+
5. Open inbound TCP ports 80 and 443 on your firewall/security group.
167+
168+
Start the Caddy reverse proxy
169+
170+
```shell
171+
docker compose -f caddy.compose.yml up -d
172+
```
173+
130174
## API Documentation
131175

132176
Our API is documented in accordance with the OpenAPI spec.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
networks:
2+
capture-network:
3+
driver: bridge
4+
5+
services:
6+
caddy:
7+
image: caddy:2.10-alpine
8+
container_name: caddy
9+
restart: unless-stopped
10+
ports:
11+
- "80:80"
12+
- "443:443"
13+
volumes:
14+
- ./caddy/Caddyfile:/etc/caddy/Caddyfile
15+
- caddy_data:/data
16+
networks:
17+
- capture-network
18+
19+
capture:
20+
image: ghcr.io/bluewave-labs/capture:latest
21+
restart: unless-stopped
22+
expose:
23+
- "59232"
24+
environment:
25+
- API_SECRET=REPLACE_WITH_YOUR_SECRET
26+
- GIN_MODE=release
27+
volumes:
28+
- /etc/os-release:/etc/os-release:ro
29+
networks:
30+
- capture-network
31+
32+
volumes:
33+
caddy_data:
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
replacewithyourdomain.com {
2+
reverse_proxy capture:59232
3+
}

0 commit comments

Comments
 (0)