Skip to content
Commits on Source (9)
......@@ -42,7 +42,7 @@ jobs:
- run:
name: run tests
command: |
xvfb-run pytest --rungui --cov=onionshare --cov=onionshare_gui --cov-report=term-missing -vvv tests/
xvfb-run -s "-screen 0 1280x1024x24" pytest --rungui --cov=onionshare --cov=onionshare_gui --cov-report=term-missing -vvv --no-qt-log tests/
test-3.6:
<<: *test-template
......
......@@ -51,3 +51,6 @@ tags
# virtualenv
venv
# other
.vscode
\ No newline at end of file
......@@ -14,13 +14,13 @@ Install the needed dependencies:
For Debian-like distros:
```
apt install -y python3-flask python3-stem python3-pyqt5 python3-crypto python3-socks python-nautilus tor obfs4proxy python3-pytest build-essential fakeroot python3-all python3-stdeb dh-python
apt install -y python3-flask python3-stem python3-pyqt5 python3-crypto python3-socks python-nautilus tor obfs4proxy python3-pytest build-essential fakeroot python3-all python3-stdeb dh-python python3-flask-httpauth python3-distutils
```
For Fedora-like distros:
```
dnf install -y python3-flask python3-stem python3-qt5 python3-crypto python3-pysocks nautilus-python tor obfs4 python3-pytest rpm-build
dnf install -y python3-flask python3-flask-httpauth python3-stem python3-qt5 python3-crypto python3-pysocks nautilus-python tor obfs4 python3-pytest rpm-build
```
After that you can try both the CLI and the GUI version of OnionShare:
......@@ -46,11 +46,11 @@ If you find that these instructions don't work for your Linux distribution or ve
Install Xcode from the Mac App Store. Once it's installed, run it for the first time to set it up. Also, run this to make sure command line tools are installed: `xcode-select --install`. And finally, open Xcode, go to Preferences > Locations, and make sure under Command Line Tools you select an installed version from the dropdown. (This is required for installing Qt5.)
Download and install Python 3.7.2 from https://www.python.org/downloads/release/python-372/. I downloaded `python-3.7.2-macosx10.9.pkg`.
Download and install Python 3.7.4 from https://www.python.org/downloads/release/python-374/. I downloaded `python-3.7.4-macosx10.9.pkg`.
You may also need to run the command `/Applications/Python\ 3.7/Install\ Certificates.command` to update Python 3.6's internal certificate store. Otherwise, you may find that fetching the Tor Browser .dmg file fails later due to a certificate validation error.
Install Qt 5.12.1 from https://download.qt.io/archive/qt/5.12/5.12.1/. I downloaded `qt-opensource-mac-x64-5.12.1.dmg`. In the installer, you can skip making an account, and all you need is `Qt` > `Qt 5.12.1` > `macOS`.
Install Qt 5.13.1 for macOS from https://www.qt.io/offline-installers. I downloaded `qt-opensource-mac-x64-5.13.1.dmg`. In the installer, you can skip making an account, and all you need is `Qt` > `Qt 5.13.1` > `macOS`.
Now install pip dependencies. If you want to use a virtualenv, create it and activate it first:
......@@ -72,48 +72,6 @@ pip3 install -r install/requirements.txt
./dev_scripts/onionshare-gui
```
#### Building PyInstaller
If you want to build an app bundle, you'll need to use PyInstaller. Recently there has been issues with installing PyInstaller using pip, so here's how to build it from source. First, make sure you don't have PyInstaller currently installed:
```sh
pip3 uninstall PyInstaller
```
Change to a folder where you keep source code, and clone the PyInstaller git repo:
```sh
git clone https://github.com/pyinstaller/pyinstaller.git
```
Verify the v3.4 git tag:
```sh
cd pyinstaller
gpg --keyserver hkps://keyserver.ubuntu.com:443 --recv-key 0xD4AD8B9C167B757C4F08E8777B752811BF773B65
git tag -v v3.4
```
It should say `Good signature from "Hartmut Goebel <h.goebel@goebel-consult.de>`. If it verified successfully, checkout the tag:
```sh
git checkout v3.4
```
And compile the bootloader, following [these instructions](https://pyinstaller.readthedocs.io/en/stable/bootloader-building.html#building-for-mac-os-x). To compile, run this:
```sh
cd bootloader
python3 waf distclean all --target-arch=64bit
```
Finally, install the PyInstaller module into your local site-packages. If you're using a virtualenv, make sure to run this last command while your virtualenv is activated:
```sh
cd ..
python3 setup.py install
```
#### To build the app bundle
```sh
......@@ -134,7 +92,7 @@ Now you should have `dist/OnionShare.pkg`.
### Setting up your dev environment
Download Python 3.7.2, 32-bit (x86) from https://www.python.org/downloads/release/python-372/. I downloaded `python-3.7.2.exe`. When installing it, make sure to check the "Add Python 3.7 to PATH" checkbox on the first page of the installer.
Download Python 3.7.4, 32-bit (x86) from https://www.python.org/downloads/release/python-374/. I downloaded `python-3.7.4.exe`. When installing it, make sure to check the "Add Python 3.7 to PATH" checkbox on the first page of the installer.
Open a command prompt, cd to the onionshare folder, and install dependencies with pip:
......@@ -142,7 +100,7 @@ Open a command prompt, cd to the onionshare folder, and install dependencies wit
pip install -r install\requirements.txt
```
Install the Qt 5.12.1 from https://download.qt.io/archive/qt/5.12/5.12.1/. I downloaded `qt-opensource-windows-x86-5.12.1.exe`. In the installer, you can skip making an account, and all you need `Qt` > `Qt 5.12.1` > `MSVC 2017 32-bit`.
Install the Qt 5.13.1 from https://www.qt.io/offline-installers. I downloaded `qt-opensource-windows-x86-5.13.1.exe`. In the installer, you can skip making an account, and all you need `Qt` > `Qt 5.13.1` > `MSVC 2017 32-bit`.
After that you can try both the CLI and the GUI version of OnionShare:
......@@ -155,33 +113,31 @@ python dev_scripts\onionshare-gui
These instructions include adding folders to the path in Windows. To do this, go to Start and type "advanced system settings", and open "View advanced system settings" in the Control Panel. Click Environment Variables. Under "System variables" double-click on Path. From there you can add and remove folders that are available in the PATH.
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 `7z1900.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.
Download and install the standalone [Windows 10 SDK](https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk). Note that you may not need this if you already have Visual Studio.
Add the following directories to the path:
Add the following directories (you might want to make sure these are exact on your computer) to the path:
* `C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x86`
* `C:\Program Files (x86)\Windows Kits\10\Redist\10.0.18362.0\ucrt\DLLs\x86`
* `C:\Users\user\AppData\Local\Programs\Python\Python37-32\Lib\site-packages\PyQt5\Qt\bin`
* `C:\Program Files (x86)\7-Zip`
* `C:\Users\user\AppData\Local\Programs\Python\Python37-32\Lib\site-packages\PyQt5\Qt\bin`
#### If you want the .exe to not get falsely flagged as malicious by anti-virus software
OnionShare uses PyInstaller to turn the python source code into Windows executable `.exe` file. Apparently, malware developers also use PyInstaller, and some anti-virus vendors have included snippets of PyInstaller code in their virus definitions. To avoid this, you have to compile the Windows PyInstaller bootloader yourself instead of using the pre-compiled one that comes with PyInstaller.
(If you don't care about this, you can install PyInstaller with `pip install PyInstaller==3.4`.)
(If you don't care about this, you can install PyInstaller with `pip install PyInstaller==3.5`.)
Here's how to compile the PyInstaller bootloader:
Download and install [Microsoft Build Tools for Visual Studio 2019](https://www.visualstudio.com/downloads/#build-tools-for-visual-studio-2019). I downloaded `vs_buildtools__265029578.1555959436.exe`. In the installer, check the box next to "Visual C++ build tools". Click "Individual components", and under "Compilers, build tools and runtimes", check "Windows Universal CRT SDK". Then click install. When installation is done, you may have to reboot your computer.
Download and install [Microsoft Build Tools for Visual Studio 2019](https://www.visualstudio.com/downloads/#build-tools-for-visual-studio-2019). I downloaded `vs_buildtools__1285639570.1568593053.exe`. In the installer, check the box next to "Visual C++ build tools". Click "Individual components", and under "Compilers, build tools and runtimes", check "Windows Universal CRT SDK". Then click install. When installation is done, you may have to reboot your computer.
Then, enable the 32-bit Visual C++ Toolset on the Command Line like this:
```
cd "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build"
cd "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build"
vcvars32.bat
```
......@@ -198,30 +154,15 @@ pip uninstall PyInstaller
rmdir C:\Users\user\AppData\Local\Programs\Python\Python37-32\Lib\site-packages\PyInstaller /S
```
Change to a folder where you keep source code, and clone the PyInstaller git repo:
Change to a folder where you keep source code, and clone the PyInstaller git repo and checkout the `v3.5` tag:
```
git clone https://github.com/pyinstaller/pyinstaller.git
```
To verify the git tag, you first need the signing key's PGP key, which means you need `gpg`. If you installed git from git-scm.com, you can run this from Git Bash:
```
gpg --keyserver hkps://keyserver.ubuntu.com:443 --recv-key 0xD4AD8B9C167B757C4F08E8777B752811BF773B65
```
And now verify the tag:
```
cd pyinstaller
git tag -v v3.4
git tag -v v3.5
```
It should say `Good signature from "Hartmut Goebel <h.goebel@goebel-consult.de>`. If it verified successfully, checkout the tag:
```
git checkout v3.4
```
(Note that ideally you would verify the git tag, but the PGP key that has signed the `v3.5` git tag for is not published anywhere, so this isn't possible. See [this issue](https://github.com/pyinstaller/pyinstaller/issues/4430).)
And compile the bootloader, following [these instructions](https://pythonhosted.org/PyInstaller/bootloader-building.html). To compile, run this:
......@@ -346,7 +287,7 @@ To make a macOS release, go to macOS build machine:
Then move back to the developer machine:
- PGP-sign the macOS installer, `gpg --detach-sign OnionShare-$VERSION.pkg`
- PGP-sign the macOS installer, `gpg -a --detach-sign OnionShare-$VERSION.pkg`
Note that once we support notarizing the macOS installer (see [this issue](https://github.com/micahflee/onionshare/issues/953)), these will be the steps instead:
......@@ -400,8 +341,10 @@ To publish the release:
- Create a new release on GitHub, put the changelog in the description of the release, and upload all six files (the macOS installer, the Windows installer, the source package, and their signatures)
- Upload the six release files to https://onionshare.org/dist/$VERSION/
- Copy the six release files into the OnionShare team Keybase filesystem
- Update the [onionshare-website](https://github.com/micahflee/onionshare-website) repo:
- Edit `latest-version.txt` to match the latest version
- Update the version number and download links
- Deploy to https://onionshare.org/
- Email the [onionshare-dev](https://lists.riseup.net/www/subscribe/onionshare-dev) mailing list announcing the release
- Make a PR to [homebrew-cask](https://github.com/homebrew/homebrew-cask) to update the macOS version
# OnionShare Changelog
## 2.2
* New feature: Website mode, which allows publishing a static HTML website as an onion service
* Allow individual files to be viewed or downloaded in Share mode, including the ability to browse into subdirectories and use breadcrumbs to navigate back
* Show a counter when individual files or pages are viewed
* Better History items including colors and status codes to differentiate between successful and failed requests
* Swap out the random /slug suffix for HTTP basic authentication (when in non-public mode)
* Hide the Tor connection settings if the ONIONSHARE_HIDE_TOR_SETTINGS environment variable is set (Tails compatibility)
* Remove the NoScript XSS warning in Receive Mode now that the NoScript/Tor Browser bug is fixed. The ajax upload method still exists when javascript is enabled.
* Better support for DragonFly BSD
* Updated various dependencies, including Flask, Werkzeug, urllib3, requests, and PyQt5
* Updated Tor to 0.4.1.5
* Other minor bug fixes
* New translations:
* Arabic (العربية)
* Dutch (Nederlands)
* Persian (فارسی)
* Romanian (Română)
* Serbian latin (Srpska (latinica))
* Removed translations with fewer than 90% of strings translated:
* Finnish (Suomi)
## 2.1
* New feature: Auto-start timer, which allows scheduling when the server starts
* Renamed CLI argument --debug to --verbose
* Make Tor connection timeout configurable as a CLI argument
* Updated various dependencies, including to fix third-party security issues in urllib3, jinja2, and jQuery
* Update Tor to 0.3.5.8
* Updated various dependencies, including fixing third-party security issues in urllib3, Jinja2, and jQuery
* Updated Tor to 0.3.5.8
* New translations:
* Traditional Chinese (正體中文 (繁體)),
* Simplified Chinese (中文 (简体))
......@@ -14,15 +36,15 @@
* German (Deutsch)
* Icelandic (Íslenska)
* Irish (Gaeilge)
* Norwegian Bokmål (Norsk Bokmål)
* Norwegian Bokmål (Norsk bokmål)
* Polish (Polski)
* Portuguese Portugal (Português (Portugal))
* Telugu (తెలుగు)
* Turkish (Türkçe)
* Ukrainian (Українська)
* Removed translations because less than 90% of the strings were translated:
* Removed translations with fewer than 90% of strings translated:
* Bengali (বাংলা)
* Persian (فارسی),
* Persian (فارسی)
## 2.0
......@@ -35,7 +57,7 @@
* New feature: Allow selecting your language from a dropdown
* New translations: Bengali (বাংলা), Catalan (Català), Danish (Dansk), French (Français), Greek (Ελληνικά), Italian (Italiano), Japanese (日本語), Persian (فارسی), Portuguese Brazil (Português Brasil), Russian (Русский), Spanish (Español), Swedish (Svenska)
* Several bugfixes
* Invisible to users, but this version includes some major refactoring of the codebase, and a robust set of unit tests which makes OnionShare easier to maintain going forward
* Invisible to users, this version includes some major refactoring of the codebase, and a robust set of unit tests which makes OnionShare easier to maintain going forward
## 1.3.2
......@@ -44,22 +66,22 @@
## 1.3.1
* Updated Tor to 0.2.3.10
* Windows and Mac binaries are now distributed with licenses for tor and obfs4
* Windows and Mac binaries are now distributed with licenses for Tor and obfs4
## 1.3
* Major UI redesign, introducing many UX improvements
* Client-side web interfact redesigned
* New feature: Support for meek_lite pluggable transports (Amazon and Azure) - not yet ready for Windows or Mac, sorry
* New feature: Support for custom obfs4 and meek_lite bridges (again, meek_lite not available on Windows/Mac yet)
* New feature: ability to cancel share before it starts
* Bug fix: the UpdateChecker no longer blocks the UI when checking
* Bug fix: simultaneous downloads (broken in 1.2)
* Update Tor to 0.2.3.9
* New feature: Support for meek_lite pluggable transports (Amazon and Azure) - not yet ready for Windows or macOS, sorry
* New feature: Support for custom obfs4 and meek_lite bridges (again, meek_lite not available on Windows/macOS yet)
* New feature: Ability to cancel share before it starts
* Bugfix: The UpdateChecker no longer blocks the UI when checking
* Bugfix: Simultaneous downloads (broken in 1.2)
* Updated Tor to 0.2.3.9
* Improved support for BSD
* Updated French and Danish translations
* Minor build script and build documentation fixes
* Add flake8 tests
* Flake8 tests added
## 1.2
......@@ -67,18 +89,18 @@
* New feature: Ability to use a persistent URL
* New feature: Auto-stop timer, to stop OnionShare at a specified time
* New feature: Get notification when Tor connection dies
* Updated versions of python, Qt, tor, and other dependencies that are bundled
* Updated versions of Python, Qt, Tor, and other dependencies that are bundled
* Added ability to supply a custom settings file as a command line arg
* Added support for FreeBSD
* Fixed small user interface issues
* Fixed minor bugs
* New translations for Dutch
* New Dutch translations
## 1.1
* OnionShare connects to Tor itself now, so opening Tor Browser in the background isn't required
* In Windows and macOS, OnionShare alerts users about updates
* Removed the menu bar, and adding a Settings button
* Removed the menu bar, and adding a "Settings" button
* Added desktop notifications, and a system tray icon
* Ability to add multiple files and folders with a single "Add" button
* Ability to delete multiple files and folders at once with the "Delete" button
......@@ -160,7 +182,7 @@
* Brand new drag-and-drop GUI with ability to start and stop server
* Much cleaner code split into several files
* Support for sharing multiple files and folders at once, and automatically zips files before sharing
* Support for sharing multiple files and folders at once, and automatically compresses files before sharing
* Redesigned receiver HTML interface
* Waits for hidden service to be available before displaying URL
* Cleans up hidden service directory on exit
......@@ -198,4 +220,4 @@
* Shows download progress
* Limited suite of tests
* If a localized string doesn't exist, falls back to English
* New translations: Dutch, Portuguese, German, Russian, and updated translations: Norwegian, Spanish, French, Italian
* New translations: Dutch, Portuguese, German, Russian, and updated translations: Norwegian Bokmål, Spanish, French, Italian
......@@ -6,8 +6,8 @@ include share/images/*
include share/locale/*
include share/templates/*
include share/static/*
include install/onionshare.desktop
include install/onionshare.appdata.xml
include install/onionshare80.xpm
include install/org.onionshare.OnionShare.desktop
include install/org.onionshare.OnionShare.appdata.xml
include install/org.onionshare.OnionShare.svg
include install/scripts/onionshare-nautilus.py
include tests/*.py
......@@ -42,3 +42,5 @@ Test status: [![CircleCI](https://circleci.com/gh/micahflee/onionshare.svg?style
![Receive mode OnionShare](/screenshots/onionshare-receive-server.png)
![Receive mode Tor Browser](/screenshots/onionshare-receive-client.png)
![Website mode OnionShare](/screenshots/onionshare-website-server.png)
\ No newline at end of file
onionshare (2.2-1) unstable; urgency=medium
* New upstream release.
* Run wrap-and-sort to minimise future diff noise.
* Add python3-flask-httpauth to binary and build dependencies.
* Specify Rules-Requires-Root: no.
-- Chris Lamb <lamby@debian.org> Mon, 04 Nov 2019 13:15:12 -0800
onionshare (2.1-1) unstable; urgency=medium
* New upstream release, uploading without binaries to ensure migration to
......
Source: onionshare
Maintainer: Debian Privacy Tools Maintainers <pkg-privacy-maintainers@lists.alioth.debian.org>
Uploaders: Ulrike Uhlig <ulrike@debian.org>, anonym <anonym@riseup.net>, Chris Lamb <lamby@debian.org>
Uploaders:
Ulrike Uhlig <ulrike@debian.org>,
anonym <anonym@riseup.net>,
Chris Lamb <lamby@debian.org>,
Section: net
Priority: optional
Build-Depends: debhelper-compat (= 12), dh-python, python3-all, python3-crypto, python3-distutils-extra, python3-flask, python-nautilus, python3-nose, python3-pyqt5, python3-pytest, python3-requests, python3-setuptools, python3-socks, python3-stem (>= 1.4.0)
Standards-Version: 4.4.0
Build-Depends:
debhelper-compat (= 12),
dh-python,
python-nautilus,
python3-all,
python3-crypto,
python3-distutils-extra,
python3-flask,
python3-flask-httpauth,
python3-nose,
python3-pyqt5,
python3-pytest,
python3-requests,
python3-setuptools,
python3-socks,
python3-stem (>= 1.4.0),
Standards-Version: 4.4.1
Homepage: https://onionshare.org
Vcs-Git: https://salsa.debian.org/pkg-privacy-team/onionshare.git
Vcs-Browser: https://salsa.debian.org/pkg-privacy-team/onionshare
Rules-Requires-Root: no
Package: onionshare
Architecture: all
Depends: ${misc:Depends}, obfs4proxy, ${python3:Depends}, python3-crypto, python3-flask, python3-pyqt5, python3-socks, python3-stem (>= 1.4.0), tor
Depends:
obfs4proxy,
python3-crypto,
python3-flask,
python3-flask-httpauth,
python3-pyqt5,
python3-socks,
python3-stem (>= 1.4.0),
tor,
${misc:Depends},
${python3:Depends},
Description: Share a file over Tor Hidden Services anonymously and securely
OnionShare lets you securely and anonymously share a file of any size with
someone. It works by starting a web server, making it accessible as a Tor
......
......@@ -2,6 +2,3 @@
pristine-tar = True
debian-branch = debian/sid
upstream-branch = master
[import-orig]
upstream-vcs-tag = v%(version)s
debian/onionshare.1
debian/onionshare-gui.1
debian/onionshare.1
......@@ -9,7 +9,7 @@ VERSION=`cat share/version.txt`
rm -r build dist >/dev/null 2>&1
# build binary package
python3 setup.py bdist_rpm --requires="python3-flask, python3-stem, python3-qt5, python3-crypto, python3-pysocks, nautilus-python, tor, obfs4"
python3 setup.py bdist_rpm --requires="python3-flask, python3-flask-httpauth, python3-stem, python3-qt5, python3-crypto, python3-pysocks, nautilus-python, tor, obfs4"
# install it
echo ""
......
......@@ -33,12 +33,25 @@ import fileinput, argparse, re, os, codecs, json, sys
def arg_parser():
desc = __doc__.strip().splitlines()[0]
p = argparse.ArgumentParser(description=desc)
p.add_argument('-d', default='.', help='onionshare directory',
metavar='ONIONSHARE_DIR', dest='onionshare_dir')
p.add_argument('--show-all-keys', action='store_true',
help='show translation key in source and exit'),
p.add_argument('-l', default='all', help='language code (default: all)',
metavar='LANG_CODE', dest='lang_code')
p.add_argument(
"-d",
default=".",
help="onionshare directory",
metavar="ONIONSHARE_DIR",
dest="onionshare_dir",
)
p.add_argument(
"--show-all-keys",
action="store_true",
help="show translation key in source and exit",
),
p.add_argument(
"-l",
default="all",
help="language code (default: all)",
metavar="LANG_CODE",
dest="lang_code",
)
return p
......@@ -54,26 +67,29 @@ def main():
dir = args.onionshare_dir
src = files_in(dir, 'onionshare') + \
files_in(dir, 'onionshare_gui') + \
files_in(dir, 'onionshare_gui/mode') + \
files_in(dir, 'onionshare_gui/mode/share_mode') + \
files_in(dir, 'onionshare_gui/mode/receive_mode') + \
files_in(dir, 'install/scripts') + \
files_in(dir, 'tests')
pysrc = [p for p in src if p.endswith('.py')]
src = (
files_in(dir, "onionshare")
+ files_in(dir, "onionshare_gui")
+ files_in(dir, "onionshare_gui/mode")
+ files_in(dir, "onionshare_gui/mode/share_mode")
+ files_in(dir, "onionshare_gui/mode/receive_mode")
+ files_in(dir, "onionshare_gui/mode/website_mode")
+ files_in(dir, "install/scripts")
+ files_in(dir, "tests")
)
pysrc = [p for p in src if p.endswith(".py")]
lang_code = args.lang_code
translate_keys = set()
# load translate key from python source
for line in fileinput.input(pysrc, openhook=fileinput.hook_encoded('utf-8')):
for line in fileinput.input(pysrc, openhook=fileinput.hook_encoded("utf-8")):
# search `strings._('translate_key')`
# `strings._('translate_key', True)`
m = re.findall(r'strings\._\((.*?)\)', line)
m = re.findall(r"strings\._\((.*?)\)", line)
if m:
for match in m:
key = match.split(',')[0].strip('''"' ''')
key = match.split(",")[0].strip(""""' """)
translate_keys.add(key)
if args.show_all_keys:
......@@ -81,12 +97,16 @@ def main():
print(k)
sys.exit()
if lang_code == 'all':
locale_files = [f for f in files_in(dir, 'share/locale') if f.endswith('.json')]
if lang_code == "all":
locale_files = [f for f in files_in(dir, "share/locale") if f.endswith(".json")]
else:
locale_files = [f for f in files_in(dir, 'share/locale') if f.endswith('%s.json' % lang_code)]
locale_files = [
f
for f in files_in(dir, "share/locale")
if f.endswith("%s.json" % lang_code)
]
for locale_file in locale_files:
with codecs.open(locale_file, 'r', encoding='utf-8') as f:
with codecs.open(locale_file, "r", encoding="utf-8") as f:
trans = json.load(f)
# trans -> {"key1": "translate-text1", "key2": "translate-text2", ...}
locale_keys = set(trans.keys())
......@@ -96,11 +116,11 @@ def main():
locale, ext = os.path.splitext(os.path.basename(locale_file))
for k in sorted(disused):
print(locale, 'disused', k)
print(locale, "disused", k)
for k in sorted(lacked):
print(locale, 'lacked', k)
print(locale, "lacked", k)
if __name__ == '__main__':
if __name__ == "__main__":
main()
......@@ -34,17 +34,24 @@ import shutil
import subprocess
import requests
def main():
dmg_url = 'https://archive.torproject.org/tor-package-archive/torbrowser/8.0.8/TorBrowser-8.0.8-osx64_en-US.dmg'
dmg_filename = 'TorBrowser-8.0.8-osx64_en-US.dmg'
expected_dmg_sha256 = '1dc01b95146352593c3f18ece25f8735120565f921e22c2827df819effdddca3'
dmg_url = "https://archive.torproject.org/tor-package-archive/torbrowser/8.5.5/TorBrowser-8.5.5-osx64_en-US.dmg"
dmg_filename = "TorBrowser-8.5.5-osx64_en-US.dmg"
expected_dmg_sha256 = (
"9c1b7840bd251a4c52f0c919991e57cafb9178c55e11fa49f83ffacce3c20511"
)
# Build paths
root_path = os.path.dirname(os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))))
working_path = os.path.join(root_path, 'build', 'tor')
dmg_tor_path = os.path.join('/Volumes', 'Tor Browser', 'Tor Browser.app', 'Contents')
root_path = os.path.dirname(
os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
)
working_path = os.path.join(root_path, "build", "tor")
dmg_tor_path = os.path.join(
"/Volumes", "Tor Browser", "Tor Browser.app", "Contents"
)
dmg_path = os.path.join(working_path, dmg_filename)
dist_path = os.path.join(root_path, 'dist', 'OnionShare.app', 'Contents')
dist_path = os.path.join(root_path, "dist", "OnionShare.app", "Contents")
# Make sure the working folder exists
if not os.path.exists(working_path):
......@@ -54,10 +61,10 @@ def main():
if not os.path.exists(dmg_path):
print("Downloading {}".format(dmg_url))
r = requests.get(dmg_url)
open(dmg_path, 'wb').write(r.content)
open(dmg_path, "wb").write(r.content)
dmg_sha256 = hashlib.sha256(r.content).hexdigest()
else:
dmg_data = open(dmg_path, 'rb').read()
dmg_data = open(dmg_path, "rb").read()
dmg_sha256 = hashlib.sha256(dmg_data).hexdigest()
# Compare the hash
......@@ -68,34 +75,52 @@ def main():
sys.exit(-1)
# Mount the dmg, copy data to the working path
subprocess.call(['hdiutil', 'attach', dmg_path])
subprocess.call(["hdiutil", "attach", dmg_path])
# Make sure Resources/tor exists before copying files
if os.path.exists(os.path.join(dist_path, 'Resources', 'Tor')):
shutil.rmtree(os.path.join(dist_path, 'Resources', 'Tor'))
os.makedirs(os.path.join(dist_path, 'Resources', 'Tor'))
if os.path.exists(os.path.join(dist_path, 'MacOS', 'Tor')):
shutil.rmtree(os.path.join(dist_path, 'MacOS', 'Tor'))
os.makedirs(os.path.join(dist_path, 'MacOS', 'Tor'))
if os.path.exists(os.path.join(dist_path, "Resources", "Tor")):
shutil.rmtree(os.path.join(dist_path, "Resources", "Tor"))
os.makedirs(os.path.join(dist_path, "Resources", "Tor"))
if os.path.exists(os.path.join(dist_path, "MacOS", "Tor")):
shutil.rmtree(os.path.join(dist_path, "MacOS", "Tor"))
os.makedirs(os.path.join(dist_path, "MacOS", "Tor"))
# Modify the tor script to adjust the path
tor_script = open(os.path.join(dmg_tor_path, 'Resources', 'TorBrowser', 'Tor', 'tor'), 'r').read()
tor_script = tor_script.replace('../../../MacOS/Tor', '../../MacOS/Tor')
open(os.path.join(dist_path, 'Resources', 'Tor', 'tor'), 'w').write(tor_script)
tor_script = open(
os.path.join(dmg_tor_path, "Resources", "TorBrowser", "Tor", "tor"), "r"
).read()
tor_script = tor_script.replace("../../../MacOS/Tor", "../../MacOS/Tor")
open(os.path.join(dist_path, "Resources", "Tor", "tor"), "w").write(tor_script)
# Copy into dist
shutil.copyfile(os.path.join(dmg_tor_path, 'Resources', 'TorBrowser', 'Tor', 'geoip'), os.path.join(dist_path, 'Resources', 'Tor', 'geoip'))
shutil.copyfile(os.path.join(dmg_tor_path, 'Resources', 'TorBrowser', 'Tor', 'geoip6'), os.path.join(dist_path, 'Resources', 'Tor', 'geoip6'))
os.chmod(os.path.join(dist_path, 'Resources', 'Tor', 'tor'), 0o755)
shutil.copyfile(os.path.join(dmg_tor_path, 'MacOS', 'Tor', 'tor.real'), os.path.join(dist_path, 'MacOS', 'Tor', 'tor.real'))
shutil.copyfile(os.path.join(dmg_tor_path, 'MacOS', 'Tor', 'libevent-2.1.6.dylib'), os.path.join(dist_path, 'MacOS', 'Tor', 'libevent-2.1.6.dylib'))
os.chmod(os.path.join(dist_path, 'MacOS', 'Tor', 'tor.real'), 0o755)
shutil.copyfile(
os.path.join(dmg_tor_path, "Resources", "TorBrowser", "Tor", "geoip"),
os.path.join(dist_path, "Resources", "Tor", "geoip"),
)
shutil.copyfile(
os.path.join(dmg_tor_path, "Resources", "TorBrowser", "Tor", "geoip6"),
os.path.join(dist_path, "Resources", "Tor", "geoip6"),
)
os.chmod(os.path.join(dist_path, "Resources", "Tor", "tor"), 0o755)
shutil.copyfile(
os.path.join(dmg_tor_path, "MacOS", "Tor", "tor.real"),
os.path.join(dist_path, "MacOS", "Tor", "tor.real"),
)
shutil.copyfile(
os.path.join(dmg_tor_path, "MacOS", "Tor", "libevent-2.1.6.dylib"),
os.path.join(dist_path, "MacOS", "Tor", "libevent-2.1.6.dylib"),
)
os.chmod(os.path.join(dist_path, "MacOS", "Tor", "tor.real"), 0o755)
# obfs4proxy binary
shutil.copyfile(os.path.join(dmg_tor_path, 'MacOS', 'Tor', 'PluggableTransports', 'obfs4proxy'), os.path.join(dist_path, 'Resources', 'Tor', 'obfs4proxy'))
os.chmod(os.path.join(dist_path, 'Resources', 'Tor', 'obfs4proxy'), 0o755)
shutil.copyfile(
os.path.join(dmg_tor_path, "MacOS", "Tor", "PluggableTransports", "obfs4proxy"),
os.path.join(dist_path, "Resources", "Tor", "obfs4proxy"),
)
os.chmod(os.path.join(dist_path, "Resources", "Tor", "obfs4proxy"), 0o755)
# Eject dmg
subprocess.call(['diskutil', 'eject', '/Volumes/Tor Browser'])
subprocess.call(["diskutil", "eject", "/Volumes/Tor Browser"])
if __name__ == '__main__':
if __name__ == "__main__":
main()
......@@ -32,15 +32,22 @@ import shutil
import subprocess
import requests
def main():
exe_url = 'https://archive.torproject.org/tor-package-archive/torbrowser/8.0.8/torbrowser-install-8.0.8_en-US.exe'
exe_filename = 'torbrowser-install-8.0.8_en-US.exe'
expected_exe_sha256 = 'bfe32a737e9fa37bf0c8837dbf3385be41cd9e8f9a88850d8f2946bb736e784f'
exe_url = "https://archive.torproject.org/tor-package-archive/torbrowser/8.5.5/torbrowser-install-8.5.5_en-US.exe"
exe_filename = "torbrowser-install-8.5.5_en-US.exe"
expected_exe_sha256 = (
"a3aa7e626d1d2365dcecc6f17055f467f31c4ff9558a769e51d4b90640e48bb0"
)
# 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')
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")
exe_path = os.path.join(working_path, exe_filename)
dist_path = os.path.join(os.path.join(os.path.join(root_path, 'dist'), 'onionshare'), 'tor')
dist_path = os.path.join(
os.path.join(os.path.join(root_path, "dist"), "onionshare"), "tor"
)
# Make sure the working folder exists
if not os.path.exists(working_path):
......@@ -50,10 +57,10 @@ def main():
if not os.path.exists(exe_path):
print("Downloading {}".format(exe_url))
r = requests.get(exe_url)
open(exe_path, 'wb').write(r.content)
open(exe_path, "wb").write(r.content)
exe_sha256 = hashlib.sha256(r.content).hexdigest()
else:
exe_data = open(exe_path, 'rb').read()
exe_data = open(exe_path, "rb").read()
exe_sha256 = hashlib.sha256(exe_data).hexdigest()
# Compare the hash
......@@ -64,8 +71,22 @@ def main():
sys.exit(-1)
# Extract the bits we need from the exe
cmd = ['7z', 'e', '-y', exe_path, 'Browser\TorBrowser\Tor', '-o%s' % os.path.join(working_path, 'Tor')]
cmd2 = ['7z', 'e', '-y', exe_path, 'Browser\TorBrowser\Data\Tor\geoip*', '-o%s' % os.path.join(working_path, 'Data')]
cmd = [
"7z",
"e",
"-y",
exe_path,
"Browser\TorBrowser\Tor",
"-o%s" % os.path.join(working_path, "Tor"),
]
cmd2 = [
"7z",
"e",
"-y",
exe_path,
"Browser\TorBrowser\Data\Tor\geoip*",
"-o%s" % os.path.join(working_path, "Data"),
]
subprocess.Popen(cmd).wait()
subprocess.Popen(cmd2).wait()
......@@ -73,8 +94,11 @@ def main():
if os.path.exists(dist_path):
shutil.rmtree(dist_path)
os.makedirs(dist_path)
shutil.copytree( os.path.join(working_path, 'Tor'), os.path.join(dist_path, 'Tor') )
shutil.copytree( os.path.join(working_path, 'Data'), os.path.join(dist_path, 'Data', 'Tor') )
shutil.copytree(os.path.join(working_path, "Tor"), os.path.join(dist_path, "Tor"))
shutil.copytree(
os.path.join(working_path, "Data"), os.path.join(dist_path, "Data", "Tor")
)
if __name__ == '__main__':
if __name__ == "__main__":
main()
......@@ -3,10 +3,10 @@
!define ABOUTURL "https:\\onionshare.org\"
# change these with each release
!define INSTALLSIZE 115186
!define INSTALLSIZE 132423
!define VERSIONMAJOR 2
!define VERSIONMINOR 1
!define VERSIONSTRING "2.1"
!define VERSIONMINOR 2
!define VERSIONSTRING "2.2"
RequestExecutionLevel admin
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2018 Micah Lee <micah@micahflee.com> -->
<component type="desktop">
<id>onionshare.desktop</id>
<component type="desktop-application">
<id>org.onionshare.OnionShare</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-3.0</project_license>
<name>OnionShare</name>
<summary>Securely and anonymously share a file of any size</summary>
<description>
<p>
OnionShare lets you securely and anonymously send and receive files. It works by starting a
web server, making it accessible as a Tor onion service, and generating an unguessable web
address so others can download files from you, or upload files to you. It does <em>not</em>
require setting up a separate server or using a third party file-sharing service.
OnionShare lets you securely and anonymously send and receive files. It works by starting a web server,
making it accessible as a Tor onion service, and generating an unguessable web address so others can
download files from you, or upload files to you. It does <em>not</em> require setting up a separate server
or using a third party file-sharing service.
</p>
<p>
If you want to send files to someone, OnionShare hosts them on your own computer and uses a Tor
onion service to make them temporarily accessible over the internet. The receiving user just
needs to open the web address in Tor Browser to download the files. If you want to receive files,
OnionShare hosts an anonymous dropbox directly on your computer and uses a Tor onion service to
make it temporarily accessible over the internet. Other users can upload files to you from by
loading the web address in Tor Browser.
If you want to send files to someone, OnionShare hosts them on your own computer and uses a Tor onion
service to make them temporarily accessible over the internet. The receiving user just needs to open the web
address in Tor Browser to download the files. If you want to receive files, OnionShare hosts an anonymous
dropbox directly on your computer and uses a Tor onion service to make it temporarily accessible over the
internet. Other users can upload files to you from by loading the web address in Tor Browser.
</p>
</description>
<launchable type="desktop-id">org.onionshare.OnionShare.desktop</launchable>
<screenshots>
<screenshot type="default">
<image>https://raw.githubusercontent.com/micahflee/onionshare/master/screenshots/appdata-onionshare-share-server.png</image>
......@@ -40,6 +40,13 @@
<caption>Uploading files to OnionShare user using Tor Browser</caption>
</screenshot>
</screenshots>
<url type="bugtracker">https://github.com/micahflee/onionshare/issues/</url>
<url type="help">https://github.com/micahflee/onionshare/wiki/</url>
<url type="homepage">https://onionshare.org/</url>
<updatecontact>micah@micahflee.com</updatecontact>
<developer_name>Micah Lee</developer_name>
<update_contact>micah@micahflee.com</update_contact>
<content_rating type="oars-1.1" />
<releases>
<release type="stable" date="2019-05-07" version="2.1" />
</releases>
</component>
......@@ -7,7 +7,7 @@ Comment[de]=Teile Dateien sicher und anonym über das Tor-Netzwerk
Exec=/usr/bin/onionshare-gui
Terminal=false
Type=Application
Icon=onionshare80
Icon=org.onionshare.OnionShare
Categories=Network;FileTransfer;
Keywords=tor;anonymity;privacy;onion service;file sharing;file hosting;
Keywords[da]=tor;anonymitet;privatliv;onion-tjeneste;fildeling;filhosting;
......
This diff is collapsed.
......@@ -58,7 +58,7 @@ if p == 'Darwin':
app = BUNDLE(
coll,
name='OnionShare.app',
icon='install/onionshare.icns',
icon='onionshare.icns',
bundle_identifier='com.micahflee.onionshare',
info_plist={
'CFBundleShortVersionString': version,
......
atomicwrites==1.3.0
attrs==19.1.0
more-itertools==5.0.0
pluggy==0.9.0
more-itertools==7.2.0
pluggy==0.13.0
py==1.8.0
pytest==4.4.1
pytest-faulthandler==1.5.0
pytest==5.1.2
pytest-faulthandler==2.0.1
pytest-qt==3.2.2
six==1.12.0
urllib3==1.24.2
urllib3==1.25.3
\ No newline at end of file