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
```
2022-04-03 14:15:53 -04:00
Make sure you have Python 3 installed. If you're using Windows or macOS, install version 3.9.12 [from python.org ](https://www.python.org/downloads/release/python-3912/ ). For Windows, make sure 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
2022-04-03 14:15:53 -04:00
Make sure you have [poetry ](https://python-poetry.org/ ) installed:
2021-12-19 20:33:11 -05:00
```
2022-04-03 14:15:53 -04:00
pip3 install poetry
2021-10-11 23:17:26 -04:00
```
2021-05-31 15:20:21 -04:00
2022-04-03 14:15:53 -04:00
And install the poetry dependencies:
2020-11-04 18:57:14 -05:00
```sh
2022-04-03 14:15:53 -04:00
poetry install
2020-11-04 18:57:14 -05:00
```
2022-04-03 14:15:53 -04:00
**Windows users:** You may need to install [Microsoft C++ Build Tools ](https://visualstudio.microsoft.com/visual-cpp-build-tools/ ), making sure to check "Desktop development with C++", before `poetry install` will work properly.
2020-10-13 20:28:54 -04:00
2022-04-03 14:15:53 -04:00
### Get Tor
2020-10-13 20:28:54 -04:00
2022-04-03 14:15:53 -04:00
**Linux users:** In Ubuntu 20.04 you need the `libxcb-xinerama0` package installed.
**Windows users:** Download and install 7-Zip from https://7-zip.org/download.html. [Add ](https://medium.com/@kevinmarkvi/how-to-add-executables-to-your-path-in-windows-5ffa4ce61a53 ) `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
2022-04-03 14:15:53 -04:00
poetry run python ./scripts/get-tor.py
2020-10-13 20:28:54 -04:00
```
2021-10-24 14:48:18 -04:00
### Compile dependencies
2022-04-03 14:15:53 -04:00
Install Go. The simplest way to make sure everything works is to install Go by following [these instructions ](https://golang.org/doc/install ).
2021-10-24 14:48:18 -04:00
Download and compile `meek-client` :
2020-11-29 13:42:04 -05:00
```sh
2022-04-03 14:15:53 -04:00
poetry run python ./scripts/build-meek-client.py
2022-03-27 15:44:41 -04: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
```