Ir al contenido principal

Ralsina.Me — El sitio web de Roberto Alsina

Publicaciones sobre software

Home Server Update May 2023

This is a longer-term up­date on the state of my home serv­er. You can read more about it in these 1 2 3 4 5 6 post­s.

Hardware

  • Got some SS­Ds for cheap, so mi­grat­ed it from HDDs to SDDs. Thanks to btrf­s, I could even do that with­out turn­ing the thing of­f.
  • Did some ex­per­i­ments to mea­sure pow­er us­age. It's around 8W when it goes full throt­tle with heavy disk us­age.
  • Work­ing on im­ple­ment­ing a UPS for the whole sys­tem.

Software

Since the last up­date I have added a few new ser­vices:

Filebrowser

I added a we­b-based file­brows­er. It's ... File­brows­er

Why? Be­cause some­times I need to man­age some files. No big deal, al­most nev­er use it.

Ebook Server

It's Kavi­ta and it's pret­ty good, if a lit­tle too ba­sic. I use it to man­age an epub col­lec­tion, and it work­s. Writ­ing scripts to au­to­mat­i­cal­ly tag and add meta­da­ta to ran­dom crap­py ebooks was fun.

Snips

A snip­pet/­paste­bin thing called snip­s.sh and it's re­al­ly nice. I added a small shell script so I can just pipe things to it. I am mak­ing the HTTPS pub­lic at snip­s.ralsi­na.me and keep­ing the SSH pri­vate in my VPN thank you very much.

Had some trou­ble mak­ing it work on ARM be­cause of a ten­sor­flow de­pen­den­cy, but it's run­ning fine.

WatchTower

Watch­tow­er is a tool that mon­i­tors your run­ning con­tain­ers and will dai­ly check if there are new ver­sion­s. If there are, it will up­grade them. Nice to have things up­date unat­tend­ed.

Conclusion

Serv­er is sta­ble

Pet Server (Feb 2023 update)

This is a longer-term up­date on the state of my home serv­er. You can read more about it in these 1 2 3 4 5 post­s.

Not much has changed in it, to be hon­est.

Hard­ware's the same as in the past, ev­ery­thing is work­ing fine. I have a good back­up of the serv­er us­ing what I de­scribed here and I have ac­tu­al­ly test­ed it. I can bring it back up in un­der half an hour, which is ok.

I am con­sid­er­ing get­ting a bet­ter USB hub, be­cause the one it's us­ing now is pret­ty slow for the stor­age. Not slow enough that I can no­tice but slow­er than it could be.

I may re­do the case be­cause I have learned a lot about mak­ing cas­es and can do a bet­ter one :-)

What could im­prove?

  • Some things are tricky to de­ploy in ARM
  • Some of my ad-hoc im­ple­men­ta­tions are clunky
  • I am not re­al­ly us­ing the whole me­dia serv­er im­ple­men­ta­tion all that much

How hap­py am I with it? Su­per hap­py. I use it ev­ery day, it's re­li­able and ba­si­cal­ly main­te­nance-free.

Pet Server (September 2022 update)

This is a longer-term up­date on the state of my home serv­er. You can read more about it in these 1 2 3 4 post­s.

What's the hardware nowadays?

  • Radxa Ze­ro: 4-­core 4GB RAM, 32GB eMMC
  • 2 1TB HDD over USB
  • 100Mbps eth­er­net wired con­nec­tion to the router

And ... so far, it's more than enough. No strain :-)

What is it running?

Al­so back­ups via restic and oth­er ran­dom things. I have a sep­a­rate oc­to­print serv­er but I may move it here.

Really, it runs all that?

Yeah, and it works just fine. Of course this is most­ly be­cause I am the on­ly re­al user, but hey, it work­s.

Anything else you would want to run?

  • Maybe some sort of push no­ti­fi­ca­tion thingie so I can no­ti­fy my phone if there's a prob­lem
  • Maybe grafana? But don't care enough yet.

Was it worth it?

I could run all this on cloud­s, but the hard­ware I am us­ing would cost maybe 100 dol­lars, and month­ly fees for ser­vices will quick­ly reach that amount and sur­pass it. I am al­ready pay­ing for the band­width any­way.

OTOH I have spent maybe 50 or 60 hours set­ting this up and if I look at my hourly rates ... ick.

