feat(netbird): automate admin setup, API token, setup key, and LAN route on rus-central
This commit is contained in:
1 parent
842a633916
commit
324327ee24
13 files changed
+515
-17
No files matched your search
@@ -9,7 +9,7 @@ before=${3:-}
|
||||
after=${4:-}
|
||||
|
||||
case "$machine" in
|
||||
core-net | core-secrets | rus-central) ;;
|
||||
core-net | core-secrets | rus-central | opnsense) ;;
|
||||
*)
|
||||
echo "Неизвестная машина: $machine" >&2
|
||||
exit 2
|
||||
@@ -30,6 +30,7 @@ TOKEN=$(infisical login \
|
||||
--client-id="${INFISICAL_CLIENT_ID}" \
|
||||
--client-secret="${INFISICAL_CLIENT_SECRET}" \
|
||||
--plain)
|
||||
export INFISICAL_TOKEN="${TOKEN}"
|
||||
|
||||
eval "$(infisical export --domain="${INFISICAL_DOMAIN}" --token="${TOKEN}" --env=prod --projectId="${INFISICAL_PROJECT_ID}" --path="/ci-cd" --format=dotenv-export --silent)"
|
||||
|
||||
@@ -73,6 +74,11 @@ case "$machine" in
|
||||
export NETBIRD_AUTH_SECRET="${NETBIRD_AUTH_SECRET:-}"
|
||||
export NETBIRD_DATASTORE_KEY="${NETBIRD_DATASTORE_KEY:-}"
|
||||
export NETBIRD_SESSION_KEY="${NETBIRD_SESSION_KEY:-}"
|
||||
export NETBIRD_ADMIN_EMAIL="${NETBIRD_ADMIN_EMAIL:-}"
|
||||
export NETBIRD_ADMIN_NAME="${NETBIRD_ADMIN_NAME:-}"
|
||||
export NETBIRD_ADMIN_PASSWORD="${NETBIRD_ADMIN_PASSWORD:-}"
|
||||
export NETBIRD_API_TOKEN="${NETBIRD_API_TOKEN:-}"
|
||||
export NETBIRD_SETUP_KEY="${NETBIRD_SETUP_KEY:-}"
|
||||
if [ -n "$input_email" ]; then
|
||||
NETBIRD_LETSENCRYPT_EMAIL="$input_email"
|
||||
fi
|
||||
@@ -80,6 +86,13 @@ case "$machine" in
|
||||
extra+=(-e "netbird_letsencrypt_email=${NETBIRD_LETSENCRYPT_EMAIL}")
|
||||
fi
|
||||
;;
|
||||
opnsense)
|
||||
eval "$(infisical export --domain="${INFISICAL_DOMAIN}" --token="${TOKEN}" --env=prod --projectId="${INFISICAL_PROJECT_ID}" --path="/services/netbird" --format=dotenv-export --silent)"
|
||||
eval "$(infisical export --domain="${INFISICAL_DOMAIN}" --token="${TOKEN}" --env=prod --projectId="${INFISICAL_PROJECT_ID}" --path="/services/opnsense" --format=dotenv-export --silent)"
|
||||
export NETBIRD_SETUP_KEY="${NETBIRD_SETUP_KEY:-}"
|
||||
export OPNSENSE_API_KEY="${OPNSENSE_API_KEY:-}"
|
||||
export OPNSENSE_API_SECRET="${OPNSENSE_API_SECRET:-}"
|
||||
;;
|
||||
esac
|
||||
|
||||
root=$(CDPATH= cd -- "$(dirname "$0")/../.." && pwd)
|
||||
|
||||
Reference in new issue
Block a user