2020-10-13 20:28:54 -04:00
# OnionShare Desktop
## Building OnionShare
2020-10-15 01:36:31 -04:00
Start by getting the source code and changing to the `desktop` folder:
```sh
2021-08-20 16:34:55 -04:00
git clone https://github.com/onionshare/onionshare.git
2020-10-15 01:36:31 -04:00
cd onionshare/desktop
```
2021-12-21 17:16:10 -05:00
Make sure you have Python 3 installed. If you're using Windows or macOS, install version 3.9.9 [from python.org ](https://www.python.org/downloads/release/python-399/ ). For Windows, make sure to install the 32-bit (x86) version, and to check the box to add python to the path on the first page of the installer.
2021-12-19 20:33:11 -05:00
Make sure you have [poetry installed ](https://python-poetry.org/docs/#installation ), and then install the dependencies:
```sh
poetry install
```
2020-10-13 20:28:54 -04:00
### Install platform-specific dependencies
#### Linux
2021-10-11 23:17:26 -04:00
In Ubuntu 20.04 you need the `libxcb-xinerama0` package installed.
2020-10-13 20:28:54 -04:00
2021-10-11 23:17:26 -04:00
Download Tor Browser and extract the binaries:
```sh
2021-12-19 20:33:11 -05:00
poetry run ./scripts/get-tor-linux.py
2021-10-11 23:17:26 -04:00
```
2021-05-31 15:20:21 -04:00
2020-10-13 20:28:54 -04:00
#### macOS
2020-11-04 18:57:14 -05:00
Download Tor Browser and extract the binaries:
```sh
2021-12-19 20:33:11 -05:00
poetry run ./scripts/get-tor-osx.py
2020-11-04 18:57:14 -05:00
```
2020-10-13 20:28:54 -04:00
#### Windows
2020-10-15 01:36:31 -04:00
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.
2020-10-13 20:28:54 -04:00
2021-08-22 16:18:52 -04:00
Download and install 7-Zip from https://7-zip.org/download.html. I downloaded `7z1900.exe` . Add `C:\Program Files (x86)\7-Zip` to your path.
2020-10-15 01:36:31 -04:00
2020-11-04 18:57:14 -05:00
Download Tor Browser and extract the binaries:
2020-10-15 01:36:31 -04:00
2021-12-19 20:33:11 -05:00
```sh
poetry run python scripts\get-tor-windows.py
2020-10-13 20:28:54 -04:00
```
2021-10-24 14:48:18 -04:00
### Compile dependencies
2021-12-21 17:16:10 -05:00
Install Go. The simplest way to make sure everything works is to install Go by following [these instructions ](https://golang.org/doc/install ). (In Windows, make sure to install the 32-bit version of Go, such as `go1.17.5.windows-386.msi` .)
2021-10-24 14:48:18 -04:00
Download and compile `meek-client` :
2020-11-29 13:42:04 -05:00
```sh
2021-12-19 20:33:11 -05:00
./scripts/build-meek-client.py
2020-11-29 13:42:04 -05:00
```
2020-11-29 14:23:23 -05:00
### Running OnionShare from the source code tree
2021-12-19 20:33:11 -05:00
To run OnionShare from the source tree:
2020-10-13 20:28:54 -04:00
2021-12-19 20:33:11 -05:00
```sh
poetry run onionshare
poetry run onionshare --help
poetry run onionshare -v
poetry run onionshare -v --local-only
2020-11-29 14:23:23 -05:00
```
2021-12-23 14:49:43 -05:00
You can also run `onionshare-cli` from the source tree, and it will look for Tor binaries in `desktop/onionshare/resources/tor` .
```sh
poetry run onionshare-cli --help
```
2020-10-13 20:28:54 -04:00
## Running tests
2021-12-19 20:33:11 -05:00
Run the tests:
2020-10-13 20:28:54 -04:00
```sh
2021-12-19 20:33:11 -05:00
poetry run ./tests/run.sh
2020-10-13 20:28:54 -04:00
```
2020-10-14 23:42:20 -04:00
If you want to run tests while hiding the GUI, you must have the `xvfb` package installed, and then:
2020-10-14 23:17:08 -04:00
```sh
2021-12-19 20:33:11 -05:00
xvfb-run poetry run ./tests/run.sh
2020-10-14 23:17:08 -04:00
```