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

Porting in features from Den #666

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
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
13 changes: 11 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
# Change Log

<!--
## UNRELEASED [x.y.z](https://github.com/davidalger/warden/tree/x.y.z) (yyyy-mm-dd)
[All Commits](https://github.com/davidalger/warden/compare/0.13.1..develop)
-->


**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)

Expand Down
11 changes: 11 additions & 0 deletions commands/install.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion commands/sign-certificate.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion commands/status.help
Original file line number Diff line number Diff line change
@@ -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"
WARDEN_USAGE="Provides listing of projects that are currently running that Warden has been used to start"
4 changes: 4 additions & 0 deletions utils/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down