Hacker News

Best stories

Live mirror
30 storiesupdated just nowView source snapshot
  1. When did Google get so weird? (sancho.bearblog.dev)
    698comments
  2. Breaking Up with Google Play: Why Conversations Is Now Free (gultsch.de)
    292comments
  3. Owed a billion dollars in Nvidia stock (colo.to)
    274comments
  4. Unsealed Briefs in Authors’ Case v. Microsoft/OpenAI (authorsguild.org)
    601comments
  5. I'm the mom in that viral Giants clip. Let me tell you about my husband (themomoftheyear.substack.com)
    235comments
  6. Ember-1 (fireworks.ai)
    210comments
  7. Meta Blocks President Lula's Facebook Page, Campaign Ads 2 Weeks from Election (reddit.com)
    292comments
  8. Fifteen years later, the Apple Cards origin story (lexontech.org)
    114comments
  9. Show HN: Reladraw – A diagram language where you decide where to place things (github.com/reladraw)
    114comments
  10. Go Concurrency Distilled (antonz.org)
    180comments
  11. On caring for user data: NeoVim caused Vim undo files to be deleted (aresluna.org)
    327comments
  12. Tells of a Slop UI (hereticpleb.vercel.app)
    232comments
  13. There are no "rogue" AI agents (eoinhiggins.substack.com)
    251comments
  14. How to keep enjoying programming in a world of LLMs (haskell.org)
    337comments
  15. DeepSeek Elastic Compute (DSec) (arxiv.org)
    109comments
  16. The Normalization of Inexplicable Failures (ihatethefuture.com)
    108comments
  17. What is the size of Yemen? (2024) (theborys.substack.com)
    78comments
  18. In an $80 motel room, a discovery to shed light on the origins of life (nytimes.com)
    92comments
  19. Show HN: Lofi Cities – Pixel-art city nights with browser-generated lofi (loficities.com)
    112comments
  20. Don't couple your Go code to GitHub (iain.rocks)
    108comments
  21. Floci: Locally emulating any cloud service (floci.io)
    48comments
  22. If we do not stop to help each other, what do we become? (codinghorror.com)
    89comments
  23. Plunging test scores are a slow-moving catastrophe (economist.com)
    395comments
  24. Japan moves to tighten rules for foreigners (aljazeera.com)
    585comments
  25. SNL Weekend Update: Anthropic CEO Dario Amodei on A.I.'S Threat to Humanity [video] (youtube.com)
    95comments
  26. One Month Without AI (bustikiller.com)
    225comments
  27. Self-Hosting on the Dark Web (alvarezrosa.com)
    64comments
  28. PostmarketOS is rebranding as Nura (nura.eco)
    55comments
  29. Drawgent: Coding agent on a live Excalidraw canvas (tangled.org/yanndegat.tngl.sh)
    45comments
  30. Replacing the old battery on rechargeable bike lights (jvns.ca)
    91comments

Self-Hosting on the Dark Web

180 pointsby 13h agodavid.alvarezrosa.com
67 comments
10h agoHN ↗

Thanks for sharing! Happy to get feedback :)

10h agoHN ↗

Ran a small onion site for a couple years and the nice part is you never touch a public IP or a cert. Downside is onion v3 addresses are impossible to share verbally and the latency makes anything chatty feel broken. Static pages only, honestly.

8h agoHN ↗

You have to keep chattiness low, but a lot of SSR stuff works fine. Dread uses SSR, and even nags you if you have JavaScript enabled.

10h agoHN ↗

Nice thing is you skip port forwarding entirely, which matters a lot if your ISP has you behind CGNAT. Curious how people handle uptime though, since a hidden service going down isn't something you notice until someone tells you.

16m agoHN ↗

Can't you just forward ports through ssh?

3h agoHN ↗

Same as you handle uptime on anything else: you use monitoring software.

If people need to tell you your services are down, you end up eating a huge amount of downtime.

9h agoHN ↗

What is the benefit of building the same website twice with different hostnames instead of using relative links to content on the same domain?

9h agoHN ↗

Fair point. Very small things like RSS, canonical link or og:url or microformats use absolute URL

To make sure once in the .onion, you never leave the .onion

3h agoHN ↗

Website impersonation/fronting is a big problem in onionland, this at least makes fronters need to take more effort.

9h agoHN ↗

Besides accessing your page are random people able to use your server as an exit node? Am I thinking the right thing... I met someone in Switzerland that was hosting anonymous exit nodes to some anonymous network and he said that it was a pain having to explain what was happening to the police.

9h agoHN ↗

That'd be an exit relay, not doing that atm, just in case

9h agoHN ↗

Running a Tor exit node is a manual process. Running a hidden service like a website, or chat server doesn't involve anything like that.

8h agoHN ↗

Exit node are an entirely optional part of the Tor network. If you run a relay or a hidden service you are not forced to participate in the exit node side of things. It's also not recommended to combine these roles because it could have security implications for your hidden service.

