Compare commits

...
54 Commits
Author SHA1 Message Date
Adam Ierymenko a207ce13c0 VERSION 0.7.1: installation fixes, new supernode
This version contains fixes to Linux installation and deployment and adds a
new supernode in Tokyo, Japan. It also has a working Windows installer, though
a bit more testing is going to take place before Windows binaries are
actually released.
2014-03-05 15:19:45 -08:00
Adam Ierymenko 17c77da38f Fix GitHub issue #45 - Linux install issues 2014-03-05 23:57:25 +01:00
Adam Ierymenko 54313212a4 New supernode: shoggoth.zerotier.com in Tokyo, Japan! This just about covers the entire world for global low-latency peer location and relaying. 2014-03-05 23:21:23 +01:00
Adam Ierymenko b2673eab55 Revisions to Linux install script, and support for init.d or upstart systems without chkconfig (Ubuntu). 2014-03-05 22:33:58 +01:00
Adam Ierymenko 282d41bc94 Script to build UI against our own new precompiled Win32 static Qt binary, which paradoxiclally results in a smaller executable than dynamic Qt and doesn't require us to bundle a million DLLs. Also update installer to reflect that. Finally, add a step to the installer to remove all instances of the tap device on full uninstall so as not to leave orphaned junk in your network connections or device manager. Looking good! 2014-03-05 09:52:59 -08:00
Adam Ierymenko b72c2c6358 Disable SSE on 32-bit Windows builds since people might still be using old school chips... x64 builds with SSE since pretty much all AMD64/x86_64 chips have it. 2014-03-04 11:18:34 -08:00
Adam Ierymenko 5581339d5b Build with /MT on Windows so we can stop having to install a redistributable... makes installer less noisy but unfortunately makes binary bigger. Oh well. 2014-03-04 11:16:39 -08:00
Adam Ierymenko 78f3966d66 Make sysV init script run as daemon, for GitHub issue #45 2014-03-03 12:00:26 -08:00
Adam Ierymenko bae9fa1480 -d switch for daemonizing on Unix 2014-03-03 11:53:43 -08:00
Adam Ierymenko cef750d1d2 Add option to install drivers in driver cache on Windows, needed for Windows installer. Blech. 2014-03-03 10:23:19 -08:00
Adam Ierymenko be36eda858 Add prerequisites (VS2012 redistributables) to installer. 2014-02-28 16:09:42 -08:00
Adam Ierymenko 13fbf9a200 *nix build fix 2014-02-28 15:05:56 -08:00
Adam Ierymenko f2a03f68bd Add code to clean unused permanent tap interfaces on Windows (but not used yet). 2014-02-28 15:04:50 -08:00
Adam Ierymenko d997c1a32a Installer work... 2014-02-28 12:20:05 -08:00
Adam Ierymenko d27251ec4e Make AtomicCounter use <atomic> on Windows (eventually this will replace it on other platforms), and some installer work. 2014-02-28 09:15:29 -08:00
Adam Ierymenko 9ae6403346 Installer works, and fix for ugly fonts in pulldown menus in main windows in UI. Also remove dummy installer, which we don't need anymore. 2014-02-27 21:56:57 -08:00
Adam Ierymenko 39d411ce0b Installer work... 2014-02-27 21:28:34 -08:00
Adam Ierymenko 93fe848bb6 Ignore a build dir. 2014-02-27 16:39:02 -08:00
Adam Ierymenko 9d05897f7a Windows service works now! 2014-02-27 16:28:55 -08:00
Adam Ierymenko cbeb9c5236 Installer work, sign devcon. 2014-02-26 16:32:32 -08:00
Adam Ierymenko 2203958798 Windows auto-updater invocation works... time to try an installer! 2014-02-26 14:37:21 -08:00
Adam Ierymenko 268ec8d1e0 Fix for GitHub issue #40: updates.d not being cleared. 2014-02-24 13:23:03 -08:00
Adam Ierymenko 093d745b86 ZT_OFFICIAL_RELEASE and ZT_AUTO_UPDATE in Windows build in Release mode. 2014-02-23 09:06:55 -08:00
Adam Ierymenko 655b6d1996 Windows auto-update URL and dummy Windows update for testing. 2014-02-23 08:01:52 -08:00
Adam Ierymenko 833a0621fa Windows service auto-update work. 2014-02-21 23:49:24 -08:00
Adam Ierymenko b5c3a92be2 Boring stuff: update dates in copyrights across all files. 2014-02-16 12:40:22 -08:00
Adam Ierymenko 78694bb2f5 VERSION 0.7.0: another documentation update (no version change or code changes) 2014-02-16 12:10:43 -08:00
Adam Ierymenko 297cfd86fa VERSION 0.7.0: updated docs (no version change)
See previous commit message for 0.7.0 release notes.
2014-02-16 12:08:13 -08:00
Adam Ierymenko 43b2bf6c16 VERSION 0.7.0: fix two bugs reported on GitHub, public binaries now in the wild!
Version 0.7.0 commemorates public beta binaries now being in the wild for Mac
and Linux platforms, though this actually happened a few days ago with 0.6.14.

