summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2013-11-18 15:06:05 -0500
committerAdam Ierymenko <adam.ierymenko@gmail.com>2013-11-18 15:06:05 -0500
commit0adc91d6cb40e185de972b5fa588ac9607e1ac74 (patch)
treefbb86b7b2504559ae5656cf8cb0ddd0a42ce68e4
parent77bab135465a14d13f7835c7a9c3a53dc04496dd (diff)
downloadinfinitytier-0adc91d6cb40e185de972b5fa588ac9607e1ac74.tar.gz
infinitytier-0adc91d6cb40e185de972b5fa588ac9607e1ac74.zip
Add AppleScript to get authentication token and place in home directory, used for OSX GUI app to authenticate a user as authorized to admin ZT1.
-rw-r--r--ZeroTierUI/helpers/mac/ZeroTier One (Authenticate).app/Contents/Info.plist50
-rwxr-xr-xZeroTierUI/helpers/mac/ZeroTier One (Authenticate).app/Contents/MacOS/appletbin0 -> 25028 bytes
-rw-r--r--ZeroTierUI/helpers/mac/ZeroTier One (Authenticate).app/Contents/PkgInfo1
-rw-r--r--ZeroTierUI/helpers/mac/ZeroTier One (Authenticate).app/Contents/Resources/Scripts/main.scptbin0 -> 1768 bytes
-rw-r--r--ZeroTierUI/helpers/mac/ZeroTier One (Authenticate).app/Contents/Resources/applet.icnsbin0 -> 71867 bytes
-rw-r--r--ZeroTierUI/helpers/mac/ZeroTier One (Authenticate).app/Contents/Resources/applet.rsrcbin0 -> 362 bytes
-rw-r--r--ZeroTierUI/helpers/mac/ZeroTier One (Authenticate).app/Contents/Resources/description.rtfd/TXT.rtf4
-rw-r--r--ZeroTierUI/mainwindow.cpp23
-rw-r--r--ZeroTierUI/mainwindow.h6
9 files changed, 84 insertions, 0 deletions
diff --git a/ZeroTierUI/helpers/mac/ZeroTier One (Authenticate).app/Contents/Info.plist b/ZeroTierUI/helpers/mac/ZeroTier One (Authenticate).app/Contents/Info.plist
new file mode 100644
index 00000000..0f32d0ef
--- /dev/null
+++ b/ZeroTierUI/helpers/mac/ZeroTier One (Authenticate).app/Contents/Info.plist
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleAllowMixedLocalizations</key>
+ <true/>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>applet</string>
+ <key>CFBundleIconFile</key>
+ <string>applet</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.zerotier.one.ZeroTierOneMacAuthenticateScript</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>ZeroTier One (Authenticate)</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>aplt</string>
+ <key>LSMinimumSystemVersionByArchitecture</key>
+ <dict>
+ <key>x86_64</key>
+ <string>10.6</string>
+ </dict>
+ <key>LSRequiresCarbon</key>
+ <true/>
+ <key>NSHumanReadableCopyright</key>
+ <string>(c) 2013 ZeroTier Networks LLC</string>
+ <key>WindowState</key>
+ <dict>
+ <key>dividerCollapsed</key>
+ <false/>
+ <key>eventLogLevel</key>
+ <integer>-1</integer>
+ <key>name</key>
+ <string>ScriptWindowState</string>
+ <key>positionOfDivider</key>
+ <real>333</real>
+ <key>savedFrame</key>
+ <string>7 181 602 597 0 0 1280 778 </string>
+ <key>selectedTabView</key>
+ <string>result</string>
+ </dict>
+</dict>
+</plist>
diff --git a/ZeroTierUI/helpers/mac/ZeroTier One (Authenticate).app/Contents/MacOS/applet b/ZeroTierUI/helpers/mac/ZeroTier One (Authenticate).app/Contents/MacOS/applet
new file mode 100755
index 00000000..8057b9e3
--- /dev/null
+++ b/ZeroTierUI/helpers/mac/ZeroTier One (Authenticate).app/Contents/MacOS/applet
Binary files differ
diff --git a/ZeroTierUI/helpers/mac/ZeroTier One (Authenticate).app/Contents/PkgInfo b/ZeroTierUI/helpers/mac/ZeroTier One (Authenticate).app/Contents/PkgInfo
new file mode 100644
index 00000000..3253614c
--- /dev/null
+++ b/ZeroTierUI/helpers/mac/ZeroTier One (Authenticate).app/Contents/PkgInfo
@@ -0,0 +1 @@
+APPLaplt \ No newline at end of file
diff --git a/ZeroTierUI/helpers/mac/ZeroTier One (Authenticate).app/Contents/Resources/Scripts/main.scpt b/ZeroTierUI/helpers/mac/ZeroTier One (Authenticate).app/Contents/Resources/Scripts/main.scpt
new file mode 100644
index 00000000..cb578574
--- /dev/null
+++ b/ZeroTierUI/helpers/mac/ZeroTier One (Authenticate).app/Contents/Resources/Scripts/main.scpt
Binary files differ
diff --git a/ZeroTierUI/helpers/mac/ZeroTier One (Authenticate).app/Contents/Resources/applet.icns b/ZeroTierUI/helpers/mac/ZeroTier One (Authenticate).app/Contents/Resources/applet.icns
new file mode 100644
index 00000000..0cdd1708
--- /dev/null
+++ b/ZeroTierUI/helpers/mac/ZeroTier One (Authenticate).app/Contents/Resources/applet.icns
Binary files differ
diff --git a/ZeroTierUI/helpers/mac/ZeroTier One (Authenticate).app/Contents/Resources/applet.rsrc b/ZeroTierUI/helpers/mac/ZeroTier One (Authenticate).app/Contents/Resources/applet.rsrc
new file mode 100644
index 00000000..a528ee8a
--- /dev/null
+++ b/ZeroTierUI/helpers/mac/ZeroTier One (Authenticate).app/Contents/Resources/applet.rsrc
Binary files differ
diff --git a/ZeroTierUI/helpers/mac/ZeroTier One (Authenticate).app/Contents/Resources/description.rtfd/TXT.rtf b/ZeroTierUI/helpers/mac/ZeroTier One (Authenticate).app/Contents/Resources/description.rtfd/TXT.rtf
new file mode 100644
index 00000000..09700b2f
--- /dev/null
+++ b/ZeroTierUI/helpers/mac/ZeroTier One (Authenticate).app/Contents/Resources/description.rtfd/TXT.rtf
@@ -0,0 +1,4 @@
+{\rtf1\ansi\ansicpg1252\cocoartf1265
+{\fonttbl}
+{\colortbl;\red255\green255\blue255;}
+} \ No newline at end of file
diff --git a/ZeroTierUI/mainwindow.cpp b/ZeroTierUI/mainwindow.cpp
index bb2c263b..d96ab207 100644
--- a/ZeroTierUI/mainwindow.cpp
+++ b/ZeroTierUI/mainwindow.cpp
@@ -2,7 +2,30 @@
#include "aboutwindow.h"
#include "ui_mainwindow.h"
+#include <string>
+#include <map>
+#include <vector>
+
#include <QClipboard>
+#include <QMutex>
+
+static std::map< unsigned long,std::vector<std::string> > ztReplies;
+static QMutex ztReplies_m;
+static void handleZTMessage(void *arg,unsigned long id,const char *line)
+{
+ ztReplies_m.lock();
+ if (*line) {
+ ztReplies[id].push_back(std::string(line));
+ ztReplies_m.unlock();
+ } else {
+ std::vector<std::string> resp(ztReplies[id]);
+ ztReplies.erase(id);
+ ztReplies_m.unlock();
+ }
+}
+
+// Globally visible
+ZeroTier::Node::LocalClient *zeroTierClient = (ZeroTier::Node::LocalClient *)0;
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
diff --git a/ZeroTierUI/mainwindow.h b/ZeroTierUI/mainwindow.h
index b68ba4f7..f41e527b 100644
--- a/ZeroTierUI/mainwindow.h
+++ b/ZeroTierUI/mainwindow.h
@@ -3,10 +3,16 @@
#include <QMainWindow>
+#include "../node/Node.hpp"
+
namespace Ui {
class MainWindow;
}
+// Globally visible instance of local client for communicating with ZT1
+// Can be null if not connected, or will point to current
+extern ZeroTier::Node::LocalClient *zeroTierClient;
+
class MainWindow : public QMainWindow
{
Q_OBJECT