From 5b54612d91129afb92aee01e14984e7e2e401709 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Wed, 6 May 2015 20:41:51 -0700 Subject: Pass authtoken in from user, and add a wrapper for web UI on Mac. --- .../api.xcuserdatad/UserInterfaceState.xcuserstate | Bin 0 -> 18268 bytes .../api.xcuserdatad/WorkspaceSettings.xcsettings | 10 ++++++++++ 2 files changed, 10 insertions(+) create mode 100644 ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/project.xcworkspace/xcuserdata/api.xcuserdatad/UserInterfaceState.xcuserstate create mode 100644 ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/project.xcworkspace/xcuserdata/api.xcuserdatad/WorkspaceSettings.xcsettings (limited to 'ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/project.xcworkspace/xcuserdata/api.xcuserdatad') diff --git a/ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/project.xcworkspace/xcuserdata/api.xcuserdatad/UserInterfaceState.xcuserstate b/ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/project.xcworkspace/xcuserdata/api.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 00000000..04ade238 Binary files /dev/null and b/ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/project.xcworkspace/xcuserdata/api.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/project.xcworkspace/xcuserdata/api.xcuserdatad/WorkspaceSettings.xcsettings b/ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/project.xcworkspace/xcuserdata/api.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 00000000..659c8766 --- /dev/null +++ b/ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/project.xcworkspace/xcuserdata/api.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + -- cgit v1.2.3 From d56e9fce415e5b764091921dd5cedde175fbcf7d Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Wed, 6 May 2015 20:45:02 -0700 Subject: Get user data out of repo. --- .gitignore | 1 + .../MacGap.xcodeproj/project.pbxproj | 6 + .../xcshareddata/MacGap.xccheckout | 18 +-- .../api.xcuserdatad/UserInterfaceState.xcuserstate | Bin 18268 -> 19568 bytes .../xcdebugger/Breakpoints.xcbkptlist | 131 ----------------- .../Alex.xcuserdatad/xcschemes/MacGap.xcscheme | 86 ----------- .../xcschemes/xcschememanagement.plist | 22 --- .../xcdebugger/Breakpoints_v2.xcbkptlist | 5 - .../xcdebugger/Breakpoints.xcbkptlist | 161 --------------------- .../liamks.xcuserdatad/xcschemes/MacGap.xcscheme | 84 ----------- .../xcschemes/xcschememanagement.plist | 22 --- .../AppIcon.appiconset/Contents.json | 63 ++++++++ .../AppIcon.appiconset/application128x128.png | Bin 0 -> 11247 bytes .../AppIcon.appiconset/application16x16.png | Bin 0 -> 715 bytes .../AppIcon.appiconset/application256x256.png | Bin 0 -> 29043 bytes .../AppIcon.appiconset/application32x32.png | Bin 0 -> 1787 bytes .../AppIcon.appiconset/application512x512.png | Bin 0 -> 57374 bytes .../MacGap/MacGap-Info.plist | 2 - ext/mac-ui-macgap1-wrapper/README.md | 38 +---- 19 files changed, 83 insertions(+), 556 deletions(-) delete mode 100644 ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/xcuserdata/Alex.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist delete mode 100644 ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/xcuserdata/Alex.xcuserdatad/xcschemes/MacGap.xcscheme delete mode 100644 ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/xcuserdata/Alex.xcuserdatad/xcschemes/xcschememanagement.plist delete mode 100644 ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/xcuserdata/api.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist delete mode 100644 ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/xcuserdata/liamks.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist delete mode 100644 ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/xcuserdata/liamks.xcuserdatad/xcschemes/MacGap.xcscheme delete mode 100644 ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/xcuserdata/liamks.xcuserdatad/xcschemes/xcschememanagement.plist create mode 100644 ext/mac-ui-macgap1-wrapper/MacGap/Images.xcassets/AppIcon.appiconset/Contents.json create mode 100644 ext/mac-ui-macgap1-wrapper/MacGap/Images.xcassets/AppIcon.appiconset/application128x128.png create mode 100644 ext/mac-ui-macgap1-wrapper/MacGap/Images.xcassets/AppIcon.appiconset/application16x16.png create mode 100644 ext/mac-ui-macgap1-wrapper/MacGap/Images.xcassets/AppIcon.appiconset/application256x256.png create mode 100644 ext/mac-ui-macgap1-wrapper/MacGap/Images.xcassets/AppIcon.appiconset/application32x32.png create mode 100644 ext/mac-ui-macgap1-wrapper/MacGap/Images.xcassets/AppIcon.appiconset/application512x512.png (limited to 'ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/project.xcworkspace/xcuserdata/api.xcuserdatad') diff --git a/.gitignore b/.gitignore index db660e14..f789b3b7 100755 --- a/.gitignore +++ b/.gitignore @@ -39,3 +39,4 @@ /root-topology/*.secret /root-topology/test/supernodes /root-topology/test/test-root-topology +xcuserdata diff --git a/ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/project.pbxproj b/ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/project.pbxproj index ea339cf0..9d71cecc 100644 --- a/ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/project.pbxproj +++ b/ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/project.pbxproj @@ -19,6 +19,7 @@ 88C0646014BDE10A00E4BCE2 /* Window.m in Sources */ = {isa = PBXBuildFile; fileRef = 88C0645F14BDE10A00E4BCE2 /* Window.m */; }; 88C0646614BDEC5800E4BCE2 /* Window.xib in Resources */ = {isa = PBXBuildFile; fileRef = 88C0646414BDEC5800E4BCE2 /* Window.xib */; }; 88C0646D14BDF6A600E4BCE2 /* WindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 88C0646C14BDF6A600E4BCE2 /* WindowController.m */; }; + C13A649D1AFB171100CB31FE /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C13A649C1AFB171100CB31FE /* Images.xcassets */; }; C1C2B9911AFB0CF10060D7C2 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C1C2B9901AFB0CF10060D7C2 /* Security.framework */; }; F2B80016179E0FC100B069A8 /* Clipboard.m in Sources */ = {isa = PBXBuildFile; fileRef = F2B80015179E0FC100B069A8 /* Clipboard.m */; }; FA32509D14BA813600BF0781 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA32509C14BA813600BF0781 /* WebKit.framework */; }; @@ -74,6 +75,7 @@ 88C0646514BDEC5800E4BCE2 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/Window.xib; sourceTree = ""; }; 88C0646B14BDF6A600E4BCE2 /* WindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WindowController.h; sourceTree = ""; }; 88C0646C14BDF6A600E4BCE2 /* WindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WindowController.m; sourceTree = ""; }; + C13A649C1AFB171100CB31FE /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; C1C2B9901AFB0CF10060D7C2 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; }; F2B80014179E0FC100B069A8 /* Clipboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Clipboard.h; sourceTree = ""; }; F2B80015179E0FC100B069A8 /* Clipboard.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Clipboard.m; sourceTree = ""; }; @@ -227,6 +229,7 @@ FAE451D114BA79C600190544 /* AppDelegate.m */, FAE451D314BA79C600190544 /* MainMenu.xib */, 88C0646414BDEC5800E4BCE2 /* Window.xib */, + C13A649C1AFB171100CB31FE /* Images.xcassets */, FAE451C514BA79C600190544 /* Supporting Files */, ); path = MacGap; @@ -299,6 +302,7 @@ files = ( FA3250E514BA883A00BF0781 /* public in Resources */, FAE451C914BA79C600190544 /* InfoPlist.strings in Resources */, + C13A649D1AFB171100CB31FE /* Images.xcassets in Resources */, FAE451CF14BA79C600190544 /* Credits.rtf in Resources */, FAE451D514BA79C600190544 /* MainMenu.xib in Resources */, FA3250E714BA8BCE00BF0781 /* application.icns in Resources */, @@ -426,6 +430,7 @@ FAE451D914BA79C600190544 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_CXX_LANGUAGE_STANDARD = "compiler-default"; CLANG_CXX_LIBRARY = "compiler-default"; COMBINE_HIDPI_IMAGES = YES; @@ -447,6 +452,7 @@ FAE451DA14BA79C600190544 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_CXX_LANGUAGE_STANDARD = "compiler-default"; CLANG_CXX_LIBRARY = "compiler-default"; COMBINE_HIDPI_IMAGES = YES; diff --git a/ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/project.xcworkspace/xcshareddata/MacGap.xccheckout b/ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/project.xcworkspace/xcshareddata/MacGap.xccheckout index b2ea215d..2a06dbc5 100644 --- a/ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/project.xcworkspace/xcshareddata/MacGap.xccheckout +++ b/ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/project.xcworkspace/xcshareddata/MacGap.xccheckout @@ -10,31 +10,31 @@ MacGap IDESourceControlProjectOriginsDictionary - 60776BB1B4F98ABFCF3BD8223221516D7FB415ED - https://github.com/MacGapProject/MacGap1.git + ABA3617E9F0148F844A82502F0D808DE6591AA97 + http://adam.ierymenko@git.int.zerotier.com/zerotier/zerotierone IDESourceControlProjectPath - MacGap.xcodeproj + ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj IDESourceControlProjectRelativeInstallPathDictionary - 60776BB1B4F98ABFCF3BD8223221516D7FB415ED - ../.. + ABA3617E9F0148F844A82502F0D808DE6591AA97 + ../../../.. IDESourceControlProjectURL - https://github.com/MacGapProject/MacGap1.git + http://adam.ierymenko@git.int.zerotier.com/zerotier/zerotierone IDESourceControlProjectVersion 111 IDESourceControlProjectWCCIdentifier - 60776BB1B4F98ABFCF3BD8223221516D7FB415ED + ABA3617E9F0148F844A82502F0D808DE6591AA97 IDESourceControlProjectWCConfigurations IDESourceControlRepositoryExtensionIdentifierKey public.vcs.git IDESourceControlWCCIdentifierKey - 60776BB1B4F98ABFCF3BD8223221516D7FB415ED + ABA3617E9F0148F844A82502F0D808DE6591AA97 IDESourceControlWCCName - MacGap1 + ZeroTierOne diff --git a/ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/project.xcworkspace/xcuserdata/api.xcuserdatad/UserInterfaceState.xcuserstate b/ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/project.xcworkspace/xcuserdata/api.xcuserdatad/UserInterfaceState.xcuserstate index 04ade238..6dfcf6d0 100644 Binary files a/ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/project.xcworkspace/xcuserdata/api.xcuserdatad/UserInterfaceState.xcuserstate and b/ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/project.xcworkspace/xcuserdata/api.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/xcuserdata/Alex.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist b/ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/xcuserdata/Alex.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist deleted file mode 100644 index 38f66126..00000000 --- a/ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/xcuserdata/Alex.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist +++ /dev/null @@ -1,131 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/xcuserdata/Alex.xcuserdatad/xcschemes/MacGap.xcscheme b/ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/xcuserdata/Alex.xcuserdatad/xcschemes/MacGap.xcscheme deleted file mode 100644 index 0aaad582..00000000 --- a/ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/xcuserdata/Alex.xcuserdatad/xcschemes/MacGap.xcscheme +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/xcuserdata/Alex.xcuserdatad/xcschemes/xcschememanagement.plist b/ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/xcuserdata/Alex.xcuserdatad/xcschemes/xcschememanagement.plist deleted file mode 100644 index 921f1a6f..00000000 --- a/ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/xcuserdata/Alex.xcuserdatad/xcschemes/xcschememanagement.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - SchemeUserState - - MacGap.xcscheme - - orderHint - 0 - - - SuppressBuildableAutocreation - - FAE451B914BA79C600190544 - - primary - - - - - diff --git a/ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/xcuserdata/api.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/xcuserdata/api.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist deleted file mode 100644 index fe2b4541..00000000 --- a/ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/xcuserdata/api.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/xcuserdata/liamks.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist b/ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/xcuserdata/liamks.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist deleted file mode 100644 index 8e541eab..00000000 --- a/ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/xcuserdata/liamks.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist +++ /dev/null @@ -1,161 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/xcuserdata/liamks.xcuserdatad/xcschemes/MacGap.xcscheme b/ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/xcuserdata/liamks.xcuserdatad/xcschemes/MacGap.xcscheme deleted file mode 100644 index 872d6d7d..00000000 --- a/ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/xcuserdata/liamks.xcuserdatad/xcschemes/MacGap.xcscheme +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/xcuserdata/liamks.xcuserdatad/xcschemes/xcschememanagement.plist b/ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/xcuserdata/liamks.xcuserdatad/xcschemes/xcschememanagement.plist deleted file mode 100644 index 921f1a6f..00000000 --- a/ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/xcuserdata/liamks.xcuserdatad/xcschemes/xcschememanagement.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - SchemeUserState - - MacGap.xcscheme - - orderHint - 0 - - - SuppressBuildableAutocreation - - FAE451B914BA79C600190544 - - primary - - - - - diff --git a/ext/mac-ui-macgap1-wrapper/MacGap/Images.xcassets/AppIcon.appiconset/Contents.json b/ext/mac-ui-macgap1-wrapper/MacGap/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..2592eae9 --- /dev/null +++ b/ext/mac-ui-macgap1-wrapper/MacGap/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,63 @@ +{ + "images" : [ + { + "idiom" : "mac", + "scale" : "2x", + "size" : "16x16" + }, + { + "size" : "16x16", + "idiom" : "mac", + "filename" : "application16x16.png", + "scale" : "1x" + }, + { + "size" : "32x32", + "idiom" : "mac", + "filename" : "application32x32.png", + "scale" : "1x" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "32x32" + }, + { + "size" : "128x128", + "idiom" : "mac", + "filename" : "application128x128.png", + "scale" : "1x" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "128x128" + }, + { + "size" : "256x256", + "idiom" : "mac", + "filename" : "application256x256.png", + "scale" : "1x" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "256x256" + }, + { + "size" : "512x512", + "idiom" : "mac", + "filename" : "application512x512.png", + "scale" : "1x" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "512x512" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/ext/mac-ui-macgap1-wrapper/MacGap/Images.xcassets/AppIcon.appiconset/application128x128.png b/ext/mac-ui-macgap1-wrapper/MacGap/Images.xcassets/AppIcon.appiconset/application128x128.png new file mode 100644 index 00000000..93dd80a1 Binary files /dev/null and b/ext/mac-ui-macgap1-wrapper/MacGap/Images.xcassets/AppIcon.appiconset/application128x128.png differ diff --git a/ext/mac-ui-macgap1-wrapper/MacGap/Images.xcassets/AppIcon.appiconset/application16x16.png b/ext/mac-ui-macgap1-wrapper/MacGap/Images.xcassets/AppIcon.appiconset/application16x16.png new file mode 100644 index 00000000..3aa19da6 Binary files /dev/null and b/ext/mac-ui-macgap1-wrapper/MacGap/Images.xcassets/AppIcon.appiconset/application16x16.png differ diff --git a/ext/mac-ui-macgap1-wrapper/MacGap/Images.xcassets/AppIcon.appiconset/application256x256.png b/ext/mac-ui-macgap1-wrapper/MacGap/Images.xcassets/AppIcon.appiconset/application256x256.png new file mode 100644 index 00000000..c30106b7 Binary files /dev/null and b/ext/mac-ui-macgap1-wrapper/MacGap/Images.xcassets/AppIcon.appiconset/application256x256.png differ diff --git a/ext/mac-ui-macgap1-wrapper/MacGap/Images.xcassets/AppIcon.appiconset/application32x32.png b/ext/mac-ui-macgap1-wrapper/MacGap/Images.xcassets/AppIcon.appiconset/application32x32.png new file mode 100644 index 00000000..05ff6cb8 Binary files /dev/null and b/ext/mac-ui-macgap1-wrapper/MacGap/Images.xcassets/AppIcon.appiconset/application32x32.png differ diff --git a/ext/mac-ui-macgap1-wrapper/MacGap/Images.xcassets/AppIcon.appiconset/application512x512.png b/ext/mac-ui-macgap1-wrapper/MacGap/Images.xcassets/AppIcon.appiconset/application512x512.png new file mode 100644 index 00000000..b6b9da61 Binary files /dev/null and b/ext/mac-ui-macgap1-wrapper/MacGap/Images.xcassets/AppIcon.appiconset/application512x512.png differ diff --git a/ext/mac-ui-macgap1-wrapper/MacGap/MacGap-Info.plist b/ext/mac-ui-macgap1-wrapper/MacGap/MacGap-Info.plist index 2031cefc..3730da8f 100644 --- a/ext/mac-ui-macgap1-wrapper/MacGap/MacGap-Info.plist +++ b/ext/mac-ui-macgap1-wrapper/MacGap/MacGap-Info.plist @@ -6,8 +6,6 @@ en CFBundleExecutable ZeroTier One - CFBundleIconFile - application.icns CFBundleIdentifier com.zerotier.$(PRODUCT_NAME:rfc1034identifier) CFBundleInfoDictionaryVersion diff --git a/ext/mac-ui-macgap1-wrapper/README.md b/ext/mac-ui-macgap1-wrapper/README.md index bc69b132..daf3eae9 100644 --- a/ext/mac-ui-macgap1-wrapper/README.md +++ b/ext/mac-ui-macgap1-wrapper/README.md @@ -1,36 +1,6 @@ -#MacGap +Mac Web UI Wrapper +====== -The MacGap project provides HTML/JS/CSS developers an Xcode project for developing Native OSX Apps that run in OSX's WebView and take advantage of WebKit technologies. +This is a modified version of MacGap1 which launches a WebKit view and accesses the local ZeroTier service at its web URL. It builds the URL from the authtoken.secret file in the system home (or the user home) and the zerotier-one.port file that ZeroTier creates to advertise its control port. -The project exposes a JavaScript API for OS X integration, such as displaying native OS X 10.9 notifications. The MacGap project is extremely lightweight and nimble; a blank application is about 980KB. - -### Features: -* tiny compiled app sizes -* Mac App Store compatible -* access to many Mac OS X-specific features - -##Pre-requisites - -MacGap works on OSX 10.6 and later. - -Generate apps with the [macgap generator](http://github.com/maccman/macgap-rb), no compile necessary. - - gem install macgap - - macgap new myapp - macgap build myapp - -##API - -MacGap exposes an object called `macgap` inside JavaScript. You can use it to alter the Dock icon and display Growl notifications, amongst other things. The API is documented in the WIKI on GitHub: https://github.com/maccman/macgap/wiki - - -##Attributes - -MacGap was forked/ported from Phonegap-mac. It's under the same license (MIT). - -##Custom Build - -To build, make sure you have installed the latest Mac OSX Core Library. Download at [http://developer.apple.com/](http://developer.apple.com/). - -Just clone the repository and build in Xcode. The file `public/index.html` is loaded on startup. +It's based on the original MacGap1 source by Twitter, Inc. which is licensed under the MIT license. -- cgit v1.2.3 From 4426899e8c9469518325f39f173151b3535ac20e Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Wed, 6 May 2015 21:02:59 -0700 Subject: Add support for local user account caching of authtoken.secret as in old UI -- this is now pretty much working. --- .gitignore | 2 +- .../api.xcuserdatad/UserInterfaceState.xcuserstate | Bin 19568 -> 0 bytes .../api.xcuserdatad/xcschemes/MacGap.xcscheme | 88 ------------ .../xcschemes/xcschememanagement.plist | 22 --- ext/mac-ui-macgap1-wrapper/MacGap/AppDelegate.m | 153 +++++++++++++-------- 5 files changed, 95 insertions(+), 170 deletions(-) delete mode 100644 ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/project.xcworkspace/xcuserdata/api.xcuserdatad/UserInterfaceState.xcuserstate delete mode 100644 ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/xcuserdata/api.xcuserdatad/xcschemes/MacGap.xcscheme delete mode 100644 ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/xcuserdata/api.xcuserdatad/xcschemes/xcschememanagement.plist (limited to 'ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/project.xcworkspace/xcuserdata/api.xcuserdatad') diff --git a/.gitignore b/.gitignore index f789b3b7..4a24c4db 100755 --- a/.gitignore +++ b/.gitignore @@ -39,4 +39,4 @@ /root-topology/*.secret /root-topology/test/supernodes /root-topology/test/test-root-topology -xcuserdata +/ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/project.xcworkspace/xcuserdata/* diff --git a/ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/project.xcworkspace/xcuserdata/api.xcuserdatad/UserInterfaceState.xcuserstate b/ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/project.xcworkspace/xcuserdata/api.xcuserdatad/UserInterfaceState.xcuserstate deleted file mode 100644 index 6dfcf6d0..00000000 Binary files a/ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/project.xcworkspace/xcuserdata/api.xcuserdatad/UserInterfaceState.xcuserstate and /dev/null differ diff --git a/ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/xcuserdata/api.xcuserdatad/xcschemes/MacGap.xcscheme b/ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/xcuserdata/api.xcuserdatad/xcschemes/MacGap.xcscheme deleted file mode 100644 index 2555dc89..00000000 --- a/ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/xcuserdata/api.xcuserdatad/xcschemes/MacGap.xcscheme +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/xcuserdata/api.xcuserdatad/xcschemes/xcschememanagement.plist b/ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/xcuserdata/api.xcuserdatad/xcschemes/xcschememanagement.plist deleted file mode 100644 index 921f1a6f..00000000 --- a/ext/mac-ui-macgap1-wrapper/MacGap.xcodeproj/xcuserdata/api.xcuserdatad/xcschemes/xcschememanagement.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - SchemeUserState - - MacGap.xcscheme - - orderHint - 0 - - - SuppressBuildableAutocreation - - FAE451B914BA79C600190544 - - primary - - - - - diff --git a/ext/mac-ui-macgap1-wrapper/MacGap/AppDelegate.m b/ext/mac-ui-macgap1-wrapper/MacGap/AppDelegate.m index 96a3e820..3e25ca13 100644 --- a/ext/mac-ui-macgap1-wrapper/MacGap/AppDelegate.m +++ b/ext/mac-ui-macgap1-wrapper/MacGap/AppDelegate.m @@ -7,6 +7,8 @@ // #import "AppDelegate.h" +#include +#include @implementation AppDelegate @@ -29,75 +31,108 @@ } - (void) applicationDidFinishLaunching:(NSNotification *)aNotification { - // Create authorization reference - OSStatus status; - AuthorizationRef authorizationRef; - - // AuthorizationCreate and pass NULL as the initial - // AuthorizationRights set so that the AuthorizationRef gets created - // successfully, and then later call AuthorizationCopyRights to - // determine or extend the allowable rights. - // http://developer.apple.com/qa/qa2001/qa1172.html - status = AuthorizationCreate(NULL, kAuthorizationEmptyEnvironment, kAuthorizationFlagDefaults, &authorizationRef); - if (status != errAuthorizationSuccess) - { - NSLog(@"Error Creating Initial Authorization: %d", status); - return; - } - - // kAuthorizationRightExecute == "system.privilege.admin" - AuthorizationItem right = {kAuthorizationRightExecute, 0, NULL, 0}; - AuthorizationRights rights = {1, &right}; - AuthorizationFlags flags = kAuthorizationFlagDefaults | kAuthorizationFlagInteractionAllowed | - kAuthorizationFlagPreAuthorize | kAuthorizationFlagExtendRights; - - // Call AuthorizationCopyRights to determine or extend the allowable rights. - status = AuthorizationCopyRights(authorizationRef, &rights, NULL, flags, NULL); - if (status != errAuthorizationSuccess) - { - NSLog(@"Copy Rights Unsuccessful: %d", status); - return; - } - - // use rm tool with -rf - char *tool = "/bin/cat"; - char *args[] = {"/Library/Application Support/ZeroTier/One/authtoken.secret", NULL}; - FILE *pipe = NULL; - - status = AuthorizationExecuteWithPrivileges(authorizationRef, tool, kAuthorizationFlagDefaults, args, &pipe); - if (status != errAuthorizationSuccess) - { - NSLog(@"Error: %d", status); - } - - char url[16384]; - memset(url,0,sizeof(url)); - if (pipe) { - char buf[16384]; + char buf[16384],userAuthTokenPath[4096]; - FILE *pf = fopen("/Library/Application Support/ZeroTier/One/zerotier-one.port","r"); + FILE *pf = fopen("/Library/Application Support/ZeroTier/One/zerotier-one.port","r"); + long port = 9993; // default + if (pf) { long n = fread(buf,1,sizeof(buf)-1,pf); - long port = 9993; // default if (n > 0) { buf[n] = (char)0; port = strtol(buf,(char **)0,10); } fclose(pf); + } - n = (long)fread(buf,1,sizeof(buf)-1,pipe); - if (n > 0) { - buf[n] = (char)0; - snprintf(url,sizeof(url),"http://127.0.0.1:%ld/index.html?authToken=%s",port,buf); + char url[16384]; + memset(url,0,sizeof(url)); + + const char *homeDir = getenv("HOME"); + if (homeDir) { + snprintf(userAuthTokenPath,sizeof(userAuthTokenPath),"%s/Library/Application Support/ZeroTier/One/authtoken.secret",homeDir); + pf = fopen(userAuthTokenPath,"r"); + if (pf) { + long n = fread(buf,1,sizeof(buf)-1,pf); + if (n > 0) { + buf[n] = (char)0; + snprintf(url,sizeof(url),"http://127.0.0.1:%ld/index.html?authToken=%s",port,buf); + } + fclose(pf); + } + } + + if (!url[0]) { + // Create authorization reference + OSStatus status; + AuthorizationRef authorizationRef; + + // AuthorizationCreate and pass NULL as the initial + // AuthorizationRights set so that the AuthorizationRef gets created + // successfully, and then later call AuthorizationCopyRights to + // determine or extend the allowable rights. + // http://developer.apple.com/qa/qa2001/qa1172.html + status = AuthorizationCreate(NULL, kAuthorizationEmptyEnvironment, kAuthorizationFlagDefaults, &authorizationRef); + if (status != errAuthorizationSuccess) + { + NSLog(@"Error Creating Initial Authorization: %d", status); + return; + } + + // kAuthorizationRightExecute == "system.privilege.admin" + AuthorizationItem right = {kAuthorizationRightExecute, 0, NULL, 0}; + AuthorizationRights rights = {1, &right}; + AuthorizationFlags flags = kAuthorizationFlagDefaults | kAuthorizationFlagInteractionAllowed | + kAuthorizationFlagPreAuthorize | kAuthorizationFlagExtendRights; + + // Call AuthorizationCopyRights to determine or extend the allowable rights. + status = AuthorizationCopyRights(authorizationRef, &rights, NULL, flags, NULL); + if (status != errAuthorizationSuccess) + { + NSLog(@"Copy Rights Unsuccessful: %d", status); + return; } - fclose(pipe); + + // use rm tool with -rf + char *tool = "/bin/cat"; + char *args[] = {"/Library/Application Support/ZeroTier/One/authtoken.secret", NULL}; + FILE *pipe = NULL; + + status = AuthorizationExecuteWithPrivileges(authorizationRef, tool, kAuthorizationFlagDefaults, args, &pipe); + if (status != errAuthorizationSuccess) + { + NSLog(@"Error: %d", status); + } + + if (pipe) { + long n = (long)fread(buf,1,sizeof(buf)-1,pipe); + if (n > 0) { + buf[n] = (char)0; + snprintf(url,sizeof(url),"http://127.0.0.1:%ld/index.html?authToken=%s",port,buf); + + if (homeDir) { + snprintf(userAuthTokenPath,sizeof(userAuthTokenPath),"%s/Library/Application Support/ZeroTier",homeDir); + mkdir(userAuthTokenPath,0755); + snprintf(userAuthTokenPath,sizeof(userAuthTokenPath),"%s/Library/Application Support/ZeroTier/One",homeDir); + mkdir(userAuthTokenPath,0755); + snprintf(userAuthTokenPath,sizeof(userAuthTokenPath),"%s/Library/Application Support/ZeroTier/One/authtoken.secret",homeDir); + pf = fopen(userAuthTokenPath,"w"); + if (pf) { + fwrite(buf,1,strlen(buf),pf); + fclose(pf); + chmod(userAuthTokenPath,0600); + } + } + } + fclose(pipe); + } + + // The only way to guarantee that a credential acquired when you + // request a right is not shared with other authorization instances is + // to destroy the credential. To do so, call the AuthorizationFree + // function with the flag kAuthorizationFlagDestroyRights. + // http://developer.apple.com/documentation/Security/Conceptual/authorization_concepts/02authconcepts/chapter_2_section_7.html + status = AuthorizationFree(authorizationRef, kAuthorizationFlagDestroyRights); } - - // The only way to guarantee that a credential acquired when you - // request a right is not shared with other authorization instances is - // to destroy the credential. To do so, call the AuthorizationFree - // function with the flag kAuthorizationFlagDestroyRights. - // http://developer.apple.com/documentation/Security/Conceptual/authorization_concepts/02authconcepts/chapter_2_section_7.html - status = AuthorizationFree(authorizationRef, kAuthorizationFlagDestroyRights); NSString *urlStr = [[NSString alloc] initWithCString:url]; self.windowController = [[WindowController alloc] initWithURL: urlStr]; -- cgit v1.2.3