https://github.com/lldap/lldap logo
mu'i ma do se cinri le mi cmene? - Hi I've been...
# troubleshooting
x
502 is caddy cant find lldap, docker wise is it on same docker network? As the config directly
lldap:17170
i assume the caddy on different docker networkt with lldap
m
They are on the same default network. Pretty sure there's nothing wrong with Caddy or docker compose since I set up Grafana with that same exact entry (with
grafana:3000
) instead and that worked.
the grafana container exposes 3000 and the lldap container exposes 17170
x
This is my minimal sample compose, i can connect with caddy fine
Copy code
version: "3"
services:
  lldap:
    image: nitnelave/lldap:latest
    ports:
      - 25000:3890
    volumes:
      - data:/app/data
    environment:
      - LLDAP_JWT_SECRET=RANDOMTHINGSTOADD
      - LLDAP_LDAP_USER_PASS=admindemo
      - LLDAP_LDAP_BASE_DN=dc=example,dc=com
      - LLDAP_VERBOSE=true

  caddy:
    image: caddy
    ports:
      - 25100:80
    volumes:
      - ./caddyfile:/etc/caddy/Caddyfile

volumes:
  data:
Caddyfile
Copy code
# The Caddyfile is an easy way to configure your Caddy web server.
#
# Unless the file starts with a global options block, the first
# uncommented line is always the address of your site.
#
# To use your own domain name (with automatic HTTPS), first make
# sure your domain's A/AAAA DNS records are properly pointed to
# this machine's public IP, then replace ":80" below with your
# domain name.

:80 {
    # Set this path to your site's directory.
    root * /usr/share/caddy

    # Enable the static file server.
    file_server

    # Another common task is to set up a reverse proxy:
    reverse_proxy lldap:17170

    # Or serve a PHP site through php-fpm:
    # php_fastcgi localhost:9000
}

# Refer to the Caddy docs for more information:
# https://caddyserver.com/docs/caddyfile
# https://github.com/caddyserver/dist/blob/master/config/Caddyfile
m
yeah i'm not sure why it's unable to connect to lldap when it can connect to grafana just fine. but thanks for your help anyways
i'm using podman and podman compose instead, the containers are rootless
x
maybe just podman acting up for no reason, docker also sometimes just do weird things
m
I'm inside a shell inside the caddy container, I can verify that it can connect to grafana but not lldap:
Copy code
sh
/srv # wget --spider -o /dev/stdout grafana:3000
Connecting to grafana:3000 (10.89.0.10:3000)
Connecting to grafana.localhost:50443 ([::1]:50443)
wget: can't connect to remote host: Connection refused
/srv # wget --spider -o /dev/stdout lldap:3000
wget: bad address 'lldap:3000'
x
it like lldap isolated or so, how about lldap to caddy? podman inspect may show details about the container, the network part
m
caddy container:
Copy code
json
               "Networks": {
                    "server_default": {
                         "EndpointID": "",
                         "Gateway": "10.89.0.1",
                         "IPAddress": "10.89.0.3",
                         "IPPrefixLen": 24,
                         "IPv6Gateway": "fdc1:8b78:44dc:d691::1",
                         "GlobalIPv6Address": "fdc1:8b78:44dc:d691::3",
                         "GlobalIPv6PrefixLen": 64,
                         "MacAddress": "6e:74:b3:77:c8:f4",
                         "NetworkID": "server_default",
                         "DriverOpts": null,
                         "IPAMConfig": null,
                         "Links": null,
                         "Aliases": [
                              "caddy",
                              "82b2138689e2"
                         ]
                    }
               }
wait i can't find lldap's corresponding section in the inspection
I put
network_mode: "slirp4netns:allow_host_loopback=true"
for lldap in the configuration
so that it can access the host's postgres database
not for caddy since caddy doesn't need it
i'm going to try removing postgres connection for it and rebuilding it
I GOT IT WORKING
thank you for the suggestions!
I'm not sure why that network_mode option excludes it from the network when the default network already uses slirp4netns
x
i think it create another one outside the default, but well it working 🤣
m
i finally got my usecase working. I set the database url to
postgresql://lldap:${POSTGRESQL_PASSWORD_LLDAP}@%2Fvar%2Frun%2Fpostgresql/lldap
and add
/run/postgresql:/var/run/postgresql
as a volume. now I don't need network access to the host
x
oh, socket bind connection 👍