2h agoHN ↗

You can't accidentally run an exit node.

9h agoHN ↗

Good call, I'd missed that. Adding it now, thanks.

8h agoHN ↗

Imagine if normal people could install a single normal application and just run a website from a folder. CLI makes it more difficult than hosting a normal website. Typing commands you don't understand doesn't seem all that of a great idea.

6h agoHN ↗

If you don't understand what a command does, go learn it.

5h agoHN ↗

For us that's fine. It's quite a hill to climb for non technical folks. Even AIs holding their hand will have to do a lot of explaining.

8h agoHN ↗

Besides using a separate port, I would also suggest running the hidden service on a non-127.0.0.1 bind address, just in case you ever host something else on that port and forget to disable the hidden service:

HiddenServicePort 80 127.13.37.1:8080

listen 127.13.37.1:8080;

This way, strangers won't be able to connect to a service bound to 127.0.0.1, should you ever decide to re-use the port and forget to disable the hidden service.

You'll also need to use separate ports and/or bind addresses if you host multiple hidden services and don't want people to correlate them - if nginx doesn't match the Host header, it will serve whichever site comes first alphabetically.

3h agoHN ↗

using unix socket rather than tcp has advantages

2h agoHN ↗

AFAIK TCP outperforms Unix sockets for some odd reason, but it's irrelevant anyway because you aren't getting that much bandwidth through Tor.

27m agoHN ↗

Every time I've tried using Unix sockets, I've run into the problem as described in your stackoverflow link. The suggested solution ("just run tor as root") is not exactly best practice.

You can monkey-patch scripts around Tor service activation, but I haven't been able to get my Tor+nginx setup to work reliably after updates/service restarts when using unix sockets.

7h agoHN ↗

A few more tips.

1. If you want to improve page load speed you need to buy a HTTPS certificate so you are not limited to HTTP/1.1. Multiplexing in HTTP/2 is important for getting sites to load fast.

2. You can set the HiddenServiceExportCircuitID configuration to pass the circuit id to your web server for telemetry or anti abuse purposes. Otherwise your logs will say that all users are coming from the same IP.

https://blog.cloudflare.com/cloudflare-onion-service

6h agoHN ↗

Fascinating, onion services are always encrypted by the tor network but still tunnel "cleartext" http inside that, and there are no CAs that issue free of charge certificates for .onion domains, and therefore there's no free of charge way to get http/2 on onion services without self signing.

Which raises the question: why not just trust self-signed certificates on onion services? From my brief look it seems to be because the Tor project views the primary purposes of HTTPS on onion services to be other things rather than just http/2 support: http/2 isn't even mentioned on their page about https for onion services (https://community.torproject.org/onion-services/advanced/htt...). Unfortunate.

6h agoHN ↗

I personally would support automatically trusting self signed https certs since their key is typically secured under the same safety as the hidden service's key. And even when they are not the browser has no warning when you get downgraded to HTTP on an onion compared to a regular site.

Trying to push hidden services to stay on HTTP is going against what the rest of the web is doing and as a minority of web traffic it really should be aligned to the rest of the web and also require HTTPS. Yes, it's technically wasteful, but reduces both work and security risk by keeping security models aligned with the rest of the web.

2h agoHN ↗

And it breaks Javascript as a lot of APIs only work when the site is served via HTTP - which .onion sites won't be usually. Tor browser treats .onion sites as secure content, but not your regular browser using TOR via proxy.

1h agoHN ↗

The "self" in "self-signed" means "you"

18m agoHN ↗

There's no point teaching the browser that self signed certificates are secure instead of teaching the browser that onion addresses are secure.

5m agoHN ↗

Negotiating HTTP 2 requires an extra round trip btw. It gets absorbed into the several round trips required for TLS.

7h agoHN ↗

What I really love about Onion sites is that if they are big enough, performance engineering really becomes Tor-specific. A few examples:

- Making assets embedded as base64 (img src the header logo as base64, all CSS should be inline, etc.).

- Leveraging CSS as much as possible (if you use animations and transitions, use CSS as much as possible for these, avoid JS for them).

- Make sure your website is mostly rendered on the backend. If you're to have JS, your website should work without it.

- Security becomes REALLY fun, as in, avoid XSS, CSRF, SQL Injection attacks and any other injections as much as possible.

As someone summarizes in another comment[0], keep the chattiness as minimal as possible. By chattiness I understand they mean, pack as much data as you can in the same Keep-Alive connection. Avoid making new HTTP requests as much as possible, as each one might get assigned to a new Onion route making things slow.

If you can ship your website to the browser in a single connection, you've won.

I've always been impressed by performance of these big Onion sites, they really push the limits of software engineering creativity, given these constraints and nature of Tor.

--

[0]: https://news.ycombinator.com/item?id=49872320

EDIT: Formatting of bullet points.

