apiVersion: v1
kind: ConfigMap
metadata:
  name: fedmsg-configmap
data:
  base.py: |-
    config = dict(
      environment="dev",
      topic_prefix='org.fedoraproject',
      # Everything is Active in here
      active=True,

      post_init_sleep=1.0,
      zmq_linger=2000,
      high_water_mark=0,
      io_threads=1,
      zmq_enabled=True,
      zmq_strict=False,

    )
  relay.py: |-
    import socket
    hostname = socket.gethostname().split('.', 1)[0]

    if "fedmsg-relay" not in hostname:
      print("Using fedmsg-relay for hostname")
      relayhost = "fedmsg-relay"
    else:
      print("This is a fedmsg-relay")
      relayhost = hostname

    config = dict(
      endpoints={
        "relay_outbound": [
          "tcp://%s:3999" % relayhost,
        ],
        "localsystem": [
          "tcp://%s:3000" % hostname,
        ],
        "fedmsg-relay": [
          "tcp://fedmsg-relay:3000",
        ],
        "koji-hub": [
          "tcp://koji-hub:3000",
        ],
        "mbs-backend": [
          "tcp://mbs-backend:3000",
        ],
        "mbs-frontend": [
          "tcp://mbs-frontend:3000",
        ],
      },
      relay_inbound=[
        "tcp://%s:9941" % relayhost,
      ]
    )

  policy.py: |-
    config = dict(
      routing_nitpicky=False,
      routing_policy={},
      sign_messages=False,
      validate_signatures=False,
    )

  logging.py: |-
    import logging
    logging.basicConfig(level=logging.DEBUG)
    config = dict(
      logging=dict(
        version=1,
        handlers=dict(
          console={
            "class": "logging.StreamHandler",
            "level": "DEBUG",
            "stream": "ext://sys.stdout",
          }
        ),
        loggers=dict(
          root={
            "level": "DEBUG",
            "handlers": ["console"],
          }
        ),
      )
    )
