From 445a8423d5118f47c499de6ad35c97b9c15585a9 Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Mon, 28 May 2018 15:52:43 +1000 Subject: [PATCH 01/21] Fix some lingering attribute/module references that had not been updated to use their new names/paths --- onionshare_gui/onionshare_gui.py | 4 ++-- onionshare_gui/settings_dialog.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/onionshare_gui/onionshare_gui.py b/onionshare_gui/onionshare_gui.py index d5a0889a..527129e9 100644 --- a/onionshare_gui/onionshare_gui.py +++ b/onionshare_gui/onionshare_gui.py @@ -560,7 +560,7 @@ class OnionShareGui(QtWidgets.QMainWindow): self.primary_action.hide() self.info_widget.hide() self.status_bar.showMessage(strings._('gui_tor_connection_lost', True)) - if self.systemTray.supportsMessages() and self.settings.get('systray_notifications'): + if self.systemTray.supportsMessages() and self.common.settings.get('systray_notifications'): self.systemTray.showMessage(strings._('gui_tor_connection_lost', True), strings._('gui_tor_connection_error_settings', True)) # scroll to the bottom of the dl progress bar log pane @@ -585,7 +585,7 @@ class OnionShareGui(QtWidgets.QMainWindow): elif event["type"] == self.web.REQUEST_DOWNLOAD: self.downloads.no_downloads_label.hide() - self.downloads.add_download(event["data"]["id"], web.zip_filesize) + self.downloads.add_download(event["data"]["id"], self.web.zip_filesize) self.new_download = True self.downloads_in_progress += 1 self.update_downloads_in_progress(self.downloads_in_progress) diff --git a/onionshare_gui/settings_dialog.py b/onionshare_gui/settings_dialog.py index 94aa8342..20c7403d 100644 --- a/onionshare_gui/settings_dialog.py +++ b/onionshare_gui/settings_dialog.py @@ -716,7 +716,7 @@ class SettingsDialog(QtWidgets.QDialog): self.common.log('SettingsDialog', 'save_clicked', 'rebooting the Onion') self.onion.cleanup() - tor_con = TorConnectionDialog(self.qtapp, settings, self.onion) + tor_con = TorConnectionDialog(self.common, self.qtapp, self.onion, settings) tor_con.start() self.common.log('SettingsDialog', 'save_clicked', 'Onion done rebooting, connected to Tor: {}'.format(self.onion.connected_to_tor)) From 348bf16cef9a1772af7ba2034ca766aaab69217f Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Mon, 28 May 2018 16:14:44 +1000 Subject: [PATCH 02/21] Fix installation of static assets on MacOS and probably Windows too --- install/pyinstaller.spec | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/install/pyinstaller.spec b/install/pyinstaller.spec index a4f1532a..716eec88 100644 --- a/install/pyinstaller.spec +++ b/install/pyinstaller.spec @@ -21,7 +21,9 @@ a = Analysis( ('../share/images/*', 'share/images'), ('../share/locale/*', 'share/locale'), ('../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') ], hiddenimports=[], hookspath=[], From 536ea0ffc9c3ac6eb79a06f8d9a65f14436d827c Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Sun, 17 Jun 2018 16:09:37 -0700 Subject: [PATCH 03/21] Added licenses for tor and obfs4 --- install/licenses/LICENSE.obfs4 | 55 +++++ install/licenses/LICENSE.tor | 381 +++++++++++++++++++++++++++++++++ install/licenses/readme.txt | 1 + 3 files changed, 437 insertions(+) create mode 100644 install/licenses/LICENSE.obfs4 create mode 100644 install/licenses/LICENSE.tor create mode 100644 install/licenses/readme.txt diff --git a/install/licenses/LICENSE.obfs4 b/install/licenses/LICENSE.obfs4 new file mode 100644 index 00000000..6b89f8ca --- /dev/null +++ b/install/licenses/LICENSE.obfs4 @@ -0,0 +1,55 @@ +Copyright (c) 2014, Yawning Angel +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. + diff --git a/install/licenses/LICENSE.tor b/install/licenses/LICENSE.tor new file mode 100644 index 00000000..3d0f8c12 --- /dev/null +++ b/install/licenses/LICENSE.tor @@ -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 + * 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 + + 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 . + +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 + + 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/)" +=============================================================================== diff --git a/install/licenses/readme.txt b/install/licenses/readme.txt new file mode 100644 index 00000000..c92e516d --- /dev/null +++ b/install/licenses/readme.txt @@ -0,0 +1 @@ +This folder contains the software licenses for 3rd-party binaries included with OnionShare. From 5b27f952e4bd9a6c08adfcdbffe7f8dabdafc134 Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Sun, 17 Jun 2018 16:43:38 -0700 Subject: [PATCH 04/21] Add onionshare license to licenses folder, and add licenses folder to PyInstaller spec, and to NSIS installer --- .../licenses/LICENSE.onionshare | 5 ++++- install/onionshare.nsi | 13 +++++++++++-- install/pyinstaller.spec | 1 - 3 files changed, 15 insertions(+), 4 deletions(-) rename share/license.txt => install/licenses/LICENSE.onionshare (99%) diff --git a/share/license.txt b/install/licenses/LICENSE.onionshare similarity index 99% rename from share/license.txt rename to install/licenses/LICENSE.onionshare index 1223e5a6..3d26a84e 100644 --- a/share/license.txt +++ b/install/licenses/LICENSE.onionshare @@ -1,4 +1,7 @@ -Copyright (C) 2017 Micah Lee +OnionShare + +Copyright © 2018 + Micah Lee GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 diff --git a/install/onionshare.nsi b/install/onionshare.nsi index 4030636a..5470b4b6 100644 --- a/install/onionshare.nsi +++ b/install/onionshare.nsi @@ -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" + File "${BINPATH}\licenses\LICENSE.onionshare" + File "${BINPATH}\licenses\LICENSE.tor" + File "${BINPATH}\licenses\readme.txt" + SetOutPath "$INSTDIR\PyQt5\Qt\bin" File "${BINPATH}\PyQt5\Qt\bin\qt.conf" @@ -188,7 +194,6 @@ 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" @@ -351,6 +356,10 @@ FunctionEnd Delete "$INSTDIR\lib2to3\tests" Delete "$INSTDIR\lib2to3\tests\data" Delete "$INSTDIR\lib2to3\tests\data\README" + Delete "$INSTDIR\licenses\LICENSE.obfs4" + Delete "$INSTDIR\licenses\LICENSE.onionshare" + Delete "$INSTDIR\licenses\LICENSE.tor" + Delete "$INSTDIR\licenses\readme.txt" Delete "$INSTDIR\mfc140u.dll" Delete "$INSTDIR\MSVCP140.dll" Delete "$INSTDIR\onionshare-gui.exe" @@ -405,7 +414,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" @@ -466,6 +474,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" diff --git a/install/pyinstaller.spec b/install/pyinstaller.spec index 6ca2fdbe..30553707 100644 --- a/install/pyinstaller.spec +++ b/install/pyinstaller.spec @@ -10,7 +10,6 @@ a = Analysis( pathex=['.'], binaries=None, datas=[ - ('../share/license.txt', 'share'), ('../share/version.txt', 'share'), ('../share/wordlist.txt', 'share'), ('../share/torrc_template', 'share'), From e05cee19bcb73ffdd21c2e3a5fef8b8694ea2043 Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Sun, 17 Jun 2018 16:53:44 -0700 Subject: [PATCH 05/21] Update OnionShare copyright year to 2018 --- LICENSE | 2 +- dev_scripts/onionshare | 2 +- dev_scripts/onionshare-gui | 2 +- install/get-tor-osx.py | 2 +- install/get-tor-windows.py | 2 +- install/scripts/onionshare | 2 +- install/scripts/onionshare-gui | 2 +- install/scripts/onionshare-pyinstaller | 2 +- onionshare/__init__.py | 2 +- onionshare/common.py | 2 +- onionshare/onion.py | 2 +- onionshare/onionshare.py | 2 +- onionshare/settings.py | 2 +- onionshare/strings.py | 2 +- onionshare/web.py | 2 +- onionshare_gui/__init__.py | 2 +- onionshare_gui/alert.py | 2 +- onionshare_gui/downloads.py | 2 +- onionshare_gui/file_selection.py | 2 +- onionshare_gui/onionshare_gui.py | 2 +- onionshare_gui/server_status.py | 2 +- onionshare_gui/settings_dialog.py | 2 +- onionshare_gui/tor_connection_dialog.py | 2 +- onionshare_gui/update_checker.py | 2 +- setup.py | 2 +- test/test_helpers.py | 2 +- test/test_onionshare.py | 2 +- test/test_onionshare_common.py | 2 +- test/test_onionshare_settings.py | 2 +- test/test_onionshare_strings.py | 2 +- 30 files changed, 30 insertions(+), 30 deletions(-) diff --git a/LICENSE b/LICENSE index dd69f276..3d26a84e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ OnionShare -Copyright © 2016 +Copyright © 2018 Micah Lee GNU GENERAL PUBLIC LICENSE diff --git a/dev_scripts/onionshare b/dev_scripts/onionshare index 81be89f4..358293e1 100755 --- a/dev_scripts/onionshare +++ b/dev_scripts/onionshare @@ -3,7 +3,7 @@ """ OnionShare | https://onionshare.org/ -Copyright (C) 2017 Micah Lee +Copyright (C) 2018 Micah Lee 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 diff --git a/dev_scripts/onionshare-gui b/dev_scripts/onionshare-gui index aab70404..4e008809 100755 --- a/dev_scripts/onionshare-gui +++ b/dev_scripts/onionshare-gui @@ -3,7 +3,7 @@ """ OnionShare | https://onionshare.org/ -Copyright (C) 2017 Micah Lee +Copyright (C) 2018 Micah Lee 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 diff --git a/install/get-tor-osx.py b/install/get-tor-osx.py index f6cac62f..c780ebae 100644 --- a/install/get-tor-osx.py +++ b/install/get-tor-osx.py @@ -2,7 +2,7 @@ """ OnionShare | https://onionshare.org/ -Copyright (C) 2017 Micah Lee +Copyright (C) 2018 Micah Lee 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 diff --git a/install/get-tor-windows.py b/install/get-tor-windows.py index f5aeb3f7..8875a556 100644 --- a/install/get-tor-windows.py +++ b/install/get-tor-windows.py @@ -2,7 +2,7 @@ """ OnionShare | https://onionshare.org/ -Copyright (C) 2017 Micah Lee +Copyright (C) 2018 Micah Lee 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 diff --git a/install/scripts/onionshare b/install/scripts/onionshare index 6a1529fe..6c560aec 100755 --- a/install/scripts/onionshare +++ b/install/scripts/onionshare @@ -3,7 +3,7 @@ """ OnionShare | https://onionshare.org/ -Copyright (C) 2017 Micah Lee +Copyright (C) 2018 Micah Lee 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 diff --git a/install/scripts/onionshare-gui b/install/scripts/onionshare-gui index 786277c4..6b9fb21b 100755 --- a/install/scripts/onionshare-gui +++ b/install/scripts/onionshare-gui @@ -3,7 +3,7 @@ """ OnionShare | https://onionshare.org/ -Copyright (C) 2017 Micah Lee +Copyright (C) 2018 Micah Lee 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 diff --git a/install/scripts/onionshare-pyinstaller b/install/scripts/onionshare-pyinstaller index c9552120..d026e1bf 100644 --- a/install/scripts/onionshare-pyinstaller +++ b/install/scripts/onionshare-pyinstaller @@ -3,7 +3,7 @@ """ OnionShare | https://onionshare.org/ -Copyright (C) 2017 Micah Lee +Copyright (C) 2018 Micah Lee 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 diff --git a/onionshare/__init__.py b/onionshare/__init__.py index 76d2b601..032b4acc 100644 --- a/onionshare/__init__.py +++ b/onionshare/__init__.py @@ -2,7 +2,7 @@ """ OnionShare | https://onionshare.org/ -Copyright (C) 2017 Micah Lee +Copyright (C) 2018 Micah Lee 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 diff --git a/onionshare/common.py b/onionshare/common.py index 0d00c7b1..ca6c667d 100644 --- a/onionshare/common.py +++ b/onionshare/common.py @@ -2,7 +2,7 @@ """ OnionShare | https://onionshare.org/ -Copyright (C) 2017 Micah Lee +Copyright (C) 2018 Micah Lee 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 diff --git a/onionshare/onion.py b/onionshare/onion.py index 068648ba..4d159d94 100644 --- a/onionshare/onion.py +++ b/onionshare/onion.py @@ -2,7 +2,7 @@ """ OnionShare | https://onionshare.org/ -Copyright (C) 2017 Micah Lee +Copyright (C) 2018 Micah Lee 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 diff --git a/onionshare/onionshare.py b/onionshare/onionshare.py index 85bfaf22..b1760537 100644 --- a/onionshare/onionshare.py +++ b/onionshare/onionshare.py @@ -2,7 +2,7 @@ """ OnionShare | https://onionshare.org/ -Copyright (C) 2017 Micah Lee +Copyright (C) 2018 Micah Lee 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 diff --git a/onionshare/settings.py b/onionshare/settings.py index 545915e8..034e863f 100644 --- a/onionshare/settings.py +++ b/onionshare/settings.py @@ -2,7 +2,7 @@ """ OnionShare | https://onionshare.org/ -Copyright (C) 2017 Micah Lee +Copyright (C) 2018 Micah Lee 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 diff --git a/onionshare/strings.py b/onionshare/strings.py index 7a1f08a5..ccbfc37f 100644 --- a/onionshare/strings.py +++ b/onionshare/strings.py @@ -2,7 +2,7 @@ """ OnionShare | https://onionshare.org/ -Copyright (C) 2017 Micah Lee +Copyright (C) 2018 Micah Lee 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 diff --git a/onionshare/web.py b/onionshare/web.py index d16ca251..702ba686 100644 --- a/onionshare/web.py +++ b/onionshare/web.py @@ -2,7 +2,7 @@ """ OnionShare | https://onionshare.org/ -Copyright (C) 2017 Micah Lee +Copyright (C) 2018 Micah Lee 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 diff --git a/onionshare_gui/__init__.py b/onionshare_gui/__init__.py index 24e627bb..5350fe29 100644 --- a/onionshare_gui/__init__.py +++ b/onionshare_gui/__init__.py @@ -2,7 +2,7 @@ """ OnionShare | https://onionshare.org/ -Copyright (C) 2017 Micah Lee +Copyright (C) 2018 Micah Lee 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 diff --git a/onionshare_gui/alert.py b/onionshare_gui/alert.py index 814ff786..75975cfb 100644 --- a/onionshare_gui/alert.py +++ b/onionshare_gui/alert.py @@ -2,7 +2,7 @@ """ OnionShare | https://onionshare.org/ -Copyright (C) 2017 Micah Lee +Copyright (C) 2018 Micah Lee 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 diff --git a/onionshare_gui/downloads.py b/onionshare_gui/downloads.py index 166f14a4..bf891b55 100644 --- a/onionshare_gui/downloads.py +++ b/onionshare_gui/downloads.py @@ -2,7 +2,7 @@ """ OnionShare | https://onionshare.org/ -Copyright (C) 2017 Micah Lee +Copyright (C) 2018 Micah Lee 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 diff --git a/onionshare_gui/file_selection.py b/onionshare_gui/file_selection.py index 29bcc592..3f52a96d 100644 --- a/onionshare_gui/file_selection.py +++ b/onionshare_gui/file_selection.py @@ -2,7 +2,7 @@ """ OnionShare | https://onionshare.org/ -Copyright (C) 2017 Micah Lee +Copyright (C) 2018 Micah Lee 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 diff --git a/onionshare_gui/onionshare_gui.py b/onionshare_gui/onionshare_gui.py index f38dd727..c05e3323 100644 --- a/onionshare_gui/onionshare_gui.py +++ b/onionshare_gui/onionshare_gui.py @@ -2,7 +2,7 @@ """ OnionShare | https://onionshare.org/ -Copyright (C) 2017 Micah Lee +Copyright (C) 2018 Micah Lee 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 diff --git a/onionshare_gui/server_status.py b/onionshare_gui/server_status.py index 03540415..f3156fed 100644 --- a/onionshare_gui/server_status.py +++ b/onionshare_gui/server_status.py @@ -2,7 +2,7 @@ """ OnionShare | https://onionshare.org/ -Copyright (C) 2017 Micah Lee +Copyright (C) 2018 Micah Lee 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 diff --git a/onionshare_gui/settings_dialog.py b/onionshare_gui/settings_dialog.py index 7c81afc6..c2dca97c 100644 --- a/onionshare_gui/settings_dialog.py +++ b/onionshare_gui/settings_dialog.py @@ -2,7 +2,7 @@ """ OnionShare | https://onionshare.org/ -Copyright (C) 2017 Micah Lee +Copyright (C) 2018 Micah Lee 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 diff --git a/onionshare_gui/tor_connection_dialog.py b/onionshare_gui/tor_connection_dialog.py index dc472725..12730c32 100644 --- a/onionshare_gui/tor_connection_dialog.py +++ b/onionshare_gui/tor_connection_dialog.py @@ -2,7 +2,7 @@ """ OnionShare | https://onionshare.org/ -Copyright (C) 2017 Micah Lee +Copyright (C) 2018 Micah Lee 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 diff --git a/onionshare_gui/update_checker.py b/onionshare_gui/update_checker.py index 8b4884a2..5d73efb4 100644 --- a/onionshare_gui/update_checker.py +++ b/onionshare_gui/update_checker.py @@ -2,7 +2,7 @@ """ OnionShare | https://onionshare.org/ -Copyright (C) 2017 Micah Lee +Copyright (C) 2018 Micah Lee 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 diff --git a/setup.py b/setup.py index 23e1ea17..14cf05b1 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ """ OnionShare | https://onionshare.org/ -Copyright (C) 2017 Micah Lee +Copyright (C) 2018 Micah Lee 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 diff --git a/test/test_helpers.py b/test/test_helpers.py index 02db1eb8..b0e94a5c 100644 --- a/test/test_helpers.py +++ b/test/test_helpers.py @@ -1,7 +1,7 @@ """ OnionShare | https://onionshare.org/ -Copyright (C) 2017 Micah Lee +Copyright (C) 2018 Micah Lee 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 diff --git a/test/test_onionshare.py b/test/test_onionshare.py index 76e471bd..b9e50ba1 100644 --- a/test/test_onionshare.py +++ b/test/test_onionshare.py @@ -1,7 +1,7 @@ """ OnionShare | https://onionshare.org/ -Copyright (C) 2017 Micah Lee +Copyright (C) 2018 Micah Lee 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 diff --git a/test/test_onionshare_common.py b/test/test_onionshare_common.py index cb864313..d3c78710 100644 --- a/test/test_onionshare_common.py +++ b/test/test_onionshare_common.py @@ -1,7 +1,7 @@ """ OnionShare | https://onionshare.org/ -Copyright (C) 2017 Micah Lee +Copyright (C) 2018 Micah Lee 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 diff --git a/test/test_onionshare_settings.py b/test/test_onionshare_settings.py index e50eee41..212aceb8 100644 --- a/test/test_onionshare_settings.py +++ b/test/test_onionshare_settings.py @@ -1,7 +1,7 @@ """ OnionShare | https://onionshare.org/ -Copyright (C) 2017 Micah Lee +Copyright (C) 2018 Micah Lee 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 diff --git a/test/test_onionshare_strings.py b/test/test_onionshare_strings.py index d9fa9896..0e7a32ab 100644 --- a/test/test_onionshare_strings.py +++ b/test/test_onionshare_strings.py @@ -2,7 +2,7 @@ """ OnionShare | https://onionshare.org/ -Copyright (C) 2017 Micah Lee +Copyright (C) 2018 Micah Lee 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 From 089c8201f112b573ab49daa6f234ed02689f7961 Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Sun, 17 Jun 2018 16:55:04 -0700 Subject: [PATCH 06/21] Actually add licenses folder to PyInstaller spec --- install/pyinstaller.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/install/pyinstaller.spec b/install/pyinstaller.spec index 30553707..9c233cf4 100644 --- a/install/pyinstaller.spec +++ b/install/pyinstaller.spec @@ -19,7 +19,8 @@ a = Analysis( ('../share/torrc_template-windows', 'share'), ('../share/images/*', 'share/images'), ('../share/locale/*', 'share/locale'), - ('../share/html/*', 'share/html') + ('../share/html/*', 'share/html'), + ('../install/licenses/*', 'licenses') ], hiddenimports=[], hookspath=[], From f1ba17fc7bfd7a2811d9ec517fc1f6f2842bec71 Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Mon, 18 Jun 2018 10:34:06 -0700 Subject: [PATCH 07/21] Renamed license files to be lowercase, use .txt extension --- .../licenses/{LICENSE.obfs4 => license-obfs4.txt} | 0 .../{LICENSE.onionshare => license-onionshare.txt} | 0 install/licenses/{LICENSE.tor => license-tor.txt} | 0 install/onionshare.nsi | 12 ++++++------ 4 files changed, 6 insertions(+), 6 deletions(-) rename install/licenses/{LICENSE.obfs4 => license-obfs4.txt} (100%) rename install/licenses/{LICENSE.onionshare => license-onionshare.txt} (100%) rename install/licenses/{LICENSE.tor => license-tor.txt} (100%) diff --git a/install/licenses/LICENSE.obfs4 b/install/licenses/license-obfs4.txt similarity index 100% rename from install/licenses/LICENSE.obfs4 rename to install/licenses/license-obfs4.txt diff --git a/install/licenses/LICENSE.onionshare b/install/licenses/license-onionshare.txt similarity index 100% rename from install/licenses/LICENSE.onionshare rename to install/licenses/license-onionshare.txt diff --git a/install/licenses/LICENSE.tor b/install/licenses/license-tor.txt similarity index 100% rename from install/licenses/LICENSE.tor rename to install/licenses/license-tor.txt diff --git a/install/onionshare.nsi b/install/onionshare.nsi index 5470b4b6..245a128b 100644 --- a/install/onionshare.nsi +++ b/install/onionshare.nsi @@ -163,9 +163,9 @@ Section "install" File "${BINPATH}\lib2to3\tests\data\README" SetOutPath "$INSTDIR\licenses" - File "${BINPATH}\licenses\LICENSE.obfs4" - File "${BINPATH}\licenses\LICENSE.onionshare" - File "${BINPATH}\licenses\LICENSE.tor" + 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" @@ -356,9 +356,9 @@ FunctionEnd Delete "$INSTDIR\lib2to3\tests" Delete "$INSTDIR\lib2to3\tests\data" Delete "$INSTDIR\lib2to3\tests\data\README" - Delete "$INSTDIR\licenses\LICENSE.obfs4" - Delete "$INSTDIR\licenses\LICENSE.onionshare" - Delete "$INSTDIR\licenses\LICENSE.tor" + 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" From 3be94afbcf8afa871bf1e8d2c352b1effa951302 Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Mon, 18 Jun 2018 12:00:50 -0700 Subject: [PATCH 08/21] Update Windows build instructions to include newer versions of software --- BUILD.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/BUILD.md b/BUILD.md index e6e54951..c5fe3601 100644 --- a/BUILD.md +++ b/BUILD.md @@ -85,7 +85,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 +100,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-x64.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 +113,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: From 97acfccf0965dcd12e80169795b4d62f07c15282 Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Mon, 18 Jun 2018 12:10:28 -0700 Subject: [PATCH 09/21] Upgrade get-tor scripts to download Tor Browser 7.5.5, which includes Tor 0.3.2.10 --- install/get-tor-osx.py | 6 +++--- install/get-tor-windows.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/install/get-tor-osx.py b/install/get-tor-osx.py index c780ebae..207ecfb3 100644 --- a/install/get-tor-osx.py +++ b/install/get-tor-osx.py @@ -28,9 +28,9 @@ import inspect, os, sys, hashlib, zipfile, io, shutil, subprocess import urllib.request 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())))) diff --git a/install/get-tor-windows.py b/install/get-tor-windows.py index 8875a556..e7783191 100644 --- a/install/get-tor-windows.py +++ b/install/get-tor-windows.py @@ -28,9 +28,9 @@ import inspect, os, sys, hashlib, shutil, subprocess import urllib.request 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') From 19c2193a496265f69d7a086077d2a0eb3ad4f811 Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Mon, 18 Jun 2018 12:53:27 -0700 Subject: [PATCH 10/21] Add requests build dependency, and use requests to download Tor Browser in get-tor-osx.py and get-tor-windows.py, because I was running into SSL certificate verification issues downloading using urllib --- install/get-tor-osx.py | 18 ++++++++++++------ install/get-tor-windows.py | 16 ++++++++++------ install/requirements-windows.txt | 1 + install/requirements.txt | 1 + 4 files changed, 24 insertions(+), 12 deletions(-) diff --git a/install/get-tor-osx.py b/install/get-tor-osx.py index 207ecfb3..3c498dfe 100644 --- a/install/get-tor-osx.py +++ b/install/get-tor-osx.py @@ -24,8 +24,15 @@ 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.5/TorBrowser-7.5.5-osx64_en-US.dmg' @@ -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() diff --git a/install/get-tor-windows.py b/install/get-tor-windows.py index e7783191..44c4ac23 100644 --- a/install/get-tor-windows.py +++ b/install/get-tor-windows.py @@ -24,8 +24,13 @@ 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.5/torbrowser-install-7.5.5_en-US.exe' @@ -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() diff --git a/install/requirements-windows.txt b/install/requirements-windows.txt index 32b8da4a..6e03f6e8 100644 --- a/install/requirements-windows.txt +++ b/install/requirements-windows.txt @@ -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 diff --git a/install/requirements.txt b/install/requirements.txt index c7828080..ed83b995 100644 --- a/install/requirements.txt +++ b/install/requirements.txt @@ -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 From d53303a84c99cb7fcfe9cba0e6a5d00144290101 Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Mon, 18 Jun 2018 12:55:59 -0700 Subject: [PATCH 11/21] Oops, download 32-bit 7zip in build instructions --- BUILD.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BUILD.md b/BUILD.md index c5fe3601..77d5ee0e 100644 --- a/BUILD.md +++ b/BUILD.md @@ -100,7 +100,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 `7z1805-x64.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. From 662c2b05e64042f5390d332bf8bfc7fe9171db17 Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Mon, 18 Jun 2018 13:08:40 -0700 Subject: [PATCH 12/21] Version bump to 1.3.1 and updated changelog --- CHANGELOG.md | 5 +++++ install/onionshare.nsi | 2 +- share/version.txt | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a03a151..136dd2b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/install/onionshare.nsi b/install/onionshare.nsi index 245a128b..0d4a22c1 100644 --- a/install/onionshare.nsi +++ b/install/onionshare.nsi @@ -6,7 +6,7 @@ !define INSTALLSIZE 66537 !define VERSIONMAJOR 1 !define VERSIONMINOR 3 -!define VERSIONSTRING "1.3" +!define VERSIONSTRING "1.3.1" RequestExecutionLevel admin diff --git a/share/version.txt b/share/version.txt index 7e32cd56..3a3cd8cc 100644 --- a/share/version.txt +++ b/share/version.txt @@ -1 +1 @@ -1.3 +1.3.1 From 688e1d4777a788722cd32a008959b100c740c00e Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Mon, 18 Jun 2018 16:26:53 -0700 Subject: [PATCH 13/21] LICENSE includes a note pointing to the 3rd party licenses --- LICENSE | 6 +++--- install/licenses/license-onionshare.txt | 4 +--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/LICENSE b/LICENSE index 3d26a84e..5a03b106 100644 --- a/LICENSE +++ b/LICENSE @@ -1,7 +1,7 @@ -OnionShare +(Note: Third-party licenses can be found under install/licenses/.) -Copyright © 2018 - Micah Lee +OnionShare +Copyright © 2018 Micah Lee GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 diff --git a/install/licenses/license-onionshare.txt b/install/licenses/license-onionshare.txt index 3d26a84e..dc049cff 100644 --- a/install/licenses/license-onionshare.txt +++ b/install/licenses/license-onionshare.txt @@ -1,7 +1,5 @@ OnionShare - -Copyright © 2018 - Micah Lee +Copyright © 2018 Micah Lee GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 From 85609e68418ed05e23a778be5e33d7c3774ccc1d Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Mon, 18 Jun 2018 16:28:09 -0700 Subject: [PATCH 14/21] Remove the /fd sha256 from signtool.exe command, because I'm having trouble generating signatures with the smart card setup with sha256 digests --- install/build_exe.bat | 4 ++-- install/onionshare.nsi | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/install/build_exe.bat b/install/build_exe.bat index 6c49c7d8..ba626fa2 100644 --- a/install/build_exe.bat +++ b/install/build_exe.bat @@ -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 diff --git a/install/onionshare.nsi b/install/onionshare.nsi index 0d4a22c1..279f4803 100644 --- a/install/onionshare.nsi +++ b/install/onionshare.nsi @@ -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" From 4bdbf3f15258ef5ca9b6daf05f97ae1495ecda39 Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Sat, 21 Jul 2018 15:50:37 +1000 Subject: [PATCH 15/21] Fix another two places where Alert was called without passing the common object --- onionshare_gui/settings_dialog.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/onionshare_gui/settings_dialog.py b/onionshare_gui/settings_dialog.py index 20c7403d..83c4eb25 100644 --- a/onionshare_gui/settings_dialog.py +++ b/onionshare_gui/settings_dialog.py @@ -503,7 +503,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_amazon'): - 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_meek_lite_azure_radio_toggled(self, checked): """ @@ -513,7 +513,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): """ From a6bc01533b7a991fb2759693606ca9b90f906d84 Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Sat, 21 Jul 2018 15:52:11 +1000 Subject: [PATCH 16/21] #691 remove meek_lite Amazon --- install/onionshare.nsi | 2 -- install/pyinstaller.spec | 1 - onionshare/onion.py | 6 ------ onionshare/settings.py | 1 - onionshare_gui/settings_dialog.py | 36 +------------------------------ share/locale/en.json | 2 -- test/test_onionshare_settings.py | 2 -- 7 files changed, 1 insertion(+), 49 deletions(-) diff --git a/install/onionshare.nsi b/install/onionshare.nsi index d037ba58..134ff8d2 100644 --- a/install/onionshare.nsi +++ b/install/onionshare.nsi @@ -197,7 +197,6 @@ Section "install" 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" @@ -434,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" diff --git a/install/pyinstaller.spec b/install/pyinstaller.spec index e679ec6e..b8abe5fe 100644 --- a/install/pyinstaller.spec +++ b/install/pyinstaller.spec @@ -14,7 +14,6 @@ a = Analysis( ('../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'), diff --git a/onionshare/onion.py b/onionshare/onion.py index 461af6a2..6132cc9a 100644 --- a/onionshare/onion.py +++ b/onionshare/onion.py @@ -210,11 +210,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 +276,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: diff --git a/onionshare/settings.py b/onionshare/settings.py index a8f2521f..2d056aa6 100644 --- a/onionshare/settings.py +++ b/onionshare/settings.py @@ -66,7 +66,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, diff --git a/onionshare_gui/settings_dialog.py b/onionshare_gui/settings_dialog.py index e9d3ed8f..07b63fe6 100644 --- a/onionshare_gui/settings_dialog.py +++ b/onionshare_gui/settings_dialog.py @@ -168,16 +168,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() @@ -190,7 +180,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 @@ -216,7 +205,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) @@ -450,13 +438,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'): @@ -495,16 +481,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. @@ -700,7 +676,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 @@ -810,31 +786,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. diff --git a/share/locale/en.json b/share/locale/en.json index 525dab04..4367e1e0 100644 --- a/share/locale/en.json +++ b/share/locale/en.json @@ -105,8 +105,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!

