mirror of
https://github.com/netbirdio/netbird.git
synced 2024-11-25 01:23:22 +01:00
[misc] Add support for NETBIRD_STORE_ENGINE_POSTGRES_DSN environment variable in setup.env (#2462)
* Added Postgres DSN env variable * Added postgres check to script
This commit is contained in:
parent
d92f2b633f
commit
33b264e598
@ -41,6 +41,18 @@ if [[ "x-$NETBIRD_DOMAIN" == "x-" ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Check if PostgreSQL is set as the store engine
|
||||||
|
if [[ "$NETBIRD_STORE_CONFIG_ENGINE" == "postgres" ]]; then
|
||||||
|
# Exit if 'NETBIRD_STORE_ENGINE_POSTGRES_DSN' is not set
|
||||||
|
if [[ -z "$NETBIRD_STORE_ENGINE_POSTGRES_DSN" ]]; then
|
||||||
|
echo "Warning: NETBIRD_STORE_CONFIG_ENGINE=postgres but NETBIRD_STORE_ENGINE_POSTGRES_DSN is not set."
|
||||||
|
echo "Please add the following line to your setup.env file:"
|
||||||
|
echo 'NETBIRD_STORE_ENGINE_POSTGRES_DSN="host=<PG_HOST> user=<PG_USER> password=<PG_PASSWORD> dbname=<PG_DB_NAME> port=<PG_PORT>"'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
export NETBIRD_STORE_ENGINE_POSTGRES_DSN
|
||||||
|
fi
|
||||||
|
|
||||||
# local development or tests
|
# local development or tests
|
||||||
if [[ $NETBIRD_DOMAIN == "localhost" || $NETBIRD_DOMAIN == "127.0.0.1" ]]; then
|
if [[ $NETBIRD_DOMAIN == "localhost" || $NETBIRD_DOMAIN == "127.0.0.1" ]]; then
|
||||||
export NETBIRD_MGMT_SINGLE_ACCOUNT_MODE_DOMAIN="netbird.selfhosted"
|
export NETBIRD_MGMT_SINGLE_ACCOUNT_MODE_DOMAIN="netbird.selfhosted"
|
||||||
|
@ -77,6 +77,9 @@ services:
|
|||||||
options:
|
options:
|
||||||
max-size: "500m"
|
max-size: "500m"
|
||||||
max-file: "2"
|
max-file: "2"
|
||||||
|
environment:
|
||||||
|
- NETBIRD_STORE_ENGINE_POSTGRES_DSN=$NETBIRD_STORE_ENGINE_POSTGRES_DSN
|
||||||
|
|
||||||
# Coturn
|
# Coturn
|
||||||
coturn:
|
coturn:
|
||||||
image: coturn/coturn:$COTURN_TAG
|
image: coturn/coturn:$COTURN_TAG
|
||||||
|
@ -81,6 +81,8 @@ services:
|
|||||||
- traefik.http.routers.netbird-management.service=netbird-management
|
- traefik.http.routers.netbird-management.service=netbird-management
|
||||||
- traefik.http.services.netbird-management.loadbalancer.server.port=443
|
- traefik.http.services.netbird-management.loadbalancer.server.port=443
|
||||||
- traefik.http.services.netbird-management.loadbalancer.server.scheme=h2c
|
- traefik.http.services.netbird-management.loadbalancer.server.scheme=h2c
|
||||||
|
environment:
|
||||||
|
- NETBIRD_STORE_ENGINE_POSTGRES_DSN=$NETBIRD_STORE_ENGINE_POSTGRES_DSN
|
||||||
|
|
||||||
# Coturn
|
# Coturn
|
||||||
coturn:
|
coturn:
|
||||||
|
Loading…
Reference in New Issue
Block a user