Merge branch 'main' into x-forwarded-for

This commit is contained in:
Michael Quigley 2024-05-13 11:51:43 -04:00
commit f47785b58a
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62
5 changed files with 96 additions and 4 deletions

View File

@ -41,13 +41,13 @@ jobs:
run: echo ::set-output name=TAG::$(git describe --tags --abbrev=0) run: echo ::set-output name=TAG::$(git describe --tags --abbrev=0)
- name: Update zrok NodeJS-SDK's package.json version based on current zrok repo git tag - name: Update zrok NodeJS-SDK's package.json version based on current zrok repo git tag
if: github.ref == 'refs/heads/main' if: github.ref_type == 'tag'
run: | run: |
cd ${{ runner.workspace }}/${{ github.event.repository.name }}/sdk/nodejs/sdk cd ${{ runner.workspace }}/${{ github.event.repository.name }}/sdk/nodejs/sdk
npm version ${{ steps.tag.outputs.TAG }} --no-git-tag-version --allow-same-version npm version ${{ steps.tag.outputs.TAG }} --no-git-tag-version --allow-same-version
- name: Setup .npmrc - name: Setup .npmrc
if: github.ref == 'refs/heads/main' if: github.ref_type == 'tag'
# Setup .npmrc file to prepare for possible publish to npm # Setup .npmrc file to prepare for possible publish to npm
uses: actions/setup-node@v1 uses: actions/setup-node@v1
with: with:

View File

@ -1,5 +1,13 @@
# CHANGELOG # CHANGELOG
## v0.4.30
FIX: Fix to the Node.js release process to properly support releasing on a tag.
## v0.4.29
FIX: Backed out an incorrect change to support a FreeBSD port in progress.
## v0.4.28 ## v0.4.28
FEATURE: Node.js support for the zrok SDK (https://github.com/openziti/zrok/issues/400) FEATURE: Node.js support for the zrok SDK (https://github.com/openziti/zrok/issues/400)

View File

@ -11,12 +11,21 @@ http:// {
*.{$ZROK_DNS_ZONE} { *.{$ZROK_DNS_ZONE} {
tls { tls {
dns {$CADDY_DNS_PLUGIN} {$CADDY_DNS_PLUGIN_TOKEN} dns {$CADDY_DNS_PLUGIN} {$CADDY_DNS_PLUGIN_TOKEN}
propagation_timeout 60m
} }
log { log {
output stdout output stdout
format console format console
level DEBUG level INFO
}
# ziti administration console uses :443 for the benefit of a web UI cert and accesses the ziti edge-management API
@ziti host ziti.{$ZROK_DNS_ZONE}
reverse_proxy @ziti ziti-quickstart:{$ZITI_CTRL_ADVERTISED_PORT:1280} {
transport http {
tls_insecure_skip_verify
}
} }
@oauth host oauth.{$ZROK_DNS_ZONE} @oauth host oauth.{$ZROK_DNS_ZONE}

View File

@ -5,6 +5,17 @@ set -o nounset
set -o pipefail set -o pipefail
# set -o xtrace # set -o xtrace
_usage(){
if (( $# )); then
echo -e "\nERROR: unexpected arg '$1'" >&2
fi
echo -e "\n Usage:\n"\
" fetch.bash\n"\
"\n Options:\n"\
" --quiet\t\tsuppress INFO messages\n"\
" --verbose\t\tshow DEBUG messages\n"
}
requireBashVersion() { requireBashVersion() {
if (( "${BASH_VERSION%%.*}" < 4 )); then if (( "${BASH_VERSION%%.*}" < 4 )); then
echo "This script requires Bash major version 4 or greater." echo "This script requires Bash major version 4 or greater."
@ -13,6 +24,51 @@ requireBashVersion() {
fi fi
} }
logger() {
local caller="${FUNCNAME[1]}"
if (( $# < 1 )); then
echo "ERROR: $caller() takes 1 or more args" >&2
return 1
fi
local message="$*"
if [[ "$message" =~ ^r\'(.+)\'$ ]]; then
raw_message="${BASH_REMATCH[1]}"
message="$raw_message"
fi
caller_level="${caller##log}"
if (( DEBUG )); then
line="${caller_level^^} ${FUNCNAME[2]}:${BASH_LINENO[1]}: $message"
else
line="${caller_level^^} $message"
fi
if [[ -n "${raw_message-}" ]]; then
echo -E "$line"
else
echo -e "$line"
fi
}
logInfo() {
logger "$*"
}
logWarn() {
logger "$*" >&2
}
logError() {
logger "$*" >&2
}
logDebug() {
logger "$*" >&3
}
fetchFile() { fetchFile() {
local url="${1}" local url="${1}"
@ -68,7 +124,25 @@ setWorkingDir() {
} }
main() { main() {
requireBashVersion : "${DEBUG:=0}"
while (( $# )); do
case "$1" in
-q|--quiet) exec > /dev/null
shift
;;
-v|--verbose)
DEBUG=1
exec 3>&1
shift
;;
-h|*help) _usage
exit 0
;;
*) _usage "$1"
exit
;;
esac
done
declare -a BINS=(unzip find) declare -a BINS=(unzip find)
for BIN in "${BINS[@]}"; do for BIN in "${BINS[@]}"; do
requireCommand "$BIN" requireCommand "$BIN"
@ -82,4 +156,5 @@ main() {
rm zrok.zip .gitignore fetch.bash rm zrok.zip .gitignore fetch.bash
} }
requireBashVersion
main "${@}" main "${@}"