this post was submitted on 13 Sep 2023
17 points (87.0% liked)

Selfhosted

61755 readers
366 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:

Detailed Rules Post

  1. Be civil.

  2. No spam.

  3. Posts are to be related to self-hosting.

  4. Don't duplicate the full text of your blog or readme if you're providing a link.

  5. Submission headline should match the article title.

  6. No trolling.

  7. Promotion posts require active participation, with an account that is at least 30 days old. F/LOSS without a paywall has exceptions, with requirements. See the rules link for details. Tags [CBH] or [AIP] are required, see the links in Rule 8 for details.

  8. AI-related discussions and AI-involved promotional posts have additional requirements for tagging, as noted in Rule 7 and the AI & Promotional Post Expanded Rules post, and find example disclosures here.

Resources:

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

Questions? DM the mods!

founded 3 years ago
MODERATORS
 

I followed this Guide to setup headscale with caddy. And tried to add Keycloak with this guide from the same guy.

Sadly my docker containers do not seem to be able to connect to the keycloak server. What happens is that if i try to download the openid configuration from the host (via wget) or from my local PC it just works. But the headscale server gets a timeout when trying to connect to the endpoint. When i use the internal docker name to connect to the keycloak container the connection works fine but then i get an error because its not the external url.

I experimented a bit and managed to reproduce the issue with a different container (running an ubuntu container and also getting a timeout when trying to download the config from keycloak). If i run the container with the host network i works just fine.

Does anyone know how to fix this?

PS: i also tried the example from the guide with gitea an its also the same problem

Update: I tried most suggestions and for some reason it just didn't work. My solution that is working now is that I bind the container ports to localhost only (by using p.e.: ports: -"127.0.0.1:4567:8080") and using the caddy server in host network mode. Now all containers can connect like expected and are working flawlessly. Thanks for all your suggestions :)

you are viewing a single comment's thread
view the rest of the comments
[–] Jerry1098@sh.itjust.works 1 points 2 years ago (2 children)
[–] webuge@lemmy.dbzer0.com 2 points 2 years ago (2 children)

I think it would be easier to use only one docker compose file with all services, and use the same network across all of them

[–] Jerry1098@sh.itjust.works 3 points 2 years ago (3 children)

But the network is created externally, so shouldn't this be the same?

[–] webuge@lemmy.dbzer0.com 2 points 2 years ago

I didn't read the docker files with attention in the first time, but since you have an external network it should work.

[–] Discover5164@lemm.ee 1 points 2 years ago

yes is the same, or at least should.

[–] Jerry1098@sh.itjust.works 1 points 2 years ago (1 children)

And container to container works fine, im able to communicate p.e. with keycloak:9000

[–] webuge@lemmy.dbzer0.com 1 points 2 years ago

Do you have coddy to point the DNS to your keyckloak instance like in this part of the tutorial? auth.gurucomputing.com { reverse_proxy http://keycloak:8080 }

Also do you have the domain registered?

[–] Discover5164@lemm.ee 1 points 2 years ago

this is a long shot but the keycloack container is connected to 2 networks, does this couse a problem?

i'm saying this because traefik need you to specify on the labels which docker network it should use. maybe there is something similar.

but as i said this is a very long shot and it's probably bs