2020-10-13 17:28:54 -07:00
# OnionShare Desktop
## Building OnionShare
2020-10-14 22:36:31 -07:00
Start by getting the source code and changing to the `desktop` folder:
```sh
2021-08-20 13:34:55 -07:00
git clone https://github.com/onionshare/onionshare.git
2020-10-14 22:36:31 -07:00
cd onionshare/desktop
```
2023-02-05 13:39:28 -08:00
Make sure you have Python 3 installed. If you're using Windows or macOS, install the latest version of 3.10 [from python.org ](https://www.python.org/downloads/ ). For Windows, make sure to check the box to add python to the path on the first page of the installer.
2021-12-19 17:33:11 -08:00
2022-04-03 11:15:53 -07:00
Make sure you have [poetry ](https://python-poetry.org/ ) installed:
2021-12-19 17:33:11 -08:00
```
2022-04-03 11:15:53 -07:00
pip3 install poetry
2021-10-11 20:17:26 -07:00
```
2021-05-31 12:20:21 -07:00
2022-04-03 11:15:53 -07:00
And install the poetry dependencies:
2020-11-04 15:57:14 -08:00
```sh
2022-04-03 11:15:53 -07:00
poetry install
2020-11-04 15:57:14 -08:00
```
2022-04-03 11:15:53 -07: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 17:28:54 -07:00
2022-04-03 11:15:53 -07:00
### Get Tor
2020-10-13 17:28:54 -07:00
2022-04-03 11:15:53 -07: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-14 22:36:31 -07:00
2022-12-30 22:23:52 +01:00
Download Tor Browser and extract the binaries for your platform. The platform must be `win32` , `win64` , `macos` , or `linux64` .
2020-10-14 22:36:31 -07:00
2021-12-19 17:33:11 -08:00
```sh
2022-06-19 14:57:37 -04:00
poetry run python ./scripts/get-tor.py [platform]
2020-10-13 17:28:54 -07:00
```
2021-10-24 11:48:18 -07:00
### Compile dependencies
2022-04-03 11:15:53 -07: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 11:48:18 -07:00
2022-06-19 14:57:37 -04:00
Compile pluggable transports:
**Windows users, in PowerShell:**
```powershell
.\scripts\build-pt-obfs4proxy.ps1
.\scripts\build-pt-snowflake.ps1
.\scripts\build-pt-meek.ps1
```
**macOS and Linux users:**
2021-10-24 11:48:18 -07:00
2020-11-29 10:42:04 -08:00
```sh
2022-06-19 14:57:37 -04:00
./scripts/build-pt-obfs4proxy.sh
./scripts/build-pt-snowflake.sh
./scripts/build-pt-meek.sh
2022-03-27 12:44:41 -07:00
```
2020-11-29 11:23:23 -08:00
### Running OnionShare from the source code tree
2021-12-19 17:33:11 -08:00
To run OnionShare from the source tree:
2020-10-13 17:28:54 -07:00
2021-12-19 17:33:11 -08:00
```sh
poetry run onionshare
poetry run onionshare --help
poetry run onionshare -v
poetry run onionshare -v --local-only
2020-11-29 11:23:23 -08:00
```
2021-12-23 11:49:43 -08: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 17:28:54 -07:00
## Running tests
2021-12-19 17:33:11 -08:00
Run the tests:
2020-10-13 17:28:54 -07:00
```sh
2021-12-19 17:33:11 -08:00
poetry run ./tests/run.sh
2020-10-13 17:28:54 -07:00
```
2020-10-14 20:42:20 -07:00
If you want to run tests while hiding the GUI, you must have the `xvfb` package installed, and then:
2020-10-14 20:17:08 -07:00
```sh
2021-12-19 17:33:11 -08:00
xvfb-run poetry run ./tests/run.sh
2020-10-14 20:17:08 -07:00
```