mirror of
https://github.com/onionshare/onionshare.git
synced 2025-02-02 09:35:33 -05:00
Merge branch 'develop' into receiver-mode-gui
This commit is contained in:
commit
8312058fcc
12
BUILD.md
12
BUILD.md
@ -11,9 +11,9 @@ cd onionshare
|
||||
|
||||
Install the needed dependencies:
|
||||
|
||||
For Debian-like distros: `apt install -y build-essential fakeroot python3-all python3-stdeb dh-python python3-flask python3-stem python3-pyqt5 python-nautilus python3-pytest tor obfs4proxy`
|
||||
For Debian-like distros: `apt install -y build-essential fakeroot python3-all python3-stdeb dh-python python3-socks python3-flask python3-stem python3-pyqt5 python-nautilus python3-pytest tor obfs4proxy`
|
||||
|
||||
For Fedora-like distros: `dnf install -y rpm-build python3-flask python3-stem python3-qt5 python3-pytest nautilus-python tor obfs4`
|
||||
For Fedora-like distros: `dnf install -y rpm-build python3-flask python3-stem python3-qt5 python3-pytest nautilus-python tor obfs4 rpm-build`
|
||||
|
||||
After that you can try both the CLI and the GUI version of OnionShare:
|
||||
|
||||
@ -28,6 +28,8 @@ Create a .deb on Debian-like distros: `./install/build_deb.sh`
|
||||
|
||||
Create a .rpm on Fedora-like distros: `./install/build_rpm.sh`
|
||||
|
||||
For OpenSuSE: There are instructions for building [in the wiki](https://github.com/micahflee/onionshare/wiki/Linux-Distribution-Support#opensuse-leap-150).
|
||||
|
||||
For ArchLinux: There is a PKBUILD available [here](https://aur.archlinux.org/packages/onionshare/) that can be used to install OnionShare.
|
||||
|
||||
If you find that these instructions don't work for your Linux distribution or version, consult the [Linux Distribution Support wiki guide](https://github.com/micahflee/onionshare/wiki/Linux-Distribution-Support), which might contain extra instructions.
|
||||
@ -85,7 +87,7 @@ pip3 install -r install\requirements-windows.txt
|
||||
|
||||
Download and install pywin32 (build 221, x86, for python 3.6) from https://sourceforge.net/projects/pywin32/files/pywin32/Build%20221/. I downloaded `pywin32-221.win32-py3.6.exe`.
|
||||
|
||||
Download and install Qt5 from https://www.qt.io/download-open-source/. I downloaded `qt-unified-windows-x86-3.0.2-online.exe`. There's no need to login to a Qt account during installation. Make sure you install the latest Qt 5.x. I installed Qt 5.10.0.
|
||||
Download and install Qt5 from https://www.qt.io/download-open-source/. I downloaded `qt-unified-windows-x86-3.0.4-online.exe`. There's no need to login to a Qt account during installation. Make sure you install the latest Qt 5.x. I installed Qt 5.11.0. You only need to install the `MSVC 2015 32-bit` component, as well as all of the the `Qt` components, for that that version.
|
||||
|
||||
After that you can try both the CLI and the GUI version of OnionShare:
|
||||
|
||||
@ -100,7 +102,7 @@ These instructions include adding folders to the path in Windows. To do this, go
|
||||
|
||||
Download and install the 32-bit [Visual C++ Redistributable for Visual Studio 2015](https://www.microsoft.com/en-US/download/details.aspx?id=48145). I downloaded `vc_redist.x86.exe`.
|
||||
|
||||
Download and install 7-Zip from http://www.7-zip.org/download.html. I downloaded `7z1800.exe`.
|
||||
Download and install 7-Zip from http://www.7-zip.org/download.html. I downloaded `7z1805.exe`.
|
||||
|
||||
Download and install the standalone [Windows 10 SDK](https://dev.windows.com/en-us/downloads/windows-10-sdk). Note that you may not need this if you already have Visual Studio.
|
||||
|
||||
@ -113,7 +115,7 @@ Add the following directories to the path:
|
||||
|
||||
If you want to build the installer:
|
||||
|
||||
* Go to http://nsis.sourceforge.net/Download and download the latest NSIS. I downloaded `nsis-3.02.1-setup.exe`.
|
||||
* Go to http://nsis.sourceforge.net/Download and download the latest NSIS. I downloaded `nsis-3.03-setup.exe`.
|
||||
* Add `C:\Program Files (x86)\NSIS` to the path.
|
||||
|
||||
If you want to sign binaries with Authenticode:
|
||||
|
@ -1,5 +1,10 @@
|
||||
# OnionShare Changelog
|
||||
|
||||
## 1.3.1
|
||||
|
||||
* Updated Tor to 0.2.3.10
|
||||
* Windows and Mac binaries are now distributed with licenses for tor and obfs4
|
||||
|
||||
## 1.3
|
||||
|
||||
* Major UI redesign, introducing many UX improvements
|
||||
|
6
LICENSE
6
LICENSE
@ -1,7 +1,7 @@
|
||||
OnionShare
|
||||
(Note: Third-party licenses can be found under install/licenses/.)
|
||||
|
||||
Copyright © 2014-2018
|
||||
Micah Lee <micah@micahflee.com>
|
||||
OnionShare
|
||||
Copyright © 2014-2018 Micah Lee <micah@micahflee.com>
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
@ -3,7 +3,7 @@
|
||||
"""
|
||||
OnionShare | https://onionshare.org/
|
||||
|
||||
Copyright (C) 2014-2018 Micah Lee <micah@micahflee.com>
|
||||
Copyright (C) 2014-2018 Micah Lee <micah@micahflee.com>>>>>>>> develop
|
||||
|
||||
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
|
||||
|
@ -8,10 +8,10 @@ REM download tor
|
||||
python install\get-tor-windows.py
|
||||
|
||||
REM sign onionshare-gui.exe
|
||||
signtool.exe sign /v /d "OnionShare" /a /tr http://time.certum.pl/ /fd sha256 dist\onionshare\onionshare-gui.exe
|
||||
signtool.exe sign /v /d "OnionShare" /a /tr http://time.certum.pl/ dist\onionshare\onionshare-gui.exe
|
||||
|
||||
REM build an installer, dist\onionshare-setup.exe
|
||||
makensis.exe install\onionshare.nsi
|
||||
|
||||
REM sign onionshare-setup.exe
|
||||
signtool.exe sign /v /d "OnionShare" /a /tr http://time.certum.pl/ /fd sha256 dist\onionshare-setup.exe
|
||||
signtool.exe sign /v /d "OnionShare" /a /tr http://time.certum.pl/ dist\onionshare-setup.exe
|
||||
|
@ -24,13 +24,20 @@ In order to avoid a Mac gnupg dependency, I manually verify the signature
|
||||
and hard-code the sha256 hash.
|
||||
"""
|
||||
|
||||
import inspect, os, sys, hashlib, zipfile, io, shutil, subprocess
|
||||
import urllib.request
|
||||
import inspect
|
||||
import os
|
||||
import sys
|
||||
import hashlib
|
||||
import zipfile
|
||||
import io
|
||||
import shutil
|
||||
import subprocess
|
||||
import requests
|
||||
|
||||
def main():
|
||||
dmg_url = 'https://archive.torproject.org/tor-package-archive/torbrowser/7.5/TorBrowser-7.5-osx64_en-US.dmg'
|
||||
dmg_filename = 'TorBrowser-7.5-osx64_en-US.dmg'
|
||||
expected_dmg_sha256 = '43a8dc0afd0a77e42766311eb54ad9fc8714f67fcd2d3582a3bcb98b22c2e629'
|
||||
dmg_url = 'https://archive.torproject.org/tor-package-archive/torbrowser/7.5.5/TorBrowser-7.5.5-osx64_en-US.dmg'
|
||||
dmg_filename = 'TorBrowser-7.5.5-osx64_en-US.dmg'
|
||||
expected_dmg_sha256 = '2b445e4237cdd9be0e71e65f76db5d36f0d6c37532982d642803b57e388e4636'
|
||||
|
||||
# Build paths
|
||||
root_path = os.path.dirname(os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))))
|
||||
@ -46,10 +53,9 @@ def main():
|
||||
# Make sure the zip is downloaded
|
||||
if not os.path.exists(dmg_path):
|
||||
print("Downloading {}".format(dmg_url))
|
||||
response = urllib.request.urlopen(dmg_url)
|
||||
dmg_data = response.read()
|
||||
open(dmg_path, 'wb').write(dmg_data)
|
||||
dmg_sha256 = hashlib.sha256(dmg_data).hexdigest()
|
||||
r = requests.get(dmg_url)
|
||||
open(dmg_path, 'wb').write(r.content)
|
||||
dmg_sha256 = hashlib.sha256(r.content).hexdigest()
|
||||
else:
|
||||
dmg_data = open(dmg_path, 'rb').read()
|
||||
dmg_sha256 = hashlib.sha256(dmg_data).hexdigest()
|
||||
|
@ -24,13 +24,18 @@ In order to avoid a Windows gnupg dependency, I manually verify the signature
|
||||
and hard-code the sha256 hash.
|
||||
"""
|
||||
|
||||
import inspect, os, sys, hashlib, shutil, subprocess
|
||||
import urllib.request
|
||||
import inspect
|
||||
import os
|
||||
import sys
|
||||
import hashlib
|
||||
import shutil
|
||||
import subprocess
|
||||
import requests
|
||||
|
||||
def main():
|
||||
exe_url = 'https://archive.torproject.org/tor-package-archive/torbrowser/7.5/torbrowser-install-7.5_en-US.exe'
|
||||
exe_filename = 'torbrowser-install-7.5_en-US.exe'
|
||||
expected_exe_sha256 = '81ccb9456118cf8fa755a3eafb5c514665fc69599cdd41e9eb36baa335ebe233'
|
||||
exe_url = 'https://archive.torproject.org/tor-package-archive/torbrowser/7.5.5/torbrowser-install-7.5.5_en-US.exe'
|
||||
exe_filename = 'torbrowser-install-7.5.5_en-US.exe'
|
||||
expected_exe_sha256 = '992f9a6658001c3419ed3695a908eef4fb7feb1cd549389bdacbadb7f8cb08a7'
|
||||
# Build paths
|
||||
root_path = os.path.dirname(os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))))
|
||||
working_path = os.path.join(os.path.join(root_path, 'build'), 'tor')
|
||||
@ -44,10 +49,9 @@ def main():
|
||||
# Make sure the zip is downloaded
|
||||
if not os.path.exists(exe_path):
|
||||
print("Downloading {}".format(exe_url))
|
||||
response = urllib.request.urlopen(exe_url)
|
||||
exe_data = response.read()
|
||||
open(exe_path, 'wb').write(exe_data)
|
||||
exe_sha256 = hashlib.sha256(exe_data).hexdigest()
|
||||
r = requests.get(exe_url)
|
||||
open(exe_path, 'wb').write(r.content)
|
||||
exe_sha256 = hashlib.sha256(r.content).hexdigest()
|
||||
else:
|
||||
exe_data = open(exe_path, 'rb').read()
|
||||
exe_sha256 = hashlib.sha256(exe_data).hexdigest()
|
||||
|
55
install/licenses/license-obfs4.txt
Normal file
55
install/licenses/license-obfs4.txt
Normal file
@ -0,0 +1,55 @@
|
||||
Copyright (c) 2014, Yawning Angel <yawning at torproject dot org>
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
==============================================================================
|
||||
|
||||
Copyright (c) 2012 The Go Authors. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following disclaimer
|
||||
in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of Google Inc. nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
381
install/licenses/license-tor.txt
Normal file
381
install/licenses/license-tor.txt
Normal file
@ -0,0 +1,381 @@
|
||||
This file contains the license for Tor,
|
||||
a free software project to provide anonymity on the Internet.
|
||||
|
||||
It also lists the licenses for other components used by Tor.
|
||||
|
||||
For more information about Tor, see https://www.torproject.org/.
|
||||
|
||||
If you got this file as a part of a larger bundle,
|
||||
there may be other license terms that you should be aware of.
|
||||
|
||||
===============================================================================
|
||||
Tor is distributed under this license:
|
||||
|
||||
Copyright (c) 2001-2004, Roger Dingledine
|
||||
Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson
|
||||
Copyright (c) 2007-2017, The Tor Project, Inc.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following disclaimer
|
||||
in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
|
||||
* Neither the names of the copyright owners nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
===============================================================================
|
||||
src/ext/strlcat.c and src/ext/strlcpy.c by Todd C. Miller are licensed
|
||||
under the following license:
|
||||
|
||||
* Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
* THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
===============================================================================
|
||||
src/ext/tor_queue.h is licensed under the following license:
|
||||
|
||||
* Copyright (c) 1991, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
|
||||
===============================================================================
|
||||
src/ext/csiphash.c is licensed under the following license:
|
||||
|
||||
Copyright (c) 2013 Marek Majkowski <marek@popcount.org>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
===============================================================================
|
||||
Trunnel is distributed under this license:
|
||||
|
||||
Copyright 2014 The Tor Project, Inc.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following disclaimer
|
||||
in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
|
||||
* Neither the names of the copyright owners nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
===============================================================================
|
||||
src/config/geoip is licensed under the following license:
|
||||
|
||||
OPEN DATA LICENSE (GeoLite Country and GeoLite City databases)
|
||||
|
||||
Copyright (c) 2008 MaxMind, Inc. All Rights Reserved.
|
||||
|
||||
All advertising materials and documentation mentioning features or use of
|
||||
this database must display the following acknowledgment:
|
||||
"This product includes GeoLite data created by MaxMind, available from
|
||||
http://maxmind.com/"
|
||||
|
||||
Redistribution and use with or without modification, are permitted provided
|
||||
that the following conditions are met:
|
||||
1. Redistributions must retain the above copyright notice, this list of
|
||||
conditions and the following disclaimer in the documentation and/or other
|
||||
materials provided with the distribution.
|
||||
2. All advertising materials and documentation mentioning features or use of
|
||||
this database must display the following acknowledgement:
|
||||
"This product includes GeoLite data created by MaxMind, available from
|
||||
http://maxmind.com/"
|
||||
3. "MaxMind" may not be used to endorse or promote products derived from this
|
||||
database without specific prior written permission.
|
||||
|
||||
THIS DATABASE IS PROVIDED BY MAXMIND, INC ``AS IS'' AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL MAXMIND BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
DATABASE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
===============================================================================
|
||||
m4/pc_from_ucontext.m4 is available under the following license. Note that
|
||||
it is *not* built into the Tor software.
|
||||
|
||||
Copyright (c) 2005, Google Inc.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following disclaimer
|
||||
in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of Google Inc. nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
===============================================================================
|
||||
m4/pkg.m4 is available under the following license. Note that
|
||||
it is *not* built into the Tor software.
|
||||
|
||||
pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
|
||||
serial 1 (pkg-config-0.24)
|
||||
|
||||
Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
|
||||
|
||||
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
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
As a special exception to the GNU General Public License, if you
|
||||
distribute this file as part of a program that contains a
|
||||
configuration script generated by Autoconf, you may include it under
|
||||
the same distribution terms that you use for the rest of that program.
|
||||
===============================================================================
|
||||
src/ext/readpassphrase.[ch] are distributed under this license:
|
||||
|
||||
Copyright (c) 2000-2002, 2007 Todd C. Miller <Todd.Miller@courtesan.com>
|
||||
|
||||
Permission to use, copy, modify, and distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
Sponsored in part by the Defense Advanced Research Projects
|
||||
Agency (DARPA) and Air Force Research Laboratory, Air Force
|
||||
Materiel Command, USAF, under agreement number F39502-99-1-0512.
|
||||
|
||||
===============================================================================
|
||||
src/ext/mulodi4.c is distributed under this license:
|
||||
|
||||
=========================================================================
|
||||
compiler_rt License
|
||||
=========================================================================
|
||||
|
||||
The compiler_rt library is dual licensed under both the
|
||||
University of Illinois "BSD-Like" license and the MIT license.
|
||||
As a user of this code you may choose to use it under either
|
||||
license. As a contributor, you agree to allow your code to be
|
||||
used under both.
|
||||
|
||||
Full text of the relevant licenses is included below.
|
||||
|
||||
=========================================================================
|
||||
|
||||
University of Illinois/NCSA
|
||||
Open Source License
|
||||
|
||||
Copyright (c) 2009-2016 by the contributors listed in CREDITS.TXT
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Developed by:
|
||||
|
||||
LLVM Team
|
||||
|
||||
University of Illinois at Urbana-Champaign
|
||||
|
||||
http://llvm.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation
|
||||
files (the "Software"), to deal with the Software without
|
||||
restriction, including without limitation the rights to use,
|
||||
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following
|
||||
conditions:
|
||||
|
||||
* Redistributions of source code must retain the above
|
||||
copyright notice, this list of conditions and the following
|
||||
disclaimers.
|
||||
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following
|
||||
disclaimers in the documentation and/or other materials
|
||||
provided with the distribution.
|
||||
|
||||
* Neither the names of the LLVM Team, University of Illinois
|
||||
at Urbana-Champaign, nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this
|
||||
Software without specific prior written permission.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT
|
||||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS WITH THE SOFTWARE.
|
||||
|
||||
=========================================================================
|
||||
|
||||
Copyright (c) 2009-2015 by the contributors listed in CREDITS.TXT
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation
|
||||
files (the "Software"), to deal in the Software without
|
||||
restriction, including without limitation the rights to use,
|
||||
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following
|
||||
conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
=========================================================================
|
||||
Copyrights and Licenses for Third Party Software Distributed with LLVM:
|
||||
=========================================================================
|
||||
|
||||
The LLVM software contains code written by third parties. Such
|
||||
software will have its own individual LICENSE.TXT file in the
|
||||
directory in which it appears. This file will describe the
|
||||
copyrights, license, and restrictions which apply to that code.
|
||||
|
||||
The disclaimer of warranty in the University of Illinois Open
|
||||
Source License applies to all code in the LLVM Distribution, and
|
||||
nothing in any of the other licenses gives permission to use the
|
||||
names of the LLVM Team or the University of Illinois to endorse
|
||||
or promote products derived from this Software.
|
||||
|
||||
===============================================================================
|
||||
If you got Tor as a static binary with OpenSSL included, then you should know:
|
||||
"This product includes software developed by the OpenSSL Project
|
||||
for use in the OpenSSL Toolkit (http://www.openssl.org/)"
|
||||
===============================================================================
|
1
install/licenses/readme.txt
Normal file
1
install/licenses/readme.txt
Normal file
@ -0,0 +1 @@
|
||||
This folder contains the software licenses for 3rd-party binaries included with OnionShare.
|
@ -6,7 +6,7 @@
|
||||
!define INSTALLSIZE 66537
|
||||
!define VERSIONMAJOR 1
|
||||
!define VERSIONMINOR 3
|
||||
!define VERSIONSTRING "1.3"
|
||||
!define VERSIONSTRING "1.3.1"
|
||||
|
||||
RequestExecutionLevel admin
|
||||
|
||||
@ -39,7 +39,7 @@ ${EndIf}
|
||||
!echo "Creating normal installer"
|
||||
!system "makensis.exe /DINNER onionshare.nsi" = 0
|
||||
!system "$%TEMP%\tempinstaller.exe" = 2
|
||||
!system "signtool.exe sign /v /d $\"Uninstall OnionShare$\" /a /tr http://time.certum.pl/ /fd sha256 $%TEMP%\uninstall.exe" = 0
|
||||
!system "signtool.exe sign /v /d $\"Uninstall OnionShare$\" /a /tr http://time.certum.pl/ $%TEMP%\uninstall.exe" = 0
|
||||
|
||||
# all done, now we can build the real installer
|
||||
OutFile "..\dist\onionshare-setup.exe"
|
||||
@ -162,6 +162,12 @@ Section "install"
|
||||
SetOutPath "$INSTDIR\lib2to3\tests\data"
|
||||
File "${BINPATH}\lib2to3\tests\data\README"
|
||||
|
||||
SetOutPath "$INSTDIR\licenses"
|
||||
File "${BINPATH}\licenses\license-obfs4.txt"
|
||||
File "${BINPATH}\licenses\license-onionshare.txt"
|
||||
File "${BINPATH}\licenses\license-tor.txt"
|
||||
File "${BINPATH}\licenses\readme.txt"
|
||||
|
||||
SetOutPath "$INSTDIR\PyQt5\Qt\bin"
|
||||
File "${BINPATH}\PyQt5\Qt\bin\qt.conf"
|
||||
|
||||
@ -188,11 +194,9 @@ Section "install"
|
||||
File "${BINPATH}\PyQt5\Qt\plugins\printsupport\windowsprintersupport.dll"
|
||||
|
||||
SetOutPath "$INSTDIR\share"
|
||||
File "${BINPATH}\share\license.txt"
|
||||
File "${BINPATH}\share\torrc_template"
|
||||
File "${BINPATH}\share\torrc_template-windows"
|
||||
File "${BINPATH}\share\torrc_template-obfs4"
|
||||
File "${BINPATH}\share\torrc_template-meek_lite_amazon"
|
||||
File "${BINPATH}\share\torrc_template-meek_lite_azure"
|
||||
File "${BINPATH}\share\version.txt"
|
||||
File "${BINPATH}\share\wordlist.txt"
|
||||
@ -353,6 +357,10 @@ FunctionEnd
|
||||
Delete "$INSTDIR\lib2to3\tests"
|
||||
Delete "$INSTDIR\lib2to3\tests\data"
|
||||
Delete "$INSTDIR\lib2to3\tests\data\README"
|
||||
Delete "$INSTDIR\licenses\license-obfs4.txt"
|
||||
Delete "$INSTDIR\licenses\license-onionshare.txt"
|
||||
Delete "$INSTDIR\licenses\license-tor.txt"
|
||||
Delete "$INSTDIR\licenses\readme.txt"
|
||||
Delete "$INSTDIR\mfc140u.dll"
|
||||
Delete "$INSTDIR\MSVCP140.dll"
|
||||
Delete "$INSTDIR\onionshare-gui.exe"
|
||||
@ -409,7 +417,6 @@ FunctionEnd
|
||||
Delete "$INSTDIR\share\images\settings.png"
|
||||
Delete "$INSTDIR\share\images\web_file.png"
|
||||
Delete "$INSTDIR\share\images\web_folder.png"
|
||||
Delete "$INSTDIR\share\license.txt"
|
||||
Delete "$INSTDIR\share\locale\cs.json"
|
||||
Delete "$INSTDIR\share\locale\de.json"
|
||||
Delete "$INSTDIR\share\locale\en.json"
|
||||
@ -426,7 +433,6 @@ FunctionEnd
|
||||
Delete "$INSTDIR\share\torrc_template"
|
||||
Delete "$INSTDIR\share\torrc_template-windows"
|
||||
Delete "$INSTDIR\share\torrc_template-obfs4"
|
||||
Delete "$INSTDIR\share\torrc_template-meek_lite_amazon"
|
||||
Delete "$INSTDIR\share\torrc_template-meek_lite_azure"
|
||||
Delete "$INSTDIR\share\version.txt"
|
||||
Delete "$INSTDIR\share\wordlist.txt"
|
||||
@ -470,6 +476,7 @@ FunctionEnd
|
||||
rmDir "$INSTDIR\lib2to3\tests\data"
|
||||
rmDir "$INSTDIR\lib2to3\tests"
|
||||
rmDir "$INSTDIR\lib2to3"
|
||||
rmDir "$INSTDIR\licenses"
|
||||
rmDir "$INSTDIR\PyQt5\Qt\bin"
|
||||
rmDir "$INSTDIR\PyQt5\Qt\plugins\iconengines"
|
||||
rmDir "$INSTDIR\PyQt5\Qt\plugins\imageformats"
|
||||
|
@ -10,18 +10,20 @@ a = Analysis(
|
||||
pathex=['.'],
|
||||
binaries=None,
|
||||
datas=[
|
||||
('../share/license.txt', 'share'),
|
||||
('../share/version.txt', 'share'),
|
||||
('../share/wordlist.txt', 'share'),
|
||||
('../share/torrc_template', 'share'),
|
||||
('../share/torrc_template-obfs4', 'share'),
|
||||
('../share/torrc_template-meek_lite_amazon', 'share'),
|
||||
('../share/torrc_template-meek_lite_azure', 'share'),
|
||||
('../share/torrc_template-windows', 'share'),
|
||||
('../share/images/*', 'share/images'),
|
||||
('../share/locale/*', 'share/locale'),
|
||||
('../share/static/*', 'share/static'),
|
||||
('../share/templates/*', 'share/templates'),
|
||||
('../share/static/*', 'share/static')
|
||||
('../share/static/css/*', 'share/static/css'),
|
||||
('../share/static/img/*', 'share/static/img'),
|
||||
('../share/static/js/*', 'share/static/js'),
|
||||
('../install/licenses/*', 'licenses')
|
||||
],
|
||||
hiddenimports=[],
|
||||
hookspath=[],
|
||||
|
@ -8,6 +8,7 @@ pefile==2017.11.5
|
||||
PyInstaller==3.3.1
|
||||
PyQt5==5.9.2
|
||||
PySocks==1.6.7
|
||||
requests==2.19.1
|
||||
sip==4.19.6
|
||||
stem==1.6.0
|
||||
Werkzeug==0.14.1
|
||||
|
@ -6,6 +6,7 @@ MarkupSafe==1.0
|
||||
PyInstaller==3.3.1
|
||||
PyQt5==5.9.2
|
||||
PySocks==1.6.7
|
||||
requests==2.19.1
|
||||
sip==4.19.6
|
||||
stem==1.6.0
|
||||
Werkzeug==0.14.1
|
||||
|
@ -23,7 +23,6 @@ from stem import ProtocolError, SocketClosed
|
||||
from stem.connection import MissingPassword, UnreadableCookieFile, AuthenticationFailure
|
||||
import os, sys, tempfile, shutil, urllib, platform, subprocess, time, shlex
|
||||
|
||||
from . import socks
|
||||
from . import common, strings
|
||||
from .settings import Settings
|
||||
|
||||
@ -210,11 +209,6 @@ class Onion(object):
|
||||
with open(self.common.get_resource_path('torrc_template-obfs4')) as o:
|
||||
for line in o:
|
||||
f.write(line)
|
||||
elif self.settings.get('tor_bridges_use_meek_lite_amazon'):
|
||||
f.write('ClientTransportPlugin meek_lite exec {}\n'.format(self.obfs4proxy_file_path))
|
||||
with open(self.common.get_resource_path('torrc_template-meek_lite_amazon')) as o:
|
||||
for line in o:
|
||||
f.write(line)
|
||||
elif self.settings.get('tor_bridges_use_meek_lite_azure'):
|
||||
f.write('ClientTransportPlugin meek_lite exec {}\n'.format(self.obfs4proxy_file_path))
|
||||
with open(self.common.get_resource_path('torrc_template-meek_lite_azure')) as o:
|
||||
@ -281,7 +275,6 @@ class Onion(object):
|
||||
# If using bridges, it might take a bit longer to connect to Tor
|
||||
if self.settings.get('tor_bridges_use_custom_bridges') or \
|
||||
self.settings.get('tor_bridges_use_obfs4') or \
|
||||
self.settings.get('tor_bridges_use_meek_lite_amazon') or \
|
||||
self.settings.get('tor_bridges_use_meek_lite_azure'):
|
||||
connect_timeout = 150
|
||||
else:
|
||||
|
@ -65,7 +65,6 @@ class Settings(object):
|
||||
'autoupdate_timestamp': None,
|
||||
'no_bridges': True,
|
||||
'tor_bridges_use_obfs4': False,
|
||||
'tor_bridges_use_meek_lite_amazon': False,
|
||||
'tor_bridges_use_meek_lite_azure': False,
|
||||
'tor_bridges_use_custom_bridges': '',
|
||||
'save_private_key': False,
|
||||
|
@ -1,530 +0,0 @@
|
||||
"""
|
||||
SocksiPy - Python SOCKS module.
|
||||
Version 1.5.0
|
||||
|
||||
Copyright 2006 Dan-Haim. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
3. Neither the name of Dan Haim nor the names of his contributors may be used
|
||||
to endorse or promote products derived from this software without specific
|
||||
prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY DAN HAIM "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
EVENT SHALL DAN HAIM OR HIS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA
|
||||
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
This module provides a standard socket-like interface for Python
|
||||
for tunneling connections through SOCKS proxies.
|
||||
|
||||
===============================================================================
|
||||
|
||||
Minor modifications made by Christopher Gilbert (http://motomastyle.com/)
|
||||
for use in PyLoris (http://pyloris.sourceforge.net/)
|
||||
|
||||
Minor modifications made by Mario Vilas (http://breakingcode.wordpress.com/)
|
||||
mainly to merge bug fixes found in Sourceforge
|
||||
|
||||
Modifications made by Anorov (https://github.com/Anorov)
|
||||
-Forked and renamed to PySocks
|
||||
-Fixed issue with HTTP proxy failure checking (same bug that was in the old ___recvall() method)
|
||||
-Included SocksiPyHandler (sockshandler.py), to be used as a urllib2 handler,
|
||||
courtesy of e000 (https://github.com/e000): https://gist.github.com/869791#file_socksipyhandler.py
|
||||
-Re-styled code to make it readable
|
||||
-Aliased PROXY_TYPE_SOCKS5 -> SOCKS5 etc.
|
||||
-Improved exception handling and output
|
||||
-Removed irritating use of sequence indexes, replaced with tuple unpacked variables
|
||||
-Fixed up Python 3 bytestring handling - chr(0x03).encode() -> b"\x03"
|
||||
-Other general fixes
|
||||
-Added clarification that the HTTP proxy connection method only supports CONNECT-style tunneling HTTP proxies
|
||||
-Various small bug fixes
|
||||
"""
|
||||
|
||||
__version__ = "1.5.0"
|
||||
|
||||
import socket
|
||||
import struct
|
||||
|
||||
PROXY_TYPE_SOCKS4 = SOCKS4 = 1
|
||||
PROXY_TYPE_SOCKS5 = SOCKS5 = 2
|
||||
PROXY_TYPE_HTTP = HTTP = 3
|
||||
|
||||
PRINTABLE_PROXY_TYPES = {SOCKS4: "SOCKS4", SOCKS5: "SOCKS5", HTTP: "HTTP"}
|
||||
|
||||
_orgsocket = _orig_socket = socket.socket
|
||||
|
||||
|
||||
class ProxyError(IOError):
|
||||
"""
|
||||
socket_err contains original socket.error exception.
|
||||
"""
|
||||
def __init__(self, msg, socket_err=None):
|
||||
self.msg = msg
|
||||
self.socket_err = socket_err
|
||||
|
||||
if socket_err:
|
||||
self.msg = msg + ": {}".format(socket_err)
|
||||
|
||||
def __str__(self):
|
||||
return self.msg
|
||||
|
||||
|
||||
class GeneralProxyError(ProxyError):
|
||||
pass
|
||||
|
||||
|
||||
class ProxyConnectionError(ProxyError):
|
||||
pass
|
||||
|
||||
|
||||
class SOCKS5AuthError(ProxyError):
|
||||
pass
|
||||
|
||||
|
||||
class SOCKS5Error(ProxyError):
|
||||
pass
|
||||
|
||||
|
||||
class SOCKS4Error(ProxyError):
|
||||
pass
|
||||
|
||||
|
||||
class HTTPError(ProxyError):
|
||||
pass
|
||||
|
||||
|
||||
SOCKS4_ERRORS = {
|
||||
0x5B: "Request rejected or failed",
|
||||
0x5C: "Request rejected because SOCKS server cannot connect to identd on the client",
|
||||
0x5D: "Request rejected because the client program and identd report different user-ids",
|
||||
}
|
||||
|
||||
SOCKS5_ERRORS = {
|
||||
0x01: "General SOCKS server failure",
|
||||
0x02: "Connection not allowed by ruleset",
|
||||
0x03: "Network unreachable",
|
||||
0x04: "Host unreachable",
|
||||
0x05: "Connection refused",
|
||||
0x06: "TTL expired",
|
||||
0x07: "Command not supported, or protocol error",
|
||||
0x08: "Address type not supported",
|
||||
}
|
||||
|
||||
DEFAULT_PORTS = {
|
||||
SOCKS4: 1080,
|
||||
SOCKS5: 1080,
|
||||
HTTP: 8080,
|
||||
}
|
||||
|
||||
|
||||
def set_default_proxy(proxy_type=None, addr=None, port=None, rdns=True, username=None, password=None):
|
||||
"""
|
||||
set_default_proxy(proxy_type, addr[, port[, rdns[, username, password]]])
|
||||
|
||||
Sets a default proxy which all further socksocket objects will use,
|
||||
unless explicitly changed.
|
||||
"""
|
||||
socksocket.default_proxy = (proxy_type, addr.encode(), port, rdns,
|
||||
username.encode() if username else None,
|
||||
password.encode() if password else None)
|
||||
|
||||
setdefaultproxy = set_default_proxy
|
||||
|
||||
|
||||
def get_default_proxy():
|
||||
"""
|
||||
Returns the default proxy, set by set_default_proxy.
|
||||
"""
|
||||
return socksocket.default_proxy
|
||||
|
||||
getdefaultproxy = get_default_proxy
|
||||
|
||||
|
||||
def wrap_module(module):
|
||||
"""
|
||||
Attempts to replace a module's socket library with a SOCKS socket. Must set
|
||||
a default proxy using set_default_proxy(...) first.
|
||||
This will only work on modules that import socket directly into the namespace;
|
||||
most of the Python Standard Library falls into this category.
|
||||
"""
|
||||
if socksocket.default_proxy:
|
||||
module.socket.socket = socksocket
|
||||
else:
|
||||
raise GeneralProxyError("No default proxy specified")
|
||||
|
||||
wrapmodule = wrap_module
|
||||
|
||||
|
||||
def create_connection(dest_pair, proxy_type=None, proxy_addr=None,
|
||||
proxy_port=None, proxy_username=None,
|
||||
proxy_password=None, timeout=None):
|
||||
"""create_connection(dest_pair, **proxy_args) -> socket object
|
||||
|
||||
Like socket.create_connection(), but connects to proxy
|
||||
before returning the socket object.
|
||||
|
||||
dest_pair - 2-tuple of (IP/hostname, port).
|
||||
**proxy_args - Same args passed to socksocket.set_proxy().
|
||||
timeout - Optional socket timeout value, in seconds.
|
||||
"""
|
||||
sock = socksocket()
|
||||
if isinstance(timeout, (int, float)):
|
||||
sock.settimeout(timeout)
|
||||
sock.set_proxy(proxy_type, proxy_addr, proxy_port,
|
||||
proxy_username, proxy_password)
|
||||
sock.connect(dest_pair)
|
||||
return sock
|
||||
|
||||
|
||||
class socksocket(socket.socket):
|
||||
"""socksocket([family[, type[, proto]]]) -> socket object
|
||||
|
||||
Open a SOCKS enabled socket. The parameters are the same as
|
||||
those of the standard socket init. In order for SOCKS to work,
|
||||
you must specify family=AF_INET, type=SOCK_STREAM and proto=0.
|
||||
"""
|
||||
|
||||
default_proxy = None
|
||||
|
||||
def __init__(self, family=socket.AF_INET, type=socket.SOCK_STREAM, proto=0, _sock=None):
|
||||
_orig_socket.__init__(self, family, type, proto, _sock)
|
||||
|
||||
if self.default_proxy:
|
||||
self.proxy = self.default_proxy
|
||||
else:
|
||||
self.proxy = (None, None, None, None, None, None)
|
||||
self.proxy_sockname = None
|
||||
self.proxy_peername = None
|
||||
|
||||
self.proxy_negotiators = {
|
||||
SOCKS4: self._negotiate_SOCKS4,
|
||||
SOCKS5: self._negotiate_SOCKS5,
|
||||
HTTP: self._negotiate_HTTP,
|
||||
}
|
||||
|
||||
def _recvall(self, count):
|
||||
"""
|
||||
Receive EXACTLY the number of bytes requested from the socket.
|
||||
Blocks until the required number of bytes have been received.
|
||||
"""
|
||||
data = b""
|
||||
while len(data) < count:
|
||||
d = self.recv(count - len(data))
|
||||
if not d:
|
||||
raise GeneralProxyError("Connection closed unexpectedly")
|
||||
data += d
|
||||
return data
|
||||
|
||||
def set_proxy(self, proxy_type=None, addr=None, port=None, rdns=True, username=None, password=None):
|
||||
"""set_proxy(proxy_type, addr[, port[, rdns[, username[, password]]]])
|
||||
Sets the proxy to be used.
|
||||
|
||||
proxy_type - The type of the proxy to be used. Three types
|
||||
are supported: PROXY_TYPE_SOCKS4 (including socks4a),
|
||||
PROXY_TYPE_SOCKS5 and PROXY_TYPE_HTTP
|
||||
addr - The address of the server (IP or DNS).
|
||||
port - The port of the server. Defaults to 1080 for SOCKS
|
||||
servers and 8080 for HTTP proxy servers.
|
||||
rdns - Should DNS queries be performed on the remote side
|
||||
(rather than the local side). The default is True.
|
||||
Note: This has no effect with SOCKS4 servers.
|
||||
username - Username to authenticate with to the server.
|
||||
The default is no authentication.
|
||||
password - Password to authenticate with to the server.
|
||||
Only relevant when username is also provided.
|
||||
"""
|
||||
self.proxy = (proxy_type, addr.encode(), port, rdns,
|
||||
username.encode() if username else None,
|
||||
password.encode() if password else None)
|
||||
|
||||
setproxy = set_proxy
|
||||
|
||||
def get_proxy_sockname(self):
|
||||
"""
|
||||
Returns the bound IP address and port number at the proxy.
|
||||
"""
|
||||
return self.proxy_sockname
|
||||
|
||||
getproxysockname = get_proxy_sockname
|
||||
|
||||
def get_proxy_peername(self):
|
||||
"""
|
||||
Returns the IP and port number of the proxy.
|
||||
"""
|
||||
return _orig_socket.getpeername(self)
|
||||
|
||||
getproxypeername = get_proxy_peername
|
||||
|
||||
def get_peername(self):
|
||||
"""
|
||||
Returns the IP address and port number of the destination
|
||||
machine (note: get_proxy_peername returns the proxy)
|
||||
"""
|
||||
return self.proxy_peername
|
||||
|
||||
getpeername = get_peername
|
||||
|
||||
def _negotiate_SOCKS5(self, dest_addr, dest_port):
|
||||
"""
|
||||
Negotiates a connection through a SOCKS5 server.
|
||||
"""
|
||||
proxy_type, addr, port, rdns, username, password = self.proxy
|
||||
|
||||
# First we'll send the authentication packages we support.
|
||||
if username and password:
|
||||
# The username/password details were supplied to the
|
||||
# set_proxy method so we support the USERNAME/PASSWORD
|
||||
# authentication (in addition to the standard none).
|
||||
self.sendall(b"\x05\x02\x00\x02")
|
||||
else:
|
||||
# No username/password were entered, therefore we
|
||||
# only support connections with no authentication.
|
||||
self.sendall(b"\x05\x01\x00")
|
||||
|
||||
# We'll receive the server's response to determine which
|
||||
# method was selected
|
||||
chosen_auth = self._recvall(2)
|
||||
|
||||
if chosen_auth[0:1] != b"\x05":
|
||||
# Note: string[i:i+1] is used because indexing of a bytestring
|
||||
# via bytestring[i] yields an integer in Python 3
|
||||
raise GeneralProxyError("SOCKS5 proxy server sent invalid data")
|
||||
|
||||
# Check the chosen authentication method
|
||||
|
||||
if chosen_auth[1:2] == b"\x02":
|
||||
# Okay, we need to perform a basic username/password
|
||||
# authentication.
|
||||
self.sendall(b"\x01" + chr(len(username)).encode()
|
||||
+ username
|
||||
+ chr(len(password)).encode()
|
||||
+ password)
|
||||
auth_status = self._recvall(2)
|
||||
if auth_status[0:1] != b"\x01":
|
||||
# Bad response
|
||||
raise GeneralProxyError("SOCKS5 proxy server sent invalid data")
|
||||
if auth_status[1:2] != b"\x00":
|
||||
# Authentication failed
|
||||
raise SOCKS5AuthError("SOCKS5 authentication failed")
|
||||
|
||||
# Otherwise, authentication succeeded
|
||||
|
||||
# No authentication is required if 0x00
|
||||
elif chosen_auth[1:2] != b"\x00":
|
||||
# Reaching here is always bad
|
||||
if chosen_auth[1:2] == b"\xFF":
|
||||
raise SOCKS5AuthError("All offered SOCKS5 authentication methods were rejected")
|
||||
else:
|
||||
raise GeneralProxyError("SOCKS5 proxy server sent invalid data")
|
||||
|
||||
# Now we can request the actual connection
|
||||
req = b"\x05\x01\x00"
|
||||
# If the given destination address is an IP address, we'll
|
||||
# use the IPv4 address request even if remote resolving was specified.
|
||||
try:
|
||||
addr_bytes = socket.inet_aton(dest_addr)
|
||||
req += b"\x01" + addr_bytes
|
||||
except socket.error:
|
||||
# Well it's not an IP number, so it's probably a DNS name.
|
||||
if rdns:
|
||||
# Resolve remotely
|
||||
addr_bytes = None
|
||||
req += b"\x03" + chr(len(dest_addr)).encode() + dest_addr.encode()
|
||||
else:
|
||||
# Resolve locally
|
||||
addr_bytes = socket.inet_aton(socket.gethostbyname(dest_addr))
|
||||
req += b"\x01" + addr_bytes
|
||||
|
||||
req += struct.pack(">H", dest_port)
|
||||
self.sendall(req)
|
||||
|
||||
# Get the response
|
||||
resp = self._recvall(4)
|
||||
if resp[0:1] != b"\x05":
|
||||
raise GeneralProxyError("SOCKS5 proxy server sent invalid data")
|
||||
|
||||
status = ord(resp[1:2])
|
||||
if status != 0x00:
|
||||
# Connection failed: server returned an error
|
||||
error = SOCKS5_ERRORS.get(status, "Unknown error")
|
||||
raise SOCKS5Error("{:#04x}: {}".format(status, error))
|
||||
|
||||
# Get the bound address/port
|
||||
if resp[3:4] == b"\x01":
|
||||
bound_addr = self._recvall(4)
|
||||
elif resp[3:4] == b"\x03":
|
||||
resp += self.recv(1)
|
||||
bound_addr = self._recvall(ord(resp[4:5]))
|
||||
else:
|
||||
raise GeneralProxyError("SOCKS5 proxy server sent invalid data")
|
||||
|
||||
bound_port = struct.unpack(">H", self._recvall(2))[0]
|
||||
self.proxy_sockname = bound_addr, bound_port
|
||||
if addr_bytes:
|
||||
self.proxy_peername = socket.inet_ntoa(addr_bytes), dest_port
|
||||
else:
|
||||
self.proxy_peername = dest_addr, dest_port
|
||||
|
||||
def _negotiate_SOCKS4(self, dest_addr, dest_port):
|
||||
"""
|
||||
Negotiates a connection through a SOCKS4 server.
|
||||
"""
|
||||
proxy_type, addr, port, rdns, username, password = self.proxy
|
||||
|
||||
# Check if the destination address provided is an IP address
|
||||
remote_resolve = False
|
||||
try:
|
||||
addr_bytes = socket.inet_aton(dest_addr)
|
||||
except socket.error:
|
||||
# It's a DNS name. Check where it should be resolved.
|
||||
if rdns:
|
||||
addr_bytes = b"\x00\x00\x00\x01"
|
||||
remote_resolve = True
|
||||
else:
|
||||
addr_bytes = socket.inet_aton(socket.gethostbyname(dest_addr))
|
||||
|
||||
# Construct the request packet
|
||||
req = struct.pack(">BBH", 0x04, 0x01, dest_port) + addr_bytes
|
||||
|
||||
# The username parameter is considered userid for SOCKS4
|
||||
if username:
|
||||
req += username
|
||||
req += b"\x00"
|
||||
|
||||
# DNS name if remote resolving is required
|
||||
# NOTE: This is actually an extension to the SOCKS4 protocol
|
||||
# called SOCKS4A and may not be supported in all cases.
|
||||
if remote_resolve:
|
||||
req += dest_addr.encode() + b"\x00"
|
||||
self.sendall(req)
|
||||
|
||||
# Get the response from the server
|
||||
resp = self._recvall(8)
|
||||
if resp[0:1] != b"\x00":
|
||||
# Bad data
|
||||
raise GeneralProxyError("SOCKS4 proxy server sent invalid data")
|
||||
|
||||
status = ord(resp[1:2])
|
||||
if status != 0x5A:
|
||||
# Connection failed: server returned an error
|
||||
error = SOCKS4_ERRORS.get(status, "Unknown error")
|
||||
raise SOCKS4Error("{:#04x}: {}".format(status, error))
|
||||
|
||||
# Get the bound address/port
|
||||
self.proxy_sockname = (socket.inet_ntoa(resp[4:]), struct.unpack(">H", resp[2:4])[0])
|
||||
if remote_resolve:
|
||||
self.proxy_peername = socket.inet_ntoa(addr_bytes), dest_port
|
||||
else:
|
||||
self.proxy_peername = dest_addr, dest_port
|
||||
|
||||
def _negotiate_HTTP(self, dest_addr, dest_port):
|
||||
"""
|
||||
Negotiates a connection through an HTTP server.
|
||||
NOTE: This currently only supports HTTP CONNECT-style proxies.
|
||||
"""
|
||||
proxy_type, addr, port, rdns, username, password = self.proxy
|
||||
|
||||
# If we need to resolve locally, we do this now
|
||||
addr = dest_addr if rdns else socket.gethostbyname(dest_addr)
|
||||
|
||||
self.sendall(b"CONNECT " + addr.encode() + b":" + str(dest_port).encode() +
|
||||
b" HTTP/1.1\r\n" + b"Host: " + dest_addr.encode() + b"\r\n\r\n")
|
||||
|
||||
# We just need the first line to check if the connection was successful
|
||||
fobj = self.makefile()
|
||||
status_line = fobj.readline()
|
||||
fobj.close()
|
||||
|
||||
if not status_line:
|
||||
raise GeneralProxyError("Connection closed unexpectedly")
|
||||
|
||||
try:
|
||||
proto, status_code, status_msg = status_line.split(" ", 2)
|
||||
except ValueError:
|
||||
raise GeneralProxyError("HTTP proxy server sent invalid response")
|
||||
|
||||
if not proto.startswith("HTTP/"):
|
||||
raise GeneralProxyError("Proxy server does not appear to be an HTTP proxy")
|
||||
|
||||
try:
|
||||
status_code = int(status_code)
|
||||
except ValueError:
|
||||
raise HTTPError("HTTP proxy server did not return a valid HTTP status")
|
||||
|
||||
if status_code != 200:
|
||||
error = "{}: {}".format(status_code, status_msg)
|
||||
if status_code in (400, 403, 405):
|
||||
# It's likely that the HTTP proxy server does not support the CONNECT tunneling method
|
||||
error += ("\n[*] Note: The HTTP proxy server may not be supported by PySocks"
|
||||
" (must be a CONNECT tunnel proxy)")
|
||||
raise HTTPError(error)
|
||||
|
||||
self.proxy_sockname = (b"0.0.0.0", 0)
|
||||
self.proxy_peername = addr, dest_port
|
||||
|
||||
def connect(self, dest_pair):
|
||||
"""
|
||||
Connects to the specified destination through a proxy.
|
||||
Uses the same API as socket's connect().
|
||||
To select the proxy server, use set_proxy().
|
||||
|
||||
dest_pair - 2-tuple of (IP/hostname, port).
|
||||
"""
|
||||
proxy_type, proxy_addr, proxy_port, rdns, username, password = self.proxy
|
||||
dest_addr, dest_port = dest_pair
|
||||
|
||||
# Do a minimal input check first
|
||||
if (not isinstance(dest_pair, (list, tuple))
|
||||
or len(dest_pair) != 2
|
||||
or not isinstance(dest_addr, type(""))
|
||||
or not isinstance(dest_port, int)):
|
||||
raise GeneralProxyError("Invalid destination-connection (host, port) pair")
|
||||
|
||||
if proxy_type is None:
|
||||
# Treat like regular socket object
|
||||
_orig_socket.connect(self, (dest_addr, dest_port))
|
||||
return
|
||||
|
||||
proxy_port = proxy_port or DEFAULT_PORTS.get(proxy_type)
|
||||
if not proxy_port:
|
||||
raise GeneralProxyError("Invalid proxy type")
|
||||
|
||||
try:
|
||||
# Initial connection to proxy server
|
||||
_orig_socket.connect(self, (proxy_addr, proxy_port))
|
||||
|
||||
except socket.error as error:
|
||||
# Error while connecting to proxy
|
||||
self.close()
|
||||
proxy_server = "{}:{}".format(proxy_addr.decode(), proxy_port)
|
||||
printable_type = PRINTABLE_PROXY_TYPES[proxy_type]
|
||||
|
||||
msg = "Error connecting to {} proxy {}".format(printable_type,
|
||||
proxy_server)
|
||||
raise ProxyConnectionError(msg, error)
|
||||
|
||||
else:
|
||||
# Connected to proxy server, now negotiate
|
||||
try:
|
||||
# Calls negotiate_{SOCKS4, SOCKS5, HTTP}
|
||||
self.proxy_negotiators[proxy_type](dest_addr, dest_port)
|
||||
except socket.error as error:
|
||||
# Wrap socket errors
|
||||
self.close()
|
||||
raise GeneralProxyError("Socket error", error)
|
||||
except ProxyError:
|
||||
# Protocol error while negotiating with proxy
|
||||
self.close()
|
||||
raise
|
@ -191,16 +191,6 @@ class SettingsDialog(QtWidgets.QDialog):
|
||||
self.tor_bridges_use_obfs4_radio = QtWidgets.QRadioButton(strings._('gui_settings_tor_bridges_obfs4_radio_option', True))
|
||||
self.tor_bridges_use_obfs4_radio.toggled.connect(self.tor_bridges_use_obfs4_radio_toggled)
|
||||
|
||||
# meek_lite-amazon option radio
|
||||
# if the obfs4proxy binary is missing, we can't use meek_lite-amazon transports
|
||||
(self.tor_path, self.tor_geo_ip_file_path, self.tor_geo_ipv6_file_path, self.obfs4proxy_file_path) = self.common.get_tor_paths()
|
||||
if not os.path.isfile(self.obfs4proxy_file_path):
|
||||
self.tor_bridges_use_meek_lite_amazon_radio = QtWidgets.QRadioButton(strings._('gui_settings_tor_bridges_meek_lite_amazon_radio_option_no_obfs4proxy', True))
|
||||
self.tor_bridges_use_meek_lite_amazon_radio.setEnabled(False)
|
||||
else:
|
||||
self.tor_bridges_use_meek_lite_amazon_radio = QtWidgets.QRadioButton(strings._('gui_settings_tor_bridges_meek_lite_amazon_radio_option', True))
|
||||
self.tor_bridges_use_meek_lite_amazon_radio.toggled.connect(self.tor_bridges_use_meek_lite_amazon_radio_toggled)
|
||||
|
||||
# meek_lite-azure option radio
|
||||
# if the obfs4proxy binary is missing, we can't use meek_lite-azure transports
|
||||
(self.tor_path, self.tor_geo_ip_file_path, self.tor_geo_ipv6_file_path, self.obfs4proxy_file_path) = self.common.get_tor_paths()
|
||||
@ -213,7 +203,6 @@ class SettingsDialog(QtWidgets.QDialog):
|
||||
|
||||
# meek_lite currently not supported on the version of obfs4proxy bundled with TorBrowser
|
||||
if self.system == 'Windows' or self.system == 'Darwin':
|
||||
self.tor_bridges_use_meek_lite_amazon_radio.hide()
|
||||
self.tor_bridges_use_meek_lite_azure_radio.hide()
|
||||
|
||||
# Custom bridges radio and textbox
|
||||
@ -239,7 +228,6 @@ class SettingsDialog(QtWidgets.QDialog):
|
||||
bridges_layout = QtWidgets.QVBoxLayout()
|
||||
bridges_layout.addWidget(self.tor_bridges_no_bridges_radio)
|
||||
bridges_layout.addWidget(self.tor_bridges_use_obfs4_radio)
|
||||
bridges_layout.addWidget(self.tor_bridges_use_meek_lite_amazon_radio)
|
||||
bridges_layout.addWidget(self.tor_bridges_use_meek_lite_azure_radio)
|
||||
bridges_layout.addWidget(self.tor_bridges_use_custom_radio)
|
||||
bridges_layout.addWidget(self.tor_bridges_use_custom_textbox_options)
|
||||
@ -483,13 +471,11 @@ class SettingsDialog(QtWidgets.QDialog):
|
||||
if self.old_settings.get('no_bridges'):
|
||||
self.tor_bridges_no_bridges_radio.setChecked(True)
|
||||
self.tor_bridges_use_obfs4_radio.setChecked(False)
|
||||
self.tor_bridges_use_meek_lite_amazon_radio.setChecked(False)
|
||||
self.tor_bridges_use_meek_lite_azure_radio.setChecked(False)
|
||||
self.tor_bridges_use_custom_radio.setChecked(False)
|
||||
else:
|
||||
self.tor_bridges_no_bridges_radio.setChecked(False)
|
||||
self.tor_bridges_use_obfs4_radio.setChecked(self.old_settings.get('tor_bridges_use_obfs4'))
|
||||
self.tor_bridges_use_meek_lite_amazon_radio.setChecked(self.old_settings.get('tor_bridges_use_meek_lite_amazon'))
|
||||
self.tor_bridges_use_meek_lite_azure_radio.setChecked(self.old_settings.get('tor_bridges_use_meek_lite_azure'))
|
||||
|
||||
if self.old_settings.get('tor_bridges_use_custom_bridges'):
|
||||
@ -528,16 +514,6 @@ class SettingsDialog(QtWidgets.QDialog):
|
||||
if checked:
|
||||
self.tor_bridges_use_custom_textbox_options.hide()
|
||||
|
||||
def tor_bridges_use_meek_lite_amazon_radio_toggled(self, checked):
|
||||
"""
|
||||
meek_lite-amazon bridges option was toggled. If checked, disable custom bridge options.
|
||||
"""
|
||||
if checked:
|
||||
self.tor_bridges_use_custom_textbox_options.hide()
|
||||
# Alert the user about meek's costliness if it looks like they're turning it on
|
||||
if not self.old_settings.get('tor_bridges_use_meek_lite_amazon'):
|
||||
Alert(strings._('gui_settings_meek_lite_expensive_warning', True), QtWidgets.QMessageBox.Warning)
|
||||
|
||||
def tor_bridges_use_meek_lite_azure_radio_toggled(self, checked):
|
||||
"""
|
||||
meek_lite_azure bridges option was toggled. If checked, disable custom bridge options.
|
||||
@ -546,7 +522,7 @@ class SettingsDialog(QtWidgets.QDialog):
|
||||
self.tor_bridges_use_custom_textbox_options.hide()
|
||||
# Alert the user about meek's costliness if it looks like they're turning it on
|
||||
if not self.old_settings.get('tor_bridges_use_meek_lite_azure'):
|
||||
Alert(strings._('gui_settings_meek_lite_expensive_warning', True), QtWidgets.QMessageBox.Warning)
|
||||
Alert(self.common, strings._('gui_settings_meek_lite_expensive_warning', True), QtWidgets.QMessageBox.Warning)
|
||||
|
||||
def tor_bridges_use_custom_radio_toggled(self, checked):
|
||||
"""
|
||||
@ -703,8 +679,8 @@ class SettingsDialog(QtWidgets.QDialog):
|
||||
Alert(self.common, strings._('update_error_check_error', True), QtWidgets.QMessageBox.Warning)
|
||||
close_forced_update_thread()
|
||||
|
||||
def update_invalid_version():
|
||||
Alert(self.common, strings._('update_error_invalid_latest_version', True).format(e.latest_version), QtWidgets.QMessageBox.Warning)
|
||||
def update_invalid_version(latest_version):
|
||||
Alert(self.common, strings._('update_error_invalid_latest_version', True).format(latest_version), QtWidgets.QMessageBox.Warning)
|
||||
close_forced_update_thread()
|
||||
|
||||
forced_update_thread = UpdateThread(self.common, self.onion, self.config, force=True)
|
||||
@ -745,7 +721,7 @@ class SettingsDialog(QtWidgets.QDialog):
|
||||
'control_port_port', 'socks_address', 'socks_port',
|
||||
'socket_file_path', 'auth_type', 'auth_password',
|
||||
'no_bridges', 'tor_bridges_use_obfs4',
|
||||
'tor_bridges_use_meek_lite_amazon', 'tor_bridges_use_meek_lite_azure',
|
||||
'tor_bridges_use_meek_lite_azure',
|
||||
'tor_bridges_use_custom_bridges']):
|
||||
|
||||
reboot_onion = True
|
||||
@ -857,31 +833,21 @@ class SettingsDialog(QtWidgets.QDialog):
|
||||
if self.tor_bridges_no_bridges_radio.isChecked():
|
||||
settings.set('no_bridges', True)
|
||||
settings.set('tor_bridges_use_obfs4', False)
|
||||
settings.set('tor_bridges_use_meek_lite_amazon', False)
|
||||
settings.set('tor_bridges_use_meek_lite_azure', False)
|
||||
settings.set('tor_bridges_use_custom_bridges', '')
|
||||
if self.tor_bridges_use_obfs4_radio.isChecked():
|
||||
settings.set('no_bridges', False)
|
||||
settings.set('tor_bridges_use_obfs4', True)
|
||||
settings.set('tor_bridges_use_meek_lite_amazon', False)
|
||||
settings.set('tor_bridges_use_meek_lite_azure', False)
|
||||
settings.set('tor_bridges_use_custom_bridges', '')
|
||||
if self.tor_bridges_use_meek_lite_amazon_radio.isChecked():
|
||||
settings.set('no_bridges', False)
|
||||
settings.set('tor_bridges_use_obfs4', False)
|
||||
settings.set('tor_bridges_use_meek_lite_amazon', True)
|
||||
settings.set('tor_bridges_use_meek_lite_azure', False)
|
||||
settings.set('tor_bridges_use_custom_bridges', '')
|
||||
if self.tor_bridges_use_meek_lite_azure_radio.isChecked():
|
||||
settings.set('no_bridges', False)
|
||||
settings.set('tor_bridges_use_obfs4', False)
|
||||
settings.set('tor_bridges_use_meek_lite_amazon', False)
|
||||
settings.set('tor_bridges_use_meek_lite_azure', True)
|
||||
settings.set('tor_bridges_use_custom_bridges', '')
|
||||
if self.tor_bridges_use_custom_radio.isChecked():
|
||||
settings.set('no_bridges', False)
|
||||
settings.set('tor_bridges_use_obfs4', False)
|
||||
settings.set('tor_bridges_use_meek_lite_amazon', False)
|
||||
settings.set('tor_bridges_use_meek_lite_azure', False)
|
||||
|
||||
# Insert a 'Bridge' line at the start of each bridge.
|
||||
|
@ -19,9 +19,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"""
|
||||
from PyQt5 import QtCore
|
||||
import datetime, time, socket, re, platform
|
||||
import socks
|
||||
from distutils.version import LooseVersion as Version
|
||||
|
||||
from onionshare import socks
|
||||
from onionshare.settings import Settings
|
||||
from onionshare.onion import Onion
|
||||
|
||||
@ -53,7 +53,7 @@ class UpdateChecker(QtCore.QObject):
|
||||
update_available = QtCore.pyqtSignal(str, str, str)
|
||||
update_not_available = QtCore.pyqtSignal()
|
||||
update_error = QtCore.pyqtSignal()
|
||||
update_invalid_version = QtCore.pyqtSignal()
|
||||
update_invalid_version = QtCore.pyqtSignal(str)
|
||||
|
||||
def __init__(self, common, onion, config=False):
|
||||
super(UpdateChecker, self).__init__()
|
||||
@ -136,7 +136,7 @@ class UpdateChecker(QtCore.QObject):
|
||||
# This regex is: 1-3 dot-separated numeric components
|
||||
version_re = r"^(\d+\.)?(\d+\.)?(\d+)$"
|
||||
if not re.match(version_re, latest_version):
|
||||
self.update_invalid_version.emit()
|
||||
self.update_invalid_version.emit(latest_version)
|
||||
raise UpdateCheckerInvalidLatestVersion(latest_version)
|
||||
|
||||
# Update the last checked timestamp (dropping the seconds and milliseconds)
|
||||
@ -160,7 +160,7 @@ class UpdateThread(QtCore.QThread):
|
||||
update_available = QtCore.pyqtSignal(str, str, str)
|
||||
update_not_available = QtCore.pyqtSignal()
|
||||
update_error = QtCore.pyqtSignal()
|
||||
update_invalid_version = QtCore.pyqtSignal()
|
||||
update_invalid_version = QtCore.pyqtSignal(str)
|
||||
|
||||
def __init__(self, common, onion, config=False, force=False):
|
||||
super(UpdateThread, self).__init__()
|
||||
@ -203,7 +203,7 @@ class UpdateThread(QtCore.QThread):
|
||||
self.active = False
|
||||
self.update_error.emit()
|
||||
|
||||
def _update_invalid_version(self):
|
||||
def _update_invalid_version(self, latest_version):
|
||||
self.common.log('UpdateThread', '_update_invalid_version')
|
||||
self.active = False
|
||||
self.update_invalid_version.emit()
|
||||
self.update_invalid_version.emit(latest_version)
|
||||
|
2
setup.py
2
setup.py
@ -47,7 +47,7 @@ license = 'GPL v3'
|
||||
keywords = 'onion, share, onionshare, tor, anonymous, web server'
|
||||
data_files=[
|
||||
(os.path.join(sys.prefix, 'share/applications'), ['install/onionshare.desktop']),
|
||||
(os.path.join(sys.prefix, 'share/appdata'), ['install/onionshare.appdata.xml']),
|
||||
(os.path.join(sys.prefix, 'share/metainfo'), ['install/onionshare.appdata.xml']),
|
||||
(os.path.join(sys.prefix, 'share/pixmaps'), ['install/onionshare80.xpm']),
|
||||
(os.path.join(sys.prefix, 'share/onionshare'), file_list('share')),
|
||||
(os.path.join(sys.prefix, 'share/onionshare/images'), file_list('share/images')),
|
||||
|
@ -99,8 +99,6 @@
|
||||
"gui_settings_tor_bridges_no_bridges_radio_option": "Don't use bridges",
|
||||
"gui_settings_tor_bridges_obfs4_radio_option": "Use built-in obfs4 pluggable transports",
|
||||
"gui_settings_tor_bridges_obfs4_radio_option_no_obfs4proxy": "Use built-in obfs4 pluggable transports (requires obfs4proxy)",
|
||||
"gui_settings_tor_bridges_meek_lite_amazon_radio_option": "Use built-in meek_lite (Amazon) pluggable transports",
|
||||
"gui_settings_tor_bridges_meek_lite_amazon_radio_option_no_obfs4proxy": "Use built-in meek_lite (Amazon) pluggable transports (requires obfs4proxy)",
|
||||
"gui_settings_tor_bridges_meek_lite_azure_radio_option": "Use built-in meek_lite (Azure) pluggable transports",
|
||||
"gui_settings_tor_bridges_meek_lite_azure_radio_option_no_obfs4proxy": "Use built-in meek_lite (Azure) pluggable transports (requires obfs4proxy)",
|
||||
"gui_settings_meek_lite_expensive_warning": "Warning: the meek_lite bridges are very costly for the Tor Project to run!<br><br>You should only use meek_lite bridges if you are having trouble connecting to Tor directly, via obfs4 transports or other normal bridges.",
|
||||
|
@ -1 +1 @@
|
||||
1.3
|
||||
1.3.1
|
||||
|
@ -57,7 +57,6 @@ class TestSettings:
|
||||
'autoupdate_timestamp': None,
|
||||
'no_bridges': True,
|
||||
'tor_bridges_use_obfs4': False,
|
||||
'tor_bridges_use_meek_lite_amazon': False,
|
||||
'tor_bridges_use_meek_lite_azure': False,
|
||||
'tor_bridges_use_custom_bridges': '',
|
||||
'save_private_key': False,
|
||||
@ -126,7 +125,6 @@ class TestSettings:
|
||||
assert settings_obj.get('autoupdate_timestamp') is None
|
||||
assert settings_obj.get('no_bridges') is True
|
||||
assert settings_obj.get('tor_bridges_use_obfs4') is False
|
||||
assert settings_obj.get('tor_bridges_use_meek_lite_amazon') is False
|
||||
assert settings_obj.get('tor_bridges_use_meek_lite_azure') is False
|
||||
assert settings_obj.get('tor_bridges_use_custom_bridges') == ''
|
||||
|
||||
|
@ -61,7 +61,7 @@ def web_obj(common_obj, receive_mode, num_files=0):
|
||||
# Receive mode
|
||||
else:
|
||||
pass
|
||||
|
||||
|
||||
return web
|
||||
|
||||
|
||||
@ -89,7 +89,7 @@ class TestWeb:
|
||||
res.get_data()
|
||||
assert res.status_code == 200
|
||||
assert res.mimetype == 'application/zip'
|
||||
|
||||
|
||||
def test_share_mode_close_after_first_download_on(self, common_obj, temp_file_1024):
|
||||
web = web_obj(common_obj, False, 3)
|
||||
web.stay_open = False
|
||||
@ -104,7 +104,7 @@ class TestWeb:
|
||||
assert res.mimetype == 'application/zip'
|
||||
|
||||
assert web.running == False
|
||||
|
||||
|
||||
def test_share_mode_close_after_first_download_off(self, common_obj, temp_file_1024):
|
||||
web = web_obj(common_obj, False, 3)
|
||||
web.stay_open = True
|
||||
@ -118,7 +118,7 @@ class TestWeb:
|
||||
assert res.status_code == 200
|
||||
assert res.mimetype == 'application/zip'
|
||||
assert web.running == True
|
||||
|
||||
|
||||
def test_receive_mode(self, common_obj):
|
||||
web = web_obj(common_obj, True)
|
||||
assert web.receive_mode is True
|
||||
@ -137,7 +137,7 @@ class TestWeb:
|
||||
res = c.get('/{}'.format(web.slug))
|
||||
res.get_data()
|
||||
assert res.status_code == 200
|
||||
|
||||
|
||||
def test_receive_mode_allow_receiver_shutdown_on(self, common_obj):
|
||||
web = web_obj(common_obj, True)
|
||||
|
||||
@ -152,7 +152,7 @@ class TestWeb:
|
||||
# Should return ok, and server should stop
|
||||
assert res.status_code == 200
|
||||
assert web.running == False
|
||||
|
||||
|
||||
def test_receive_mode_allow_receiver_shutdown_off(self, common_obj):
|
||||
web = web_obj(common_obj, True)
|
||||
|
||||
@ -167,7 +167,7 @@ class TestWeb:
|
||||
# Should redirect to index, and server should still be running
|
||||
assert res.status_code == 302
|
||||
assert web.running == True
|
||||
|
||||
|
||||
def test_receive_mode_receive_public_mode_on(self, common_obj):
|
||||
web = web_obj(common_obj, True)
|
||||
common_obj.settings.set('receive_public_mode', True)
|
||||
@ -181,7 +181,7 @@ class TestWeb:
|
||||
res = c.get('/{}'.format(web.slug))
|
||||
data2 = res.get_data()
|
||||
assert res.status_code == 200
|
||||
|
||||
|
||||
def test_receive_mode_receive_public_mode_off(self, common_obj):
|
||||
web = web_obj(common_obj, True)
|
||||
common_obj.settings.set('receive_public_mode', False)
|
||||
|
Loading…
x
Reference in New Issue
Block a user