Anything weird?

I re­al­ly don't un­der­stand oth­er peo­ple's home­lab­s, they seem wild­ly over­pow­ered.

Owning a Pet Server in 2022 (Part 2)

Owning a Pet Server in 2022 (Part 2)

In part 1 I de­scribed why I want­ed this server, and some of the trade­offs and de­ci­sions I had to make to make it hap­pen and work nice­ly.

This is an up­date af­ter re­view­ing some of those de­ci­sion­s, and adding some more soft­ware.

Hardware Changes

  • I added a pow­ered hub. This makes the two-HDD sit­u­a­­tion much more man­age­able avoid­ing un­der­­volts that could harm the hard­ware. I used a cheap pow­ered USB HUB.

  • I tried us­ing a Pi 4 with 4GB of RAM, USB 3 and faster CPU and ... there was no per­­ceiv­able dif­fer­­ence in per­­for­­mance. So, it's back to a Pi 3B+ with 1GB of RAM.

Mem­o­ry us­age hov­ers around 500MB so no prob­lem there.

  • I will get a 4-­port white HUB and in­te­grate it in­to the case (or do a new case) at some point.

Software Changes

  • Moved all ser­vices to run dock­er­ized.

I was re­luc­tant at first, sus­pect­ing a per­for­mance im­pact. Well, it's neg­li­gi­ble and it makes run­ning things MUCH sim­pler.

Spe­cial h/t to lin­uxserv­er.io for their nice, qual­i­ty con­tain­er­s.

  • Added Hedge­­Doc a kick­­ass mark­­down ed­i­­tor / note-­­tak­ing ap­­pli­­ca­­tion / many oth­­er things. Us­ing it to write this!

  • Added FreeRSS as a re­­place­­ment for my us­age of In­­ore­ad­er.

  • Added Medusa, Tran­s­mis­­sion and Jel­­lyfin which com­bined turn in­­­to a nice "hey, I want to watch this TV show" so­lu­­tion.

  • THi­­sis in ad­di­­tion to a we­b­site, gitea and mux­imux to give a uni­­fied fron­­tend to ev­ery­thing.

How does it perform?

I can be stream­ing a video via Jel­lyfin (with transcod­ing) and read­ing news on FreshRSS with nice re­sponse times, and mem­o­ry us­age hov­ers around 500M­B, which CPU load is around 4.

So, I think this is about as far as I can push it, but it's a lot of func­tion­al­i­ty for a tiny, cheap, home serv­er.

Owning a Pet Server, in 2022

Introducción

El pén­du­lo más len­to de la tec­no­lo­gía es el que se mue­ve en­tre la cen­tra­li­za­ción y lo dis­tri­bui­do. To­ma años o dé­ca­das pa­ra os­ci­la­r. Por eso al­gu­na vez tu­vi­mos com­pu­ta­do­ras con ter­mi­na­les bo­ba­s, y des­pués com­pu­ta­do­ras per­so­na­le­s, que fui­mos con­vir­tien­do en ter­mi­na­les de in­ter­ne­t, que es adon­de es­ta­mos aho­ra.

Tal vez pa­rez­ca que no se va a mo­ver de ahí, pe­ro así se sen­tía tam­bién las ve­ces an­te­rio­res. Tal vez os­ci­le, tal vez no, quién sa­be, no soy fu­tu­ró­lo­go, pe­ro yo lo voy a mo­ver un po­qui­to, pa­ra mí, en un área es­pe­cí­fi­ca: no es­toy con­ten­to con que mis da­tos vi­van prin­ci­pal­men­te en gran­jas de ser­vers que tie­nen due­ños que no son yo.

Así que en vez de te­ner mis da­tos vi­vien­do en un ser­vi­dor "ga­na­do" en una gran­ja de ser­vi­do­res, aho­ra vi­ven prin­ci­pal­men­te en un ser­vi­dor mas­co­ta, en ca­sa.

Les pre­sen­to a ... pi­nk­y.

Foto de una pequeña compu de plástico blanco

Pi­nky no te va a asom­brar con sus ca­rac­te­rís­ti­ca­s, es tal vez el ser­ver prác­ti­co más len­to po­si­ble.

  • Ras­pbe­rry Pi 3b+, 1GB de RAM
  • tar­je­ta 16­GB SD
  • 2x500­GB HDD (es­pe­ja­do)