This version fixes two bugs. First, the Linux installer/updater now supports
both systemd and regular SysV init. It will detect which your distro uses at
install/update time and install the zerotier-one service accordingly.

Secondly, this fixes an issue that caused the service to always show ONLINE
in the GUI or 'zerotier-cli info' even if there was no net connection. The
online status should be more reliably reported now.
2014-02-14 22:22:19 -08:00
Adam Ierymenko aceb938e07 Another Linux installer fix: do not clobber existing directory permissions! 2014-02-14 21:45:42 -08:00
Adam Ierymenko 68f44fb932 Another little Linux installer fix. 2014-02-15 00:29:32 -05:00
Adam Ierymenko e38619dd02 Small fix to Linux installer. 2014-02-14 21:14:34 -08:00
Adam Ierymenko 4ec7cd2760 Fix for GitHub issue #38: compute whether we are ONLINE a little differently 2014-02-14 16:23:03 -08:00
Adam Ierymenko b0277ab904 Clean up old init.d installation files on systemd systems if present. 2014-02-14 15:28:45 -08:00
Adam Ierymenko 87b26b0aaf Systemd support on Linux - GitHub issue #39 2014-02-14 15:18:59 -08:00
Adam Ierymenko 01d13c153d Fix compiler warnings in Linux build. 2014-02-14 13:08:54 -08:00
Adam Ierymenko c17082a4f8 VERSION 0.6.14: bug fixes, Unix device persistence
This version adds persistence of *nix device names (where possible), and fixes
a possible crash in Topology.cpp that was introduced in a previous revision.

