mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-08-05 20:52:29 +02:00
Add dashboard env overrides for netbird-server
This commit is contained in:
@@ -12,13 +12,20 @@ The Dashboard container requires the `NETBIRD_MGMT_API_ENDPOINT` environment var
|
|||||||
|
|
||||||
1. Install the add-on.
|
1. Install the add-on.
|
||||||
2. Start the add-on and verify all services are running in the log output.
|
2. Start the add-on and verify all services are running in the log output.
|
||||||
3. Stop the add-on, edit the generated `management.json` to configure your Identity Provider (IdP), then start the add-on again.
|
3. Stop the add-on, edit the generated `management.json` to configure your Identity Provider (IdP).
|
||||||
4. Access the dashboard at `http://<HA_HOST>:8080`.
|
4. Update `/config/netbird/dashboard/env` with the `NETBIRD_MGMT_API_ENDPOINT` and `AUTH_*` values for the dashboard.
|
||||||
|
5. Start the add-on again and access the dashboard at `http://<HA_HOST>:8080`.
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
This add-on starts with zero configuration options. It writes default configs into `/config/netbird` and runs on the standard NetBird ports.
|
This add-on starts with zero configuration options. It writes default configs into `/config/netbird` and runs on the standard NetBird ports.
|
||||||
|
|
||||||
|
### Dashboard environment overrides
|
||||||
|
Edit `/config/netbird/dashboard/env` to configure the dashboard UI:
|
||||||
|
|
||||||
|
- `NETBIRD_MGMT_API_ENDPOINT`: Public URL of the management API (for example, `https://netbird.example.com`).
|
||||||
|
- `AUTH_AUTHORITY`, `AUTH_CLIENT_ID`, `AUTH_CLIENT_SECRET`, `AUTH_AUDIENCE`, `AUTH_SUPPORTED_SCOPES`, `USE_AUTH0`: OIDC settings for the dashboard UI.
|
||||||
|
|
||||||
### Generated configuration
|
### Generated configuration
|
||||||
On first start, the add-on creates:
|
On first start, the add-on creates:
|
||||||
- `management.json` in `$data_dir/management/`
|
- `management.json` in `$data_dir/management/`
|
||||||
|
|||||||
@@ -210,3 +210,21 @@ sed "s/__DASHBOARD_PORT__/${DASHBOARD_PORT}/g" \
|
|||||||
|
|
||||||
mkdir -p /run/nginx
|
mkdir -p /run/nginx
|
||||||
chmod +x /usr/local/bin/init_react_envs.sh
|
chmod +x /usr/local/bin/init_react_envs.sh
|
||||||
|
|
||||||
|
# Generate dashboard env file if missing
|
||||||
|
DASHBOARD_ENV_FILE="$DATA_DIR/dashboard/env"
|
||||||
|
if [[ ! -f "$DASHBOARD_ENV_FILE" ]]; then
|
||||||
|
bashio::log.info "Generating dashboard env file at ${DASHBOARD_ENV_FILE}."
|
||||||
|
cat <<'ENV' > "$DASHBOARD_ENV_FILE"
|
||||||
|
# NetBird dashboard environment overrides.
|
||||||
|
# Example: NETBIRD_MGMT_API_ENDPOINT="https://netbird.example.com"
|
||||||
|
NETBIRD_MGMT_API_ENDPOINT=""
|
||||||
|
AUTH_AUTHORITY=""
|
||||||
|
AUTH_CLIENT_ID=""
|
||||||
|
AUTH_CLIENT_SECRET=""
|
||||||
|
AUTH_AUDIENCE=""
|
||||||
|
AUTH_SUPPORTED_SCOPES="openid profile email api offline_access email_verified"
|
||||||
|
USE_AUTH0="false"
|
||||||
|
ENV
|
||||||
|
chmod 600 "$DASHBOARD_ENV_FILE"
|
||||||
|
fi
|
||||||
|
|||||||
@@ -16,10 +16,21 @@ AUTH_CLIENT_SECRET=""
|
|||||||
AUTH_AUDIENCE=""
|
AUTH_AUDIENCE=""
|
||||||
AUTH_SUPPORTED_SCOPES="openid profile email api offline_access email_verified"
|
AUTH_SUPPORTED_SCOPES="openid profile email api offline_access email_verified"
|
||||||
USE_AUTH0="false"
|
USE_AUTH0="false"
|
||||||
|
NETBIRD_MGMT_API_ENDPOINT=""
|
||||||
|
|
||||||
MANAGEMENT_PORT="${MANAGEMENT_LISTEN##*:}"
|
MANAGEMENT_PORT="${MANAGEMENT_LISTEN##*:}"
|
||||||
|
|
||||||
if [[ -n "$EXTERNAL_BASE_URL" ]]; then
|
ENV_FILE="/config/netbird/dashboard/env"
|
||||||
|
if [[ -f "$ENV_FILE" ]]; then
|
||||||
|
set -a
|
||||||
|
# shellcheck disable=SC1090
|
||||||
|
. "$ENV_FILE"
|
||||||
|
set +a
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -n "$NETBIRD_MGMT_API_ENDPOINT" ]]; then
|
||||||
|
NETBIRD_MGMT_API_ENDPOINT="$NETBIRD_MGMT_API_ENDPOINT"
|
||||||
|
elif [[ -n "$EXTERNAL_BASE_URL" ]]; then
|
||||||
NETBIRD_MGMT_API_ENDPOINT="$EXTERNAL_BASE_URL"
|
NETBIRD_MGMT_API_ENDPOINT="$EXTERNAL_BASE_URL"
|
||||||
elif [[ -n "$DOMAIN" ]]; then
|
elif [[ -n "$DOMAIN" ]]; then
|
||||||
NETBIRD_MGMT_API_ENDPOINT="http://${DOMAIN}:${MANAGEMENT_PORT}"
|
NETBIRD_MGMT_API_ENDPOINT="http://${DOMAIN}:${MANAGEMENT_PORT}"
|
||||||
|
|||||||
Reference in New Issue
Block a user