Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix router config overwrite on docker compose up #1296

Merged
merged 3 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@

## Component Updates and Bug Fixes


* github.com/openziti/ziti: [v0.30.3 -> v0.30.4](https://github.com/openziti/ziti/compare/v0.30.3...v0.30.4)
* Fixed an issue causing router configs to be rewritten when docker compose was brought up with existing configs

# Release 0.30.3

Expand Down
11 changes: 5 additions & 6 deletions quickstart/docker/image/run-router.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ if [[ "${_ZITI_ROUTER_NAME}" != "" ]]; then
export ZITI_ROUTER_NAME="${_ZITI_ROUTER_NAME}"
echo "ZITI_ROUTER_NAME set to: ${ZITI_ROUTER_NAME}"
fi
_UNIQUE_NAME="${ZITI_HOME}/${ZITI_ROUTER_NAME}-${HOSTNAME}.init"
if [ ! -f "${_UNIQUE_NAME}" ]; then
echo "system has not been initialized. initializing..."

_CONFIG_PATH="${ZITI_HOME}/${ZITI_ROUTER_NAME}.yaml"
if [ ! -f "${_CONFIG_PATH}" ]; then
echo "config has not been generated, generating config..."
"${ZITI_BIN_DIR-}/ziti" edge login ${ZITI_CTRL_EDGE_ADVERTISED_ADDRESS}:${ZITI_CTRL_EDGE_ADVERTISED_PORT} -u $ZITI_USER -p $ZITI_PWD -y

echo "---------- Creating edge-router ${ZITI_ROUTER_NAME}...."
Expand Down Expand Up @@ -64,10 +65,8 @@ if [ ! -f "${_UNIQUE_NAME}" ]; then
"${ZITI_BIN_DIR}/ziti" router enroll "${ZITI_HOME}/${ZITI_ROUTER_NAME}.yaml" --jwt "${ZITI_HOME}/${ZITI_ROUTER_NAME}.jwt"
echo ""
fi
echo "system initialized. writing marker file"
echo "system initialized" > "${_UNIQUE_NAME}"
else
echo "system has been initialized. starting the process."
echo " Found existing config file ${_CONFIG_PATH}, not creating a new config."
fi

unset ZITI_USER
Expand Down
2 changes: 1 addition & 1 deletion ziti/cmd/pki/pki_create_ca.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func (o *PKICreateCAOptions) Run() error {
//default name, ensure uniqueness by adding a random id
o.Flags.CAName = o.Flags.CAName + " " + idgen.New()
}

commonName := o.Flags.CAName

filename := o.ObtainFileName(caFile, commonName)
Expand Down
Loading