It also adds a new supernode located in Singapore!
2014-02-11 15:16:42 -08:00
Adam Ierymenko 9acfd3eb73 Build fix on Linux with G++. 2014-02-11 23:09:53 +00:00
Adam Ierymenko 0ad84b8723 Possible bug fix in Topology, have to test... 2014-02-11 15:02:21 -08:00
Adam Ierymenko 3f912eb4ad Fix for GitHub issue #37: remember *nix device names. 2014-02-11 14:21:59 -08:00
Adam Ierymenko f1b45f7df0 A few little fixes in NodeConfig. 2014-02-11 13:20:51 -08:00
Adam Ierymenko 29c18d4bde Add new Singapore supernode! 2014-02-11 08:57:25 -08:00
Adam Ierymenko 33728840ec More local.conf stuff. 2014-02-10 16:46:53 -08:00
Adam Ierymenko cd339486b7 local.conf in NodeConfig 2014-02-10 14:22:57 -08:00
Adam Ierymenko e54a34d8dd Finally found a Windows installer option that doesn't cost $500 or require me to climb a huge learning curve just to do a basic software install. 2014-02-08 22:22:18 -08:00
Adam Ierymenko d24b192f8c Remove old updates from updates.d on Node startup. 2014-02-07 09:13:08 -08:00
Adam Ierymenko 0442d7e2d6 Forgot to save solution file. 2014-02-06 23:14:41 -08:00
Adam Ierymenko 5b97bb247e More Windows service work... it builds! Now to do a new installer and test. Also fix a Windows compile warning in Switch.cpp. 2014-02-06 23:12:12 -08:00
Adam Ierymenko 8a7486577a Windows service work, remove old installer... not sure exactly what we're going to use. 2014-02-06 22:06:27 -08:00
Adam Ierymenko 6d17993eb6 Fix a possible infinite loop in netconf service... in the long term need to fix IP assignment logic period cause the current incarnation sucks. 2014-02-06 10:59:50 -08:00
Adam Ierymenko d0e5da2884 Fix copyright notice. 2014-02-05 16:38:54 -08:00
Adam Ierymenko d5b50ee466 C++ service base stuff taken from MS public domain example project and modified slightly. 2014-02-05 16:37:50 -08:00
Adam Ierymenko 8031fe00c7 Delete C# service... going C++, probably integrating with core. 2014-02-05 14:27:31 -08:00
Adam Ierymenko 3f6152806f Add security notice the first time a user joins a public network. 2014-02-05 12:38:37 -08:00
120 changed files with 2786 additions and 6979 deletions

No files matched your search

