view the rest of the comments
Selfhosted
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:
-
Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.
-
No spam posting.
-
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.
-
Don't duplicate the full text of your blog or github here. Just post the link for folks to click.
-
Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).
-
No trolling.
Resources:
- selfh.st Newsletter and index of selfhosted software and apps
- awesome-selfhosted software
- awesome-sysadmin resources
- Self-Hosted Podcast from Jupiter Broadcasting
Any issues on the community? Report it using the report flag.
Questions? DM the mods!
Traefik. It has a GUI that I can use to see things, and (depending on your setup) you define the routes and stuff as part of your container definitions, minimal extra work required, makes setup and teardown a breeze. It is also nice that you can use it in all sorts of places, I have used it as Kubernetes ingress and as the thing that routed traffic to a Nomad cluster.
I went from Apache to Nginx (manually configured, including ACME) to Traefik over the course of the past ~10 years. I tried Caddy when I was making the switch to Traefik and found it very annoying to use, too much magic in the wrong places. I have never actually used NPM, as it doesn't seem useful for what I want...
Anyway, with traefik you can write your services in docker compose like this, and traefik will just pick them up and do the right thing:
It will just work most of the time, though sometimes you'll have to specify
'traefik.http.services.foo-example-com.loadbalancer.server.port': whatever
or other labels according to the traefik docs if you want specific behaviors or middleware or whatever.And your deployment of traefik would look something like this:
Note that you'd have to create the
traefik-expose-network
manually for this to work, as that is how traefik will talk to your different services. You can get even fancier and set it up to expose your sites by default and auto-detect what to call them based on container name and stuff, but that is beyond the scope of a comment like this.Technically my setup is a little more complex to allow for services on many different machines (so I don't use the built-in docker provider), and to route everything from the internet using frp using proxy protocol so I don't expose my home IP... I think this illustrates the point well regardless.
Well, it works just fine for Docker containers, but trying to point it at other services is what is making my head hurt. With NPM it is literally "this IP at this port with this certificate = https://service.domain.tld"
This setup sadly ends up with ERR_SSL_UNRECOGNIZED_NAME_ALERT for both services. These URLs are NOT proxied through Cloudflare. I'm trying to move from Truecharts + Traefik into manual docker + traefik
Is traefik successfully getting the cert via LE? It sounds like for one reason or another it is still using the built-in/default cert for those services. You can check the traefik log's LEGO lines, and/or look at your
/letsencrypt/acme.json
.In my example I specified
entrypoints.https.http.tls.domains
, but I think that is only necessary when you're doing wildcard domains with a DNS solver.edit: You may need to use the file provider rather than trying to specify stuff in the main config toml... traefik differentiates from "static" config that it has to know at boot time and can't change and "dynamic" config like routers and stuff.
I am using a dynamic file, traefik_dynamic.toml
And it seems like I'm not getting certificates, acme.json doesn't have those two services in my dynamic config, ie jellyfin and librespeed
Your logs (at debug level at least, which is where I keep my server, haha) should have entries something along the lines of:
The only thing Portainer gives me is weirdly
And syntax errors in my dynamic.toml file, but nothing about routers, services or certificates
I can see those services and routers in the traefik dashboard though
I am pretty sure what I described is only when
--log.level=DEBUG
orThe syntax errors are weird/concerning if it says there are errors but it still seems to load the config anyway (based on you seeing them in the dashboard).
Back when I used the file provider I pointed it at a directory and put every router/service in its own file with that volume'd in to e.g.
/traefik-conf
. That's probably more just advice than being your problem though.I did try having jellyfin.toml and librespeed.toml but thought that isn't possible. If it is I would def prefer to go that way.
I often save when editing files, that's why it's popping up there
Enabled log.level debug but still nothing