Skip to content

Commit

Permalink
clean-up
Browse files Browse the repository at this point in the history
  • Loading branch information
BIG-RAT committed Nov 11, 2023
1 parent e9edc03 commit c5b7a55
Show file tree
Hide file tree
Showing 14 changed files with 349 additions and 519 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ Access Preferences from the menu bar icon. Here you'll be able to set the follo
- Whether the alert window is displayed at every polling interval or only when the status changes.<br>
- How the menubar icon is displayed. Minimizing will place a thin transparent icon in the menubar.<br>
- Use of a LaunchAgent, to automatically start the app when logging in.<br>
- Information for your specific Jamf Cloud instance. The account used only needs to be able to authenticate, no need to assign permissions. If your cloud server does not utilize the HTTPS port 443 be sure to include the port you use in the URL.
- Information for your specific Jamf Cloud instance. Use either a local user account or API client.
- Most notification can be viewed using an account with no permissions set in Jamf Pro. Using an account with ready-only on all objects ensure you'll see all notifications. If your cloud server does not utilize the standard HTTPS port (443) be sure to include the port you use in the URL.

<img src="./jamfStatus/images/prefs.png" alt="notifications" width="600" /><br>

Expand Down Expand Up @@ -119,7 +120,9 @@ Thu Sep 17 20:27:30 Jamf Cloud: All systems go.

## Change log

2022-10-02: v2.3.6 - Update logging to prevent potential looping.
2023-11-11: v2.4.0 - Fix issue with notifications not being displayed. Add ability to use API client.

2023-04-07: v2.3.6 - Update logging to prevent potential looping.

2022-10-02: v2.3.2 - Rework authentication/token refresh.

