From 0dd5ce5a5b82d6b919d32da7b8a303716b43d595 Mon Sep 17 00:00:00 2001 From: Anaswara T Rajan Date: Mon, 23 Sep 2024 15:20:23 +0530 Subject: [PATCH 1/6] dev script for first time setup in linux --- setup-project.sh | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 setup-project.sh diff --git a/setup-project.sh b/setup-project.sh new file mode 100644 index 00000000..6ea17ca5 --- /dev/null +++ b/setup-project.sh @@ -0,0 +1,32 @@ +#!/bin/bash +OS=$(uname -s) + +if [ "$OS" == "Linux" ]; then + # setup environment + cd cli + poetry install + echo "OnionShare CLI is installed!" + cd ../desktop + poetry install + + # setup tor + poetry run python ./scripts/get-tor.py linux-x86_64 + echo "Tor browser is installed" + + # compile dependencies + ./scripts/build-pt-obfs4proxy.sh + ./scripts/build-pt-snowflake.sh + ./scripts/build-pt-meek.sh + + # add alias + echo "alias onionshare='cd $(pwd) && poetry run onionshare'" >> ~/.bash_aliases + source ~/.bash_aliases + + echo "OnionShare Desktop is now installed" + echo "Try running 'onionshare' to start onionshare server from source tree" + echo "Restart a new terminal if the above doesnt work" + echo "Checkout desktop/README.md for more info" +else + echo "This script only works in linux distros, Try cli/README.md, desktop/README.md for installation steps" + exit 1 +fi From b2556a56e05f0470e2ae04ab96b65b52b4930c0d Mon Sep 17 00:00:00 2001 From: Anaswara T Rajan Date: Wed, 26 Feb 2025 20:27:33 +0530 Subject: [PATCH 2/6] update tor installed message --- setup-project.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup-project.sh b/setup-project.sh index 6ea17ca5..0c904121 100644 --- a/setup-project.sh +++ b/setup-project.sh @@ -11,7 +11,7 @@ if [ "$OS" == "Linux" ]; then # setup tor poetry run python ./scripts/get-tor.py linux-x86_64 - echo "Tor browser is installed" + echo "Tor is installed" # compile dependencies ./scripts/build-pt-obfs4proxy.sh From c8a7cd02e1c1e89eca84f4d08c61891435bb1eda Mon Sep 17 00:00:00 2001 From: Anaswara T Rajan Date: Wed, 26 Feb 2025 20:28:33 +0530 Subject: [PATCH 3/6] check for poetry installation and exit if no installation found --- setup-project.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/setup-project.sh b/setup-project.sh index 0c904121..b797ec0e 100644 --- a/setup-project.sh +++ b/setup-project.sh @@ -2,6 +2,14 @@ OS=$(uname -s) if [ "$OS" == "Linux" ]; then + # Check poetry installation and exit if no installation found. + if ! command -v poetry 2>&1 >/dev/null + then + echo "Could not detect Poetry installation. Please make sure you install Poetry first. + See https://python-poetry.org/docs/#installation or run pip3 install poetry" + exit 1 + fi + # setup environment cd cli poetry install From b9920d61ba550b006c2c9df5cc1ab4ff528db2f8 Mon Sep 17 00:00:00 2001 From: Anaswara T Rajan Date: Wed, 26 Feb 2025 20:29:27 +0530 Subject: [PATCH 4/6] add onionshare-cli bash_alias --- setup-project.sh | 1 + 1 file changed, 1 insertion(+) mode change 100644 => 100755 setup-project.sh diff --git a/setup-project.sh b/setup-project.sh old mode 100644 new mode 100755 index b797ec0e..5161762e --- a/setup-project.sh +++ b/setup-project.sh @@ -28,6 +28,7 @@ if [ "$OS" == "Linux" ]; then # add alias echo "alias onionshare='cd $(pwd) && poetry run onionshare'" >> ~/.bash_aliases + echo "alias onionshare-cli='cd $(pwd) && poetry run onionshare-cli'" >> ~/.bash_aliases source ~/.bash_aliases echo "OnionShare Desktop is now installed" From 875e346225e5718c926ae026ffea59308ddbd853 Mon Sep 17 00:00:00 2001 From: Anaswara T Rajan Date: Thu, 27 Feb 2025 17:09:39 +0530 Subject: [PATCH 5/6] check for golang installation and exit if no installation found --- setup-project.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/setup-project.sh b/setup-project.sh index 5161762e..a6a9e2ad 100755 --- a/setup-project.sh +++ b/setup-project.sh @@ -10,6 +10,14 @@ if [ "$OS" == "Linux" ]; then exit 1 fi + # Check golang installation and exit if no installation found. + if ! command -v go 2>&1 >/dev/null + then + echo "Could not detect Go installation. Please make sure you install Go first. + See https://go.dev/doc/install" + exit 1 + fi + # setup environment cd cli poetry install From 10eacf9bcccca588e51690e61d482ed3a2e019cf Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Fri, 28 Feb 2025 12:10:45 +1100 Subject: [PATCH 6/6] Add a note in the desktop/README.md about the setup-project.sh script --- desktop/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/desktop/README.md b/desktop/README.md index 88835c27..f903c143 100644 --- a/desktop/README.md +++ b/desktop/README.md @@ -2,6 +2,10 @@ ## Building OnionShare +If you are running Linux, you can make use of the script `setup-project.sh` in the parent directory, which automates most of the steps below. + +Otherwise, please continue to read on. + Start by getting the source code and changing to the `desktop` folder: ```sh