Skip to content

Commit

Permalink
experiment with bootstrap killswitch
Browse files Browse the repository at this point in the history
  • Loading branch information
qrkourier committed Jun 30, 2024
1 parent ab02127 commit d056ae1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 6 additions & 1 deletion dist/dist-packages/linux/openziti-controller/bootstrap.bash
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,11 @@ exportZitiVars() {

bootstrap() {

if [[ "${ZITI_BOOTSTRAP:-}" != true ]]; then
echo "WARN: not checking or generating a config because ZITI_BOOTSTRAP is not set to 'true'" >&2
return 0
fi

if [[ -n "${1:-}" ]]; then
local _ctrl_config_file="${1}"
echo "DEBUG: using config: $(realpath "${_ctrl_config_file}")" >&3
Expand Down Expand Up @@ -553,7 +558,7 @@ if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
set -- "${ZITI_HOME}/config.yml"
fi

if bootstrap "${@}"
if ZITI_BOOTSTRAP=true bootstrap "${@}"
then
finalizeWorkingDir "${ZITI_HOME}"
setAnswer "ZITI_PWD=" "${SVC_ENV_FILE}" "${BOOT_ENV_FILE}"
Expand Down
4 changes: 3 additions & 1 deletion dist/dist-packages/linux/openziti-controller/entrypoint.bash
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/usr/bin/env bash
#
# this thin wrapper script for the OpenZiti Controller uses variable assignments from the systemd env file
# This thin wrapper for the OpenZiti Controller is used by the systemd service and Docker container to call the bootstrap() function before invoking ziti. The bootstrap() function will exit 0 immediately if ZITI_BOOTSTRAP is not set to true. Otherwise, it will
#
# usage:
# entrypoint.bash run config.yml

set -o errexit
set -o nounset
Expand Down

0 comments on commit d056ae1

Please sign in to comment.