133
submitted 1 week ago* (last edited 5 days ago) by KazuchijouNo@lemy.lol to c/selfhosted@lemmy.world

So, I've been trying to accomplish this for a while. First I posted asking for help getting started, then I posted about trying to open ports on my router. Now, I proudly post about being able to show the world (for the first time ever) my abysmal lack of css and html skills.

I would like to thank everyone in this community, specially to those who took the time to answer my n00b questions. If you'd like to see it, it will be available at: https://kazuchijou.com/

(Beware however, for you might cringe into oblivion and back.)

Since this website is hosted on my desktop computer, there will be some down-time here and then, however I'll leave it on for the next 48 hours (rip electricity bill) only for you guys to see. <3


Now, there are a couple of things that need addressing:

I set it up as a cloudflare tunnel and linked it to my domain. However, I still don't know any docker at all (despite using it for the tunnel), and the process was too incredibly and stupidly easy. I don't think I learned as much as I expected and I didn't feel challenged at all.

The original idea was to do some port forwarding. (This was foolish and a bit of a waste of time). Despite getting a "public-ip-address" from my ISP, I still was unable to open ports successfully. I kept getting the same error again and again. If you'd like to read my original post about port forwarding you may follow this link: "[Solved] ((lie)) Noob stuck on port-forwarding wile trying to host own raw-html website. Pls help".

While I know doing this represents a security risk, I still wanted to at least have a small success with port forwarding. I just wanted to have the raw-internet-connection experience, you know? like, the basics and such. And Cloudflare is holding my hand way too hard, I want to feel like I can shoot myself in the foot (without actually doing so)

But to be honest, I'm quite happy with the outcome. There are many other avenues I'd like to explore in the future, like setting up a reverse proxy with nginx or even darknet hosting (as sugested by another commentor).

I hope to keep learning and some day help another poor soul like myself in a similar situation. I thank you again guys, you're the best.

[TL;DR] This is the best and most helpful community ever! thx <3

top 39 comments
sorted by: hot top controversial new old
[-] khapyman@sopuli.xyz 25 points 1 week ago

I'm ancient, websites with little to no CSS (and absolutely no client side scripts) are refreshing. I don't know if I'd like all of web to be like that, but there's something to be said for the absolute individuality of everybody writing their sites from scratch.

It's way too easy to spin up a Wordpress installation and be done with it.

Salute!

[-] KazuchijouNo@lemy.lol 8 points 1 week ago

Yes! I actually like that style a lot more. It's lighter, without bloat, and minimalist. Only html and css.

And I'd like to say "yeah, I wrote it all by hand btw"

[-] K3can@lemmy.radio 7 points 1 week ago* (last edited 1 week ago)

Nice. I wrote mine "by hand", too. No CSS, just raw HTML. I think it's a more personal experience than just using whatever random template some all-in-one web hosting company offers.

[-] KazuchijouNo@lemy.lol 1 points 1 week ago

Nice!! I agree with you. The experience is more personalized. You can show people who you are, and show them that you're not just another default template. I loved the gifs btw. Are you self hosting it or is it on a vps?

Btw, how did you do the side panel menu-thingy? I'd appreciate if you just pointed the direction, I'll read the docs myself

[-] K3can@lemmy.radio 1 points 1 week ago

Self hosted from my homelab on an nginx server. I also self host my blog, which has some info on my whole set up. My blog uses some basic bloging software, though, rather than being hand-made.

The "side menu thingy" is achieved through HTML "frames". It's an element of HTML that's pretty much extinct nowadays, but was all the rage when I built my very first page back in the day.

[-] user224@lemmy.sdf.org 16 points 1 week ago

Just in case: If your storage is completely full all of a sudden, check /var/log/nginx if you haven't pointed the logs elsewhere.

I know I was pretty confused to find my storage absolutely full, then I found the multi-GB error.log file. When a network interface it was listening on disappeared it filled with errors as such:

