A small web and file server I built together with my friend and long-time collaborator Paul Bille. Currently broken because I short circuited it :(
I have not been so good at writing the log lately, but will try to be better again. The server is currently standing at the Sandberg. That means, it's hidden behind a firewall/the router, since I don't have access to the router to set up port forwarding etc.
I got around this by asking Jan Kees to help me get around it. He set up a Reverse Poxy (I think that's the correct term), which means that all the traffic of the Server is forwarded through the pub.sandberg.nl server. In simple terms: we created a new subdomain, cloud0.192168285.xyz, which points to pub.sandberg.nl. Pub Sandberg then forwards this request to our server. It knows where my server is, because our server has an open SSH connection with pub.sandberg.nl.
Effectively this renders our server nomadic, in that it can serve from everywhere in the world, as long as it has an internet connection, and the pub server is online. So far so good.
The setup is a bit more complicated, and I will go into detail in one of the next logs. For now the issue is how to open this connection on boot. Right now, whenever I start the server, I have to run the ssh command
ssh -fNR 18443:localhost:443 si &
The ampersand means it will run in the background, apparently. This opens the SSH tunnel. But, ssh connections sometimes drop. This is why I use the autossh command instead:
autossh -M 18444 -o "PubkeyAuthentication=yes" -fNR 18443:localhost:443 si &
This actually works really well, and even over night the services I run remain online. Now the question is how to get this to work automatically when the server boots. This way I could restart it remotely, for example, and ensure I would be able to connect to it again once it has started up (I actually still need to set up the reverse tunnel for ssh but that's another thing).
There is a file called rc.local which runs things when we boot, but I am unable to get this to work. I also followed this description, and created a systemd service file, but the result is the same. It seems that both these approaches run the command as root, which doesn't work for some reason (might be because no ssh setup with si?). Also as soon as the command is run as root once, it doesn't work anymore to run it as a user.
I've had to do a lot of other things during the day but frustratingly this has taken me all day. I briefly ran into Ada just now, she mentioned I should try setting up a cronjob. Turned out very easy. I followed this guide. The cron job I defined is, giving it 10 seconds before running the script to make sure it's logged into the wifi :
@reboot sleep 10 && /home/pleb/fw2si.ssl.autossh.sh
The executable script we run (fw2si.ssl.autossh.sh) looks like this:
#!/bin/bash
autossh -M 18444 -o "PubkeyAuthentication=yes" -fNR 18443:localhost:443 si
I am happy to say that this finally worked!
Talked with my friend Franz. To set up SSH tunneling, I have to google it lol.
Ada mentioned Zerotier. It creates a network of personal devices, which for example would let me check if my server is online even if I cannot reach it or autossh is not working again. Might be worth checking out.
I finally connected the fan! Last week, when using the GUI and working the cloud with another user, I realized that the Ordoid got crazy warm. So I finally went and connected the fan. I found an old forum entry of someone doing this, and explaining the process: https://forum.odroid.com/viewtopic.php?f=171&t=36030
In order to connect the fan I had to get a JST P4 GH connector (Japanese Solderless Terminal, 4 Pin, 1.25mm pitch, or distance between pitch) and connect the cables to the fans connector. Luckily the person from the forum included images which I could just match since my connector had different colors. For me it was:
Blue -> Green
Green -> Yellow
Yellow -> Black
Black -> Red
Then it was just a matter of rebooting and entering the BIOS and changing the fan speed. This however didn't really seem to work. I checked this by installing the libraries stress and sensors and ran
$ stress --cpu 8 --io 4 --vm 2 --vm-bytes 128M --timeout 10s
$ sensors
The CPU went up to 80 Celsius but the fan never changed speed. I suspect that is because it's a 12V fan in a 5V connector. I will ask Jan Kees if maybe it's possible to draw power from one of the SATA ports, which is what someone in the forum suggested.
Met with Jan Kees today and asked him some questions.
I finally figured out how to do the SSH forwarding, basically it was already set up. I asked him about
(redacted)
Lastly we talked about the fan. I asked if I could just connect to the 12V+ SATA connector, he said it's pretty fool proof. Well he made the calculation without me: I think I broke the computer. It doesn't turn on anymore or light up. Fuck.
Just to confirm, I broke the computer. I will have to find a replacement. This sucks.