logging:
  logs:
    default:
      level: INFO

storage:
  module: file_system
  root: /data

apps:
  tls:
    certificates:
      automate:
        - agenda.grfgraph.com
        - rtc.agenda.grfgraph.com
        - turn.agenda.grfgraph.com
        - whip.agenda.grfgraph.com

  layer4:
    servers:
      main:
        listen: [":4443"]

        routes:

        # ---------- TURN (TLS – sem HTTP) ----------
        - match:
            - tls:
                sni: ["turn.agenda.grfgraph.com"]
          handle:
            - handler: tls                # ← sem ALPN aqui
            - handler: proxy
              upstreams:
                - dial: ["localhost:5349"]

        # --------------- LiveKit -------------------
        - match:
            - tls:
                sni: ["rtc.agenda.grfgraph.com"]
          handle:
            - handler: tls
              connection_policies:        # ← força HTTP/1.1
                - alpn: ["http/1.1"]
            - handler: proxy
              upstreams:
                - dial: ["localhost:7880"]

        # ---------------- WHIP ---------------------
        - match:
            - tls:
                sni: ["whip.agenda.grfgraph.com"]
          handle:
            - handler: tls
              connection_policies:        # ← força HTTP/1.1
                - alpn: ["http/1.1"]
            - handler: proxy
              upstreams:
                - dial: ["localhost:8020"]

        # ---------------- Django -------------------
        - match:
            - tls:
                sni: ["agenda.grfgraph.com"]
          handle:
            - handler: tls
              connection_policies:        # ← força HTTP/1.1
                - alpn: ["http/1.1"]
            - handler: proxy
              upstreams:
                - dial: ["localhost:8020"]