You should only use meek_lite bridges if you are having trouble connecting to Tor directly, via obfs4 transports or other normal bridges.", diff --git a/test/test_onionshare_settings.py b/test/test_onionshare_settings.py index df05ab76..bfc98f2e 100644 --- a/test/test_onionshare_settings.py +++ b/test/test_onionshare_settings.py @@ -58,7 +58,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') == '' From 2d3c68638377f084b1db7141c17a94043e18a65c Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Sun, 22 Jul 2018 15:50:37 +1000 Subject: [PATCH 17/21] #692 move appstream file to /usr/share/metainfo --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index b502e7ae..8806fd12 100644 --- a/setup.py +++ b/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')), From 0c50f4ea9393c639e687b2c92c30031eb095d20a Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Wed, 15 Aug 2018 09:09:52 +1000 Subject: [PATCH 18/21] Add explicit dependency on rpm-build in the BUILD.md. Add a link to community-provided OpenSuSE instructions --- BUILD.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/BUILD.md b/BUILD.md index 77d5ee0e..4b87b98f 100644 --- a/BUILD.md +++ b/BUILD.md @@ -13,7 +13,7 @@ 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 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. From fee1a1eba23c2244f2663552aef0c1515c507151 Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Thu, 30 Aug 2018 15:18:29 +1000 Subject: [PATCH 19/21] Fix the passing of the latest version returned to the UI if it is an invalid version --- onionshare_gui/settings_dialog.py | 4 ++-- onionshare_gui/update_checker.py | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/onionshare_gui/settings_dialog.py b/onionshare_gui/settings_dialog.py index e9d3ed8f..ab0b0b4d 100644 --- a/onionshare_gui/settings_dialog.py +++ b/onionshare_gui/settings_dialog.py @@ -658,8 +658,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) diff --git a/onionshare_gui/update_checker.py b/onionshare_gui/update_checker.py index 9c4ee82e..1fd52505 100644 --- a/onionshare_gui/update_checker.py +++ b/onionshare_gui/update_checker.py @@ -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) From 1e29a12221469e011e1410d626b5ffa439d1168a Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Tue, 4 Sep 2018 14:26:47 +1000 Subject: [PATCH 20/21] Use the distribution's PySocks module instead of our custom version --- BUILD.md | 4 +- onionshare/onion.py | 1 - onionshare/socks.py | 530 ------------------------------- onionshare_gui/update_checker.py | 2 +- 4 files changed, 3 insertions(+), 534 deletions(-) delete mode 100644 onionshare/socks.py diff --git a/BUILD.md b/BUILD.md index 77d5ee0e..f079806b 100644 --- a/BUILD.md +++ b/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-pysocks python3-stem python3-qt5 python3-pytest nautilus-python tor obfs4` After that you can try both the CLI and the GUI version of OnionShare: diff --git a/onionshare/onion.py b/onionshare/onion.py index 461af6a2..7cdd68ab 100644 --- a/onionshare/onion.py +++ b/onionshare/onion.py @@ -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 diff --git a/onionshare/socks.py b/onionshare/socks.py deleted file mode 100644 index 809a4444..00000000 --- a/onionshare/socks.py +++ /dev/null @@ -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 diff --git a/onionshare_gui/update_checker.py b/onionshare_gui/update_checker.py index 9c4ee82e..c573b1b9 100644 --- a/onionshare_gui/update_checker.py +++ b/onionshare_gui/update_checker.py @@ -19,9 +19,9 @@ along with this program. If not, see . """ 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 From 3eace71261b11ca8b07df70799c1bcaaa26dcd6e Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Tue, 4 Sep 2018 14:49:56 +1000 Subject: [PATCH 21/21] Pass self to help_clicked function in systray, so we can use self.common --- onionshare_gui/onionshare_gui.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onionshare_gui/onionshare_gui.py b/onionshare_gui/onionshare_gui.py index a6c20e33..6dfbaf4e 100644 --- a/onionshare_gui/onionshare_gui.py +++ b/onionshare_gui/onionshare_gui.py @@ -277,7 +277,7 @@ class OnionShareGui(QtWidgets.QMainWindow): self.settingsAction = menu.addAction(strings._('gui_settings_window_title', True)) self.settingsAction.triggered.connect(self.open_settings) self.helpAction = menu.addAction(strings._('gui_settings_button_help', True)) - self.helpAction.triggered.connect(SettingsDialog.help_clicked) + self.helpAction.triggered.connect(lambda: SettingsDialog.help_clicked(self)) self.exitAction = menu.addAction(strings._('systray_menu_exit', True)) self.exitAction.triggered.connect(self.close)