squeezing it all out of a rpi 3





i think i asked at some point when does a towel become a rag (and back)


ive had this raspberry pi 3b laying around for a few solid years now. cant really tell how the idea suddently came to me but a few weeks ago i decided on finally giving it a use and make a media streaming/all purpose server out of it.

there were two main things i wanted it to do:

the plan was i leave it plugged in my room at home and use it to torrent when im in the uk. the internet speeds in my home country are huge plus the isps dont really care about piracy. id send it the magnet link then get the files later via sftp. my main goal of the project was the streaming thing though. the idea of a personal netflix sounded real good, much more comfortable than browsing the file explorer randomly. anyway


the pi setup



for my os of choice i went with dietpi, which is a pretty based minimal and lightweight debian based distro designed for SBCs. the pi 3 is not very powerful at all and dietpi has neat comparison stats. another huge thing i like about dietpi is dietpi-software which is a list of ready to run software already optimised for your machine. it has pretty much most of the things youll need.
after this its fairly simple for a while

  1. installed git and python
  2. setup this hat display
  3. changed ssh srv from dropbear to openssh
    • (i think i had a reason for doing this but i dont remember anymore)
  4. install fail2ban

nice and easy. next issue came in the form of power supply. i bought a 2tb 2.5in hdd to use as storage for the served media and torrents, however none of my microusb (yeah the pi3 uses that) chargers were powerful enough. i spent the next few days tracking down a good enough adapter, which was supri. eventually i found this 5V 3A charger with a power switch on it on a second hand selling website my country uses. Had it not been for that, I would've gone into one of the markets where they sell basically everything, especially electronic repair/spare parts and stuff. I got a Y-head screwdriver there for like so cheap a few months back.


jellyfish? ><> ><>



for the media streaming i went with jellyfin. the other options were either plex or emby, which are both closed source in some manner and have feature behind paywalls. jellyfin does pretty much the same things for free and its also open src so it has community support i assume. now at this point everything was going well, i only added 3 movies to the library only test around, and it really did work well and nice on the local network. even later when i opened it to the internet it was smooth and good and clean. unfortunately that didnt last long tho lmao


blessed caddyserver



the way i was gonna make it all from outside home network was using a reverse proxy. ive never done that before and the only sollutions were using nginx and docker. im fine with nginx but i kinda wanted to avoid using docker. (side note. yeah i know you can probably do it without docker) anyway i found caddy which is the basedest and simplest sollution to making a server that i know of. literally all you have to do is install caddy, make a caddyfile, and run it. that's it. assuming your domain records are in order, caddy takes care of everything, including getting ssl certs from lets encrypt. not to mention how easy it is to make the caddyfile. unreally based.

as for the domain, i got freckleskies.net from njal.la, a based registrar that doesn't ask for your information and instead they supply their own. this was all easy, setup the main A record then some CNAMEs for subdomains. because i have a dynamic ip from my isp, i needed to keep changing the records so the domain points to where its supposed to point. i did this with a simple python script that every 5 minutes checks for its current ip by requesting the ipify api and if its different than what it had stored, changes the main A record with the njal.la api. 50 lines of python code running on boot, cant believe people actually pay for this shit.

protip: lower your ttl. it took me a while to figure out that i need to lower my ttl when i make ip changes or something, god that was frustrating.


the (d)rag



alright, everything's set up (except the torrenting part but i focused on jellyfin first). you can access it online easy, some friends said streaming juno was flawless and fast. i can finally import my library and be done with this.

yeah

mind you, i didn't even really move all of it, just 300gb. jellyfin slowed down to a crawl, the pi froze entirely countless times. this is apparently a known issue with jellyfin. i wont bother you with the details. the pi isnt strong enough to fully scan the library. i stopped it eventualy and just messed around with what had already been imported. none of the vids imported can be streamed anymore, not even the ones that were in already for testing. juno for example, which worked fine when it was alone on the hdd, takes like 5 mins to start and also stutters randomly. quality is a struggle as well. for some reason ever since i tried to import the lib, the cpu runs by default at 70% usage and the swap is nearly full too, no matter how many cold reboots i make. speaking of cold reboots, i cant warm reboot it anymore either lmao. it just gets stuck on the reboot. i looked it up a little bit (i could see where exactly it got stuck bcos of the screen hat attached to it, see it was useful somewhat) but not much couse at this point i was pretty tired of this. from the little that ive gathered some files had corrupted or something. anyway


???



so the kino pi wont work, thats alright i guess. it wasnt really wasted time honestly as it was great linux experience for me. before this i only had kubuntu on dual boot and used it for work, but i havent done anything too interesting with it. im definitely more comfortable with linux now after making something like this, pretty neat experience.

ill retaliate. wipe the sd card and hdd, start over. this time ill only make use it for the piracy stuff and keep as an online storage i guess. maybe finally look into sonarr/radarr, heard those are useful. maybe also an email server, why not, what can go wrong. caddy is still amazing so itll be there serving freckleskies.net and the other services. man do i love caddy. oh i also really should get youtube-dl going, genos documentaries need to be preserved, among other things. oh well, ive got things to try