Pe­ro es más que su­fi­cien­te pa­ra al­gu­nos ti­pos es­pe­cí­fi­cos de tra­ba­jo que ne­ce­si­to. En es­te do­cu­men­to voy a tra­tar de ex­pli­car por qué los quie­ro ha­ce­r, des­cri­bir­lo­s, ex­pli­car las li­mi­ta­cio­nes y el pro­ce­so que me lle­vó a la de­ci­sión de adop­tar es­ta so­lu­ció­n.

Software

Una de las co­sas más im­por­tan­tes acá es Gi­tea.

Es di­fí­cil exa­ge­rar co­mo cam­bia las co­sas pa­ra un ti­po es­pe­cí­fi­co de usua­rio: Gi­tea ha­ce que te­ner tu ser­vi­dor de git sea fá­cil y ba­ra­to.

¿Y qué? pre­gun­ta­rá al­guno.

Bue­no, un ser­ver git es útil co­mo ba­ckend pa­ra mu­chas co­sas úti­le­s, aún si no te in­te­re­sa ha­cer de­sa­rro­llo de so­ftwa­re (que a mí si me in­te­re­sa).

Pass

Por ejem­plo, su­po­né­te que que­rés ma­ne­jar tus pro­pias pa­sswor­d­s, en vez de con­fiar en un ser­vi­cio de ter­ce­ro­s. Una ma­ne­ra de ha­cer­lo es usar pa­ss que es una im­ple­men­ta­ción open sour­ce so­por­ta­da por ca­si to­dos los bro­w­ser­s, apli­ca­cio­nes de es­cri­to­rio, ter­mi­na­les y que se yo.

Pe­ro si te­nés más de un dis­po­si­ti­vo ... ¿có­mo sin­cro­ni­zás tus pa­sswor­ds en­tre ello­s? Sí, usan­do un ser­ver gi­t.

Chezmoi

Y sí, uso más de una com­pu. Ten­go una en ca­sa, una en la ofi­ci­na, otra pa­ra tra­ba­ja­r, y me es­toy ha­cien­do al­gu­nas ca­se­ras con ras­pbe­rry pis, y quie­ro que al­gu­nas co­sas fun­cio­nen de la mis­ma ma­ne­ra en to­das ella­s.

Chez­moi Es una im­ple­men­ta­ción del con­cep­to de do­tfi­le­s.

Bá­si­ca­men­te le de­cís que ma­ne­ja al­gu­nos de tus ar­chi­vos de con­fi­gu­ra­ció­n, los que se guar­dan ver­sio­na­dos y com­par­ti­dos en­tre tus com­pus usan­do ... si, un ser­ver gi­t.

Me lle­vó un po­co de es­fuer­zo pa­ra de­jar­lo en un es­ta­do usa­ble, pe­ro creo que aho­ra le es­tá agre­gan­do va­lor a mis com­pus.

Mi Sitio

Si, ya sé, muy 2003. Pe­ro bue­no, a mí me sir­ve. Una ubi­ca­ción cen­tral pa­ra:

  • Co­sas que es­cri­bo (co­mo es­ta)
  • Li­bros que leo y co­men­to, via goodrea­ds
  • Vi­deos que ha­go, via you­tu­be

De nue­vo, una de las me­tas es que mis da­tos son míos así que to­das esas lis­tas de li­bro­s, co­men­ta­rios y ca­li­fi­ca­cio­nes y de­más ... ¿Por qué de­be­rían es­tar so­lo en goodrea­d­s? ¿Y si Ama­zon lo cie­rra?

Co­mo pue­do es­cri­bir so­ftwa­re, lo aga­rro to­do y lo pon­go en mi si­tio, y lis­to. Y cual es el lu­gar don­de es­tá to­do eso ... sí, un re­po gi­t, que se buil­dea y de­plo­yea au­to­má­ti­ca­men­te.

Acla­ra­ció­n: mi si­tio es­tá prin­ci­pal­men­te en una VPS que pa­go pa­ra otra co­sa, pe­ro hay un es­pe­jo en ho­me.­ral­si­na.­me que es­tá, efec­ti­va­men­te en pi­nk­y.

Gateway a la VPN de mi oficina / casa

