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
```
2023-02-05 16:39:28 -05: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 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
2023-05-21 14:11:16 -04:00
**Linux users:** In Ubuntu you may need the `libxcb-xinerama0` package installed.
2022-04-03 14:15:53 -04:00
2023-05-21 19:30:45 -04:00
**Windows users:**
- Download and install 7-Zip (x64) from https://7-zip.org/download.html. [Add ](https://medium.com/@kevinmarkvi/how-to-add-executables-togit fethc-your-path-in-windows-5ffa4ce61a53 ) `C:\Program Files\7-Zip` to your path.
- Download and install gpg4win from https://gpg4win.org/. Add `C:\Program Files (x86)\GnuPG\bin` to your path too.
2020-10-15 01:36:31 -04:00
2023-02-08 18:28:20 -05:00
Download Tor Browser and extract the binaries for your platform. The platform must be `win64` , `macos` , or `linux64` .
2020-10-15 01:36:31 -04:00
2021-12-19 20:33:11 -05:00
```sh
2022-06-19 14:57:37 -04:00
poetry run python ./scripts/get-tor.py [platform]
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
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 14:48:18 -04:00
2020-11-29 13:42:04 -05: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 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
```