Installation Snowflake?

Hey,

I am trying to install Snowflake under 8.3.1 Bullseye according to the following instructions.

sudo apt-get update
sudo apt-get upgrade

sudo apt-get install git
sudo apt-get install golang

cd
git clone https://git.torproject.org/pluggable-transports/snowflake.git

cd snowflake/proxy
go build

I can’t get any further here, I get an error message with “directory not found”.

Is this due to /home/pi?

nohup /home/pi/snowflake/proxy/proxy > /home/pi/snowflake/proxy/snowflake.log 2>&1 &

Thanks

of course directory /home/pi/ did not exist on DietPi as the entire user pi did not exist. If such a user is required, it would need to be created manually.

k, found something else :slight_smile:

//Edit: New Link Install Tor Snowflake on the Raspberry Pi with DietPi.

Btw, the latest version of Go can be installed via DietPi-Software:

apt autopurge golang
dietpi-software install 188

This pulls the latest upstream build while the Debian package is several versions older :slight_smile:.

As alternative to /home/pi you could use /home/dietpi. Latest Raspberry Pi OS doesn’t ship with the pi user anymore either, but one is offered to create a custom login user now on first boot. Something we wanted to do with DietPi as well when time allows.

Thanks, I currently have go1.15.15 installed.
Snowflake should now run according to the tutorial from my second link.

Let’s see, I will look again in the next days for the golang update :slight_smile:

MichaIng

Had now installed it again via DietPi-software 188 → but I still have go1.15.15 linux/arm.
Do i have to uninstall the old version before i install the 188 again?

by the way: root@Snowflake:~# tail -f /var/log/snowflake/snowflake.log
May 3 14:39:45 Snowflake snowflake[20734]: 2022/05/03 12:39:45 In the last 1h0m0s, there were 6 connections. Traffic Relayed ↑ 59 MB, ↓ 4 MB.


AnyDesk_xcsVExth7o.png

Have you purged the APT package and rebuilt snowflake?

Also restart the shell (logout+login) to update the Go paths in the environment.

first uninstalled it via dietpi-software.
then again.

sudo apt-get remove golang-go
sudo apt-get remove --auto-remove golang-go

Paths remained, but version is now up to date. Thanks

Great. Now I see that your second link contains this way of installing Go from upstream builds as well. There is also a step to add the Go paths. If you followed this, that care that paths are not set doubled: dietpi-software adds them for all users via /etc/bashrc.d/dietpi-go.sh, if I’m not mistaken (currently on the road).

I too wanted to set up the snowflake proxy on my fresh dietpi install. Ran into some difficulties with the go install via dietpi-software. It seems that like there could still be something amiss with the Go paths set via dietpi-software

I manually had to add the GOPATH to my .bashrc. This did work when running go directly from the cli. However, when trying to build the snowflake proxy, go was not found on my system.
My current workaround is to uninstall go and install golang via apt.

– Edit
I set up a clean install once more and installed go via dietpi-software. Sadly no bueno on the paths being added on install.

GOPATH isn’t set intentionally. It defaults to ~/go and hence now is consistent with upstream and Debian install.

The Go compiler and tools however should be available in any interactive bash session. Please show:

echo "$PATH"
cat /etc/bashrc.d/go.sh

Alright, this is after a fresh install, having only adguard&unbound, and snowflake build via golang running. I then proceeded to install go via ‘sudo dietpi-software install 188’.

$ echo “$PATH”
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
$ cat /etc/bashrc.d/go.sh
cat: /etc/bashrc.d/go.sh: Datei oder Verzeichnis nicht gefunden

I did notice this output on my screen after installation.


 DietPi-Software
─────────────────────────────────────────────────────
 Step: Installing Go: Runtime environment and package installer

[  OK  ] DietPi-Software | cd /tmp/DietPi-Software
[  OK  ] DietPi-Software | curl -sSfL https://golang.org/dl/go1.19.2.linux-arm64.tar.gz -o go1.19.2.linux-arm64.tar.gz
[  OK  ] DietPi-Software | tar xf go1.19.2.linux-arm64.tar.gz --one-top-level=/usr/local
[  OK  ] DietPi-Software | rm go1.19.2.linux-arm64.tar.gz
export PATH="$PATH:/usr/local/go/bin" /etc/bashrc.d/go.sh
/boot/dietpi/dietpi-software: line 3204: /etc/bashrc.d/go.sh: No such file or directory

probably a bug on our install script. we will have a look

Seems like it. Checking dietpi-software on GitHub shows, that the previous creation of go.sh is missing entirely. Also, I just double checked, /mnt/dietpi_userdata/go is not created.

RP up: DietPi-Software | Go by Joulinar · Pull Request #5852 · MichaIng/DietPi · GitHub

2 Likes

As mentioned in the PR, /mnt/dietpi_userdata/go isn’t used anymore on fresh installs, but projects/modules/crates are created in ~/go now by default, to align with official and Debian Go installs. But GOPATH can still be set of course to overwrite the default.