Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{{container_name}} not working #14

Closed
jordanlambrecht opened this issue Mar 29, 2024 · 1 comment
Closed

{{container_name}} not working #14

jordanlambrecht opened this issue Mar 29, 2024 · 1 comment

Comments

@jordanlambrecht
Copy link

I'm having some issues getting the dynamic variables to work.

I keep getting this error:
WARN autokuma::sync > Encountered error during sync: Encountered errors trying to validate '{{container_name}}': ["Missing property 'name'"]

Here's my compose file:

x-common-service-config: &common-service-config
  environment:
    TZ: ${TZ}
    PUID: ${PUID}
    PGID: ${PGID}
    UMASK: ${UMASK}
  networks:
    - <redacted>
  restart: always

services:
  uptime-kuma:
    <<: *common-service-config
    image: louislam/uptime-kuma:1
    container_name: uptime-kuma
    volumes:
      - ./uptime-kuma:/app/data
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      WEBSOCKET: "true"
    networks:
      <redacted>:
        aliases:
          - kuma
    ports:
      - ${UPTIME_KUMA_PORT}:${UPTIME_KUMA_PORT}
    labels:
      kuma.controltower.group.name: "Control Tower"
      kuma.{{container_name}}.http.name: "Uptime Kuma"
      kuma.{{container_name}}.http.url: "http://kuma:3001"
      kuma.{{container_name}}.http.parent_name: "control-tower"
      kuma.{{container_name}}.docker.parent_name: "control-tower"
      kuma.{{container_name}}.docker.name: "uptime-kuma"
      kuma.{{container_name}}.docker.docker_container: "uptime-kuma"

  autokuma:
    <<: *common-service-config
    image: ghcr.io/bigboot/autokuma:latest
    container_name: autokuma
    restart: unless-stopped
    hostname: autokuma
    environment:
      AUTOKUMA__KUMA__URL: http://kuma:3001
      AUTOKUMA__KUMA__USERNAME: "${ADMIN_USERNAME}"
      AUTOKUMA__KUMA__PASSWORD: "${ADMIN_PASSWORD}"
      AUTOKUMA__URL: http://kuma:3001
      AUTOKUMA__USERNAME: "${ADMIN_USERNAME}"
      AUTOKUMA__PASSWORD: "${ADMIN_PASSWORD}"
      AUTOKUMA__TAG_NAME: AutoKuma
      AUTOKUMA__TAG_COLOR: "#42C0FB"
      AUTOKUMA__DEFAULT_SETTINGS: |-
        docker.docker_container: {{container_name}}
        http.max_redirects: 10
        http.max_retries: 2
      AUTOKUMA__DOCKER__SOCKET: /var/run/docker.sock
      AUTOKUMA__DOCKER__LABEL_PREFIX: kuma
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    depends_on:
      - uptime-kuma

overseerr:
    <<: *common-service-config
    image: sctx/overseerr:develop
    container_name: overseerr
    hostname: overseerr
    ports:
      - 5055:5055
    volumes:
      - ./overseerr/:/app/config
    labels:
      kuma.mediamanager.group.name: "Media Manager"
      kuma.{{container_name}}.http.name: "Overseerr"
      kuma.{{container_name}}.http.url: "http://overseerr:5055"
      kuma.{{container_name}}.http.parent_name: "media-manager"
      kuma.{{container_name}}.docker.parent_name: "media-manager"
      kuma.{{container_name}}.docker.name: "Overseerr"
      kuma.{{container_name}}.docker.docker_container: "overseerr"

It's probably me doing something stupid, but the documentation could really benefit from some more granular instructions and a detailed example docker-compose file. Also there's some conflicting information between the documentation and the release notes for 0.3.0, hence the doubling-up on the variables- any advice there would be greatly appreciated.

Love this project!

@BigBoot
Copy link
Owner

BigBoot commented Mar 31, 2024

Hi, there are actually a few problems with this config:

  1. Templates are currently not supported in the label names, only values
    -> This has been added in master
  2. Container names start with a "/" because of some legacy stuff in docker, this would be invalid in docker label names
    -> {{container_name}} will now strip the leading "/" in master
  3. Your group id is controltower/mediamanager but you try to assign the children to control-tower/media-manager
    -> Make sure your id's are in sync
  4. The http/docker monitors share the same id {{container_name}}, this is not supported
    -> Use separate ids for all monitors, e.g. kuma.{{container_name}}-http.http./kuma.{{container_name}}-docker.http.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants