6 ms·
Run your ghost blog on Raspberry Pi for free
- vira28 5y agoauthor here: I tried port forwarding (because I never did in the past) and couldn't figure how to do it. capture here https://viggy28.dev/article/pain-of-setting-up-port-forwarding-in-xfinity/ https://viggy28.dev/article/pain-of-setting-up-port-forwardi... I guess Alex's inlets (https://github.com/inlets https://github.com/inlets) might do it too. I would love to hear other alternatives.
- jpillora 5y agoPort forwarding is fairly simple. All routers should support it. Forward port 443 to local-rpi-ip-address:443. Setup caddy/traefik. Create A record to public ip. Enable tls. Enable file hosting. Done: you now have TLS static website without any 3rd parties. That said, cloudflare is super handy for dns, and for proxying specific domains, where you don't want to expose your public ip.
- vira28 5y agoThanks. Xfinity (my ISP) supports only TCP and UDP for Xfi Gateway and not HTTP/HTTPS. The thing which I don't know is how to remove Xfi Gateway and use my own gateway/router.
- Thorrez 5y agoHTTP and HTTPS are layer 7 protocols that both go inside the layer 4 protocol TCP. So port forward TCP and you'll be good. https://en.wikipedia.org/wiki/OSI_model https://en.wikipedia.org/wiki/OSI_model
- vira28 5y agoPerfect. Thanks. That was my doubt. Will try it out.
- WrtCdEvrydy 5y agoYeah, most routers have a predefined list of "Applications" but you can add a custom application with custom port. Back in the day, DynDNS actually allowed the IP to DNS as a free service.
- Thorrez 5y agoOh, I forgot to mention HTTP uses TCP port 80, and HTTPS uses TCP port 443.
- sodality2 5y agoUnfortunately residential networks usually don't have static IP's so the IP changes on reboots. Updating the DNS record every time would probably be a PITA.
- 27100974 5y agoCouple of notes: You can use a DNS updater like this one: https://github.com/timothymiller/cloudflare-ddns https://github.com/timothymiller/cloudflare-ddns The bigger problem would be if your ISP implemented CGNAT.
- ekianjo 5y agoEasily taken care of by duckdns for example
- skeletonjelly 5y agoAnd then you have to hope your ISP doesn't use CGNAT
- sodality2 5y agoThen I can't hook it up to a real domain like google.com, just a subdomain of whatever site is running it.
- anaganisk 5y agoIf you are going to use inlets, which needs a bastion host. I would rather just suggest to jump in and use wireguard VPN instead on a $3.5 vps on linode or lightsail. You get more control over your connection and firewall capabilities than inlets, which locks down premium capabilities. Also Cloudflared tunnel will timeout and turn off your endpoint after a network disconnection. If you notice the systemd default file that comes with it, you will notice it restarts after a day. So you will have significant downtime, if your home network or power goes down.
- spraveenitpro 5y agoWhat about WordPress?
- jhunter1016 5y agoGhost has some of the best self-hosting documentation out there. I self-hosted for a while but decided I didn’t want to deal with upgrades and wanted to support them as a company. So I’m paying for a manager solution.
- vira28 5y agoAgree. Very good point. I am looking at their GH sponsor page. Will do it. BTW, I checked Ghosting pricing https://ghost.org/pricing/ https://ghost.org/pricing/ and I see Basic for $29. What is manager solution?
- sarangab 5y agoNice work! How does this compare with a self-hosted wordpress?
- vira28 5y agoHonestly, I have never used Wordpress and I think there is not much difference. Both are CMS. Things which I liked with Ghost: 1. Easy to write, publish (that's one of the biggest challenge for at least me to write more) 2. Lot of good add-ons (I guess Wordpress also will have same)
- vorpalhex 5y agoNode JS based instead of running a full LAMP stack. I believe ghost supports sqlite for low traffic.
- vira28 5y agoCan confirm. Currently it does use Sqlite. Of course, one can replace it with mysql or mariadb.
- anaganisk 5y agoI've got to add that if your raspberry pI doesn't have power backup or for some reason your network does down, cloudflared tunnel (as used in the post) shuts off after sometime and will not reconnect again till a day(default timeout for cloudflared tunnel to restart). If this is unmonitored you might end up showing an error page for a long time.
- lukevp 5y agoIs this info current? In the post announcing free CloudFlare tunnel for all users [1], named tunnels and enhanced reconnection capabilities were also introduced. They seem to be specifically addressing the issue you mentioned, but I haven’t tested them yet. [1] https://blog.cloudflare.com/tunnel-for-everyone/ https://blog.cloudflare.com/tunnel-for-everyone/
- vira28 5y agoGood point. Yes, a lot of reliability improvements for Tunnels announced during Developer week. I will certainly test this problem sometime and post here. Thread on the community seems relevant: https://community.cloudflare.com/t/getting-cloudflared-to-run-my-tunnel-as-a-service/226876/13 https://community.cloudflare.com/t/getting-cloudflared-to-ru...
- skybrian 5y agoHmm, I'm wondering if it makes sense to push static pages to Cloudflare Pages and take the Raspberry Pi out of the serving path entirely?
- graton 5y agoThe have a pretty good blog post about improvements made and de-coupling they have done: https://blog.cloudflare.com/argo-tunnels-that-live-forever/ https://blog.cloudflare.com/argo-tunnels-that-live-forever/
- cstrat 5y agoMaybe I don't understand docker as well as I'd like - but why do you create the named volume instead of simply mapping to a local folder on the host? In my experience mapping to a local dir is nice because you can browse the files on the host machine and can implement backups etc... quite easily. When you do a named volume like that, where are the actual files on the host?
- galenguyer 5y agoOn Debian they end up under /var/lib/docker/volumes/
- cstrat 5y agoAh ok cool, I guess it isn't hard to find then. I usually have my docker-compose.yml file in a dir along with the mapped volume directories. Allows me to just rsync that one folder to capture all config & data. Are names volumes just a way to not have to worry about the files and leave them handled by docker?
- kcb 5y agoYea a use case would be to to persist application data when updating by pulling a newer container. Mapping to the host introduces the possibility of conflicts between the host and/or other containers.
- vorpalhex 5y agoYou can move them as well.
- killingtime74 5y agoIs Argo free? I only see paid options
- killingtime74 5y agoThey haven’t updated their docs yet https://blog.cloudflare.com/tunnel-for-everyone/ https://blog.cloudflare.com/tunnel-for-everyone/
- vira28 5y agoAFAIK, Cloudflare Tunnel (used to be called as Argo Tunnel) is free. Argo (smart routing) is usage based. PS: From https://www.cloudflare.com/products/argo-tunnel/ https://www.cloudflare.com/products/argo-tunnel/, I do see "To start using Argo Tunnel, you'll need a Cloudflare plan and an Argo subscription." - I haven't enabled Argo subscription and I am able to use Tunnel. So there is some confusion.
- orliesaurus 5y agoIs this better than running a static site/blog locally generated and hosted on github/gitlab/cloudflare pages?
- whoisjuan 5y agoHe said the blog is for his dad. Clearly he just wants to setup something simple with a GUI and that is self-hosted. What you’re suggesting doesn’t accomplish any of those things.
- yawnxyz 5y agowould it possible to create something w/ a GUI like Ghost but hosted on Cloudflare pages/workers? It's hard for me to understand why something as simple as a blog needs a server
- conradludgate 5y agoIf you want to write one for the rest of us, that would be awesome! But ghost is well known, well tested and has plenty of customisation options
- orliesaurus 5y agoisn't that just a headless CMS set up? I hacked something like that for my wife so she can blog...It uses Hexo [1] and a web-ui and a bash script that opens up the localhost/admin url into a fresh browser and then when she closes the script it kills it and frees resources back :) [1] https://hexo.io/ https://hexo.io/
- odyslam 5y agoHey OP, I have made a similar setup. One question that I have not yet answered and thus I am changing setup is how secure is to "give" your IP to everyone on the internet. My assumption is that your home-router has security vuln that we don't know about and could be bypassed by hackers who are willing to mess with you. Even though you may have taken precautions, such as opening only very specific ports, etc.
- vira28 5y agoThose are something I just randomly created.
- dang 5y agoThis is not a valid Show HN. Please read the rules: https://news.ycombinator.com/showhn.html https://news.ycombinator.com/showhn.html.
- vira28 5y agoSorry, wasn't aware of that.
- torstenvl 5y agoSorry, what rule does this post violate? Maybe I'm under-caffeinated but I'm not seeing it.
- dang 5y agoOff topic: blog posts [...] and other reading material https://news.ycombinator.com/showhn.html https://news.ycombinator.com/showhn.html It's a fine HN submission, just not a Show HN.