diff --git a/CHANGELOG.md b/CHANGELOG.md index 05c90d7b..d3e52cda 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,18 @@ # Change Log - + + +**Enhancements** +* `warden status` command ported from Den. Originally created by @bap14 ([swiftotter/den#94](https://github.com/swiftotter/den/pull/94)) +* Simplified Traefik check. Originally created by @bap14 ([swiftotter/den#88](https://github.com/swiftotter/den/pull/88)) + +**Migration-related** +* Den signed certificates will automatically be signed for Warden when running `warden install` +* `warden install` will now change the tunnel from using the Den certificate to the Warden certificate automatically +* Both features based heavily on the work of @ihor-sviziev ([swiftotter/den#33](https://github.com/swiftotter/den/pull/33) & [swiftotter/den#44](https://github.com/swiftotter/den/pull/44)) + ## Version [0.14.0](https://github.com/wardenenv/warden/tree/0.14.0) (2023-06-19) [All Commits](https://github.com/wardenenv/warden/compare/0.13.1..0.14.0) diff --git a/commands/install.cmd b/commands/install.cmd index 2034a92e..07bec831 100644 --- a/commands/install.cmd +++ b/commands/install.cmd @@ -51,6 +51,17 @@ then -k /Library/Keychains/System.keychain "${WARDEN_SSL_DIR}/rootca/certs/ca.cert.pem" fi +if [[ -d ~/.den/ssl/certs/ ]]; then + domains_to_generate="$(diff -B <(ls ~/.warden/ssl/certs/ | grep .key.pem | sed 's/.key.pem//' | grep -v den.test) <(ls ~/.den/ssl/certs/ | grep .key.pem | sed 's/.key.pem//' | grep -v den.test) | grep '^>' | sed 's/^>\ //')" + if [[ -n "$domains_to_generate" ]]; then + echo "Generating certificates present in Den..." + + echo "$domains_to_generate" | while read i; do + warden sign-certificate "$i" + done + fi +fi + ## configure resolver for .test domains on Mac OS only as Linux lacks support ## for BSD like per-TLD configuration as is done at /etc/resolver/test on Mac if [[ "$OSTYPE" == "darwin"* ]]; then diff --git a/commands/sign-certificate.cmd b/commands/sign-certificate.cmd index 32f500b4..44fed6b5 100644 --- a/commands/sign-certificate.cmd +++ b/commands/sign-certificate.cmd @@ -51,7 +51,7 @@ openssl x509 -req -days 365 -sha256 -extensions v3_req \ -in "${WARDEN_SSL_DIR}/certs/${CERTIFICATE_NAME}.csr.pem" \ -out "${WARDEN_SSL_DIR}/certs/${CERTIFICATE_NAME}.crt.pem" -if [[ "$(cd "${WARDEN_HOME_DIR}" && ${DOCKER_COMPOSE_COMMAND} -p warden -f "${WARDEN_DIR}/docker/docker-compose.yml" ps -q traefik)" ]] +if [[ "$("$WARDEN_BIN" svc ps -q traefik)" ]] then echo "==> Updating traefik" "$WARDEN_BIN" svc up traefik diff --git a/commands/status.help b/commands/status.help index 5c1c2002..280a8c08 100644 --- a/commands/status.help +++ b/commands/status.help @@ -1,4 +1,4 @@ #!/usr/bin/env bash [[ ! ${WARDEN_DIR} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!\033[0m" && exit 1 -WARDEN_USAGE="Provides listing of projects that are currently running that Warden has been used to start" \ No newline at end of file +WARDEN_USAGE="Provides listing of projects that are currently running that Warden has been used to start" diff --git a/utils/install.sh b/utils/install.sh index dc80e05a..a58e4aa5 100644 --- a/utils/install.sh +++ b/utils/install.sh @@ -17,6 +17,10 @@ function installSshConfig () { ## WARDEN END ## EOT fi + + if grep "${HOME}/.den/tunnel/ssh_key" /etc/ssh/ssh_config >/dev/null; then + sudo sed -i.bak 's/~\/.den/~\/.warden/' /etc/ssh/ssh_config + fi } function assertWardenInstall {