This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import os | |
import sys | |
import argparse | |
import requests | |
from urllib.parse import urljoin, quote | |
import base64 | |
import hashlib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
printf 'Open\tSock\tUnix\tFile\tCommand\n' | |
for CMD in 'ziti router run' 'ziti controller run' 'ziti-edge-tunnel run' | |
do | |
for PID in $(pgrep -f "$CMD") | |
do | |
# Capture lsof output for the process | |
lsof_output=$(sudo lsof -Pnp "$PID" 2>/dev/null) | |
# Total open files | |
total_open=$(echo "$lsof_output" | wc -l) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# this one-shot script demonstrates how to use a ziti router as a transparent proxy sidecar | |
set -o errexit -o nounset -o pipefail #-o xtrace | |
function cleanup() { | |
if ! (( I_AM_ROBOT )) | |
then | |
echo "WARNING: destroying docker volumes in 30s; set I_AM_ROBOT=1 to suppress this message" >&2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zrok(){ | |
if [[ "$1" =~ ^(-p|--profile)$ ]] | |
then | |
shift | |
local profile="$1" | |
shift | |
else | |
/usr/bin/zrok ${@} | |
return $? | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM openziti/ziti-cli AS ziti-cli | |
FROM ubuntu | |
COPY --from=ziti-cli /usr/local/bin/ziti /usr/local/bin/ziti | |
RUN apt-get update && apt-get install --yes \ | |
nano \ | |
vim \ | |
iputils-ping \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
_gen_ula(){ | |
# Generate a 40-bit random global ID | |
local random_id | |
random_id=$(od -An -N5 -tx1 /dev/urandom | xxd -p | tr -d '\n') | |
# Construct the ULA address prefix with the generated global ID | |
local ula_prefix="fd${random_id:0:2}:${random_id:2:4}:${random_id:6:4}" | |
echo "${ula_prefix}::1" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -o errexit | |
set -o nounset | |
set -o pipefail | |
exec 3>/dev/null # suppress debug on 3 | |
exec 4>&1; exec 1>/dev/null # stash stdout on 4 | |
declare -a ARTIFACTS=(openziti{-{controller,router},}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -o errexit | |
set -o nounset | |
set -o pipefail | |
set -o xtrace | |
get(){ | |
local target=$1 | |
local arch=$2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(set -euxopipefail | |
GOOD_VERSION=1.0.0 | |
for REPO in ziti-{cli,controller,router}; do | |
docker buildx imagetools create --tag openziti/${REPO}:latest openziti/${REPO}:${GOOD_VERSION} | |
done | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( | |
set -euxopipefail | |
ARTIFACTORY_REPO='zitipax-openziti-(rpm|deb)-stable' | |
DELETE="--dry-run" | |
: DELETE="--quiet" | |
BAD_VERSION=1.1.8 | |
declare -a ARTIFACTS=(openziti{,-controller,-router}) |
NewerOlder