+5 -3
View File
@@ -11,11 +11,16 @@
/ipch
/windows/ZeroTierOne.sdf
/windows/ZeroTierOne.v11.suo
/windows/x64
/windows/Win32
/windows/*/x64
/windows/*/Win32
/windows/ZeroTierOne/Release
/windows/ZeroTierOneService/obj
/windows/ZeroTierOneService/bin
/windows/Build
/ext/installfiles/windows/ZeroTier One-SetupFiles
/ext/installfiles/windows/Prerequisites
*.log
*.opensdf
*.user
@@ -26,7 +31,4 @@
/ZeroTierOneInstaller-*
.qmake.stash
*.autosave
/ZeroTier One.zip
/ZeroTier One.dmg
/windows/x64
/windows/ZeroTierOneInstaller/ZeroTierOneInstaller
+2 -10
View File
@@ -8,21 +8,13 @@ do this eventually.
-- Linux
make
That's it. Add ZT_AUTO_UPDATE=1 to the make command line to build an
auto-update-enabled version that will update from ZeroTier's servers.
This is disabled by default since such a build will automatically
replace itself with our binary distributions.
Just type 'make'. You'll need gcc and g++ installed, but ZeroTier One requires
no other third party libraries beyond the standard libc, libstdc++, and libm.
-- MacOS
make
The same ZT_AUTO_UPDATE=1 option as Linux supports can be used here to
build an auto-update-enabled version. By default auto-updates are not
enabled.
If you are building ext/tap-mac you will need a different version of the
OSX gcc compiler chain than what currently ships (clang). We've got a copy
available here:
+2 -6
View File
@@ -3,16 +3,12 @@ ZeroTier One
ZeroTier One creates flat virtual Ethernet networks of almost unlimited size. [Visit ZeroTier Networks on the web](https://www.zerotier.com/) for more information.
This project is now in beta, which means that major incompatible protocol shifts should now become considerably more rare. You should still update very often if you plan to use it. Binary packages with auto-update are coming very soon.
Follow the [ZeroTier blog](http://blog.zerotier.com/) and the [GitHub project](https://github.com/zerotier/ZeroTierOne) to stay up to date.
See BUILDING.txt and RUNNING.txt for instructions. It currently runs on Mac and Linux. A Windows port is well along the way to completion. If you're brave you can load the Visual Studio 2012 solution and play around.
Auto-updating binary packages that install easily [can be found here.](https://www.zerotier.com/download.html) If you want to build from source, clone this repository and see BUILDING.txt and RUNNING.txt.
Once you have it running you can join the Earth network -- a LAN for the planet -- by using the 'zerotier-cli' tool: 'sudo zerotier-cli join 8056c2e21c000001'. Right now Earth is the only network. Ability to create private networks, as well as some additional special-purpose public ones, will be coming soon. (Note: previous alpha versions auto-joined Earth, but since 0.5.0 it no longer does this.)
Once you are up and running, you can [create an account on the network control panel](https://www.zerotier.com/networks.html) if you want to create a private network or you can join [Earth](https://www.zerotier.com/earth.html) by running (on Linux and Mac) `sudo ./zerotier-cli join 8056c2e21c000001`.
Note that this won't work if your firewall does not allow outbound UDP. It must allow two way UDP conversations on port 9993 at a minimum.
ZeroTier One is licensed under the GNU General Public License version 3. You are free to use, modify, or redistribute it under the terms of that license. If you would like to embed ZeroTier One in a closed source product or create a closed source derivative product, contact ZeroTier Networks LLC.
(c)2012-2013 [ZeroTier Networks LLC](https://www.zerotier.com/)
+31 -35
View File
@@ -1,15 +1,19 @@
First build it -- see BUILDING.txt -- then...
This guide is for those building and running from source. See BUILDING.txt
first.
-- MacOS --
The wiki at GitHub contains several pages that are probably also of interest:
https://github.com/zerotier/ZeroTierOne/wiki
By convention, ZeroTier One will keep its state here on mac:
--- MacOS
On Mac, the default ZeroTier home is:
/Library/Application Support/ZeroTier/One
ZeroTier ships with a kernel extension for its own tap device, which it
stores in the above directory. To install this, type:
sudo make -f Makefile.mac install-mac-tap
sudo make install-mac-tap
This will create the ZeroTier One home above if it does not exist and install
the kext there. Note that the kext must be owned by root:wheel. The make
@@ -20,14 +24,7 @@ If run with no options, it will use the default home directory above.
sudo ./zerotier-one &
Finally, join the Earth network (the big public LAN and the only net for now):
sudo zerotier-cli join 8056c2e21c000001
Try pinging earth.zerotier.net and going to http://earth.zerotier.net/ in a
browser to see if you're online.
-- Linux
--- LINUX
On Linux, the default ZeroTier home is:
@@ -38,31 +35,14 @@ Just type:
sudo mkdir /var/lib/zerotier-one
sudo ./zerotier-one &
When run with no options, ZT1 uses its default home path on the current
platform. Note that ZT1 requires the Linux tap driver, so it must be
available in the kernel or as a module. In most Linux distributions it's
included out of the box and should just work.
Your system must have the Linux tun/tap driver available (tun). All tested
distributions so far ship with this driver as a module that will load
automatically.
Finally, join the Earth network (the big public LAN and the only net for now):
UDP port 9993 must be open in your local firewall for this to work properly.
How to do this varies by Linux distribution.
sudo zerotier-cli join bc8f9a8ee3000001
Try pinging earth.zerotier.net and going to http://earth.zerotier.net/ in a
browser to see if you're online.
-- Windows
Port in progress, and it's going to pretty much always be more painful to
build than *nix systems. Just wait for the binary release unless you're
brave, in which case you can load the VS2012 solution and play around.
-- Open UDP port 9993
As noted in README.md, to actually function properly, you need to open
UDP port 9993 in your firewall. Following are instructions to open UDP port
9993 for specific operating systems.
--- Ubuntu (version 12.04 and possibly other versions, too)
- Opening port 9993 on Ubuntu
Follow the Ubuntu documentation about UFW https://help.ubuntu.com/community/UFW
@@ -76,3 +56,19 @@ sudo ufw allow 9993/udp
You should now be able to ping and browse earth.zerotier.net
--- WINDOWS
A windows port is in progress.
--- ONCE IT'S RUNNING:
To use the command line interface, see this guide:
https://github.com/zerotier/ZeroTierOne/wiki/Command-Line-Interface
If you want to test by joining the Earth network, try:
sudo ./zerotier-cli join 8056c2e21c000001
An interface called 'zt0' should appear and should get an IP address in
the 28.0.0.0/7 range (28.* or 29.*) within a few seconds or so. Then try
pinging earth.zerotier.net or navigating to http://earth.zerotier.net/ in
a web browser.
+9
View File
@@ -0,0 +1,9 @@
REM If you're an OSS user and want to run this batch file, edit to change the path to Qt.
REM Start Visual Studio command prompt and run this from within the ZeroTierUI subfolder.
CD ..
MKDIR build-ZeroTierUI-win32-release
CD build-ZeroTierUI-win32-release
C:\Qt\5.2.1\Src\qtbase\bin\qmake.exe ..\ZeroTierUI\ZeroTierUI.pro
nmake clean
nmake
+6 -3
View File
@@ -45,7 +45,8 @@ SOURCES += main.cpp \
../ext/lz4/lz4hc.c \
networkwidget.cpp \
installdialog.cpp \
licensedialog.cpp
licensedialog.cpp \
onetimedialog.cpp
HEADERS += mainwindow.h \
aboutwindow.h \
@@ -98,14 +99,16 @@ HEADERS += mainwindow.h \
installdialog.h \
mac_doprivileged.h \
licensedialog.h \
main.h
main.h \
onetimedialog.h
FORMS += mainwindow.ui \
aboutwindow.ui \
networkwidget.ui \
installdialog.ui \
licensedialog.ui \
quickstartdialog.ui
quickstartdialog.ui \
onetimedialog.ui
RESOURCES += \
resources.qrc
+1 -1
View File
@@ -1,6 +1,6 @@
/*
* ZeroTier One - Global Peer to Peer Ethernet
* Copyright (C) 2012-2013 ZeroTier Networks LLC
* Copyright (C) 2011-2014 ZeroTier Networks LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
+1 -1
View File
@@ -1,6 +1,6 @@
/*
* ZeroTier One - Global Peer to Peer Ethernet
* Copyright (C) 2012-2013 ZeroTier Networks LLC
* Copyright (C) 2011-2014 ZeroTier Networks LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
+1 -1
View File
@@ -1,6 +1,6 @@
/*
* ZeroTier One - Global Peer to Peer Ethernet
* Copyright (C) 2012-2013 ZeroTier Networks LLC
* Copyright (C) 2011-2014 ZeroTier Networks LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
+3 -1
View File
@@ -1,6 +1,6 @@
/*
* ZeroTier One - Global Peer to Peer Ethernet
* Copyright (C) 2012-2013 ZeroTier Networks LLC
* Copyright (C) 2011-2014 ZeroTier Networks LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -38,6 +38,8 @@
#include "../node/Address.hpp"
// Right now InstallDialog is only used on Mac
namespace Ui {
class InstallDialog;
}
+105 -5
View File
@@ -1,6 +1,6 @@
/*
* ZeroTier One - Global Peer to Peer Ethernet
* Copyright (C) 2012-2013 ZeroTier Networks LLC
* Copyright (C) 2011-2014 ZeroTier Networks LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -25,6 +25,10 @@
* LLC. Start here: http://www.zerotier.com/
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "mainwindow.h"
#include "installdialog.h"
#include "licensedialog.h"
@@ -33,12 +37,66 @@
#include <QDir>
#include <QString>
#include <QFont>
#include <QMessageBox>
#include "../node/Constants.hpp"
#include "../node/Defaults.hpp"
// Uncomment for testing to disable making sure Windows service is running
//#define DISABLE_WINDOWS_SERVICE_MANAGEMENT
#ifdef __WINDOWS__
#include <WinSock2.h>
#include <windows.h>
#endif
#include "../windows/ZeroTierOne/ZeroTierOneService.h"
#ifndef DISABLE_WINDOWS_SERVICE_MANAGEMENT
// Returns true if started or already running, false if failed or not installed
static bool startWindowsService()
{
SERVICE_STATUS ssSvcStatus;
SC_HANDLE schSCManager = NULL;
SC_HANDLE schService = NULL;
schSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_CONNECT);
if (schSCManager == NULL)
return false;
schService = OpenServiceA(schSCManager, ZT_SERVICE_NAME, SERVICE_QUERY_STATUS | SERVICE_START);
if (schService == NULL) {
CloseServiceHandle(schSCManager);
return false;
}
int tries = 0;
bool running = true;
for(;;) {
memset(&ssSvcStatus,0,sizeof(ssSvcStatus));
if ((++tries > 20)||(!QueryServiceStatus(schService,&ssSvcStatus))) {
running = false;
break;
}
if (ssSvcStatus.dwCurrentState == SERVICE_RUNNING) {
break;
} else if (ssSvcStatus.dwCurrentState == SERVICE_START_PENDING) {
Sleep(500);
continue;
}
StartService(schService,0,NULL);
Sleep(500);
}
CloseServiceHandle(schService);
CloseServiceHandle(schSCManager);
return running;
}
#endif // !DISABLE_WINDOWS_SERVICE_MANAGEMENT
#endif // __WINDOWS__
// Globally visible settings for the app
QSettings *settings = (QSettings *)0;
int main(int argc, char *argv[])
@@ -46,6 +104,7 @@ int main(int argc, char *argv[])
QApplication a(argc, argv);
#ifdef __WINDOWS__
// Start up Winsock2
{
WSADATA wsaData;
WSAStartup(MAKEWORD(2,2),&wsaData);
@@ -65,12 +124,11 @@ int main(int argc, char *argv[])
// InstallDialog is an alternative main window. It will re-launch the app
// when done.
InstallDialog id;
id.setStyleSheet(a.styleSheet());
id.show();
return a.exec();
}
#endif
#ifdef __APPLE__
{
// Put QSettings here because this is one of the writable directories allowed
// in Apple's app store sandbox specs. We might end up in app store someday.
@@ -78,7 +136,7 @@ int main(int argc, char *argv[])
QDir::root().mkpath(zt1AppSupport);
settings = new QSettings(zt1AppSupport + "/ui.ini",QSettings::IniFormat);
}
#else
#else // on non-Apple boxen put it in the standard place using the default format
settings = new QSettings("ZeroTier Networks","ZeroTier One");
#endif
@@ -88,6 +146,48 @@ int main(int argc, char *argv[])
ld.exec();
}
#if defined(__WINDOWS__) && !defined(DISABLE_WINDOWS_SERVICE_MANAGEMENT)
{
bool winSvcInstalled = false;
while (!startWindowsService()) {
if (winSvcInstalled) {
// Service was installed and subsequently failed to start again, so
// something is wrong!
QMessageBox::critical((QWidget *)0,"Service Not Available","Unable to locate or start ZeroTier One service. There may be a problem with the installation. Try installing from the .msi file again or e-mail contact@zerotier.com if you cannot install. (Error: service failed to start)",QMessageBox::Ok);
return 1;
}
#ifdef _WIN64
BOOL is64Bit = TRUE;
#else
BOOL is64Bit = FALSE;
IsWow64Process(GetCurrentProcess(),&is64Bit);
#endif
std::string exe(ZeroTier::ZT_DEFAULTS.defaultHomePath + "\\zerotier-one_");
exe.append((is64Bit == TRUE) ? "x64.exe" : "x86.exe");
if (QFile::exists(exe.c_str())) {
STARTUPINFOA si;
PROCESS_INFORMATION pi;
memset(&si,0,sizeof(si));
memset(&pi,0,sizeof(pi));
if (CreateProcessA(NULL,const_cast <LPSTR>((exe + " -I").c_str()),NULL,NULL,FALSE,CREATE_NO_WINDOW|CREATE_NEW_PROCESS_GROUP,NULL,NULL,&si,&pi)) {
WaitForSingleObject(pi.hProcess,INFINITE);
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
winSvcInstalled = true;
}
}
if (!winSvcInstalled) {
// Service failed to install -- installation problem like missing .exe
QMessageBox::critical((QWidget *)0,"Service Not Available","Unable to locate or start ZeroTier One service. There may be a problem with the installation. Try installing from the .msi file again or e-mail contact@zerotier.com if you cannot install. (Error: service not installed)",QMessageBox::Ok);
return 1;
}
}
}
#endif
MainWindow w;
w.show();
return a.exec();
+1
View File
@@ -2,6 +2,7 @@
#define MAIN_H
#include <QSettings>
#include <QMainWindow>
extern QSettings *settings;
+7 -5
View File
@@ -1,6 +1,6 @@
/*
* ZeroTier One - Global Peer to Peer Ethernet
* Copyright (C) 2012-2013 ZeroTier Networks LLC
* Copyright (C) 2011-2014 ZeroTier Networks LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -66,7 +66,7 @@
ZeroTier::Node::LocalClient *zeroTierClient = (ZeroTier::Node::LocalClient *)0;
// Main window instance for app
static MainWindow *mainWindow = (MainWindow *)0;
QMainWindow *mainWindow = (MainWindow *)0;
// Handles message from ZeroTier One service
static void handleZTMessage(void *arg,unsigned long id,const char *line)
@@ -111,9 +111,11 @@ MainWindow::MainWindow(QWidget *parent) :
#ifdef __WINDOWS__
QWidgetList widgets = this->findChildren<QWidget*>();
foreach(QWidget *widget, widgets) {
QFont font(widget->font());
font.setPointSizeF(font.pointSizeF() * 0.75);
widget->setFont(font);
if ((typeid(*widget) != typeid(ui->menuBar))&&(typeid(*widget) != typeid(ui->menuFile))) {
QFont font(widget->font());
font.setPointSizeF(font.pointSizeF() * 0.75);
widget->setFont(font);
}
}
#endif
+4 -1
View File
@@ -1,6 +1,6 @@
/*
* ZeroTier One - Global Peer to Peer Ethernet
* Copyright (C) 2012-2013 ZeroTier Networks LLC
* Copyright (C) 2011-2014 ZeroTier Networks LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -51,6 +51,9 @@ class MainWindow;
// Can be null if not connected, or will point to current
extern ZeroTier::Node::LocalClient *zeroTierClient;
// Globally visible pointer to main app window
extern QMainWindow *mainWindow;
class MainWindow : public QMainWindow
{
Q_OBJECT
+13 -4
View File
@@ -1,6 +1,6 @@
/*
* ZeroTier One - Global Peer to Peer Ethernet
* Copyright (C) 2012-2013 ZeroTier Networks LLC
* Copyright (C) 2011-2014 ZeroTier Networks LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -28,6 +28,8 @@
#include "networkwidget.h"
#include "mainwindow.h"
#include "ui_networkwidget.h"
#include "onetimedialog.h"
#include "main.h"
#include <QClipboard>
#include <QString>
@@ -43,7 +45,8 @@
NetworkWidget::NetworkWidget(QWidget *parent,const std::string &nwid) :
QWidget(parent),
ui(new Ui::NetworkWidget),
networkIdStr(nwid)
networkIdStr(nwid),
publicWarningShown(false)
{
ui->setupUi(this);
ui->networkIdButton->setText(QString(nwid.c_str()));
@@ -98,9 +101,15 @@ void NetworkWidget::setNetworkType(const std::string &type)
ui->networkTypeLabel->setText(QString(type.c_str()));
if (type == "?")
ui->networkTypeLabel->setStatusTip("Waiting for configuration...");
else if (type == "public")
else if (type == "public") {
if ((!publicWarningShown)&&(!settings->value("shown_publicWarning",false).toBool())) {
publicWarningShown = true;
OneTimeDialog *d = new OneTimeDialog(mainWindow,"shown_publicWarning","Security Notice","Security Notice:"ZT_EOL_S""ZT_EOL_S"You have joined a public network. Anyone can join these. We recommend making sure that your system's automatic software updates are enabled and turning off any shared network services that you do not want people to access.");
d->setModal(false);
d->show();
}
ui->networkTypeLabel->setStatusTip("This network can be joined by anyone in the world.");
else if (type == "private")
} else if (type == "private")
ui->networkTypeLabel->setStatusTip("This network is private; only authorized peers can join.");
else ui->networkTypeLabel->setStatusTip("Unknown network type.");
}
+2 -1
View File
@@ -1,6 +1,6 @@
/*
* ZeroTier One - Global Peer to Peer Ethernet
* Copyright (C) 2012-2013 ZeroTier Networks LLC
* Copyright (C) 2011-2014 ZeroTier Networks LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -62,6 +62,7 @@ private slots:
private:
Ui::NetworkWidget *ui;
std::string networkIdStr;
bool publicWarningShown;
};
#endif // NETWORK_H
+37
View File
@@ -0,0 +1,37 @@
#include "onetimedialog.h"
#include "ui_onetimedialog.h"
#include "main.h"
OneTimeDialog::OneTimeDialog(QWidget *parent,const char *propName,const QString &title,const QString &message) :
QDialog(parent),
ui(new Ui::OneTimeDialog)
{
ui->setupUi(this);
ui->label->setText(message);
this->setWindowTitle(title);
_propName = propName;
#ifdef __WINDOWS__
QWidgetList widgets = this->findChildren<QWidget*>();
foreach(QWidget *widget, widgets) {
QFont font(widget->font());
font.setPointSizeF(font.pointSizeF() * 0.75);
widget->setFont(font);
}
#endif
}
OneTimeDialog::~OneTimeDialog()
{
delete ui;
}
void OneTimeDialog::on_pushButton_clicked()
{
if (_propName) {
settings->setValue(_propName,ui->checkBox->isChecked());
settings->sync();
}
this->close();
}
+26
View File
@@ -0,0 +1,26 @@
#ifndef ONETIMEDIALOG_H
#define ONETIMEDIALOG_H
#include <QDialog>
namespace Ui {
class OneTimeDialog;
}
class OneTimeDialog : public QDialog
{
Q_OBJECT
public:
explicit OneTimeDialog(QWidget *parent = 0,const char *propName = (const char *)0,const QString &title = QString(),const QString &message = QString());
~OneTimeDialog();
private slots:
void on_pushButton_clicked();
private:
Ui::OneTimeDialog *ui;
const char *_propName;
};
#endif // ONETIMEDIALOG_H
+99
View File
@@ -0,0 +1,99 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>OneTimeDialog</class>
<widget class="QDialog" name="OneTimeDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>496</width>
<height>197</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="label">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="margin">
<number>12</number>
</property>
<property name="textInteractionFlags">
<set>Qt::NoTextInteraction</set>
</property>
</widget>
</item>
<item>
<widget class="QWidget" name="widget" native="true">
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="leftMargin">
<number>12</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>12</number>
</property>
<property name="bottomMargin">
<number>5</number>
</property>
<item>
<widget class="QCheckBox" name="checkBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Don't Show This Message Again</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton">
<property name="text">
<string>OK</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
+1 -1
View File
@@ -1,6 +1,6 @@
/*
* ZeroTier One - Global Peer to Peer Ethernet
* Copyright (C) 2012-2013 ZeroTier Networks LLC
* Copyright (C) 2011-2014 ZeroTier Networks LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Loaded 20 of 120 files, more files were not shown because too many files have changed in this diff. Show more