diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..b99e97e0 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,3 @@ +Contributions to Munki are welcome! + +Please see https://github.com/munki/munki/wiki/Contributing-to-Munki diff --git a/code/apps/Managed Software Center/MSCDockTilePlugin/Info.plist b/code/apps/Managed Software Center/MSCDockTilePlugin/Info.plist index a65d44a6..b9bdd196 100755 --- a/code/apps/Managed Software Center/MSCDockTilePlugin/Info.plist +++ b/code/apps/Managed Software Center/MSCDockTilePlugin/Info.plist @@ -19,7 +19,7 @@ CFBundleVersion 1 NSHumanReadableCopyright - Copyright © 2019 The Munki Project. All rights reserved. + Copyright © 2019-2020 The Munki Project. All rights reserved. NSPrincipalClass MSCDockTilePlugin diff --git a/code/apps/Managed Software Center/MSCDockTilePlugin/MSCDockTilePlugIn.h b/code/apps/Managed Software Center/MSCDockTilePlugin/MSCDockTilePlugIn.h index f046933a..58d5d4a0 100755 --- a/code/apps/Managed Software Center/MSCDockTilePlugin/MSCDockTilePlugIn.h +++ b/code/apps/Managed Software Center/MSCDockTilePlugin/MSCDockTilePlugIn.h @@ -2,7 +2,7 @@ File: MSCDockTilePlugIn.h - Copyright 2015-2019 Greg Neagle. + Copyright 2015-2020 Greg Neagle. Liberally adapted from Apple sample code: https://developer.apple.com/library/mac/samplecode/DockTile/Listings/DockTilePlugIn_DockTilePlugIn_h.html diff --git a/code/apps/Managed Software Center/MSCDockTilePlugin/MSCDockTilePlugIn.m b/code/apps/Managed Software Center/MSCDockTilePlugin/MSCDockTilePlugIn.m index 213c6f85..448f0803 100755 --- a/code/apps/Managed Software Center/MSCDockTilePlugin/MSCDockTilePlugIn.m +++ b/code/apps/Managed Software Center/MSCDockTilePlugin/MSCDockTilePlugIn.m @@ -2,7 +2,7 @@ File: MSCDockTilePlugIn.m - Copyright 2015-2019 Greg Neagle. + Copyright 2015-2020 Greg Neagle. Liberally adapted from Apple sample code: https://developer.apple.com/library/mac/samplecode/DockTile/Listings/DockTilePlugIn_DockTilePlugIn_h.html diff --git a/code/apps/Managed Software Center/Managed Software Center.xcodeproj/project.pbxproj b/code/apps/Managed Software Center/Managed Software Center.xcodeproj/project.pbxproj index 39c41894..d619c5c1 100755 --- a/code/apps/Managed Software Center/Managed Software Center.xcodeproj/project.pbxproj +++ b/code/apps/Managed Software Center/Managed Software Center.xcodeproj/project.pbxproj @@ -284,7 +284,7 @@ attributes = { CLASSPREFIX = MSC; LastSwiftUpdateCheck = 0920; - LastUpgradeCheck = 1000; + LastUpgradeCheck = 1020; ORGANIZATIONNAME = "The Munki Project"; TargetAttributes = { C0196316210507DB0009F51A = { diff --git a/code/apps/Managed Software Center/Managed Software Center/AppDelegate.swift b/code/apps/Managed Software Center/Managed Software Center/AppDelegate.swift index c3252c73..ab791640 100755 --- a/code/apps/Managed Software Center/Managed Software Center/AppDelegate.swift +++ b/code/apps/Managed Software Center/Managed Software Center/AppDelegate.swift @@ -3,7 +3,7 @@ // ManagedSoftwareCenter // // Created by Greg Neagle on 5/27/18. -// Copyright © 2018-2019 The Munki Project. All rights reserved. +// Copyright © 2018-2020 The Munki Project. All rights reserved. // import Cocoa @@ -86,7 +86,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele let keyword = AEKeyword(keyDirectObject) let urlDescriptor = event.paramDescriptor(forKeyword: keyword) if let urlString = urlDescriptor?.stringValue { - msc_log("MSU", "Called by external URL: \(urlString)") + msc_log("MSC", "Called by external URL: \(urlString)") if let url = URL(string: urlString) { mainWindowController.handleMunkiURL(url) } else { @@ -112,13 +112,13 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele } if user_info["action"] as? String ?? "" == "open_url" { let urlString = user_info["value"] as? String ?? "munki://updates" - msc_log("MSU", "Got user notification to open \(urlString)") + msc_log("MSC", "Got user notification to open \(urlString)") if let url = URL(string: urlString) { mainWindowController.handleMunkiURL(url) } center.removeDeliveredNotification(notification) } else { - msc_log("MSU", "Got user notification with unrecognized userInfo") + msc_log("MSC", "Got user notification with unrecognized userInfo") } } diff --git a/code/apps/Managed Software Center/Managed Software Center/Base.lproj/InfoPlist.strings b/code/apps/Managed Software Center/Managed Software Center/Base.lproj/InfoPlist.strings index 1e9d483e..aa4a2874 100644 --- a/code/apps/Managed Software Center/Managed Software Center/Base.lproj/InfoPlist.strings +++ b/code/apps/Managed Software Center/Managed Software Center/Base.lproj/InfoPlist.strings @@ -2,4 +2,4 @@ "CFBundleName" = "Managed Software Center"; "CFBundleDisplayName" = "Managed Software Center"; -NSHumanReadableCopyright = "Copyright © 2010-2019 The Munki Project\nhttps://github.com/munki/munki"; +NSHumanReadableCopyright = "Copyright © 2010-2020 The Munki Project\nhttps://github.com/munki/munki"; diff --git a/code/apps/Managed Software Center/Managed Software Center/Controllers/LogViewController.swift b/code/apps/Managed Software Center/Managed Software Center/Controllers/LogViewController.swift index 098f84c9..302ab58c 100755 --- a/code/apps/Managed Software Center/Managed Software Center/Controllers/LogViewController.swift +++ b/code/apps/Managed Software Center/Managed Software Center/Controllers/LogViewController.swift @@ -3,7 +3,7 @@ // Managed Software Center // // Created by Greg Neagle on 5/20/18. -// Copyright © 2018-2019 The Munki Project. All rights reserved. +// Copyright © 2018-2020 The Munki Project. All rights reserved. // import Cocoa diff --git a/code/apps/Managed Software Center/Managed Software Center/Controllers/MSCAlertController.swift b/code/apps/Managed Software Center/Managed Software Center/Controllers/MSCAlertController.swift index ee97a75a..7a5cddfb 100755 --- a/code/apps/Managed Software Center/Managed Software Center/Controllers/MSCAlertController.swift +++ b/code/apps/Managed Software Center/Managed Software Center/Controllers/MSCAlertController.swift @@ -3,7 +3,7 @@ // Managed Software Center // // Created by Greg Neagle on 7/15/18. -// Copyright © 2018-2019 The Munki Project. All rights reserved. +// Copyright © 2018-2020 The Munki Project. All rights reserved. // import Cocoa @@ -407,7 +407,7 @@ class MSCAlertController: NSObject { alert.buttons[1].keyEquivalent = "\r" // set Continue button to be activated by Escape key alert.buttons[0].keyEquivalent = "\u{1B}" - msc_log("MSU", "alert_on_battery_power") + msc_log("MSC", "alert_on_battery_power") let response = alert.runModal() if response == .alertSecondButtonReturn { // user clicked Cancel diff --git a/code/apps/Managed Software Center/Managed Software Center/Controllers/MSCPasswordAlertController.swift b/code/apps/Managed Software Center/Managed Software Center/Controllers/MSCPasswordAlertController.swift index 859b2480..89323b26 100755 --- a/code/apps/Managed Software Center/Managed Software Center/Controllers/MSCPasswordAlertController.swift +++ b/code/apps/Managed Software Center/Managed Software Center/Controllers/MSCPasswordAlertController.swift @@ -3,7 +3,7 @@ // Managed Software Center // // Created by Greg Neagle on 7/17/18. -// Copyright © 2018-2019 The Munki Project. All rights reserved. +// Copyright © 2018-2020 The Munki Project. All rights reserved. // import Cocoa diff --git a/code/apps/Managed Software Center/Managed Software Center/Controllers/MSCStatusController.swift b/code/apps/Managed Software Center/Managed Software Center/Controllers/MSCStatusController.swift index b03e0265..0943c813 100755 --- a/code/apps/Managed Software Center/Managed Software Center/Controllers/MSCStatusController.swift +++ b/code/apps/Managed Software Center/Managed Software Center/Controllers/MSCStatusController.swift @@ -3,7 +3,7 @@ // Managed Software Center // // Created by Greg Neagle on 7/11/18. -// Copyright © 2018-2019 The Munki Project. All rights reserved. +// Copyright © 2018-2020 The Munki Project. All rights reserved. // import Cocoa diff --git a/code/apps/Managed Software Center/Managed Software Center/Controllers/MainWindowController.swift b/code/apps/Managed Software Center/Managed Software Center/Controllers/MainWindowController.swift index 8a2ab494..73228953 100755 --- a/code/apps/Managed Software Center/Managed Software Center/Controllers/MainWindowController.swift +++ b/code/apps/Managed Software Center/Managed Software Center/Controllers/MainWindowController.swift @@ -3,7 +3,7 @@ // Managed Software Center // // Created by Greg Neagle on 6/29/18. -// Copyright © 2018-2019 The Munki Project. All rights reserved. +// Copyright © 2018-2020 The Munki Project. All rights reserved. // import Cocoa @@ -160,6 +160,19 @@ class MainWindowController: NSWindowController, NSWindowDelegate, WKNavigationDe displayUpdateCount() cached_self_service = SelfService() } + + func toolBarItemIsHighlighted(_ item: NSToolbarItem) -> Bool { + if let button = item.view as? NSButton { + return (button.state == .on) + } + return false + } + + func setHighlightFor(item: NSToolbarItem, doHighlight: Bool) { + if let button = item.view as? NSButton { + button.state = (doHighlight ? .on : .off) + } + } func highlightToolbarButtons(_ nameToHighlight: String) { for (index, item) in items.enumerated() { @@ -227,7 +240,7 @@ class MainWindowController: NSWindowController, NSWindowDelegate, WKNavigationDe comment: "Cannot Contact Server detail") } else if lastCheckResult == -2 { // preflight failed - msc_log("MSU", "cant_update", msg: "failed preflight") + msc_log("MSC", "cant_update", msg: "failed preflight") detailText = NSLocalizedString( ("Managed Software Center cannot check for updates now.\n" + "Try again later. If this situation continues, " + @@ -1330,23 +1343,27 @@ class MainWindowController: NSWindowController, NSWindowDelegate, WKNavigationDe _alertedUserToOutstandingUpdates = true } - @IBAction func softwareToolbarButtonClicked(_ sender: Any) { + @IBAction func softwareToolbarItemClicked(_ sender: Any) { // User clicked Software toolbar button + highlightToolbarButtons("Software") loadAllSoftwarePage(sender) } - @IBAction func categoriesToolbarButtonClicked(_ sender: Any) { + @IBAction func categoriesToolbarItemClicked(_ sender: Any) { // User clicked Categories toolbar button''' + highlightToolbarButtons("Categories") loadCategoriesPage(sender) } - @IBAction func myItemsToolbarButtonClicked(_ sender: Any) { + @IBAction func myItemsToolbarItemClicked(_ sender: Any) { // User clicked My Items toolbar button''' + highlightToolbarButtons("My Items") loadMyItemsPage(sender) } - @IBAction func updatesToolbarButtonClicked(_ sender: Any) { + @IBAction func updatesToolbarItemClicked(_ sender: Any) { // User clicked Updates toolbar button''' + highlightToolbarButtons("Updates") loadUpdatesPage(sender) } diff --git a/code/apps/Managed Software Center/Managed Software Center/FoundationPlist.swift b/code/apps/Managed Software Center/Managed Software Center/FoundationPlist.swift index 8fd4e528..86e9c50e 100755 --- a/code/apps/Managed Software Center/Managed Software Center/FoundationPlist.swift +++ b/code/apps/Managed Software Center/Managed Software Center/FoundationPlist.swift @@ -3,7 +3,7 @@ // Managed Software Center // // Created by Greg Neagle on 5/27/18. -// Copyright © 2018-2019 The Munki Project. All rights reserved. +// Copyright © 2018-2020 The Munki Project. All rights reserved. // import Foundation diff --git a/code/apps/Managed Software Center/Managed Software Center/HtmlFilter.swift b/code/apps/Managed Software Center/Managed Software Center/HtmlFilter.swift index 65d91bf2..7ddef160 100755 --- a/code/apps/Managed Software Center/Managed Software Center/HtmlFilter.swift +++ b/code/apps/Managed Software Center/Managed Software Center/HtmlFilter.swift @@ -3,7 +3,7 @@ // Managed Software Center // // Created by Greg Neagle on 6/15/18. -// Copyright © 2018-2019 The Munki Project. All rights reserved. +// Copyright © 2018-2020 The Munki Project. All rights reserved. // import Foundation diff --git a/code/apps/Managed Software Center/Managed Software Center/Info.plist b/code/apps/Managed Software Center/Managed Software Center/Info.plist index 37d0779c..9b711d9a 100644 --- a/code/apps/Managed Software Center/Managed Software Center/Info.plist +++ b/code/apps/Managed Software Center/Managed Software Center/Info.plist @@ -47,7 +47,7 @@ NSDockTilePlugIn MSCDockTilePlugin.docktileplugin NSHumanReadableCopyright - Copyright © 2019 The Munki Project. All rights reserved. + Copyright © 2019-2020 The Munki Project. All rights reserved. NSMainNibFile MainMenu NSPrincipalClass diff --git a/code/apps/Managed Software Center/Managed Software Center/Localization.swift b/code/apps/Managed Software Center/Managed Software Center/Localization.swift index fbce77ce..38ff64f2 100755 --- a/code/apps/Managed Software Center/Managed Software Center/Localization.swift +++ b/code/apps/Managed Software Center/Managed Software Center/Localization.swift @@ -3,7 +3,7 @@ // Managed Software Center // // Created by Greg Neagle on 27.05.18. -// Copyright © 2018-2019 The Munki Project. All rights reserved. +// Copyright © 2018-2020 The Munki Project. All rights reserved. // import Foundation diff --git a/code/apps/Managed Software Center/Managed Software Center/MSCBadgedTemplateImage.swift b/code/apps/Managed Software Center/Managed Software Center/MSCBadgedTemplateImage.swift index 9bf8332c..83757719 100644 --- a/code/apps/Managed Software Center/Managed Software Center/MSCBadgedTemplateImage.swift +++ b/code/apps/Managed Software Center/Managed Software Center/MSCBadgedTemplateImage.swift @@ -3,7 +3,7 @@ // Managed Software Center // // Created by Greg Neagle on 6/5/18. -// Copyright © 2018-2019 The Munki Project. All rights reserved. +// Copyright © 2018-2020 The Munki Project. All rights reserved. // import Cocoa diff --git a/code/apps/Managed Software Center/Managed Software Center/MSCToolbarButton.swift b/code/apps/Managed Software Center/Managed Software Center/MSCToolbarButton.swift index e86f1f77..60bfd236 100755 --- a/code/apps/Managed Software Center/Managed Software Center/MSCToolbarButton.swift +++ b/code/apps/Managed Software Center/Managed Software Center/MSCToolbarButton.swift @@ -3,7 +3,7 @@ // Managed Software Center // // Created by Greg Neagle on 5/27/18. -// Copyright © 2018-2019 The Munki Project. All rights reserved. +// Copyright © 2018-2020 The Munki Project. All rights reserved. // import Cocoa diff --git a/code/apps/Managed Software Center/Managed Software Center/MSCWebView.swift b/code/apps/Managed Software Center/Managed Software Center/MSCWebView.swift index 6979b90a..be2f7ae5 100755 --- a/code/apps/Managed Software Center/Managed Software Center/MSCWebView.swift +++ b/code/apps/Managed Software Center/Managed Software Center/MSCWebView.swift @@ -3,7 +3,7 @@ // Managed Software Center // // Created by Greg Neagle on 9/9/18. -// Copyright © 2018-2019 The Munki Project. All rights reserved. +// Copyright © 2018-2020 The Munki Project. All rights reserved. // import WebKit diff --git a/code/apps/Managed Software Center/Managed Software Center/MunkiItems.swift b/code/apps/Managed Software Center/Managed Software Center/MunkiItems.swift index 08fd4cdf..079dd9b5 100755 --- a/code/apps/Managed Software Center/Managed Software Center/MunkiItems.swift +++ b/code/apps/Managed Software Center/Managed Software Center/MunkiItems.swift @@ -3,7 +3,7 @@ // Managed Software Center // // Created by Greg Neagle on 6/7/18. -// Copyright © 2018-2019 The Munki Project. All rights reserved. +// Copyright © 2018-2020 The Munki Project. All rights reserved. // import Foundation @@ -131,7 +131,7 @@ class GenericItem: BaseItem { my["developer"] = guess_developer() } if let description = my["description"] as? String { - my["raw_description"] = description + my["raw_description"] = filtered_html(description) my["description"] = nil } my["icon"] = getIcon() @@ -690,7 +690,7 @@ class OptionalItem: GenericItem { func _get_status() -> String { // Calculates initial status for an item and also sets a boolean // if a updatecheck is needed - let managed_update_names = getInstallInfo()["managed_updates"] as? [String] ?? [String]() + let managed_update_names = cachedInstallInfo()["managed_updates"] as? [String] ?? [String]() let self_service = SelfService() my["updatecheck_needed"] = false my["user_directed_action"] = false @@ -775,7 +775,7 @@ class OptionalItem: GenericItem { func _get_note_from_problem_items() -> String { // Checks InstallInfo's problem_items for any notes for self that might // give feedback why this item can't be downloaded or installed - let problem_items = getInstallInfo()["problem_items"] as? [[String:Any]] ?? [[String:Any]]() + let problem_items = cachedInstallInfo()["problem_items"] as? [[String:Any]] ?? [[String:Any]]() // filter problem items for any whose name matches the name of // the current item let name = my["name"] as? String ?? "" @@ -831,7 +831,7 @@ class OptionalItem: GenericItem { my["updatecheck_needed"] = true var self_service_change_success = true let original_status = my["status"] as? String ?? "" - let managed_update_names = getInstallInfo()["managed_updates"] as? [String] ?? [String]() + let managed_update_names = cachedInstallInfo()["managed_updates"] as? [String] ?? [String]() let status = my["status"] as? String ?? "" let name = my["name"] as? String ?? "" let needs_update = my["needs_update"] as? Bool ?? false @@ -975,15 +975,27 @@ class UpdateItem: GenericItem { } } +func cachedInstallInfo() -> [String : Any] { + if !Cache.shared.keys.contains("InstallInfo") { + Cache.shared["InstallInfo"] = getInstallInfo() + } + return Cache.shared["InstallInfo"] as? [String : Any] ?? [String : Any]() +} + +func optionalInstallsExist() -> Bool { + let optional_items = cachedInstallInfo()["optional_installs"] as? [[String : Any]] ?? [[String : Any]]() + return optional_items.count > 0 +} + func getOptionalInstallItems() -> [OptionalItem] { let appleSoftwareUpdatesOnly = pythonishBool(pref("AppleSoftwareUpdatesOnly")) if appleSoftwareUpdatesOnly { return [OptionalItem]() } if !Cache.shared.keys.contains("optional_install_items") { - let optional_items = getInstallInfo()["optional_installs"] as? [[String : Any]] ?? [[String : Any]]() + let optional_items = cachedInstallInfo()["optional_installs"] as? [[String : Any]] ?? [[String : Any]]() var optional_install_items = optional_items.map({ OptionalItem($0) }) - let featured_items = getInstallInfo()["featured_items"] as? [String] ?? [String]() + let featured_items = cachedInstallInfo()["featured_items"] as? [String] ?? [String]() for index in 0.. [OptionalItem] { func getProblemItems() -> [UpdateItem] { if !Cache.shared.keys.contains("problem_items") { - var problem_items = getInstallInfo()["problem_items"] as? [[String:Any]] ?? [[String:Any]]() + var problem_items = cachedInstallInfo()["problem_items"] as? [[String:Any]] ?? [[String:Any]]() for i in 0.. [UpdateItem] { } } } - let install_info = getInstallInfo() + let install_info = cachedInstallInfo() if let managed_installs = install_info["managed_installs"] as? [[String: Any]] { for var item in managed_installs { item["status"] = "will-be-installed" @@ -1138,7 +1150,7 @@ func updatesContainNonUserSelectedItems() -> Bool { // available Apple updates are not user selected return true } - let install_info = getInstallInfo() + let install_info = cachedInstallInfo() let install_items = install_info["managed_installs"] as? [[String: Any]] ?? [[String: Any]]() let removal_items = install_info["removals"] as? [[String: Any]] ?? [[String: Any]]() let filtered_installs = install_items.filter( @@ -1192,7 +1204,7 @@ func dependentItems(_ item_name: String) -> [String] { // optional item if !Cache.shared.keys.contains("optional_installs_with_dependencies") { let self_service_installs = SelfService().installs - if let optional_installs = getInstallInfo()["optional_instslls"] as? [PlistDict] { + if let optional_installs = cachedInstallInfo()["optional_instslls"] as? [PlistDict] { Cache.shared["optional_installs_with_dependencies"] = ( optional_installs.filter( { diff --git a/code/apps/Managed Software Center/Managed Software Center/Resources/WebResources/detail.css b/code/apps/Managed Software Center/Managed Software Center/Resources/WebResources/detail.css index afebc5f0..b6f1c1bd 100644 --- a/code/apps/Managed Software Center/Managed Software Center/Resources/WebResources/detail.css +++ b/code/apps/Managed Software Center/Managed Software Center/Resources/WebResources/detail.css @@ -58,7 +58,7 @@ body.product .product-detail .product-info .product-review h4 { color: var(--text-color-subdued); /*text-shadow: rgba(255,255,255,1) 0 1px 0*/ } -body.product .product-detail .product-info .product-review p,body.product .product-detail .product-info .product-review ul { +body.product .product-detail .product-info .product-review p,body.product .product-detail .product-info .product-review div,body.product .product-detail .product-info .product-review ul { font-size: 12px; line-height: 16px; color: var(--text-color-normal); diff --git a/code/apps/Managed Software Center/Managed Software Center/Resources/WebResources/updates.css b/code/apps/Managed Software Center/Managed Software Center/Resources/WebResources/updates.css index c03f861e..1821280d 100644 --- a/code/apps/Managed Software Center/Managed Software Center/Resources/WebResources/updates.css +++ b/code/apps/Managed Software Center/Managed Software Center/Resources/WebResources/updates.css @@ -579,7 +579,7 @@ div.progress > span.indeterminate > span { color-stop(.76, transparent), to(transparent) ); z-index: 1; - -webkit-background-size: 20px 20px; + -webkit-background-size: 21px 21px; -webkit-animation: barber-pole 2s linear infinite; -webkit-border-radius: 4px; overflow: hidden; @@ -587,10 +587,10 @@ div.progress > span.indeterminate > span { @-webkit-keyframes barber-pole { 0% { - background-position: 0 20px; + background-position: 0 21px; } 100% { - background-position: 20px 0; + background-position: 21px 0; } } diff --git a/code/apps/Managed Software Center/Managed Software Center/SelfService.swift b/code/apps/Managed Software Center/Managed Software Center/SelfService.swift index 70a59649..e48278be 100755 --- a/code/apps/Managed Software Center/Managed Software Center/SelfService.swift +++ b/code/apps/Managed Software Center/Managed Software Center/SelfService.swift @@ -3,7 +3,7 @@ // Managed Software Center // // Created by Greg Neagle on 6/12/18. -// Copyright © 2018-2019 The Munki Project. All rights reserved. +// Copyright © 2018-2020 The Munki Project. All rights reserved. // import Foundation @@ -43,10 +43,11 @@ struct SelfService { } init() { + let selfServiceData = readSelfServiceManifest() _installs = Set( - readSelfServiceManifest()["managed_installs"] as? [String] ?? [String]()) + selfServiceData["managed_installs"] as? [String] ?? [String]()) _uninstalls = Set( - readSelfServiceManifest()["managed_uninstalls"] as? [String] ?? [String]()) + selfServiceData["managed_uninstalls"] as? [String] ?? [String]()) } mutating func subscribe(_ item_name: String) -> Bool { diff --git a/code/apps/Managed Software Center/Managed Software Center/Socket.swift b/code/apps/Managed Software Center/Managed Software Center/Socket.swift index 4897c5ed..4c5edeb7 100755 --- a/code/apps/Managed Software Center/Managed Software Center/Socket.swift +++ b/code/apps/Managed Software Center/Managed Software Center/Socket.swift @@ -3,7 +3,7 @@ // Managed Software Center // // Created by Greg Neagle on 7/23/18. -// Copyright © 2018-2019 The Munki Project. All rights reserved. +// Copyright © 2018-2020 The Munki Project. All rights reserved. // import Darwin diff --git a/code/apps/Managed Software Center/Managed Software Center/Template.swift b/code/apps/Managed Software Center/Managed Software Center/Template.swift index 9661123c..6dd52624 100755 --- a/code/apps/Managed Software Center/Managed Software Center/Template.swift +++ b/code/apps/Managed Software Center/Managed Software Center/Template.swift @@ -3,7 +3,7 @@ // Managed Software Center // // Created by Greg Neagle on 6/15/18. -// Copyright © 2018-2019 The Munki Project. All rights reserved. +// Copyright © 2018-2020 The Munki Project. All rights reserved. // // A lightweight Swift implementation of something like Python's string.Template diff --git a/code/apps/Managed Software Center/Managed Software Center/authrestart.swift b/code/apps/Managed Software Center/Managed Software Center/authrestart.swift index 50c7fdcd..b63e44d7 100755 --- a/code/apps/Managed Software Center/Managed Software Center/authrestart.swift +++ b/code/apps/Managed Software Center/Managed Software Center/authrestart.swift @@ -3,7 +3,7 @@ // Managed Software Center // // Created by Greg Neagle on 6/29/18. -// Copyright © 2018-2019 The Munki Project. All rights reserved. +// Copyright © 2018-2020 The Munki Project. All rights reserved. // import Foundation diff --git a/code/apps/Managed Software Center/Managed Software Center/da.lproj/InfoPlist.strings b/code/apps/Managed Software Center/Managed Software Center/da.lproj/InfoPlist.strings index 8a1ea041..eb02dda4 100755 --- a/code/apps/Managed Software Center/Managed Software Center/da.lproj/InfoPlist.strings +++ b/code/apps/Managed Software Center/Managed Software Center/da.lproj/InfoPlist.strings @@ -2,4 +2,4 @@ "CFBundleName" = "Managed Software Center"; "CFBundleDisplayName" = "Managed Software Center"; -NSHumanReadableCopyright = "Copyright © 2010-2019 The Munki Project\nhttps://github.com/munki/munki"; \ No newline at end of file +NSHumanReadableCopyright = "Copyright © 2010-2020 The Munki Project\nhttps://github.com/munki/munki"; \ No newline at end of file diff --git a/code/apps/Managed Software Center/Managed Software Center/de.lproj/InfoPlist.strings b/code/apps/Managed Software Center/Managed Software Center/de.lproj/InfoPlist.strings index fe8eea53..ffa12b92 100755 --- a/code/apps/Managed Software Center/Managed Software Center/de.lproj/InfoPlist.strings +++ b/code/apps/Managed Software Center/Managed Software Center/de.lproj/InfoPlist.strings @@ -2,4 +2,4 @@ "CFBundleName" = "Geführte Softwareaktualisierung"; "CFBundleDisplayName" = "Geführte Softwareaktualisierung"; -NSHumanReadableCopyright = "Copyright © 2010-2019 The Munki Project\nhttps://github.com/munki/munki"; \ No newline at end of file +NSHumanReadableCopyright = "Copyright © 2010-2020 The Munki Project\nhttps://github.com/munki/munki"; \ No newline at end of file diff --git a/code/apps/Managed Software Center/Managed Software Center/en-AU.lproj/InfoPlist.strings b/code/apps/Managed Software Center/Managed Software Center/en-AU.lproj/InfoPlist.strings old mode 100755 new mode 100644 index b1aa5fb8..84e74e8a --- a/code/apps/Managed Software Center/Managed Software Center/en-AU.lproj/InfoPlist.strings +++ b/code/apps/Managed Software Center/Managed Software Center/en-AU.lproj/InfoPlist.strings @@ -2,4 +2,4 @@ "CFBundleName" = "Managed Software Centre"; "CFBundleDisplayName" = "Managed Software Centre"; -NSHumanReadableCopyright = "Copyright © 2010-2018 The Munki Project\nhttps://github.com/munki/munki"; \ No newline at end of file +NSHumanReadableCopyright = "Copyright © 2010-2020 The Munki Project\nhttps://github.com/munki/munki"; \ No newline at end of file diff --git a/code/apps/Managed Software Center/Managed Software Center/en-CA.lproj/InfoPlist.strings b/code/apps/Managed Software Center/Managed Software Center/en-CA.lproj/InfoPlist.strings index 4a7411be..84e74e8a 100644 --- a/code/apps/Managed Software Center/Managed Software Center/en-CA.lproj/InfoPlist.strings +++ b/code/apps/Managed Software Center/Managed Software Center/en-CA.lproj/InfoPlist.strings @@ -2,4 +2,4 @@ "CFBundleName" = "Managed Software Centre"; "CFBundleDisplayName" = "Managed Software Centre"; -NSHumanReadableCopyright = "Copyright © 2010-2019 The Munki Project\nhttps://github.com/munki/munki"; \ No newline at end of file +NSHumanReadableCopyright = "Copyright © 2010-2020 The Munki Project\nhttps://github.com/munki/munki"; \ No newline at end of file diff --git a/code/apps/Managed Software Center/Managed Software Center/en-GB.lproj/InfoPlist.strings b/code/apps/Managed Software Center/Managed Software Center/en-GB.lproj/InfoPlist.strings index 4a7411be..84e74e8a 100644 --- a/code/apps/Managed Software Center/Managed Software Center/en-GB.lproj/InfoPlist.strings +++ b/code/apps/Managed Software Center/Managed Software Center/en-GB.lproj/InfoPlist.strings @@ -2,4 +2,4 @@ "CFBundleName" = "Managed Software Centre"; "CFBundleDisplayName" = "Managed Software Centre"; -NSHumanReadableCopyright = "Copyright © 2010-2019 The Munki Project\nhttps://github.com/munki/munki"; \ No newline at end of file +NSHumanReadableCopyright = "Copyright © 2010-2020 The Munki Project\nhttps://github.com/munki/munki"; \ No newline at end of file diff --git a/code/apps/Managed Software Center/Managed Software Center/en.lproj/Info.plist b/code/apps/Managed Software Center/Managed Software Center/en.lproj/Info.plist index 415c3da7..892eeab7 100755 --- a/code/apps/Managed Software Center/Managed Software Center/en.lproj/Info.plist +++ b/code/apps/Managed Software Center/Managed Software Center/en.lproj/Info.plist @@ -23,7 +23,7 @@ LSMinimumSystemVersion $(MACOSX_DEPLOYMENT_TARGET) NSHumanReadableCopyright - Copyright © 2019 The Munki Project. All rights reserved. + Copyright © 2019-2020 The Munki Project. All rights reserved. NSMainNibFile MainMenu NSPrincipalClass diff --git a/code/apps/Managed Software Center/Managed Software Center/en.lproj/InfoPlist.strings b/code/apps/Managed Software Center/Managed Software Center/en.lproj/InfoPlist.strings index 1e9d483e..aa4a2874 100755 --- a/code/apps/Managed Software Center/Managed Software Center/en.lproj/InfoPlist.strings +++ b/code/apps/Managed Software Center/Managed Software Center/en.lproj/InfoPlist.strings @@ -2,4 +2,4 @@ "CFBundleName" = "Managed Software Center"; "CFBundleDisplayName" = "Managed Software Center"; -NSHumanReadableCopyright = "Copyright © 2010-2019 The Munki Project\nhttps://github.com/munki/munki"; +NSHumanReadableCopyright = "Copyright © 2010-2020 The Munki Project\nhttps://github.com/munki/munki"; diff --git a/code/apps/Managed Software Center/Managed Software Center/es.lproj/InfoPlist.strings b/code/apps/Managed Software Center/Managed Software Center/es.lproj/InfoPlist.strings index 0fafd7da..f938d6ed 100755 --- a/code/apps/Managed Software Center/Managed Software Center/es.lproj/InfoPlist.strings +++ b/code/apps/Managed Software Center/Managed Software Center/es.lproj/InfoPlist.strings @@ -2,4 +2,4 @@ "CFBundleName" = "Centro de aplicaciones"; "CFBundleDisplayName" = "Centro de aplicaciones"; -NSHumanReadableCopyright = "Copyright © 2010-2019 The Munki Project\nhttps://github.com/munki/munki"; +NSHumanReadableCopyright = "Copyright © 2010-2020 The Munki Project\nhttps://github.com/munki/munki"; diff --git a/code/apps/Managed Software Center/Managed Software Center/fi.lproj/InfoPlist.strings b/code/apps/Managed Software Center/Managed Software Center/fi.lproj/InfoPlist.strings index 8a1ea041..eb02dda4 100755 --- a/code/apps/Managed Software Center/Managed Software Center/fi.lproj/InfoPlist.strings +++ b/code/apps/Managed Software Center/Managed Software Center/fi.lproj/InfoPlist.strings @@ -2,4 +2,4 @@ "CFBundleName" = "Managed Software Center"; "CFBundleDisplayName" = "Managed Software Center"; -NSHumanReadableCopyright = "Copyright © 2010-2019 The Munki Project\nhttps://github.com/munki/munki"; \ No newline at end of file +NSHumanReadableCopyright = "Copyright © 2010-2020 The Munki Project\nhttps://github.com/munki/munki"; \ No newline at end of file diff --git a/code/apps/Managed Software Center/Managed Software Center/fr.lproj/InfoPlist.strings b/code/apps/Managed Software Center/Managed Software Center/fr.lproj/InfoPlist.strings index 581ce409..bff80d0e 100755 --- a/code/apps/Managed Software Center/Managed Software Center/fr.lproj/InfoPlist.strings +++ b/code/apps/Managed Software Center/Managed Software Center/fr.lproj/InfoPlist.strings @@ -2,4 +2,4 @@ "CFBundleName" = "Centre de gestion des logiciels"; "CFBundleDisplayName" = "Centre de gestion des logiciels"; -NSHumanReadableCopyright = "Copyright © 2010-2019 The Munki Project\nhttps://github.com/munki/munki"; \ No newline at end of file +NSHumanReadableCopyright = "Copyright © 2010-2020 The Munki Project\nhttps://github.com/munki/munki"; \ No newline at end of file diff --git a/code/apps/Managed Software Center/Managed Software Center/iconutils.swift b/code/apps/Managed Software Center/Managed Software Center/iconutils.swift index 878b7d94..aa6802b0 100755 --- a/code/apps/Managed Software Center/Managed Software Center/iconutils.swift +++ b/code/apps/Managed Software Center/Managed Software Center/iconutils.swift @@ -3,7 +3,7 @@ // Managed Software Center // // Created by Greg Neagle on 6/11/18. -// Copyright © 2018-2019 The Munki Project. All rights reserved. +// Copyright © 2018-2020 The Munki Project. All rights reserved. // import Cocoa diff --git a/code/apps/Managed Software Center/Managed Software Center/it.lproj/InfoPlist.strings b/code/apps/Managed Software Center/Managed Software Center/it.lproj/InfoPlist.strings index e2dc43ac..21ff56ee 100755 --- a/code/apps/Managed Software Center/Managed Software Center/it.lproj/InfoPlist.strings +++ b/code/apps/Managed Software Center/Managed Software Center/it.lproj/InfoPlist.strings @@ -2,4 +2,4 @@ "CFBundleName" = "Centro Gestione Applicazioni"; "CFBundleDisplayName" = "Centro Gestione Applicazioni"; -NSHumanReadableCopyright = "Copyright © 2010-2019 The Munki Project\nhttps://github.com/munki/munki"; \ No newline at end of file +NSHumanReadableCopyright = "Copyright © 2010-2020 The Munki Project\nhttps://github.com/munki/munki"; \ No newline at end of file diff --git a/code/apps/Managed Software Center/Managed Software Center/mschtml.swift b/code/apps/Managed Software Center/Managed Software Center/mschtml.swift index af71c9a6..143b2538 100755 --- a/code/apps/Managed Software Center/Managed Software Center/mschtml.swift +++ b/code/apps/Managed Software Center/Managed Software Center/mschtml.swift @@ -3,7 +3,7 @@ // Managed Software Center // // Created by Greg Neagle on 6/15/18. -// Copyright © 2018-2019 The Munki Project. All rights reserved. +// Copyright © 2018-2020 The Munki Project. All rights reserved. // import Cocoa diff --git a/code/apps/Managed Software Center/Managed Software Center/msclib.swift b/code/apps/Managed Software Center/Managed Software Center/msclib.swift index 2f9edb93..2ed9f2e2 100755 --- a/code/apps/Managed Software Center/Managed Software Center/msclib.swift +++ b/code/apps/Managed Software Center/Managed Software Center/msclib.swift @@ -3,7 +3,7 @@ // Managed Software Center // // Created by Greg Neagle on 6/6/18. -// Copyright © 2018-2019 The Munki Project. All rights reserved. +// Copyright © 2018-2020 The Munki Project. All rights reserved. // import Foundation diff --git a/code/apps/Managed Software Center/Managed Software Center/msclog.swift b/code/apps/Managed Software Center/Managed Software Center/msclog.swift old mode 100755 new mode 100644 index 63f6e236..e26792ac --- a/code/apps/Managed Software Center/Managed Software Center/msclog.swift +++ b/code/apps/Managed Software Center/Managed Software Center/msclog.swift @@ -3,21 +3,104 @@ // Managed Software Center // // Created by Greg Neagle on 6/6/18. -// Copyright © 2018 The Munki Project. All rights reserved. +// Copyright © 2018-2020 The Munki Project. All rights reserved. // import Foundation +let MSULOGDIR = "/Users/Shared/.com.googlecode.munki.ManagedSoftwareUpdate.logs" +// TO-DO: eliminate these global vars +var MSULOGFILE = "" +var MSULOGENABLED = false +var MSUDEBUGLOGENABLED = false + +func is_safe_to_use(_ pathname: String) -> Bool { + // Returns true if we can open this file and it is a regular file owned by us + // mostly C functions since this a port from Python + var safe = false + if !(FileManager.default.fileExists(atPath: pathname)) { + if FileManager.default.createFile(atPath: pathname, contents: nil, attributes: [FileAttributeKey.posixPermissions: 0o0600]) == false { + NSLog("Could not create %@", pathname) + return false + } + } + let fref = open(UnsafePointer(pathname), O_RDWR | O_CREAT | O_NOFOLLOW, 0x0600) + if fref != -1 { + var st = stat() + if fstat(fref, UnsafeMutablePointer(&st)) == 0 { + safe = ((st.st_mode & S_IFREG) != 0) && (st.st_uid == getuid()) + } + close(fref) + } + return safe +} + func setup_logging() { - // stub + if pythonishBool(pref("MSUDebugLogEnabled")) { + MSUDEBUGLOGENABLED = true + } + if pythonishBool(pref("MSULogEnabled")) { + MSULOGENABLED = true + } + if !(MSULOGENABLED) { + return + } + + let username = NSUserName() + if !(FileManager.default.fileExists(atPath: MSULOGDIR)) { + do { + try FileManager.default.createDirectory(atPath: MSULOGDIR, withIntermediateDirectories: true, attributes: [FileAttributeKey.posixPermissions: 0o1777]) + } catch { + NSLog("Could not create %@: %@", MSULOGDIR, "\(error)") + return + } + } + var pathIsDir = ObjCBool(false) + let msuLogDirExists = FileManager.default.fileExists(atPath: MSULOGDIR, isDirectory: &pathIsDir) + if !msuLogDirExists { + NSLog("%@ doesn't exist.", MSULOGDIR) + return + } else if pathIsDir.boolValue == false { + NSLog("%@ is not a directory", MSULOGDIR) + return + } + // try to set our preferred permissions + do { + try FileManager.default.setAttributes([FileAttributeKey.posixPermissions: 0o1777], ofItemAtPath: MSULOGDIR) + } catch { + // do nothing + } + // find a safe log file to write to for this user + var filename = NSString.path(withComponents: [MSULOGDIR, "\(username).log"]) + //make sure we can write to this; that it's owned by us, and not writable by group or other + for _ in 0..<10 { + if is_safe_to_use(filename) { + MSULOGFILE = filename + NSLog("Using file %@ for user-level logging", filename) + return + } + NSLog("Not safe to use %@ for logging", filename) + filename = NSString.path(withComponents: [MSULOGDIR, "\(username)_\(arc4random()).log"]) + } + NSLog("Could not set up user-level logging for %@", username) } func msc_log(_ source: String, _ event: String, msg: String = "") { - // stub - print("\(source): \(event) \(msg)") + // Log an event from a source. + if MSULOGFILE != "" { + let datestamp = NSDate().timeIntervalSince1970 + let logString = "\(datestamp) \(source): \(event) \(msg)\n" + if let logData = logString.data(using: String.Encoding.utf8) { + if let fh = FileHandle(forUpdatingAtPath: MSULOGFILE) { + let _ = fh.seekToEndOfFile() + fh.write(logData) + } + } + } } func msc_debug_log(_ logMessage: String) { - // stub - print(logMessage) + // Log to Apple System Log facility and also to MSU log if configured + NSLog("%@", logMessage) + msc_log("MSC", "debug", msg: logMessage) } diff --git a/code/apps/Managed Software Center/Managed Software Center/munki.swift b/code/apps/Managed Software Center/Managed Software Center/munki.swift index c66ab22b..f902cd1e 100755 --- a/code/apps/Managed Software Center/Managed Software Center/munki.swift +++ b/code/apps/Managed Software Center/Managed Software Center/munki.swift @@ -3,7 +3,7 @@ // Managed Software Center // // Created by Greg Neagle on 5/27/18. -// Copyright © 2018-2019 The Munki Project. All rights reserved. +// Copyright © 2018-2020 The Munki Project. All rights reserved. // import Foundation diff --git a/code/apps/Managed Software Center/Managed Software Center/nb.lproj/InfoPlist.strings b/code/apps/Managed Software Center/Managed Software Center/nb.lproj/InfoPlist.strings index 8a1ea041..eb02dda4 100755 --- a/code/apps/Managed Software Center/Managed Software Center/nb.lproj/InfoPlist.strings +++ b/code/apps/Managed Software Center/Managed Software Center/nb.lproj/InfoPlist.strings @@ -2,4 +2,4 @@ "CFBundleName" = "Managed Software Center"; "CFBundleDisplayName" = "Managed Software Center"; -NSHumanReadableCopyright = "Copyright © 2010-2019 The Munki Project\nhttps://github.com/munki/munki"; \ No newline at end of file +NSHumanReadableCopyright = "Copyright © 2010-2020 The Munki Project\nhttps://github.com/munki/munki"; \ No newline at end of file diff --git a/code/apps/Managed Software Center/Managed Software Center/nl.lproj/InfoPlist.strings b/code/apps/Managed Software Center/Managed Software Center/nl.lproj/InfoPlist.strings index 8a1ea041..eb02dda4 100755 --- a/code/apps/Managed Software Center/Managed Software Center/nl.lproj/InfoPlist.strings +++ b/code/apps/Managed Software Center/Managed Software Center/nl.lproj/InfoPlist.strings @@ -2,4 +2,4 @@ "CFBundleName" = "Managed Software Center"; "CFBundleDisplayName" = "Managed Software Center"; -NSHumanReadableCopyright = "Copyright © 2010-2019 The Munki Project\nhttps://github.com/munki/munki"; \ No newline at end of file +NSHumanReadableCopyright = "Copyright © 2010-2020 The Munki Project\nhttps://github.com/munki/munki"; \ No newline at end of file diff --git a/code/apps/Managed Software Center/Managed Software Center/passwdutil.swift b/code/apps/Managed Software Center/Managed Software Center/passwdutil.swift index 9170c072..8706663e 100755 --- a/code/apps/Managed Software Center/Managed Software Center/passwdutil.swift +++ b/code/apps/Managed Software Center/Managed Software Center/passwdutil.swift @@ -3,7 +3,7 @@ // Managed Software Center // // Created by Greg Neagle on 6/29/18. -// Copyright © 2018-2019 The Munki Project. All rights reserved. +// Copyright © 2018-2020 The Munki Project. All rights reserved. // import Foundation diff --git a/code/apps/Managed Software Center/Managed Software Center/power.swift b/code/apps/Managed Software Center/Managed Software Center/power.swift index 31d570e5..3b3fed72 100755 --- a/code/apps/Managed Software Center/Managed Software Center/power.swift +++ b/code/apps/Managed Software Center/Managed Software Center/power.swift @@ -3,7 +3,7 @@ // Managed Software Center // // Created by Greg Neagle on 7/16/18. -// Copyright © 2018-2019 The Munki Project. All rights reserved. +// Copyright © 2018-2020 The Munki Project. All rights reserved. // import Foundation diff --git a/code/apps/Managed Software Center/Managed Software Center/ru.lproj/InfoPlist.strings b/code/apps/Managed Software Center/Managed Software Center/ru.lproj/InfoPlist.strings index 9fa0a5c0..2508a654 100755 --- a/code/apps/Managed Software Center/Managed Software Center/ru.lproj/InfoPlist.strings +++ b/code/apps/Managed Software Center/Managed Software Center/ru.lproj/InfoPlist.strings @@ -2,4 +2,4 @@ "CFBundleName" = "Центр Управления ПО"; "CFBundleDisplayName" = "Центр Управления ПО"; -NSHumanReadableCopyright = "Copyright © 2010-2019 The Munki Project\nhttps://github.com/munki/munki"; +NSHumanReadableCopyright = "Copyright © 2010-2020 The Munki Project\nhttps://github.com/munki/munki"; diff --git a/code/apps/Managed Software Center/Managed Software Center/sv.lproj/InfoPlist.strings b/code/apps/Managed Software Center/Managed Software Center/sv.lproj/InfoPlist.strings index 8a1ea041..eb02dda4 100755 --- a/code/apps/Managed Software Center/Managed Software Center/sv.lproj/InfoPlist.strings +++ b/code/apps/Managed Software Center/Managed Software Center/sv.lproj/InfoPlist.strings @@ -2,4 +2,4 @@ "CFBundleName" = "Managed Software Center"; "CFBundleDisplayName" = "Managed Software Center"; -NSHumanReadableCopyright = "Copyright © 2010-2019 The Munki Project\nhttps://github.com/munki/munki"; \ No newline at end of file +NSHumanReadableCopyright = "Copyright © 2010-2020 The Munki Project\nhttps://github.com/munki/munki"; \ No newline at end of file diff --git a/code/apps/MunkiStatus/MunkiStatus.xcodeproj/project.pbxproj b/code/apps/MunkiStatus/MunkiStatus.xcodeproj/project.pbxproj index 8c750a55..acb39ef2 100644 --- a/code/apps/MunkiStatus/MunkiStatus.xcodeproj/project.pbxproj +++ b/code/apps/MunkiStatus/MunkiStatus.xcodeproj/project.pbxproj @@ -14,6 +14,7 @@ C0544D4C20AF0EDA00DC86F6 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0544D4B20AF0EDA00DC86F6 /* AppDelegate.swift */; }; C0544D4E20AF0EDA00DC86F6 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C0544D4D20AF0EDA00DC86F6 /* Assets.xcassets */; }; C0544D5120AF0EDA00DC86F6 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = C0544D4F20AF0EDA00DC86F6 /* MainMenu.xib */; }; + C0787F7B2315C6210054D130 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0787F7A2315C6210054D130 /* main.swift */; }; C0A7937E20AFAE0300F56DD5 /* MunkiStatusViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0A7937D20AFAE0300F56DD5 /* MunkiStatusViewController.swift */; }; C0A7938020B0EA7800F56DD5 /* Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0A7937F20B0EA7800F56DD5 /* Utils.swift */; }; /* End PBXBuildFile section */ @@ -70,6 +71,7 @@ C0544D4B20AF0EDA00DC86F6 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; C0544D4D20AF0EDA00DC86F6 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; C0544D5020AF0EDA00DC86F6 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; + C0787F7A2315C6210054D130 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; }; C0A7937D20AFAE0300F56DD5 /* MunkiStatusViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MunkiStatusViewController.swift; sourceTree = ""; }; C0A7937F20B0EA7800F56DD5 /* Utils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Utils.swift; sourceTree = ""; }; /* End PBXFileReference section */ @@ -105,6 +107,7 @@ isa = PBXGroup; children = ( C04F825C20BB15F500F9C57D /* Localization.swift */, + C0787F7A2315C6210054D130 /* main.swift */, C0168E8F20B1E1D80027BD78 /* LogViewController.swift */, C0A7937D20AFAE0300F56DD5 /* MunkiStatusViewController.swift */, C0544D4B20AF0EDA00DC86F6 /* AppDelegate.swift */, @@ -146,7 +149,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0920; - LastUpgradeCheck = 0920; + LastUpgradeCheck = 1020; ORGANIZATIONNAME = "The Munki Project"; TargetAttributes = { C0544D4720AF0EDA00DC86F6 = { @@ -230,6 +233,7 @@ files = ( C0A7938020B0EA7800F56DD5 /* Utils.swift in Sources */, C04F825D20BB15F500F9C57D /* Localization.swift in Sources */, + C0787F7B2315C6210054D130 /* main.swift in Sources */, C0544D4C20AF0EDA00DC86F6 /* AppDelegate.swift in Sources */, C0A7937E20AFAE0300F56DD5 /* MunkiStatusViewController.swift in Sources */, C0168E9020B1E1D80027BD78 /* LogViewController.swift in Sources */, @@ -331,6 +335,7 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; @@ -338,6 +343,7 @@ CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; @@ -365,7 +371,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.9; + MACOSX_DEPLOYMENT_TARGET = 10.10; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; @@ -389,6 +395,7 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; @@ -396,6 +403,7 @@ CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; @@ -417,7 +425,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.9; + MACOSX_DEPLOYMENT_TARGET = 10.10; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; diff --git a/code/apps/MunkiStatus/MunkiStatus/AppDelegate.swift b/code/apps/MunkiStatus/MunkiStatus/AppDelegate.swift index 37063d0f..d30bbc34 100644 --- a/code/apps/MunkiStatus/MunkiStatus/AppDelegate.swift +++ b/code/apps/MunkiStatus/MunkiStatus/AppDelegate.swift @@ -3,12 +3,11 @@ // MunkiStatus // // Created by Greg Neagle on 5/18/18. -// Copyright © 2018-2019 The Munki Project. All rights reserved. +// Copyright © 2018-2020 The Munki Project. All rights reserved. // import Cocoa -@NSApplicationMain class AppDelegate: NSObject, NSApplicationDelegate { @IBOutlet weak var window: NSWindow! diff --git a/code/apps/MunkiStatus/MunkiStatus/Base.lproj/MainMenu.xib b/code/apps/MunkiStatus/MunkiStatus/Base.lproj/MainMenu.xib index dc4c4067..908a13d6 100644 --- a/code/apps/MunkiStatus/MunkiStatus/Base.lproj/MainMenu.xib +++ b/code/apps/MunkiStatus/MunkiStatus/Base.lproj/MainMenu.xib @@ -1,8 +1,8 @@ - + - + @@ -73,7 +73,8 @@ - + + @@ -165,7 +166,7 @@ - + @@ -218,7 +219,7 @@ - + @@ -233,7 +234,7 @@ - + @@ -271,11 +272,11 @@ -