this post was submitted on 08 May 2025
46 points (94.2% liked)

Selfhosted

46672 readers
490 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
 

I did the whole xcaddy routine with the plugin and I moved it into /usr/bin and it works, displays my site, but I'm not blocking anything. I've edited and edited and restarted and I can't see the issue. My config matches many similar ones online. I figure someone might spot my blunder in my config, so here it is.

jellyfin.nunya.biz {
    reverse_proxy mydude:8096
    @mygeofilter {
        maxmind_geolocation {
        db_path "/mnt/geoip/GeoLite2-Country_20250502/GeoLite2-Country.mmdb
        allow_countries US
        }
    } 
}
top 8 comments
sorted by: hot top controversial new old
[–] [email protected] 34 points 1 month ago* (last edited 1 month ago) (1 children)

You are defining the geofilter, but not using it. Try doing "reverse_proxy @mygeofilter mydude:8096"

[–] [email protected] 19 points 1 month ago

You have done a good deed this day. Thank you very much!

[–] [email protected] 1 points 1 month ago (1 children)

I have a question about xcaddy, if anyone would be so kind as to school me. I too would like to geoblock with Caddy. I have investigated the process and of course it uses xcaddy. Having no knowledge of xcaddy, how does that work? Is xcaddy for building modules for Caddy? Does it run separately or in conjunction with Caddy? Does it interfere with Caddy in any way. My hesitation stems from the embarrassingly long time it took for me to wrap my noodle around how Caddy works. IKR? Now it seems so simple, but I'd like very much not to mess up my Caddy installation fat fingering my way through xcaddy. Yes, I know screw ups build knowledge bases, but I'm really trying to be careful and not go in like a bull in a china closet.

'presh

[–] mik 2 points 1 month ago (2 children)

Xcaddy is a build tool. Caddy plugins are built into Caddy itself for optimization purposes, so xcaddy essentially makes you a custom version of Caddy. It only conflicts with Caddy so much as building a new version would conflict with the old version. You still get a normal "Caddy" executable after running xcaddy, just replace your existing Caddy with the new one created by xcaddy!

[–] [email protected] 2 points 1 month ago* (last edited 1 month ago) (1 children)

I disabled and removed Ubuntu's caddy before using xcaddy, then remade caddy.service and wrote up a small script to rebuild and update it when I need. I may automate it down the line.

[–] [email protected] 1 points 1 month ago (1 children)

Hmm that sounds like something you could do with n8n.

[–] mik 2 points 1 month ago

It probably would be easier to just write an "update Caddy" script. They don't release updates very often, except for security fixes, so it's not much effort to do manually. I automated mine with Forgejo Actions, you could do the same with GitHub actions as a free option for example. Lots of neat ways to accomplish this!

[–] [email protected] 1 points 1 month ago

Hey mik, thanks for that. Geoblocking with Caddy was on my list, and I can now bump it up to the front.