7h agoHN ↗

Are these simply good ideas regardless of tor?

6h agoHN ↗

With CDNs of today, they are not so much relevant for the clearnet.

1h agoHN ↗

Depends on which ones. Embedding assets as base64 makes little sense nowadays with http pipelining.

Relyinging the least possible on js, and using CSS for animations sounds like good engineering to me

1h agoHN ↗

Not really. The latency between a client and clearnet sites is tiny, and splitting assets in to separate resources makes caching work better.

7m agoHN ↗

Some people live in Australia though

5m agoHN ↗

Minimizing latency and connection count is only half of the problem, though. To the greatest extent possible not relying on JavaScript, and to the greatest extent possible not relying on third party libraries when you do seems like a good general takeaway.

2h agoHN ↗

Also DDoS becomes a problem, and the ways it's done are pretty specific to Tor. Double captchas are necessary when you're getting DDoSed, due to performance reasons. Oh, and captchas are also pretty specific to Tor as well.

There's also a problem of site fronting. Anyone could run a proxy pretending to be you, for arbitrary reasons (not even necessarily the obvious forging and credential stealing). Every site, even a personal blog, has dozens of parasitic fronts, either actively malicious or dormant. You need off-site ways to tell users what is the real address, and provide a smoke test for them (often a part of the address as a picture, for example in a captcha).

avoid JS for them

Using any JS defies the point and makes your site instantly suspicious.

46m agoHN ↗

A combination of different ones, sometimes close to what you know from the clearnet, i.e. click pictures that match a description. For the proxy defeating one, the server can send you a picture of the real .onion address where some letters are blanked out, and with noise added to it to prevent it from being solved by the proxy. You then have to enter the blanked out letters from the browser URL.

This can of course still be defeated if the proxy URL receives very few requests and just have a human in the middle to solve the CAPTCHAs. But it does make the attack non-automated.

12m agoHN ↗

There's also a problem of site fronting. Anyone could run a proxy pretending to be you, for arbitrary reasons (not even necessarily the obvious forging and credential stealing). Every site, even a personal blog, has dozens of parasitic fronts, either actively malicious or dormant. You need off-site ways to tell users what is the real address, and provide a smoke test for them (often a part of the address as a picture, for example in a captcha).

How can you do this without relying on the normal web? Let’s say you use a normal website to show the onion link, if the website gets taken down, you lost your user-trusted mean to do that.

8m agoHN ↗

Your users should have bookmarked it

6h agoHN ↗

The one thing I learned from hosting superkuhbitj6tul.onion (from a home computer) for ham radio and science stuff for about a decade was that EVERYTHING ON A .ONION IS EPHEMERAL. When the tor project correctly decided that for high security torv2 no longer was anonymous enough they unilaterally wiped out every torv2 .onion site that existed. Every link that was made between these sites came to an end in 2021 when they released a tor client without support for torv2 onions and tore the web to pieces.

Know this: the "dark web" is not for people who just want to own your domain name. It's for SECURITY and that use case is going to drive all their decisions. And if it wipes out every community in the entire tor dark web? So be it. And they'll do it again. Don't build your communities on the sand that is the dark web. You won't like the result.

5h agoHN ↗

Don't tie anything to a domain name you mean. Advice that's just as valid for clearnet.

v2 onions being deprecated was announced long in advance so many sites managed their transfer by announced the new URL well in advance. I don't think anyone was really bothered.

4h agoHN ↗

You're not wrong about significant brittleness and lack of sovereignty (and the same should be said about the web, too, roughly speaking), but I don't think your prescription is correct. Thus far, my only solution has been to maintain a variety of gateways to the same signed object which itself provides the evolving list of connection gateways. Gotta stay ahead of the whackamole through diversity, imho. I've found my i2p and tor identities have actually been some of the longest lasting, especially compared to non-bigcorpo clearnet web hosts. That's definitely not how most people want to use the net, ofc, but it's probably the right kind of practice that we should collectively be engaged in together if we want communities that actually own the means of production about as far as we reasonably can atm. And, these days, LLMs make this process much, much easier, too, as rediscovery and rebuilding custom infra per individual or community is far more doable for the average person (if they really wanted to do it, and I'm not claiming they would*).

2h agoHN ↗

No DNS, no CA, no exposed IP. Just a ridiculously long string of characters and a bit of determination.

2h agoHN ↗

so that no single party can link who you are to what you are doing

some single parties called government agencies pretty much can. it’s just much harder to do, so you’re safe from random people

2h agoHN ↗

I like the idea of TOR, but whenever I used it, I hit a speed penalty.

This, in turn, handicaps me searching for information. If they could fix this problem then I would be more likely to make use of TOR. We really need to think long-term about a future web that isn't ruined by Google etc... while also not being locked down such as via age-gating.

1h agoHN ↗

absolutely love how OP's site is designed. It's clean and minimal, fast and user-friendly, but also stylish.