Live data from Hacker News

How I built this website on a Raspberry Pi

mirawelner.com

81–90 of 94 posts

Re: How I built this website on a Raspberry Pi

#82
post #44

Surpised he does not have a step for a assigning a permanent address for the local network. He mentions it but skips it like it's not needed. a lot of routers like those from att do not allow port forwarding to addresses that have finite lease times.

I didn't know that was a thing you could do! I appreciate the comment and I have added creating a permanent address for the local network in the post and given you credit. I give your HackerNews username credit please let me know if you want your actual name listed.

Also I can tell this post was a good post because people are using he/him pronouns for me in the comments lol. What a world we live in :)

Re: How I built this website on a Raspberry Pi

#83
post #62

Earlier quoted context omitted.

I've heard it called bare metal as opposed to a docker container or VM.

This is the Wikipedia definition which is the same thing as I said. If it's on top of an OS, it's not bare metal. https://en.m.wikipedia.org/wiki/Bare_machine

Yeah, you're correct by the original definition - but in the modern context of Docker/k8s and web servers, "bare metal" is being colloquially used to refer to installing directly on the bare OS, and people understand that.

Re: How I built this website on a Raspberry Pi

#84
post #49

Any DDoS protection? Doesn't really matter with a small personal site, but I run a few solo production apps and they get hit multiple times a month by >100k rps DDoS attacks.

Me too, I need to use cloudflare... I think if he gets hit by a ddos, the pi can go down but since its a simple website and not monetized, the downtime is fine

Yeah. Though I get that it would defeat the purpose of the article, as running it on a Pi as a novelty is the whole point, and if you need to add DDoS protection you'd might as well just throw it on Cloudflare Pages instead.

Re: How I built this website on a Raspberry Pi

#85
post #52

I did something similar in 2016 https://www.e-tinkers.com/2016/11/hosting-wordpress-on-raspb... . Instead of having Apache, I use Nginx. Instead of serving webpage from SD card, I setup a 512MB hard disk except booting still done via the SD card. The site is still running on a Raspberry Pi 3 till this day from my living room.

I checked out your tutorial, its very cool! Do you think the 512MB harddisk makes your site more robust for when there are many queries? My site was crashed last night because of the hackernews hug of death and I may have to upgrade.

As most of my website are static content (blog with html/css), plus the implementation of cache and having a nginx (instead of Apache) help to serves most of the content from cache instead of access to the hard disk. Use of hard disk is trying to avoid the wear-off of SD card, I did in such as way where the boot is still done by the SD card, only the storage are in hard disk.

Re: How I built this website on a Raspberry Pi

#86

> Step 5: Getting an HTTPS Certificate If you’re using Apache2 you might also want to look at mod_md, not just certbot: https://httpd.apache.org/docs/2.4/mod/mod_md.html Also, if you want to minimize the amount of JS, then just drop jQuery and use fetch, it’s reasonably pleasant too: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API Lovely article!

Thank you very much I’m glad you liked it!

I’ll look into fetch and mod_mt - they seem helpful!

Re: How I built this website on a Raspberry Pi

#87

Very cool, very accessibly written. Thanks for sharing. Curious how you handle your router’s public IP changing as (I believe?) this is pretty common depending on the ISP, no?

I am glad you like it! Theoretically, routers have public IPs that change often and you have to buy something to make sure they don't. In practice, this has only ever happened once to me when my router got hacked and I had to get firmware replaced. So while its a major issue if you have a huge site that needs to be reliable, if it is just a personal site it can be okay to just assume it will never change, and if it d…

You can use Dynamic DNS[0]. Your server contacts a remote server and if the IP address has changed the DNS is automatically updated. You can use a free subdomain[1] and CNAME/ANAME/ALIAS[2] your domain's DNS to point to it.

Edit: Njalla supports dynamic DNS records natively[3].

[0] https://en.wikipedia.org/wiki/Dynamic_DNS

[1] https://freedns.afraid.org/

[2] https://en.wikipedia.org/wiki/CNAME_record

[3] https://njal.la/docs/ddns/

Re: How I built this website on a Raspberry Pi

#88
post #63
post #33

Earlier quoted context omitted.

At least encrypt your private key and store it somewhere private, and then store the decryption key in your password manager. Then if either one is compromised you are still safe.

I mean if my password manger is compromised I'm pretty screwed anyway but this is a good idea too.

The whole idea behind 2FA is that if your password manager is compromised, you will still be fine, thats why its so damn important. (also please please please don't use SMS 2FA, it's not secure, it's expensive and there's no reason why I should need mobile phone signal to login to a service.

Re: How I built this website on a Raspberry Pi

#89
post #66
post #65

Earlier quoted context omitted.

Now that's just goofy, I get why they have similar names but it's begging for misunderstandings. https://en.m.wikipedia.org/wiki/Bare-metal_server

Can't remember the name (if it has one), but there's a linguistic phenomenon where words take on opposite meanings from the original. The "Peacemaker" was a missile, "literally" now means "figuratively", "awful" used to mean "awe-inspiring". And apparently "bare metal" now means "runs on an operating system".

OTOH, technical fields develop jargon specifically as a solution to the problems created by semantic drift in vernacular vocabulary.

Sure, languages evolve, but that doesn't mean "anything goes" -- to the contrary, novel mutations have to survive intense selection pressures in order to eventually become part of the standard language.

Where new ways of using existing terms create ambiguity and conflict with existing meanings, their survival chances aren't always great.

Re: How I built this website on a Raspberry Pi

#90
post #67
post #61

Earlier quoted context omitted.

It is not https://en.m.wikipedia.org/wiki/Bare_machine

Although, there are multiple people in the talk section[0] arguing for the "'physical' machine" definition. Might have to get used to it, along with "crypto" and "algorithm". [0] https://en.wikipedia.org/wiki/Talk:Bare_machine

The trendy uses are "algorithim" and "crypto" are specific cases of the general meanings of these terms -- there's no contradiction or ambiguity introduced here, so these uses are OK, although people presuming the narrower trendy meanings in broader contexts are wrong.

This use of "bare metal" does contradict the pre-existing meaning, so is not quite appropriate. What is valid is describing the OS itself as running on bare metal in contrast to running within a VM/container -- but an application running on top of that OS is not running on bare metal.

This isn't particularly egregious, though, since there are negligible cases of actually running applications on bare metal today: if you are talking about applications, the context can usually explain the intended meaning. But that wasn't always the case in the past (PC "booter" software used to be common), so this doesn't necessarily apply retrospectively, and may not be the case in the future, especially considering some of the interesting things companies like Oxide are working on.

Post reply on HN