From 8b6a29b442e690eab8d2e9f7b69eab0ae0c798a0 Mon Sep 17 00:00:00 2001 From: Erik Schultink Date: Tue, 10 Feb 2026 13:11:04 -0800 Subject: [PATCH] Update example to v0.5.17 --- check-prereqs | 118 ++++++++++++++++++++++---------------------- google-workspace.tf | 2 +- init | 15 +++--- main.tf | 6 +-- msft-365.tf | 8 +-- 5 files changed, 73 insertions(+), 76 deletions(-) diff --git a/check-prereqs b/check-prereqs index 44cecf1..65a12ef 100755 --- a/check-prereqs +++ b/check-prereqs @@ -7,90 +7,88 @@ printf "See https://github.com/Worklytics/psoxy#prerequisites for more informati HOMEBREW_AVAILABLE=`brew -v &> /dev/null` -RED='\e[0;31m' -BLUE='\e[0;34m' -NC='\e[0m' # No Color +# Source centralized color scheme +source "$(dirname "$0")/set-term-colorscheme.sh" if ! git --version &> /dev/null ; then - printf "${RED}Git not installed.${NC} Not entirely sure how you got here without it, but to install see https://git-scm.com/book/en/v2/Getting-Started-Installing-Git\n" - if $HOMEBREW_AVAILABLE; then printf " or, as you have Homebrew available, run ${BLUE}brew install git${NC}\n"; fi + printf "${ERROR}Git not installed.${NC} Not entirely sure how you got here without it, but to install see https://git-scm.com/book/en/v2/Getting-Started-Installing-Git\n" + if $HOMEBREW_AVAILABLE; then printf " or, as you have Homebrew available, run ${CODE}brew install git${NC}\n"; fi exit 1 fi if ! terraform -v &> /dev/null ; then - printf "${RED}Terraform CLI not available.${NC} Psoxy examples / deployment scripts require it. See ${BLUE}https://developer.hashicorp.com/terraform/downloads${NC} for installation options\n" + printf "${ERROR}Terraform CLI not available.${NC} Psoxy examples / deployment scripts require it. See ${CODE}https://developer.hashicorp.com/terraform/downloads${NC} for installation options\n" exit 1 fi # Check Maven installation if ! mvn -v &> /dev/null ; then - printf "${RED}Maven not installed.${NC} See https://maven.apache.org/install.html\n" - if $HOMEBREW_AVAILABLE; then printf " or, as you have Homebrew available, run ${BLUE}brew install maven${NC}\n"; fi - exit 1 -fi - - -MVN_VERSION=`mvn -v | grep "Apache Maven"` -MVN_VERSION_MAJOR_MINOR=$(echo $MVN_VERSION | sed -n 's/^Apache Maven \([0-9]*\.[0-9]*\).*$/\1/p') -printf "Your Maven version is ${BLUE}${MVN_VERSION}${NC}.\n" - -# Parse Maven version components -MVN_MAJOR=$(echo "$MVN_VERSION_MAJOR_MINOR" | cut -d. -f1) -MVN_MINOR=$(echo "$MVN_VERSION_MAJOR_MINOR" | cut -d. -f2) -if (( MVN_MAJOR < 3 || (MVN_MAJOR == 3 && MVN_MINOR < 6) )); then - printf "${RED}This Maven version appears to be unsupported.${NC} Psoxy requires a supported version of Maven 3.6 or later.\n" - printf "We recommend you upgrade. See https://maven.apache.org/install.html\n" - printf "Maven is used to build the package that will be deployed to your host platform as an AWS lambda or a GCP Cloud Function\n" -fi - -printf "\n" - -# Check Java installation + printf "${WARNING}Maven not installed.${NC} It is REQUIRED unless you will use a pre-built JAR. To install, see https://maven.apache.org/install.html\n" + if $HOMEBREW_AVAILABLE; then printf " or, as you have Homebrew available, run ${CODE}brew install maven${NC}\n"; fi + printf " (Using a prebuilt jar requires adding ${CODE}deployment_bundle=""${NC} to your ${CODE}terraform.tfvars${NC} file, and filling with s3/gcs uri for your desired JAR)\n" +else + MVN_VERSION=`mvn -v | grep "Apache Maven"` + MVN_VERSION_MAJOR_MINOR=$(echo $MVN_VERSION | sed -n 's/^Apache Maven \([0-9]*\.[0-9]*\).*$/\1/p') + printf "Your Maven version is ${CODE}${MVN_VERSION}${NC}.\n" + + # Parse Maven version components + MVN_MAJOR=$(echo "$MVN_VERSION_MAJOR_MINOR" | cut -d. -f1) + MVN_MINOR=$(echo "$MVN_VERSION_MAJOR_MINOR" | cut -d. -f2) + if (( MVN_MAJOR < 3 || (MVN_MAJOR == 3 && MVN_MINOR < 6) )); then + printf "${ERROR}This Maven version appears to be unsupported.${NC} Psoxy requires a supported version of Maven 3.6 or later.\n" + printf "We recommend you upgrade. See https://maven.apache.org/install.html\n" + printf "Maven is used to build the package that will be deployed to your host platform as an AWS lambda or a GCP Cloud Function\n" + fi -JAVA_VERSION=`mvn -v | grep Java` -JAVA_VERSION_MAJOR=$(echo $JAVA_VERSION | sed -n 's/^Java version: \([0-9]*\).*/\1/p') + printf "\n" -printf "Your Maven installation uses ${BLUE}${JAVA_VERSION}${NC}.\n" + # Check Java installation + JAVA_VERSION=`mvn -v | grep Java` + JAVA_VERSION_MAJOR=$(echo $JAVA_VERSION | sed -n 's/^Java version: \([0-9]*\).*/\1/p') -if [[ "$JAVA_VERSION_MAJOR" != 17 && "$JAVA_VERSION_MAJOR" != 21 && "$JAVA_VERSION_MAJOR" != 23 && "$JAVA_VERSION_MAJOR" != 24 ]]; then - printf "${RED}This Java version appears to be unsupported. You should upgrade it, or may have compile errors.${NC} Psoxy requires an Oracle-supported version of Java 17 or later; as of April 2025, this includes Java 17, 21, or 24. See https://maven.apache.org/install.html\n" - if $HOMEBREW_AVAILABLE; then printf "or as you have Homebrew available, run ${BLUE}brew install openjdk@17${NC}\n"; fi - printf "If you have an alternative JDK installed, then you must update your ${BLUE}JAVA_HOME${NC} environment variable to point to it.\n" -fi + printf "Your Maven installation uses ${CODE}${JAVA_VERSION}${NC}.\n" -printf "\n" + if [[ "$JAVA_VERSION_MAJOR" != 17 && "$JAVA_VERSION_MAJOR" != 21 && "$JAVA_VERSION_MAJOR" != 23 && "$JAVA_VERSION_MAJOR" != 24 ]]; then + printf "${ERROR}This Java version appears to be unsupported. You should upgrade it, or may have compile errors.${NC} Psoxy requires an Oracle-supported version of Java 17 or later; as of April 2025, this includes Java 17, 21, or 24. See https://maven.apache.org/install.html\n" + if $HOMEBREW_AVAILABLE; then printf "or as you have Homebrew available, run ${CODE}brew install openjdk@17${NC}\n"; fi + printf "If you have an alternative JDK installed, then you must update your ${CODE}JAVA_HOME${NC} environment variable to point to it.\n" + fi -# if java > 23, then mvn must be 3.9.10+ -if (( JAVA_VERSION_MAJOR > 23 )); then - # Parse full Maven version for patch comparison - MVN_VERSION_FULL=$(echo "$MVN_VERSION" | sed -n 's/^Apache Maven \([0-9]*\.[0-9]*\.[0-9]*\).*$/\1/p') - MVN_PATCH=$(echo "$MVN_VERSION_FULL" | cut -d. -f3) - if (( MVN_MAJOR < 3 || (MVN_MAJOR == 3 && MVN_MINOR < 9) || (MVN_MAJOR == 3 && MVN_MINOR == 9 && MVN_PATCH < 10) )); then - printf "${RED}Maven < 3.9.10 has compatibility issues with Java 24.${NC} If you're using Java 24, psoxy will NOT build correctly unless you upgrade Maven to 3.9.10 or later.\n" - printf "See https://maven.apache.org/install.html\n" + printf "\n" + + # if java > 23, then mvn must be 3.9.10+ + if (( JAVA_VERSION_MAJOR > 23 )); then + # Parse full Maven version for patch comparison + MVN_VERSION_FULL=$(echo "$MVN_VERSION" | sed -n 's/^Apache Maven \([0-9]*\.[0-9]*\.[0-9]*\).*$/\1/p') + MVN_PATCH=$(echo "$MVN_VERSION_FULL" | cut -d. -f3) + if (( MVN_MAJOR < 3 || (MVN_MAJOR == 3 && MVN_MINOR < 9) || (MVN_MAJOR == 3 && MVN_MINOR == 9 && MVN_PATCH < 10) )); then + printf "${ERROR}Maven < 3.9.10 has compatibility issues with Java 24.${NC} If you're using Java 24, psoxy will NOT build correctly unless you upgrade Maven to 3.9.10 or later.\n" + printf "See https://maven.apache.org/install.html\n" + fi fi + + printf "\n" fi -printf "\n" # Check NPM installation if ! npm -v &> /dev/null ; then - printf "${RED}NodeJS (node) and Node Package Manager (npm) are not installed but are required for the local test tooling to work. ${NC} While this is optional, we recommend you install them to be able to test your instances. See https://nodejs.org/\n" - if $HOMEBREW_AVAILABLE; then printf " or, as you have Homebrew available, run ${BLUE}brew install node${NC}\n"; fi + printf "${WARNING}NodeJS (node) and Node Package Manager (npm) are not installed but are required for the local test tooling to work. ${NC} While this is optional, we recommend you install them to be able to test your instances. See https://nodejs.org/\n" + if $HOMEBREW_AVAILABLE; then printf " or, as you have Homebrew available, run ${CODE}brew install node${NC}\n"; fi fi # Check AWS installation AWSCLI_REASON="Required if deploying to AWS." if ! aws --version &> /dev/null ; then - printf "${RED}AWS CLI is not installed.${NC} ${AWSCLI_REASON} See https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html\n" - if $HOMEBREW_AVAILABLE; then printf " or, as you have Homebrew available, run ${BLUE}brew install awscli${NC}\n"; fi + printf "${ERROR}AWS CLI is not installed.${NC} ${AWSCLI_REASON} See https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html\n" + if $HOMEBREW_AVAILABLE; then printf " or, as you have Homebrew available, run ${CODE}brew install awscli${NC}\n"; fi else - printf "AWS CLI version ${BLUE}`aws --version`${NC} is installed.\n" + printf "AWS CLI version ${CODE}`aws --version`${NC} is installed.\n" printf "" - printf "\t- make sure ${BLUE}aws sts get-caller-identity${NC} returns the user/role/account you expect. $AWSCLI_REASON\n" + printf "\t- make sure ${CODE}aws sts get-caller-identity${NC} returns the user/role/account you expect. $AWSCLI_REASON\n" fi printf "\n" @@ -98,11 +96,11 @@ printf "\n" # Check GCloud CLI installation GCLOUD_REASON="Required if deploying to GCP or using Google Workspace data sources." if ! gcloud --version &> /dev/null ; then - printf "${RED}Google Cloud SDK is not installed.${NC} ${GCLOUD_REASON} See https://cloud.google.com/sdk/docs/install\n" - if $HOMEBREW_AVAILABLE; then printf " or, as you have Homebrew available, run ${BLUE}brew install --cask google-cloud-sdk${NC}\n"; fi + printf "${ERROR}Google Cloud SDK is not installed.${NC} ${GCLOUD_REASON} See https://cloud.google.com/sdk/docs/install\n" + if $HOMEBREW_AVAILABLE; then printf " or, as you have Homebrew available, run ${CODE}brew install --cask google-cloud-sdk${NC}\n"; fi else - printf "Google Cloud SDK version ${BLUE}`gcloud --version 2> /dev/null | head -n 1`${NC} is installed.\n" - printf "\t- make sure ${BLUE}gcloud auth list --filter=\"status:ACTIVE\"${NC} returns the account you expect. $GCLOUD_REASON\n" + printf "Google Cloud SDK version ${CODE}`gcloud --version 2> /dev/null | head -n 1`${NC} is installed.\n" + printf "\t- make sure ${CODE}gcloud auth list --filter=\"status:ACTIVE\"${NC} returns the account you expect. $GCLOUD_REASON\n" fi printf "\n" @@ -110,11 +108,11 @@ printf "\n" # Check Azure CLI installation AZCLI_REASON="Required if deploying to Azure or using Microsoft 365 data sources." if ! az --version &> /dev/null ; then - printf "${RED}Azure CLI is not installed.${NC} ${AZCLI_REASON} See https://docs.microsoft.com/en-us/cli/azure/install-azure-cli\n" - if $HOMEBREW_AVAILABLE; then printf " or, as you have Homebrew available, run ${BLUE}brew install azure-cli${NC}\n"; fi + printf "${ERROR}Azure CLI is not installed.${NC} ${AZCLI_REASON} See https://docs.microsoft.com/en-us/cli/azure/install-azure-cli\n" + if $HOMEBREW_AVAILABLE; then printf " or, as you have Homebrew available, run ${CODE}brew install azure-cli${NC}\n"; fi else # how can pipe to sed or something to strip extra whitespace out? - printf "Azure CLI version ${BLUE}`az --version --only-show-errors | head -n 1`${NC} is installed.\n" - printf "\t- make sure ${BLUE}az account show${NC} is the user/tenant you expect. If not, ${BLUE}az login --allow-no-subscription${NC} to authenticate. $AZCLI_REASON\n" + printf "Azure CLI version ${CODE}`az --version --only-show-errors | head -n 1`${NC} is installed.\n" + printf "\t- make sure ${CODE}az account show${NC} is the user/tenant you expect. If not, ${CODE}az login --allow-no-subscription${NC} to authenticate. $AZCLI_REASON\n" fi diff --git a/google-workspace.tf b/google-workspace.tf index a3bc6c3..ffad333 100644 --- a/google-workspace.tf +++ b/google-workspace.tf @@ -7,7 +7,7 @@ provider "google" { module "worklytics_connectors_google_workspace" { - source = "git::https://github.com/worklytics/psoxy//infra/modules/worklytics-connectors-google-workspace?ref=v0.5.16" + source = "git::https://github.com/worklytics/psoxy//infra/modules/worklytics-connectors-google-workspace?ref=v0.5.17" providers = { diff --git a/init b/init index 0cdf248..0f46815 100755 --- a/init +++ b/init @@ -24,9 +24,8 @@ # ../../../tools/reset-example.sh # colors -RED='\e[0;31m' -BLUE='\e[0;34m' -NC='\e[0m' # No Color +# Source centralized color scheme +source "$(dirname "$0")/set-term-colorscheme.sh" EXPLICIT_REPO_CLONE_DIR=$1 @@ -34,17 +33,17 @@ EXPLICIT_REPO_CLONE_DIR=$1 TF_CONFIG_ROOT=`pwd` if ! terraform -v &> /dev/null ; then - printf "${RED}Terraform not available; required for this Psoxy example. See https://github.com/Worklytics/psoxy#prerequisites ${NC}\n" + printf "${ERROR}Terraform not available; required for this Psoxy example. See https://github.com/Worklytics/psoxy#prerequisites ${NC}\n" exit 1 fi # initialize terraform, which downloads dependencies into `.terraform` directory -printf "Initializing ${BLUE}psoxy${NC} Terraform configuration ...\n" +printf "Initializing ${CODE}psoxy${NC} Terraform configuration ...\n" terraform init TF_INIT_EXIT_CODE=$? if [[ $TF_INIT_EXIT_CODE -ne 0 ]]; then - printf "${RED}Terraform init failed. See above for details. Cannot continue to initialize example configuration.${NC}\n" + printf "${ERROR}Terraform init failed. See above for details. Cannot continue to initialize example configuration.${NC}\n" exit 1 fi @@ -53,9 +52,9 @@ if [[ -z "$EXPLICIT_REPO_CLONE_DIR" ]]; then if [[ -d ".terraform/modules/psoxy/" ]]; then REPO_CLONE_BASE_DIR=".terraform/modules/psoxy/" else - printf "${RED}No explicit path to repo clone provided, and 'psoxy' module in Terraform configuration.${NC}\n" + printf "${ERROR}No explicit path to repo clone provided, and 'psoxy' module in Terraform configuration.${NC}\n" printf "Try running this script with a Terraform module named 'psoxy' that references to GitHub repo https://github.com/Worklytics/psoxy, or pass the path to a clone of that as the first argument to the script.\n" - printf " eg ${BLUE}./init ~/code/psoxy${NC}\n" + printf " eg ${CODE}./init ~/code/psoxy${NC}\n" exit 1 fi else diff --git a/main.tf b/main.tf index f1d4a20..91365a3 100644 --- a/main.tf +++ b/main.tf @@ -20,7 +20,7 @@ terraform { # general cases module "worklytics_connectors" { - source = "git::https://github.com/worklytics/psoxy//infra/modules/worklytics-connectors?ref=v0.5.16" + source = "git::https://github.com/worklytics/psoxy//infra/modules/worklytics-connectors?ref=v0.5.17" enabled_connectors = var.enabled_connectors chat_gpt_enterprise_example_workspace_id = var.chat_gpt_enterprise_example_workspace_id @@ -103,7 +103,7 @@ locals { } module "psoxy" { - source = "git::https://github.com/worklytics/psoxy//infra/modules/aws-host?ref=v0.5.16" + source = "git::https://github.com/worklytics/psoxy//infra/modules/aws-host?ref=v0.5.17" environment_name = var.environment_name aws_account_id = var.aws_account_id @@ -176,7 +176,7 @@ locals { module "connection_in_worklytics" { for_each = local.all_instances - source = "git::https://github.com/worklytics/psoxy//infra/modules/worklytics-psoxy-connection-aws?ref=v0.5.16" + source = "git::https://github.com/worklytics/psoxy//infra/modules/worklytics-psoxy-connection-aws?ref=v0.5.17" proxy_instance_id = each.key worklytics_host = var.worklytics_host diff --git a/msft-365.tf b/msft-365.tf index 92d6723..909e28d 100644 --- a/msft-365.tf +++ b/msft-365.tf @@ -1,7 +1,7 @@ # BEGIN MSFT module "worklytics_connectors_msft_365" { - source = "git::https://github.com/worklytics/psoxy//infra/modules/worklytics-connectors-msft-365?ref=v0.5.16" + source = "git::https://github.com/worklytics/psoxy//infra/modules/worklytics-connectors-msft-365?ref=v0.5.17" enabled_connectors = var.enabled_connectors @@ -47,7 +47,7 @@ data "aws_region" "current" { module "cognito_identity_pool" { count = local.msft_365_enabled ? 1 : 0 # only provision identity pool if MSFT-365 connectors are enabled - source = "git::https://github.com/worklytics/psoxy//infra/modules/aws-cognito-pool?ref=v0.5.16" + source = "git::https://github.com/worklytics/psoxy//infra/modules/aws-cognito-pool?ref=v0.5.17" developer_provider_name = local.developer_provider_name name = "${local.env_qualifier}-azure-ad-federation" @@ -69,7 +69,7 @@ locals { module "cognito_identity" { count = local.msft_365_enabled ? 1 : 0 # only provision identity pool if MSFT-365 connectors are enabled - source = "git::https://github.com/worklytics/psoxy//infra/modules/aws-cognito-identity-cli?ref=v0.5.16" + source = "git::https://github.com/worklytics/psoxy//infra/modules/aws-cognito-identity-cli?ref=v0.5.17" aws_region = data.aws_region.current.id @@ -106,7 +106,7 @@ locals { module "msft_connection_auth_federation" { for_each = local.provision_entraid_apps ? local.enabled_to_entraid_object : local.shared_to_entraid_object - source = "git::https://github.com/worklytics/psoxy//infra/modules/azuread-federated-credentials?ref=v0.5.16" + source = "git::https://github.com/worklytics/psoxy//infra/modules/azuread-federated-credentials?ref=v0.5.17" application_id = each.value.connector_id display_name = "${local.env_qualifier}AccessFromAWS"