2024/12/10 07:57:06 [alert] 20420#20420: accept4() failed (22: Invalid argument)
2024/12/10 07:57:06 [alert] 20420#20420: accept4() failed (22: Invalid argument)
2024/12/10 07:57:06 [alert] 20420#20420: accept4() failed (22: Invalid argument)
2024/12/10 07:57:06 [alert] 20420#20420: accept4() failed (22: Invalid argument)
2024/12/10 07:57:06 [alert] 20420#20420: accept4() failed (22: Invalid argument)
2024/12/10 07:57:06 [alert] 20420#20420: accept4() failed (22: Invalid argument)

(I just reproduced that now on-demand, thus the date.)

There's a tool called logrotate to take care of logs, but I just did the stupid and lazy thing...

error_log /dev/null;

Well, in case you get the idea to run NGINX in Termux, and then later you find your phone hot, stuck in a bootloop, it's possible the error.log filled the storage causing Android to crash because it now can't even write system files.
Not that I would have done such thing...

[-] KazuchijouNo@lemy.lol 8 points 1 week ago

Thanks a bunch!
I will certainly consider this, I had no idea nginx created these log files.

If anything, I can just rm them into oblivion right?

[-] atzanteol@sh.itjust.works 8 points 1 week ago

Sorta. If the log file is open then your rm won't take effect until the application closes the file. You won't see the file anymore but it will still be taking up space. So if nginx is running when you delete the logs you may need to either stop it or restart it depending on how nginx handles this.

[-] Cris_Color@lemmy.world 8 points 1 week ago
[-] mac@lemm.ee 7 points 1 week ago

Unsure if this interests you, but check out Jekyll, a static site generator https://jekyllrb.com/

Basically you write in markdown and have Jekyll generate the site for you

[-] yonder@sh.itjust.works 2 points 1 week ago

Hugo is also pretty cool.

[-] KazuchijouNo@lemy.lol 2 points 1 week ago

Thanks! I'll check it out!

[-] kreskin@lemmy.world 7 points 1 week ago
[-] KazuchijouNo@lemy.lol 5 points 1 week ago

You got me

I've been raw-blogging all week B)

[-] 3nthusiast@infosec.pub 4 points 1 week ago
[-] KazuchijouNo@lemy.lol 1 points 1 week ago
[-] elperronegro@lemmy.world 3 points 1 week ago

Well done. I have been having similar port forwarding problems as you. Had started to look at cloudflare tunnels but am now encouraged to go ahead. Thanks

[-] KazuchijouNo@lemy.lol 3 points 1 week ago

Sure thing! Also, when you're prompted to input the protocol type use HTTP, not HTTPS, cloudflare will turn it into HTTPS. But my website gave me the error 502 because of that.

[-] Shimitar@feddit.it 2 points 1 week ago

Love it!

1000 kudos!

Check my wiki https://wiki.gardiol.org/ I have documented my journey as well, it could be useful for you too maybe.

Also more kudos for using NGINX.

[-] KazuchijouNo@lemy.lol 1 points 1 week ago

This is truly a treasure trove! Thanks a bunch. I read the intro and I completely agree with you. That's the reason why I'm doing all this. I wan't to be able to make my own website in the most self-sufficient way possible, and then share the knowledge with as many people as I can so that they may as well open their own websites.

I miss the old internet, hence the style of my website.

[-] Shimitar@feddit.it 1 points 1 week ago

Thank you! I hope my wiki can be useful to you.

Yes, we need more internet like it was, no monetization, no ads, just sharing for the fun of it. That needs to restart back from us. A little tiny part maybe, but worthwhile.

Lots of people talks, but few acts.

[-] KazuchijouNo@lemy.lol 1 points 1 week ago

Also, is there any particular reason why my decision to use NGINX stood out to you? Is it a good start?

I wanted to use APACHE at first (really trying to go for that old internet experience) but decided to use NGINX because the learning resources were more readily available, (and I kept hearing "NGINX" everywhere)

[-] Shimitar@feddit.it 1 points 1 week ago

Apache is more a web server and less a reverse proxy. Nginx shines as reverse proxy more than as a web server IMHO.

√But lots of people here prefer "simpler" solutions like traefik or caddy, seeing somebody jumping to nginx made me smile positively.

