Skip to content

Commit 52c3bc1

Browse files
authored
Update environmental variables (#2721)
1 parent 28a5976 commit 52c3bc1

8 files changed

Lines changed: 114 additions & 149 deletions

File tree

.env-template

Lines changed: 0 additions & 37 deletions
This file was deleted.

.env.example

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
### DB configuration ###
2+
DEFGUARD_DB_HOST="localhost"
3+
DEFGUARD_DB_PORT=5432
4+
DEFGUARD_DB_NAME="defguard"
5+
DEFGUARD_DB_USER="defguard"
6+
DEFGUARD_DB_PASSWORD="defguard"
7+
# for SQLX CLI
8+
DATABASE_URL="postgresql://defguard:defguard@localhost/defguard"
9+
10+
### For localhost only ###
11+
# DEFGUARD_COOKIE_INSECURE=true
12+
13+
### Logging ###
14+
DEFGUARD_LOG_LEVEL=info
15+
16+
### HTTP Port ###
17+
DEFGUARD_HTTP_PORT=8000
18+
19+
### GRPC Port ###
20+
DEFGUARD_GRPC_PORT=50055
21+
# DEFGUARD_GRPC_BIND_ADDRESS=
22+
# DEFGUARD_HTTP_BIND_ADDRESS=
23+
24+
### OpenID Connect ###
25+
# DEFGUARD_OPENID_KEY=
26+
27+
### Docker-compose images ###
28+
IMAGE_TAG=dev

.github/workflows/release.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ jobs:
149149
fpm_args:
150150
"defguard-${{ env.VERSION }}-x86_64-unknown-linux-gnu=/usr/bin/defguard
151151
defguard.service=/usr/lib/systemd/system/defguard.service
152-
.env-template=/etc/defguard/core.conf"
152+
.env.example=/etc/defguard/core.conf"
153153
fpm_opts: "--architecture amd64 --output-type deb --version ${{ env.VERSION }} --package defguard-${{ env.VERSION }}-x86_64-unknown-linux-gnu.deb"
154154

155155
- name: Build aarch64 DEB package
@@ -158,7 +158,7 @@ jobs:
158158
fpm_args:
159159
"defguard-${{ env.VERSION }}-aarch64-unknown-linux-gnu=/usr/bin/defguard
160160
defguard.service=/usr/lib/systemd/system/defguard.service
161-
.env-template=/etc/defguard/core.conf"
161+
.env.example=/etc/defguard/core.conf"
162162
fpm_opts: "--architecture arm64 --output-type deb --version ${{ env.VERSION }} --package defguard-${{ env.VERSION }}-aarch64-unknown-linux-gnu.deb"
163163

164164
- name: Build x86_64 RPM package
@@ -167,7 +167,7 @@ jobs:
167167
fpm_args:
168168
"defguard-${{ env.VERSION }}-x86_64-unknown-linux-gnu=/usr/bin/defguard
169169
defguard.service=/usr/lib/systemd/system/defguard.service
170-
.env-template=/etc/defguard/core.conf"
170+
.env.example=/etc/defguard/core.conf"
171171
fpm_opts: "--architecture amd64 --output-type rpm --version ${{ env.VERSION }} --package defguard-${{ env.VERSION }}-x86_64-unknown-linux-gnu.rpm"
172172

173173
- name: Build aarch64 RPM package
@@ -176,7 +176,7 @@ jobs:
176176
fpm_args:
177177
"defguard-${{ env.VERSION }}-aarch64-unknown-linux-gnu=/usr/bin/defguard
178178
defguard.service=/usr/lib/systemd/system/defguard.service
179-
.env-template=/etc/defguard/core.conf"
179+
.env.example=/etc/defguard/core.conf"
180180
fpm_opts: "--architecture arm64 --output-type rpm --version ${{ env.VERSION }} --package defguard-${{ env.VERSION }}-aarch64-unknown-linux-gnu.rpm"
181181

182182
- name: Build FreeBSD package
@@ -185,7 +185,7 @@ jobs:
185185
fpm_args:
186186
"defguard-${{ env.VERSION }}-x86_64-unknown-freebsd=/usr/local/bin/defguard
187187
defguard.service.freebsd=/usr/local/etc/rc.d/defguard
188-
.env-template=/etc/defguard/core.conf"
188+
.env.example=/etc/defguard/core.conf"
189189
fpm_opts: "--architecture amd64 --output-type freebsd --version ${{ env.VERSION }} --package defguard-${{ env.VERSION }}_x86_64-unknown-freebsd.pkg --freebsd-osversion '*' --depends openssl"
190190

191191
- name: Upload Linux x86_64 archive

docker-compose.e2e.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,26 @@ services:
22
core:
33
image: ghcr.io/defguard/defguard:${IMAGE_TAG}
44
environment:
5-
DEFGUARD_DEFAULT_ADMIN_PASSWORD: pass123
65
DEFGUARD_COOKIE_INSECURE: true
76
DEFGUARD_COOKIE_DOMAIN: localhost
87
DEFGUARD_LOG_LEVEL: debug
9-
DEFGUARD_SECRET_KEY: aa5a506b11d719dd7170f57f5d9947faf8eb0bc2be1325e42aa0237c3dcfd26456e73dff9eef3b12c7bcf8711b45e3e703d8e21ee1c08520f5e12e3f5772da94
10-
DEFGUARD_AUTH_SECRET: defguard-auth-secret
11-
DEFGUARD_GATEWAY_SECRET: defguard-gateway-secret
12-
DEFGUARD_YUBIBRIDGE_SECRET: defguard-yubibridge-secret
138
DEFGUARD_DB_HOST: db
149
DEFGUARD_DB_PORT: 5432
1510
DEFGUARD_DB_USER: defguard
1611
DEFGUARD_DB_PASSWORD: defguard
1712
DEFGUARD_DB_NAME: defguard
18-
DEFGUARD_URL: http://localhost:8000
19-
DEFGUARD_LICENSE_KEY: ${DEFGUARD_LICENSE_KEY:-}
13+
DEFGUARD_GRPC_PORT: 50055
2014
RUST_BACKTRACE: 1
2115
ports:
16+
# REST API
2217
- "8000:8000"
18+
# Default Core GRPC port
19+
- "50055:50055"
2320
depends_on:
2421
- db
2522

2623
db:
27-
image: public.ecr.aws/docker/library/postgres:17-alpine
24+
image: postgres:18-alpine
2825
environment:
2926
POSTGRES_DB: defguard
3027
POSTGRES_USER: defguard
@@ -38,10 +35,13 @@ services:
3835
retries: 5
3936
start_period: 5s
4037

41-
proxy:
38+
edge:
4239
image: ghcr.io/defguard/defguard-proxy:${IMAGE_TAG}
4340
ports:
41+
# REST API
4442
- "8080:8080"
43+
# Default Edge GRPC port
44+
- "50051:50051"
4545
environment:
4646
DEFGUARD_PROXY_GRPC_PORT: 50051
4747
RUST_BACKTRACE: 1

docker-compose.ldap.yaml

Lines changed: 29 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,69 @@
11
services:
22
core:
3-
image: ghcr.io/defguard/defguard:latest
3+
image: ghcr.io/defguard/defguard:${IMAGE_TAG}
44
build:
55
context: .
66
dockerfile: Dockerfile
77
environment:
8-
DEFGUARD_COOKIE_INSECURE: "true"
9-
DEFGUARD_SECRET_KEY: aa5a506b11d719dd7170f57f5d9947faf8eb0bc2be1325e42aa0237c3dcfd26456e73dff9eef3b12c7bcf8711b45e3e703d8e21ee1c08520f5e12e3f5772da94
10-
DEFGUARD_AUTH_SECRET: defguard-auth-secret
11-
DEFGUARD_GATEWAY_SECRET: defguard-gateway-secret
12-
DEFGUARD_YUBIBRIDGE_SECRET: defguard-yubibridge-secret
138
DEFGUARD_DB_HOST: db
149
DEFGUARD_DB_PORT: 5432
1510
DEFGUARD_DB_USER: defguard
1611
DEFGUARD_DB_PASSWORD: defguard
1712
DEFGUARD_DB_NAME: defguard
18-
DEFGUARD_URL: http://localhost:8000
1913
RUST_BACKTRACE: 1
2014
ports:
21-
# rest api
15+
# REST API
2216
- "8000:8000"
23-
# grpc
17+
# Default Core GRPC port
2418
- "50055:50055"
2519
depends_on:
2620
- db
2721

2822
gateway:
29-
image: ghcr.io/defguard/gateway:latest
30-
environment:
31-
DEFGUARD_GRPC_URL: http://core:50055
32-
DEFGUARD_STATS_PERIOD: 60
33-
DEFGUARD_TOKEN: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJEZWZHdWFyZCIsInN1YiI6IlRlc3ROZXQiLCJjbGllbnRfaWQiOiIiLCJleHAiOjU5NjE3NDcwNzYsIm5iZiI6MTY2Njc3OTc4MSwicm9sZXMiOltdfQ.uEUMnw_gO23W0K2q3N1lToeP0D2zAY1swr8N-84sRHA
34-
RUST_LOG: debug
23+
image: ghcr.io/defguard/gateway:${IMAGE_TAG}
3524
ports:
3625
# WireGuard endpoint
3726
- "50051:50051/udp"
27+
# Default Gateway GRPC port
28+
- "50066:50066"
3829
depends_on:
3930
- core
4031
cap_add:
4132
- NET_ADMIN
4233

4334
db:
44-
image: postgres:17-alpine
35+
image: postgres:18-alpine
4536
environment:
4637
POSTGRES_DB: defguard
4738
POSTGRES_USER: defguard
4839
POSTGRES_PASSWORD: defguard
4940
volumes:
50-
- ./.volumes/db:/var/lib/postgresql/data
41+
- ./.volumes/db:/var/lib/postgresql
5142
ports:
5243
- "5432:5432"
5344

54-
device:
55-
build:
56-
context: .
57-
dockerfile: Dockerfile.device
58-
depends_on:
59-
- gateway
60-
cap_add:
61-
- NET_ADMIN
45+
# vector:
46+
# image: timberio/vector:latest-alpine
47+
# profiles:
48+
# - observability
49+
# container_name: vector
50+
# volumes:
51+
# - ./configs/vector.yaml:/etc/vector/vector.yaml:ro
52+
# - ./configs/key.pem:/etc/vector/key.pem:ro
53+
# - ./configs/cert.pem:/etc/vector/cert.pem:ro
54+
# command: ["--config", "/etc/vector/vector.yaml"]
55+
# ports:
56+
# - "8686:8686"
57+
# - "8001:8001"
6258

63-
vector:
64-
image: timberio/vector:latest-alpine
65-
profiles:
66-
- observability
67-
container_name: vector
68-
volumes:
69-
- ./configs/vector.yaml:/etc/vector/vector.yaml:ro
70-
- ./configs/key.pem:/etc/vector/key.pem:ro
71-
- ./configs/cert.pem:/etc/vector/cert.pem:ro
72-
command: ["--config", "/etc/vector/vector.yaml"]
73-
ports:
74-
- "8686:8686"
75-
- "8001:8001"
76-
77-
logstash:
78-
image: docker.elastic.co/logstash/logstash:8.14.0
79-
profiles:
80-
- observability
81-
ports:
82-
- "8002:8002"
83-
volumes:
84-
- ./configs/logstash.conf:/usr/share/logstash/pipeline/logstash.conf:ro
59+
# logstash:
60+
# image: docker.elastic.co/logstash/logstash:8.14.0
61+
# profiles:
62+
# - observability
63+
# ports:
64+
# - "8002:8002"
65+
# volumes:
66+
# - ./configs/logstash.conf:/usr/share/logstash/pipeline/logstash.conf:ro
8567

8668
openldap:
8769
image: bitnamilegacy/openldap:2.6

0 commit comments

Comments
 (0)