From b20e82b201f21303e15375f76e10a907d9bbe25e Mon Sep 17 00:00:00 2001 From: a-vogel Date: Mon, 14 Oct 2024 09:54:43 +0200 Subject: [PATCH 01/15] Check for accessibility of remote repo --- misty/payload/usr/local/wycomco/misty | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/misty/payload/usr/local/wycomco/misty b/misty/payload/usr/local/wycomco/misty index 942a6ce..1d35a9f 100755 --- a/misty/payload/usr/local/wycomco/misty +++ b/misty/payload/usr/local/wycomco/misty @@ -82,6 +82,10 @@ check_repo() { if [[ "$Is_SMB" == "yes" || "$Is_SMB" == "y" || "$Is_SMB" == "Y" || "$Is_SMB" == "Yes" || "$Is_SMB" == "YES" ]]; then local RepoShare=$(echo "$RepoPath" | awk -F'/' '{print $3}') if ! mount | grep -q "/Volumes/${RepoShare}"; then + if ! ping -q -c2 "${RepoName}" > /dev/null 2>&1; then + log_message "stderr" "Error: Remote repository \"$RepoName\" not accessible, please check." + exit 1 + fi local interval=1 local timeout=30 local elapsed=0 From 2886cfbefb7c947555eea71b6797df5e72054659 Mon Sep 17 00:00:00 2001 From: a-vogel Date: Mon, 14 Oct 2024 10:15:28 +0200 Subject: [PATCH 02/15] Empty line written to launchd log file before exiting --- misty/payload/usr/local/wycomco/misty | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/misty/payload/usr/local/wycomco/misty b/misty/payload/usr/local/wycomco/misty index 942a6ce..6e9729a 100755 --- a/misty/payload/usr/local/wycomco/misty +++ b/misty/payload/usr/local/wycomco/misty @@ -93,6 +93,7 @@ check_repo() { ((elapsed+=interval)) if [ $elapsed -ge $timeout ]; then log_message "stderr" "Repositories' share cannot be mounted within 30 seconds. Exiting ..." + launchd_echo >&2 exit 1 fi done @@ -101,6 +102,7 @@ check_repo() { # 'Elif' loop applicable for locally attached volumes (USB, Thunderbolt) elif [[ ! -d "$RepoPath" ]]; then log_message "stderr" "Error: Repository \"$RepoPath\" not accessible, please check." + launchd_echo >&2 exit 1 fi } @@ -115,17 +117,20 @@ check_space() { local total_required_space=$((repo_required + diskspace_required)) if (( boot_space < total_required_space )); then log_message "stderr" "Less than $total_required_space GB on the boot disk holding both repo and boot volume. Please provide more space." + launchd_echo >&2 exit 1 fi fi if (( repo_space < repo_required )); then log_message "stderr" "Less than $repo_required GB space on repo left. Please provide more space." + launchd_echo >&2 exit 1 fi if (( boot_space < diskspace_required )); then log_message "stderr" "Less than $diskspace_required GB space on boot volume left. Please provide more space." + launchd_echo >&2 exit 1 fi } @@ -218,6 +223,12 @@ get_timestamp() { echo $(date -r "$current_time" +"%Y-%m-%d %H:%M:%S").$milliseconds } +launchd_echo() { + if [[ ! -t 1 ]]; then + echo + fi +} + # Unified logging function log_message() { local log_type="$1" # Either 'stdout' or 'stderr' @@ -439,11 +450,13 @@ fi mist_check=$(which mist) if [ $? -ne 0 ]; then log_message "stderr" "Error: mist not found. Please install mist-cli or put it into the PATH." + launchd_echo >&2 exit 1 fi munkiimport_check=$(which munkiimport) if [ $? -ne 0 ]; then log_message "stderr" "Error: munkiimport not found. Please check your munki installation." + launchd_echo >&2 exit 1 fi if [[ ! -d "$LogPath" ]]; then @@ -452,6 +465,7 @@ if [[ ! -d "$LogPath" ]]; then fi if [[ ! -d "$Template" || ! $(ls -A "$Template") ]]; then log_message "stderr" "Error: The directory \"$Template\" either does not exist or is empty. Please reinstall misty." + launchd_echo >&2 exit 1 fi @@ -653,8 +667,5 @@ fi check_daemon log_message "stdout" "Finished misty run." # Enter an empty line if run as launchd to StandardOutPath -if [[ ! -t 1 ]]; then - echo -fi - +launchd_echo exit 0 From 1d5809d0f5958d4a94cf6653cb00e7938d02dd78 Mon Sep 17 00:00:00 2001 From: a-vogel Date: Mon, 14 Oct 2024 10:44:42 +0200 Subject: [PATCH 03/15] Adjust space requirements for Sequoia --- misty/payload/usr/local/wycomco/misty | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/misty/payload/usr/local/wycomco/misty b/misty/payload/usr/local/wycomco/misty index 942a6ce..d6786ab 100755 --- a/misty/payload/usr/local/wycomco/misty +++ b/misty/payload/usr/local/wycomco/misty @@ -107,7 +107,7 @@ check_repo() { check_space() { local boot_disk=$(df -P "$Base_Path" | awk 'NR==2{print $1}') - local boot_space=$(df -k "$boot_disk" | awk 'NR==2{print int($4 / 1024 / 1024)}') + local boot_space=$(df -k "$Base_Path" | awk 'NR==2{print int($4 / 1024 / 1024)}') local repo_disk=$(df -P "$RepoPath" | awk 'NR==2{print $1}') local repo_space=$(df -k "$RepoPath" | awk 'NR==2{print int($4 / 1024 / 1024)}') @@ -424,8 +424,8 @@ if [[ ! -t 1 ]]; then exec 2> >(while IFS= read -r line; do log_message "stderr" "$line"; done) fi -repo_required=28 # Size required on repo for arm64 and x86_64 installer in GB, needed during creation -diskspace_required=30 # Size required on boot disk for installer and cache in GB +repo_required=30 # Size required on repo for arm64 and x86_64 installer in GB, needed during creation +diskspace_required=32 # Size required on boot disk for installer and cache in GB Base_Path="/var/root/misty" Mist_Path="/Users/Shared/Mist" LogPath="$Base_Path/Logs" From 08b20fd47c641c7ccf3d103f98bc2e99df9ab2d7 Mon Sep 17 00:00:00 2001 From: a-vogel Date: Mon, 14 Oct 2024 10:51:35 +0200 Subject: [PATCH 04/15] Removed already fixed to do --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 249bcec..3bcfe11 100644 --- a/README.md +++ b/README.md @@ -128,7 +128,6 @@ This is a pre-release. It is working, but we have some tasks on our to-do list: - Testing in different environments, preferably with SMB and Samba shares. - Ensure all items that require FDA are mentioned. -- Calculate space requirements based on actual number of available macOS versions - Function `rm_previous_files` states one previous version when no version is available - Improve message output. - Harmonize variable names. From 70ac8dd1e801ddeef71abb75e31585b25caed7e7 Mon Sep 17 00:00:00 2001 From: a-vogel Date: Mon, 14 Oct 2024 11:19:57 +0200 Subject: [PATCH 05/15] launchd_echo call after inaccessibility of remote repo --- misty/payload/usr/local/wycomco/misty | 1 + 1 file changed, 1 insertion(+) diff --git a/misty/payload/usr/local/wycomco/misty b/misty/payload/usr/local/wycomco/misty index 0002383..f2f2bbd 100755 --- a/misty/payload/usr/local/wycomco/misty +++ b/misty/payload/usr/local/wycomco/misty @@ -84,6 +84,7 @@ check_repo() { if ! mount | grep -q "/Volumes/${RepoShare}"; then if ! ping -q -c2 "${RepoName}" > /dev/null 2>&1; then log_message "stderr" "Error: Remote repository \"$RepoName\" not accessible, please check." + launchd_echo >&2 exit 1 fi local interval=1 From ed66daf25840615f73e64dbf31f7afcdb35c34d0 Mon Sep 17 00:00:00 2001 From: a-vogel Date: Mon, 14 Oct 2024 11:27:17 +0200 Subject: [PATCH 06/15] Check daemon before repo --- misty/payload/usr/local/wycomco/misty | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misty/payload/usr/local/wycomco/misty b/misty/payload/usr/local/wycomco/misty index f2f2bbd..15daaad 100755 --- a/misty/payload/usr/local/wycomco/misty +++ b/misty/payload/usr/local/wycomco/misty @@ -559,6 +559,7 @@ if [[ ! -t 1 ]]; then log_message "stdout" "Start of misty run." fi +check_daemon check_repo Repo_uid_gid=$(stat -f "%Su:%Sg" "$RepoPath") @@ -669,7 +670,6 @@ if [[ ( -n "$macos_13" || -n "$macos_14" || -n "$macos_15" ) ]]; then makecatalogs "$RepoPath" | grep 'warning' fi -check_daemon log_message "stdout" "Finished misty run." # Enter an empty line if run as launchd to StandardOutPath launchd_echo From 548c4b7f0f8031cf1d1b32b74ac29ebeb655ce0f Mon Sep 17 00:00:00 2001 From: a-vogel Date: Mon, 14 Oct 2024 12:58:29 +0200 Subject: [PATCH 07/15] Function exit_error --- misty/payload/usr/local/wycomco/misty | 34 +++++++++++++-------------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/misty/payload/usr/local/wycomco/misty b/misty/payload/usr/local/wycomco/misty index 15daaad..3c6a06d 100755 --- a/misty/payload/usr/local/wycomco/misty +++ b/misty/payload/usr/local/wycomco/misty @@ -84,8 +84,7 @@ check_repo() { if ! mount | grep -q "/Volumes/${RepoShare}"; then if ! ping -q -c2 "${RepoName}" > /dev/null 2>&1; then log_message "stderr" "Error: Remote repository \"$RepoName\" not accessible, please check." - launchd_echo >&2 - exit 1 + exit_error fi local interval=1 local timeout=30 @@ -98,8 +97,7 @@ check_repo() { ((elapsed+=interval)) if [ $elapsed -ge $timeout ]; then log_message "stderr" "Repositories' share cannot be mounted within 30 seconds. Exiting ..." - launchd_echo >&2 - exit 1 + exit_error fi done log_message "stdout" "Share ${RepoShare} was mounted." @@ -107,8 +105,7 @@ check_repo() { # 'Elif' loop applicable for locally attached volumes (USB, Thunderbolt) elif [[ ! -d "$RepoPath" ]]; then log_message "stderr" "Error: Repository \"$RepoPath\" not accessible, please check." - launchd_echo >&2 - exit 1 + exit_error fi } @@ -122,21 +119,18 @@ check_space() { local total_required_space=$((repo_required + diskspace_required)) if (( boot_space < total_required_space )); then log_message "stderr" "Less than $total_required_space GB on the boot disk holding both repo and boot volume. Please provide more space." - launchd_echo >&2 - exit 1 + exit_error fi fi if (( repo_space < repo_required )); then log_message "stderr" "Less than $repo_required GB space on repo left. Please provide more space." - launchd_echo >&2 - exit 1 + exit_error fi if (( boot_space < diskspace_required )); then log_message "stderr" "Less than $diskspace_required GB space on boot volume left. Please provide more space." - launchd_echo >&2 - exit 1 + exit_error fi } @@ -197,6 +191,13 @@ download_macos() { fi } +exit_error() { + log_message "stdout" "misty run finished with errors, see \"/var/log/misty.log\" for error messages." + launchd_echo + exit 1 + +} + extract_macos_version() { sed -n 's/.*macOS '"$1"'[^0-9]*\([0-9.]*\).*/\1/p' "$2" | tr -d '[:space:]' } @@ -455,14 +456,12 @@ fi mist_check=$(which mist) if [ $? -ne 0 ]; then log_message "stderr" "Error: mist not found. Please install mist-cli or put it into the PATH." - launchd_echo >&2 - exit 1 + exit_error fi munkiimport_check=$(which munkiimport) if [ $? -ne 0 ]; then log_message "stderr" "Error: munkiimport not found. Please check your munki installation." - launchd_echo >&2 - exit 1 + exit_error fi if [[ ! -d "$LogPath" ]]; then mkdir -p "$LogPath" @@ -470,8 +469,7 @@ if [[ ! -d "$LogPath" ]]; then fi if [[ ! -d "$Template" || ! $(ls -A "$Template") ]]; then log_message "stderr" "Error: The directory \"$Template\" either does not exist or is empty. Please reinstall misty." - launchd_echo >&2 - exit 1 + exit_error fi ################################################################################ From d017b7e72411418c016fbc7ba166f4a6ea14ca3e Mon Sep 17 00:00:00 2001 From: a-vogel Date: Mon, 14 Oct 2024 17:16:09 +0200 Subject: [PATCH 08/15] Create workflow for signed and notarized installer --- misty/build-info.plist | 14 ++++++++++++++ mk_misty | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100755 mk_misty diff --git a/misty/build-info.plist b/misty/build-info.plist index c44bf02..6b092a7 100644 --- a/misty/build-info.plist +++ b/misty/build-info.plist @@ -10,12 +10,26 @@ / name misty-${version}.pkg + notarization_info + + asc_provider + wycomcoGmbH + keychain_profile + WYC_AC_PASSWORD + stapler_timeout + 600 + ownership recommended postinstall_action none preserve_xattr + signing_info + + identity + Developer ID Installer: wycomco GmbH (CD4727XSC2) + suppress_bundle_relocation version diff --git a/mk_misty b/mk_misty new file mode 100755 index 0000000..db5cf3c --- /dev/null +++ b/mk_misty @@ -0,0 +1,36 @@ +#!/bin/zsh + +REPO_URL="https://github.com/wycomco/misty.git" +TMP_DIR="/var/tmp/misty_pkgbuild" +ORIGINAL_DIR=$(pwd) + +if [ -d "$TMP_DIR" ]; then + echo "Found previously cloned repo in $TMP_DIR, deleting ..." + rm -rf "$TMP_DIR" +fi + +git clone "$REPO_URL" "$TMP_DIR" +if [ $? -ne 0 ]; then + echo "Failed to clone repository." + exit 1 +fi + +cd "$TMP_DIR" || { echo "Failed to cd into $TMP_DIR"; exit 1; } + +#VERSION=$(git describe --tags --abbrev=0) +#echo "Current version of misty is $VERSION" +#echo "Replacing version in build-info.plist..." +#sed -E -i '' "s/[0-9]+.[0-9]+.[0-9]+/${VERSION}/g" misty/build-info.plist + +munkipkg misty +if [ $? -ne 0 ]; then + echo "munkipkg failed." + cd "$ORIGINAL_DIR" # Return to original directory + exit 1 +fi + +open misty/build +cd "$ORIGINAL_DIR" + +exit 0 + From b25010bf06c051c45e83b6f55e2116a100a5e63a Mon Sep 17 00:00:00 2001 From: a-vogel Date: Mon, 14 Oct 2024 17:19:06 +0200 Subject: [PATCH 09/15] spaces to tabs --- misty/build-info.plist | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/misty/build-info.plist b/misty/build-info.plist index 6b092a7..0b1d59c 100644 --- a/misty/build-info.plist +++ b/misty/build-info.plist @@ -10,26 +10,26 @@ / name misty-${version}.pkg - notarization_info - - asc_provider - wycomcoGmbH - keychain_profile - WYC_AC_PASSWORD - stapler_timeout - 600 - + notarization_info + + asc_provider + wycomcoGmbH + keychain_profile + WYC_AC_PASSWORD + stapler_timeout + 600 + ownership recommended postinstall_action none preserve_xattr - signing_info - - identity - Developer ID Installer: wycomco GmbH (CD4727XSC2) - + signing_info + + identity + Developer ID Installer: wycomco GmbH (CD4727XSC2) + suppress_bundle_relocation version From 1ced45aca24b48c8912ff5006e6cdf5f1d6eacda Mon Sep 17 00:00:00 2001 From: a-vogel Date: Tue, 22 Oct 2024 17:07:13 +0200 Subject: [PATCH 10/15] Handling of special characters in $RepoPass --- misty/payload/usr/local/wycomco/misty | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/misty/payload/usr/local/wycomco/misty b/misty/payload/usr/local/wycomco/misty index 3c6a06d..6620b41 100755 --- a/misty/payload/usr/local/wycomco/misty +++ b/misty/payload/usr/local/wycomco/misty @@ -91,7 +91,9 @@ check_repo() { local elapsed=0 # Create the mount point if it doesn't exist mkdir -p "/Volumes/${RepoShare}" - mount_smbfs "//${RepoUser}:${RepoPass}@${RepoName}/${RepoShare}" "/Volumes/${RepoShare}" + # URL-encode the password for special characters like "@" + EncodedPass=$(python3 -c "import urllib.parse; print(urllib.parse.quote('${RepoPass}'))") + mount_smbfs "//${RepoUser}:${EncodedPass}@${RepoName}/${RepoShare}" "/Volumes/${RepoShare}" while ! ls "${RepoPath}" &>/dev/null; do sleep $interval ((elapsed+=interval)) From 5e3971bf9c71fcbec9851d82fc9b0d072556ac9d Mon Sep 17 00:00:00 2001 From: a-vogel Date: Thu, 24 Oct 2024 08:46:41 +0200 Subject: [PATCH 11/15] Check permissions of subdirectories of $munki_path --- misty/payload/usr/local/wycomco/misty | 51 +++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/misty/payload/usr/local/wycomco/misty b/misty/payload/usr/local/wycomco/misty index 6620b41..55ce0e3 100755 --- a/misty/payload/usr/local/wycomco/misty +++ b/misty/payload/usr/local/wycomco/misty @@ -664,12 +664,63 @@ fi # Check if any new package(s) were created if [[ ( -n "$macos_13" || -n "$macos_14" || -n "$macos_15" ) ]]; then + # Ensure correct permissions in full misty path + munki_path="${munki_path%/}" # Remove trailing slash if present + IFS="/" read -A subdirs <<< "$munki_path" # Split munki_path into its components (subdirectories) + current_pkgs_path="$RepoPath/pkgs" + current_pkgsinfo_path="$RepoPath/pkgsinfo" + # Iterate over each subdirectory, checking and applying permissions if needed + for dir in "${subdirs[@]}"; do + current_pkgs_path="$current_pkgs_path/$dir" + current_pkgsinfo_path="$current_pkgsinfo_path/$dir" + check_and_chown() { + local path="$1" + if [[ -d "$path" ]]; then + current_owner=$(ls -ld "$path" | awk '{print $3":"$4}') + if [[ "$current_owner" != "$Repo_uid_gid" ]]; then + log_message "stdout" "Changing ownership of $path to $Repo_uid_gid" + chown "$Repo_uid_gid" "$path" + fi + else + log_message "stderr" "$path does not exist, please check your config.txt" + exit_error + fi + } + check_and_chown "$current_pkgs_path" + check_and_chown "$current_pkgsinfo_path" + done if [[ -f "$Base_Path/usr/postinstall.sh" ]]; then "$Base_Path/usr/postinstall.sh" fi makecatalogs "$RepoPath" | grep 'warning' fi +# Testing part, rm if it works +munki_path="${munki_path%/}" # Remove trailing slash if present +IFS="/" read -A subdirs <<< "$munki_path" # Split munki_path into its components (subdirectories) +current_pkgs_path="$RepoPath/pkgs" +current_pkgsinfo_path="$RepoPath/pkgsinfo" +# Iterate over each subdirectory, checking and applying permissions if needed +for dir in "${subdirs[@]}"; do + current_pkgs_path="$current_pkgs_path/$dir" + current_pkgsinfo_path="$current_pkgsinfo_path/$dir" + check_and_chown() { + local path="$1" + if [[ -d "$path" ]]; then + current_owner=$(ls -ld "$path" | awk '{print $3":"$4}') + if [[ "$current_owner" != "$Repo_uid_gid" ]]; then + log_message "stdout" "Changing ownership of $path to $Repo_uid_gid" + #chown "$Repo_uid_gid" "$path" + fi + else + log_message "stderr" "$path does not exist, please check your config.txt" + exit_error + fi + } + check_and_chown "$current_pkgs_path" + check_and_chown "$current_pkgsinfo_path" +done + log_message "stdout" "Finished misty run." # Enter an empty line if run as launchd to StandardOutPath launchd_echo From 2ad6988d2b22d52b55d13b1d27250b393a208e31 Mon Sep 17 00:00:00 2001 From: a-vogel Date: Thu, 24 Oct 2024 11:48:08 +0200 Subject: [PATCH 12/15] Move function to top, rename conflicting variable name --- misty/payload/usr/local/wycomco/misty | 58 ++++++++------------------- 1 file changed, 16 insertions(+), 42 deletions(-) diff --git a/misty/payload/usr/local/wycomco/misty b/misty/payload/usr/local/wycomco/misty index 55ce0e3..cf31590 100755 --- a/misty/payload/usr/local/wycomco/misty +++ b/misty/payload/usr/local/wycomco/misty @@ -31,6 +31,20 @@ # Functions # ################################################################################ +check_and_chown() { + local current_path="$1" + if [[ -d "$current_path" ]]; then + current_owner=$(ls -ld "$current_path" | awk '{print $3":"$4}') + if [[ "$current_owner" != "$Repo_uid_gid" ]]; then + log_message "stdout" "Changing ownership of $current_path to $Repo_uid_gid" + chown "$Repo_uid_gid" "$current_path" + fi + else + log_message "stderr" "$current_path does not exist, please check your repository's structure." + exit_error + fi +} + check_daemon() { DaemonHourPlist=$(PlistBuddy -c "print :StartCalendarInterval:Hour" $DaemonPath 2>/dev/null) DaemonMinutePlist=$(PlistBuddy -c "print :StartCalendarInterval:Minute" $DaemonPath 2>/dev/null) @@ -662,30 +676,16 @@ fi # Postinstall, makecatalogs # ################################################################################ -# Check if any new package(s) were created +# Only proceed if any new package(s) were created if [[ ( -n "$macos_13" || -n "$macos_14" || -n "$macos_15" ) ]]; then # Ensure correct permissions in full misty path munki_path="${munki_path%/}" # Remove trailing slash if present IFS="/" read -A subdirs <<< "$munki_path" # Split munki_path into its components (subdirectories) current_pkgs_path="$RepoPath/pkgs" current_pkgsinfo_path="$RepoPath/pkgsinfo" - # Iterate over each subdirectory, checking and applying permissions if needed - for dir in "${subdirs[@]}"; do + for dir in "${subdirs[@]}"; do # Iterate over each subdirectory, checking and applying permissions if needed current_pkgs_path="$current_pkgs_path/$dir" current_pkgsinfo_path="$current_pkgsinfo_path/$dir" - check_and_chown() { - local path="$1" - if [[ -d "$path" ]]; then - current_owner=$(ls -ld "$path" | awk '{print $3":"$4}') - if [[ "$current_owner" != "$Repo_uid_gid" ]]; then - log_message "stdout" "Changing ownership of $path to $Repo_uid_gid" - chown "$Repo_uid_gid" "$path" - fi - else - log_message "stderr" "$path does not exist, please check your config.txt" - exit_error - fi - } check_and_chown "$current_pkgs_path" check_and_chown "$current_pkgsinfo_path" done @@ -695,32 +695,6 @@ if [[ ( -n "$macos_13" || -n "$macos_14" || -n "$macos_15" ) ]]; then makecatalogs "$RepoPath" | grep 'warning' fi -# Testing part, rm if it works -munki_path="${munki_path%/}" # Remove trailing slash if present -IFS="/" read -A subdirs <<< "$munki_path" # Split munki_path into its components (subdirectories) -current_pkgs_path="$RepoPath/pkgs" -current_pkgsinfo_path="$RepoPath/pkgsinfo" -# Iterate over each subdirectory, checking and applying permissions if needed -for dir in "${subdirs[@]}"; do - current_pkgs_path="$current_pkgs_path/$dir" - current_pkgsinfo_path="$current_pkgsinfo_path/$dir" - check_and_chown() { - local path="$1" - if [[ -d "$path" ]]; then - current_owner=$(ls -ld "$path" | awk '{print $3":"$4}') - if [[ "$current_owner" != "$Repo_uid_gid" ]]; then - log_message "stdout" "Changing ownership of $path to $Repo_uid_gid" - #chown "$Repo_uid_gid" "$path" - fi - else - log_message "stderr" "$path does not exist, please check your config.txt" - exit_error - fi - } - check_and_chown "$current_pkgs_path" - check_and_chown "$current_pkgsinfo_path" -done - log_message "stdout" "Finished misty run." # Enter an empty line if run as launchd to StandardOutPath launchd_echo From e24407a4751166596e0c44b1120290d756198bb9 Mon Sep 17 00:00:00 2001 From: a-vogel Date: Thu, 24 Oct 2024 16:31:50 +0200 Subject: [PATCH 13/15] Update changelog and readme MD files to current state --- CHANGELOG.md | 11 +++++++++-- README.md | 2 -- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b5431ff..8e8f036 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,8 +3,15 @@ ## Unreleased -### Info -- See [Testing methods](./README.md#testing-methods) and [To Do](./README.md#to-do) sections of the README if you plan to use *misty* at the current state. +### Added +- Check for presence of repo if remote – [PR#17](https://github.com/wycomco/misty/pull/17) +- Create workflow for signed and notarized installer – [PR#20](https://github.com/wycomco/misty/pull/20) +- Check owner and group of subdirectories defined in `$munki_path` – [PR#22](https://github.com/wycomco/misty/pull/22) + +### Changed +- Checking order, output of launchd logs on exit 1 – [PR#18](https://github.com/wycomco/misty/pull/18) +- Increased storage requirement for installers – [PR#19](https://github.com/wycomco/misty/pull/19) +- Handling of special characters in password for repo share – [PR#21](https://github.com/wycomco/misty/pull/21) ## [0.2.2](https://github.com/wycomco/misty/releases/tag/v0.2.2) – 2024-09-17 (Pre-release) diff --git a/README.md b/README.md index 3bcfe11..42cc7f1 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,6 @@ This script checks for the availability of new macOS releases currently supporte Since this is a pre-release with frequent updates, the installer has not yet been signed or notarized. To run the downloaded installer, please right-click the `.pkg` file and select 'Open'. -Sequoia note: If you are running the installer on macOS 15, you need to right-click the installer and choose "Open". macOS will not allow you to run the installer immediately, so you need to click on "Done". After that, allow the execution of the installer in System Settings => Privacy & Security. Scroll down to the "Security" section, where you will find the message *"misty" was blocked to protect your Mac.* Tick "Open Anyway". This will bring up a pop-up window where you need to confirm that you want to "Open Anyway" the *misty* installer. Finally, grant the installer permission to control "System Events.app". - See the [Changelog](./CHANGELOG.md) for details on version history and updates. ## Goals of this Script From df1b846fbb239d995d6e394b6cdfe812927a1ed2 Mon Sep 17 00:00:00 2001 From: a-vogel Date: Thu, 24 Oct 2024 17:05:20 +0200 Subject: [PATCH 14/15] Set version string in build-info.plist to 0.0.0, update mk_misty --- misty/build-info.plist | 2 +- mk_misty | 16 +++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/misty/build-info.plist b/misty/build-info.plist index 0b1d59c..9d6f1bf 100644 --- a/misty/build-info.plist +++ b/misty/build-info.plist @@ -33,6 +33,6 @@ suppress_bundle_relocation version - 0.2.2 + 0.0.0 diff --git a/mk_misty b/mk_misty index db5cf3c..e01867e 100755 --- a/mk_misty +++ b/mk_misty @@ -1,4 +1,6 @@ #!/bin/zsh +# +# Clone the current repo state and create an installer pkg for misty REPO_URL="https://github.com/wycomco/misty.git" TMP_DIR="/var/tmp/misty_pkgbuild" @@ -17,13 +19,17 @@ fi cd "$TMP_DIR" || { echo "Failed to cd into $TMP_DIR"; exit 1; } -#VERSION=$(git describe --tags --abbrev=0) -#echo "Current version of misty is $VERSION" -#echo "Replacing version in build-info.plist..." -#sed -E -i '' "s/[0-9]+.[0-9]+.[0-9]+/${VERSION}/g" misty/build-info.plist +VERSION=$(git describe --tags --abbrev=0) +echo "Current version of misty is $VERSION" +echo "Replacing version in build-info.plist..." +sed -E -i '' "s/[0-9]+.[0-9]+.[0-9]+/${VERSION}/g" misty/build-info.plist munkipkg misty -if [ $? -ne 0 ]; then +munkipkg_success="$?" +echo "Resetting version in build-info.plist..." +sed -E -i '' "s/${VERSION}/0.0.0/g" misty/build-info.plist + +if [ "$munkipkg_success" -ne 0 ]; then echo "munkipkg failed." cd "$ORIGINAL_DIR" # Return to original directory exit 1 From afca4bbac1e778867a7591ddaead9f2a529b72f3 Mon Sep 17 00:00:00 2001 From: a-vogel Date: Thu, 24 Oct 2024 17:09:17 +0200 Subject: [PATCH 15/15] Updated changelog, bumped version --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e8f036..6f86e4b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # Changelog -## Unreleased +## [0.2.3](https://github.com/wycomco/misty/releases/tag/v0.2.3) – 2024-10-24 (Public pre-release) ### Added - Check for presence of repo if remote – [PR#17](https://github.com/wycomco/misty/pull/17)