Es­tos ser­vi­cios ne­ce­si­tan ac­ce­der­se des­de al­gu­na par­te. Usan­do unos ge­ne­ro­sos ser­vi­cios gra­tui­tos de fly y [tailsca­le])(h­ttp­s://­tailsca­le.­co­m) mas un po­co de es­fuer­zo de con­fi­gu­ra­ción pue­do, des­de cual­quie­ra de mis com­pus o mi ce­lu­la­r, ac­ce­der a to­dos los de­má­s, no im­por­ta don­de es­tén siem­pre y cuan­do ten­gan al­gún ti­po de co­ne­xión a in­ter­ne­t.

Hardware

¿Por qué ESTE hardware?

Por­que ya lo te­nía.

  • La ras­pbe­rry jun­ta­ba tie­rra des­de pro­yec­tos an­te­rio­res.
  • Dos HDD de 500­GB que me re­ga­la­ron o de no­te­books vie­ja­s.

Tu­ve que com­prar 2 ca­bles US­B-S­ATA (mas o me­nos 1000 pe­so­s) y un ca­ble mi­cro­-usb mas lin­do (200 pe­so­s) por­que era lin­do.

Performance

¿Es len­to, pe­ro ... es len­to?

La ras­pbe­rry pi 3b+ tie­ne 4 co­res, así que pue­de eje­cu­tar gi­tea, un web ser­ver y al­gu­nas otras co­sas sin pro­ble­ma.

Tam­bién es USB 2.0, así que el ac­ce­so a dis­co es ... len­ti­to.

Por otro la­do, la ma­yor par­te del tiem­po ac­ce­do a co­sas chi­cas (un git pu­ll es muy efi­cien­te) o por un en­la­ce len­to (30M­bp­s) así que el cue­llo de bo­te­lla ca­si nun­ca va a ser el dis­co.

Una co­sa es­pe­cí­fi­ca que no tie­ne sen­ti­do en es­te ser­ver es es­pe­ja­do por RAI­D, por­que el te­ner que ha­cer los wri­tes dos ve­ces lo ha­ría to­do más len­to.

So­lu­ció­n: apa­go uno de los dis­cos (a­sí no se gas­ta) y lo pren­do a la no­che pa­ra ba­cku­pear el ser­ve­r.

Adi­cio­nal­men­te una vez por se­ma­na sa­co el dis­co se­cun­da­rio y lo co­pio offsi­te.

Electricidad

A to­do lo que da, mi co­si­to USB pa­ra me­dir el con­su­mo que com­pré por un dó­lar (no le creo mu­cho) di­ce que pue­de lle­gar a usar 1.1A a 5v así que en pro­me­dio es­tá usan­do al­go co­mo 4W.

Con mi bo­le­ta de EDE­NO­R, eso es apro­xi­ma­da­men­te 10 cen­ta­vos de dó­lar al me­s.

La Carcaza

Aga­rré una car­ca­za "s­lee­ve" pa­ra ras­pbe­rr­y, 2 car­ca­zas "s­lee­ve" pa­ra dis­cos de 2.5, las pe­go­teé con pa­ra­le­le­pí­pe­do­s, im­pri­mí to­do en la im­pre­so­ra 3D más ba­ra­ta que pue­de com­prar el di­ne­ro. Salió bár­ba­ro.

Co­mo es una Pi 3 y no una Pi 4 so­por­ta cooling pa­si­vo sin pro­ble­ma­s. Las car­ca­zas de los HDD los im­pri­mí a 50% in­fi­ll pa­ra que amor­ti­güen un po­co el rui­do. Se es­cu­cha a ve­ces un cli­ck de los dis­co­s, pe­ro es bá­si­ca­men­te si­len­cio­so.

Tam­bién es chi­quiti­to, mas o me­nos 10­cm en ca­da di­men­sió­n.

Conclusión

Lle­va un mes an­dan­do (sin la car­ca­za, eso es nue­vo) sin pro­ble­ma­s. Tie­ne up­da­tes au­to­má­ti­cos de so­ftwa­re pa­ra to­do, y si se lle­ga a rom­per al­go no pa­sa na­da, pue­do es­tar días sin el ser­ve­r.

En re­su­men, lo ca­li­fi­co co­mo un éxi­to ro­tun­do.


Contents © 2000-2023 Roberto Alsina