[-] KazuchijouNo@lemy.lol 1 points 1 week ago

I'm learning docker now. I found a whole video about the reverse proxy capabilities of nginx and docker, so I'll be checking that out.

My goal is to have my own homelab and expose some services to the internet, or maybe even set up my own vpn so that I may access and configure things on my network from somewhere else.

I'm still struggling with the port forward thingie, and while Cloudflare tunnels are a nice thing to have, they protect me too much. I want a public IP address that I can use and register on a DNS, or ssh directly into my network from anywhere in the world. As I mentioned, I want to be able to shoot myself in the foot without actually doing so, (hopefully).

[-] ipkpjersi@lemmy.ml 2 points 1 week ago

Self-hosting is definitely a ton of fun. I love being able to host my own services, whether it's using like a server in the cloud or my own hardware.

[-] KazuchijouNo@lemy.lol 2 points 6 days ago

Definitely!

You get to learn a lot, and most importantly, you become self suficient and free. No need to depend on corporations to manage your services, because you can do that yourself.

Want your own cloud? Just run and configure nextcloud on your server :D

Want your own personal blog? Make it yourself!

It's so fun!

[-] nichtburningturtle@feddit.org 2 points 1 week ago

Congratulations. I'm happy for you.

[-] KazuchijouNo@lemy.lol 2 points 1 week ago
[-] tehn00bi@lemmy.world 2 points 1 week ago

How do you protect your home network?

[-] KazuchijouNo@lemy.lol 1 points 1 week ago

Uhhhh... Prayers?

So far the only protection I've got is running it through a cloudflare tunnel. And that's it.

[-] possiblylinux127@lemmy.zip 1 points 1 week ago

Then why did you expose it to the internet?

[-] Evotech@lemmy.world 1 points 1 week ago* (last edited 1 week ago)

He didn't.

He exposed it to cloudflare

[-] possiblylinux127@lemmy.zip 3 points 1 week ago* (last edited 1 week ago)

"They're the same picture"

Not that I am saying it is bad necessarily. Cloudflare does add a extra level of protection. In fact I would say that the chances of a compromise go way down. My concerned is that a lack of knowledge could lead to a compromise.

[-] KazuchijouNo@lemy.lol 1 points 1 week ago

Thanks! I appreciate your concern.

This website is just a personal fun project, and I haven't got anything to lose if it gets compromised. On the contrary I've gained a lot so far, and I might gain even more if something bad were to happen to it.

No one can hack into the knowledge and experience I've gained so far.

If you've got any advice on security tools, good practices, etc. I'd appreciate them! I may lack the knowledge, but not the will to learn more

[-] tehn00bi@lemmy.world 2 points 6 days ago

Yeah, I bring this up because I’ve been playing around with a similar idea of a simple html website for documenting personal projects. My site still isn’t really live, but I have it running on a vm through a cloud flare tunnel, similar to you.

[-] KazuchijouNo@lemy.lol 1 points 6 days ago

I'd love to see your website btw!

[-] KazuchijouNo@lemy.lol 1 points 6 days ago

Yeah! That's cool, I haven't had any issues so far.

Everyday I get a bunch of logs of bots trying to access files and folders that don't exist. It seems that they are targeting wordpress sites because all the files start with 'wp-' for example, some tried to access 'wp-admin/credentials', but since my site isn't wordpress I'm not worried. Besides, I'm pretty sure that I could implement some rules on the firewall or even on nginx to block access to said directories by (for example) redirecting them to a different page.

[-] possiblylinux127@lemmy.zip 3 points 1 week ago

The concern is that your device could start serving a different task without you knowing. It might end up being used to help mask hijacked Azure accounts for instance.

The biggest thing I can recommend is least privilege and defense in depth. You want your setup to be compartmentalized as much as possible and you should aim for minimal permissions. The idea is that even if a security hole is exploited the blast radius is limited.

You are probably fine. It is just something to keep in mind.

this post was submitted on 10 Dec 2024
133 points (100.0% liked)

Selfhosted

40670 readers
364 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 2 years ago
MODERATORS