Expand Down
28 changes: 15 additions & 13 deletions jamfStatus.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
B51596A11E963D2D00ED3CA3 /* StatusMenuController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B51596A01E963D2D00ED3CA3 /* StatusMenuController.swift */; };
B542A1F124BA902C00EE33C8 /* Globals.swift in Sources */ = {isa = PBXBuildFile; fileRef = B542A1F024BA902C00EE33C8 /* Globals.swift */; };
B542A1F324BA90AA00EE33C8 /* WriteToLog.swift in Sources */ = {isa = PBXBuildFile; fileRef = B542A1F224BA90A900EE33C8 /* WriteToLog.swift */; };
B59970D327FCBB4C005175E2 /* JamfPro.swift in Sources */ = {isa = PBXBuildFile; fileRef = B59970D227FCBB4C005175E2 /* JamfPro.swift */; };
B5A470B02271CE7200C2A88D /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B5A470AF2271CE7200C2A88D /* WebKit.framework */; };
B5AC20321F36479A00C16EAA /* com.jamf.cloudmonitor.plist in Resources */ = {isa = PBXBuildFile; fileRef = B5AC20311F36479A00C16EAA /* com.jamf.cloudmonitor.plist */; };
B5AC20351F37858800C16EAA /* index.html in Resources */ = {isa = PBXBuildFile; fileRef = B5AC20341F37858800C16EAA /* index.html */; };
B5AC20371F37859F00C16EAA /* images in Resources */ = {isa = PBXBuildFile; fileRef = B5AC20361F37859F00C16EAA /* images */; };
B5BD6AD723297762001D244A /* Credentials2.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5BD6AD623297762001D244A /* Credentials2.swift */; };
B5BD6AD723297762001D244A /* Credentials.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5BD6AD623297762001D244A /* Credentials.swift */; };
B5BD6AD9232F108A001D244A /* VersionCheck.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5BD6AD8232F108A001D244A /* VersionCheck.swift */; };
B5BE0F9E2AFEF434000CBEBE /* TokenDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5BE0F9D2AFEF434000CBEBE /* TokenDelegate.swift */; };
B5E62F32231CAB640012FF5A /* UapiCall.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E62F31231CAB640012FF5A /* UapiCall.swift */; };
B5E62F34231DA09F0012FF5A /* NotificationAlert.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E62F33231DA09F0012FF5A /* NotificationAlert.swift */; };
B5FD9DAC2742AAC60044C321 /* Misc in Resources */ = {isa = PBXBuildFile; fileRef = B5FD9DAB2742AAC60044C321 /* Misc */; };
Expand All @@ -36,14 +36,14 @@
B51596A01E963D2D00ED3CA3 /* StatusMenuController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StatusMenuController.swift; sourceTree = "<group>"; };
B542A1F024BA902C00EE33C8 /* Globals.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Globals.swift; sourceTree = "<group>"; };
B542A1F224BA90A900EE33C8 /* WriteToLog.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WriteToLog.swift; sourceTree = "<group>"; };
B59970D227FCBB4C005175E2 /* JamfPro.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JamfPro.swift; sourceTree = "<group>"; };
B5A46CCE226FB1E300C2A88D /* jamfStatus.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = jamfStatus.entitlements; sourceTree = "<group>"; };
B5A470AF2271CE7200C2A88D /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; };
B5AC20311F36479A00C16EAA /* com.jamf.cloudmonitor.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = com.jamf.cloudmonitor.plist; sourceTree = "<group>"; };
B5AC20341F37858800C16EAA /* index.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = index.html; sourceTree = "<group>"; };
B5AC20361F37859F00C16EAA /* images */ = {isa = PBXFileReference; lastKnownFileType = folder; path = images; sourceTree = "<group>"; };
B5BD6AD623297762001D244A /* Credentials2.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Credentials2.swift; sourceTree = "<group>"; };
B5BD6AD623297762001D244A /* Credentials.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Credentials.swift; sourceTree = "<group>"; };
B5BD6AD8232F108A001D244A /* VersionCheck.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VersionCheck.swift; sourceTree = "<group>"; };
B5BE0F9D2AFEF434000CBEBE /* TokenDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TokenDelegate.swift; sourceTree = "<group>"; };
B5E62F31231CAB640012FF5A /* UapiCall.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UapiCall.swift; sourceTree = "<group>"; };
B5E62F33231DA09F0012FF5A /* NotificationAlert.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationAlert.swift; sourceTree = "<group>"; };
B5FD9DAB2742AAC60044C321 /* Misc */ = {isa = PBXFileReference; lastKnownFileType = text; path = Misc; sourceTree = "<group>"; };
Expand Down Expand Up @@ -85,11 +85,11 @@
B5A46CCE226FB1E300C2A88D /* jamfStatus.entitlements */,
B5AC20331F37855800C16EAA /* about */,
B5013BC61E95817C0099300A /* AppDelegate.swift */,
B5BD6AD623297762001D244A /* Credentials2.swift */,
B5BD6AD623297762001D244A /* Credentials.swift */,
B542A1F024BA902C00EE33C8 /* Globals.swift */,
B59970D227FCBB4C005175E2 /* JamfPro.swift */,
B5E62F33231DA09F0012FF5A /* NotificationAlert.swift */,
B51596A01E963D2D00ED3CA3 /* StatusMenuController.swift */,
B5BE0F9D2AFEF434000CBEBE /* TokenDelegate.swift */,
B5E62F31231CAB640012FF5A /* UapiCall.swift */,
B5BD6AD8232F108A001D244A /* VersionCheck.swift */,
B542A1F224BA90A900EE33C8 /* WriteToLog.swift */,
Expand Down Expand Up @@ -160,7 +160,7 @@
TargetAttributes = {
B5013BC21E95817C0099300A = {
CreatedOnToolsVersion = 8.2.1;
DevelopmentTeam = PS2F6S478M;
DevelopmentTeam = T82LNZG37Z;
LastSwiftMigration = 1020;
ProvisioningStyle = Automatic;
SystemCapabilities = {
Expand Down Expand Up @@ -218,10 +218,10 @@
B542A1F324BA90AA00EE33C8 /* WriteToLog.swift in Sources */,
B5E62F32231CAB640012FF5A /* UapiCall.swift in Sources */,
B51596A11E963D2D00ED3CA3 /* StatusMenuController.swift in Sources */,
B5BD6AD723297762001D244A /* Credentials2.swift in Sources */,
B5BD6AD723297762001D244A /* Credentials.swift in Sources */,
B542A1F124BA902C00EE33C8 /* Globals.swift in Sources */,
B5BE0F9E2AFEF434000CBEBE /* TokenDelegate.swift in Sources */,
B5013BC71E95817C0099300A /* AppDelegate.swift in Sources */,
B59970D327FCBB4C005175E2 /* JamfPro.swift in Sources */,
B5BD6AD9232F108A001D244A /* VersionCheck.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -358,11 +358,12 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = jamfStatus/jamfStatus.entitlements;
CODE_SIGN_IDENTITY = "Mac Developer";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = T82LNZG37Z;
ENABLE_HARDENED_RUNTIME = YES;
EXCLUDED_SOURCE_FILE_NAMES = Notes;
INFOPLIST_FILE = jamfStatus/Info.plist;
Expand All @@ -376,7 +377,7 @@
"$(SDKROOT)/usr/lib/system/introspection",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 2.3.6;
MARKETING_VERSION = 2.4.0;
PRODUCT_BUNDLE_IDENTIFIER = com.jamf.pse.jamfStatus;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -390,11 +391,12 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = jamfStatus/jamfStatus.entitlements;
CODE_SIGN_IDENTITY = "Mac Developer";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = T82LNZG37Z;
ENABLE_HARDENED_RUNTIME = YES;
EXCLUDED_SOURCE_FILE_NAMES = Notes;
INFOPLIST_FILE = jamfStatus/Info.plist;
Expand All @@ -408,7 +410,7 @@
"$(SDKROOT)/usr/lib/system/introspection",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 2.3.6;
MARKETING_VERSION = 2.4.0;
PRODUCT_BUNDLE_IDENTIFIER = com.jamf.pse.jamfStatus;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1410"
version = "1.3">
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
Expand Down Expand Up @@ -82,6 +82,24 @@
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
revealArchiveInOrganizer = "NO">
<PostActions>
<ExecutionAction
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
<ActionContent
title = "Run Script"
scriptText = "# notarytool credentials.&#10;# AC_PASSWORD is the name of the keychain item created with `notarytool store-credentials`.&#10;# Grant keychain access to Xcode if prompted by Xcode.&#10;AC_PASSWORD=&quot;nt_password&quot;&#10;&#10;# Do all of the work in a subdirectory of /tmp, and use a&#10;# unique ID so that there&apos;s no collision with previous builds.&#10;##EXPORT_UUID=`uuidgen`&#10;##EXPORT_PATH=&quot;/tmp/$PRODUCT_NAME-$EXPORT_UUID/&quot;&#10;osascript -e &apos;display notification &quot;Starting build process&quot;&apos;&#10;&#10;## create folder to hold exported app&#10;newMajor=&quot;$(date -u +%Y%m%d)&quot;&#10;date24H=$(date -u +%H%M)&#10;tmpMinor=$(printf &quot;%x\n&quot; $(echo $date24H | sed &apos;s/^0*//&apos;))&#10;newMinor=$(echo $tmpMinor | tr &apos;[:lower:]&apos; &apos;[:upper:]&apos;)&#10;newBuildNumber=&quot;$newMajor-$newMinor&quot;&#10;&#10;shortVer=&quot;v${MARKETING_VERSION}&quot;&#10;exeName=&quot;${EXECUTABLE_NAME}&quot;&#10;EXPORT_PATH=&quot;/Users/lesliehelou/Documents/Xcode-Projects/$exeName/$shortVer/$newBuildNumber&quot;&#10;APP_PATH=&quot;$EXPORT_PATH/$PRODUCT_NAME.app&quot;&#10;DMG_PATH=&quot;$EXPORT_PATH/${PRODUCT_NAME}_${shortVer}.dmg&quot;&#10;ZIP_PATH=&quot;$EXPORT_PATH/${PRODUCT_NAME}_${shortVer}.zip&quot;&#10;&#10;osascript -e &apos;display notification &quot;create export path&quot;&apos;&#10;mkdir -p &quot;$EXPORT_PATH&quot;&#10;&#10;# Xcode doesn&apos;t show run script errors in build log.&#10;exec &gt; &quot;$EXPORT_PATH/Xcode run script.log&quot; 2&gt;&amp;1&#10;open &quot;$EXPORT_PATH/Xcode run script.log&quot;&#10;&#10;# Use osascript(1) to present notification banners; otherwise&#10;# there&apos;s no progress indication until the script finishes.&#10;/usr/bin/osascript -e &apos;display notification &quot;Exporting application archive&#x2026;&quot; with title &quot;Submitting app for notarization&quot;&apos;&#10;&#10;# Ask xcodebuild(1) to export the app. Use the export options&#10;# from a previous manual export that used a Developer ID.&#10;##/usr/bin/xcodebuild -exportArchive -archivePath &quot;$ARCHIVE_PATH&quot; -exportOptionsPlist &quot;$SRCROOT/ExportOptions.plist&quot; -exportPath &quot;$EXPORT_PATH&quot;&#10;/usr/bin/xcodebuild -allowProvisioningUpdates -exportArchive -archivePath &quot;$ARCHIVE_PATH&quot; -exportOptionsPlist &quot;/Users/lesliehelou/Documents/GitHub/ExportOptions.plist&quot; -exportPath &quot;$EXPORT_PATH/&quot;&#10;&#10;osascript -e &apos;display notification &quot;Creating UDIF Disk Image&#x2026;&quot; with title &quot;Submitting app for notarization&quot;&apos;&#10;&#10;# Create a UDIF bzip2-compressed disk image.&#10;cd &quot;$EXPORT_PATH/&quot;&#10;mkdir &quot;$PRODUCT_NAME&quot;&#10;mv -v &quot;$APP_PATH&quot; &quot;$PRODUCT_NAME&quot;&#10;&#10;/usr/bin/hdiutil create -srcfolder &quot;$PRODUCT_NAME&quot; -format UDBZ &quot;$DMG_PATH&quot;&#10;&#10;osascript -e &apos;display notification &quot;Submitting UDIF Disk Image for notarization&#x2026;&quot; with title &quot;Submitting app for notarization&quot;&apos;&#10;&#10;# Submit the finished deliverables for notarization.&#10;# Wait up to 2 hours for a response.&#10;# Use verbose logging in order to file feedback if an error occurs.&#10;## &quot;$DEVELOPER_BIN_DIR/notarytool&quot; submit -p &quot;$AC_PASSWORD&quot; --verbose &quot;$DMG_PATH&quot; --wait --timeout 2h --output-format plist &gt; &quot;NotarizationResponse.plist&quot;&#10;&quot;/Applications/Xcode.app/Contents/Developer/usr/bin/notarytool&quot; submit -p &quot;$AC_PASSWORD&quot; --verbose &quot;$DMG_PATH&quot; --wait --timeout 2h --output-format plist &gt; &quot;NotarizationResponse.plist&quot;&#10;&#10;return_code=$?&#10;&#10;if [ $return_code -eq 0 ]; then&#10; message=`/usr/libexec/PlistBuddy -c &quot;Print :message&quot; &quot;NotarizationResponse.plist&quot;`&#10; status=`/usr/libexec/PlistBuddy -c &quot;Print :status&quot; &quot;NotarizationResponse.plist&quot;`&#10;else&#10; message=&quot;An Error Occurred.&quot;&#10; status=&quot;Check Xcode log.&quot;&#10;## open &quot;$EXPORT_PATH/Xcode run script.log&quot;&#10;fi&#10;&#10;# Show and speak the final status.&#10;osascript -e &quot;on run(argv)&quot; \&#10;-e &apos;display notification item 1 of argv &amp; &quot; : &quot; &amp; item 2 of argv with title &quot;Submitting app for notarization&quot; sound name &quot;Crystal&quot;&apos; \&#10;-e &apos;set text item delimiters to &quot;, &quot;&apos; \&#10;-e &quot;set args to argv as text&quot; \&#10;-e &quot;say args&quot; \&#10;-e &quot;delay 5&quot; \&#10;-e &quot;end&quot; \&#10;-- &quot;$message&quot; &quot;$status&quot;&#10;&#10;wait 5&#10;xcrun stapler staple &quot;$PRODUCT_NAME/$PRODUCT_NAME.app&quot;&#10;xcrun stapler staple &quot;${PRODUCT_NAME}_${shortVer}.dmg&quot;&#10;&#10;if [ -e &quot;$ZIP_PATH&quot; ];then&#10; rm -f &quot;$ZIP_PATH&quot;&#10;fi&#10;/usr/bin/ditto -c -k --keepParent &quot;$PRODUCT_NAME/$PRODUCT_NAME.app&quot; &quot;$ZIP_PATH&quot;&#10;&#10;# Open the folder that was created, which also signals completion.&#10;open &quot;$EXPORT_PATH&quot;&#10;&#10;&#10;&#10;&#10;&#10;">
<EnvironmentBuildable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "B5013BC21E95817C0099300A"
BuildableName = "jamfStatus.app"
BlueprintName = "jamfStatus"
ReferencedContainer = "container:jamfStatus.xcodeproj">
</BuildableReference>
</EnvironmentBuildable>
</ActionContent>
</ExecutionAction>
</PostActions>
</ArchiveAction>
</Scheme>
Loading

0 comments on commit c5b7a55

Please sign in to comment.