[supervisord]
nodaemon=true

[unix_http_server]
file=%(ENV_QUAYCONF)s/supervisord.sock
user=root

[supervisorctl]
serverurl=unix:///%(ENV_QUAYCONF)s/supervisord.sock

[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

[eventlistener:stdout]
environment=
  PYTHONPATH=%(ENV_QUAYDIR)s
{%- if logdriver == "syslog" %}
command = supervisor_logging
{% else %}
command = supervisor_stdout
result_handler = supervisor_stdout:event_handler
{% endif -%}
buffer_size = 1024
events = PROCESS_LOG

;;; Run batch scripts
[program:blobuploadcleanupworker]
environment=
  PYTHONPATH=%(ENV_QUAYDIR)s
command=python -m workers.blobuploadcleanupworker.blobuploadcleanupworker
autostart = {{ config['blobuploadcleanupworker']['autostart'] }}
stdout_events_enabled = true
stderr_events_enabled = true

[program:buildlogsarchiver]
environment=
  PYTHONPATH=%(ENV_QUAYDIR)s
command=python -m workers.buildlogsarchiver.buildlogsarchiver
autostart = {{ config['buildlogsarchiver']['autostart'] }}
stdout_events_enabled = true
stderr_events_enabled = true

[program:builder]
environment=
  PYTHONPATH=%(ENV_QUAYDIR)s
command=python -m buildman.builder
autostart = {{ config['builder']['autostart'] }}
stdout_events_enabled = true
stderr_events_enabled = true

[program:chunkcleanupworker]
environment=
  PYTHONPATH=%(ENV_QUAYDIR)s
command=python -m workers.chunkcleanupworker
autostart = {{ config['chunkcleanupworker']['autostart'] }}
stdout_events_enabled = true
stderr_events_enabled = true

[program:expiredappspecifictokenworker]
environment=
  PYTHONPATH=%(ENV_QUAYDIR)s
command=python -m workers.expiredappspecifictokenworker
autostart = {{ config['expiredappspecifictokenworker']['autostart'] }}
stdout_events_enabled = true
stderr_events_enabled = true

[program:exportactionlogsworker]
environment=
  PYTHONPATH=%(ENV_QUAYDIR)s
command=python -m workers.exportactionlogsworker
autostart = {{ config['exportactionlogsworker']['autostart'] }}
stdout_events_enabled = true
stderr_events_enabled = true

[program:gcworker]
environment=
  PYTHONPATH=%(ENV_QUAYDIR)s
command=python -m workers.gc.gcworker
autostart = {{ config['gcworker']['autostart'] }}
stdout_events_enabled = true
stderr_events_enabled = true

[program:globalpromstats]
environment=
  PYTHONPATH=%(ENV_QUAYDIR)s
command=python -m workers.globalpromstats.globalpromstats
autostart = {{ config['globalpromstats']['autostart'] }}
stdout_events_enabled = true
stderr_events_enabled = true

[program:logrotateworker]
environment=
  PYTHONPATH=%(ENV_QUAYDIR)s
command=python -m workers.logrotateworker
autostart = {{ config['logrotateworker']['autostart'] }}
stdout_events_enabled = true
stderr_events_enabled = true

[program:repositorygcworker]
environment=
  PYTHONPATH=%(ENV_QUAYDIR)s
command=python -m workers.repositorygcworker
autostart = {{ config['repositorygcworker']['autostart'] }}
stdout_events_enabled = true
stderr_events_enabled = true

[program:namespacegcworker]
environment=
  PYTHONPATH=%(ENV_QUAYDIR)s
command=python -m workers.namespacegcworker
autostart = {{ config['namespacegcworker']['autostart'] }}
stdout_events_enabled = true
stderr_events_enabled = true

[program:notificationworker]
environment=
  PYTHONPATH=%(ENV_QUAYDIR)s
command=python -m workers.notificationworker.notificationworker
autostart = {{ config['notificationworker']['autostart'] }}
stdout_events_enabled = true
stderr_events_enabled = true

[program:queuecleanupworker]
environment=
  PYTHONPATH=%(ENV_QUAYDIR)s
command=python -m workers.queuecleanupworker
autostart = {{ config['queuecleanupworker']['autostart'] }}
stdout_events_enabled = true
stderr_events_enabled = true

[program:repositoryactioncounter]
environment=
  PYTHONPATH=%(ENV_QUAYDIR)s
command=python -m workers.repositoryactioncounter
autostart = {{ config['repositoryactioncounter']['autostart'] }}
stdout_events_enabled = true
stderr_events_enabled = true

[program:securityworker]
environment=
  PYTHONPATH=%(ENV_QUAYDIR)s
command=python -m workers.securityworker.securityworker
autostart = {{ config['securityworker']['autostart'] }}
stdout_events_enabled = true
stderr_events_enabled = true

[program:storagereplication]
environment=
  PYTHONPATH=%(ENV_QUAYDIR)s
command=python -m workers.storagereplication
autostart = {{ config['storagereplication']['autostart'] }}
stdout_events_enabled = true
stderr_events_enabled = true

[program:teamsyncworker]
environment=
  PYTHONPATH=%(ENV_QUAYDIR)s
command=python -m workers.teamsyncworker.teamsyncworker
autostart = {{ config['teamsyncworker']['autostart'] }}
stdout_events_enabled = true
stderr_events_enabled = true

;;; Run interactive scripts
[program:dnsmasq]
command=/usr/sbin/dnsmasq --no-daemon --user=root --listen-address=127.0.0.1 --port=8053
autostart = {{ config['dnsmasq']['autostart'] }}
stdout_events_enabled = true
stderr_events_enabled = true

[program:gunicorn-registry]
environment=
  PYTHONPATH=%(ENV_QUAYDIR)s,
  DB_CONNECTION_POOLING=%(ENV_DB_CONNECTION_POOLING_REGISTRY)s
command=nice -n 10 gunicorn -c %(ENV_QUAYCONF)s/gunicorn_registry.py registry:application
autostart = {{ config['gunicorn-registry']['autostart'] }}
stdout_events_enabled = true
stderr_events_enabled = true

[program:gunicorn-secscan]
environment=
  PYTHONPATH=%(ENV_QUAYDIR)s
command=gunicorn -c %(ENV_QUAYCONF)s/gunicorn_secscan.py secscan:application
autostart = {{ config['gunicorn-secscan']['autostart'] }}
stdout_events_enabled = true
stderr_events_enabled = true

[program:gunicorn-web]
environment=
  PYTHONPATH=%(ENV_QUAYDIR)s
command=gunicorn -c %(ENV_QUAYCONF)s/gunicorn_web.py web:application
autostart = {{ config['gunicorn-web']['autostart'] }}
stdout_events_enabled = true
stderr_events_enabled = true

[program:jwtproxy]
command=/usr/local/bin/jwtproxy --config %(ENV_QUAYCONF)s/jwtproxy_conf.yaml
autostart = {{ config['jwtproxy']['autostart'] }}
stdout_events_enabled = true
stderr_events_enabled = true

[program:memcache]
command=memcached -u memcached -m 64 -l 127.0.0.1 -p 18080
autostart = {{ config['memcache']['autostart'] }}
stdout_events_enabled = true
stderr_events_enabled = true

[program:nginx]
environment=
  PYTHONPATH=%(ENV_QUAYDIR)s
command=nginx -c %(ENV_QUAYCONF)s/nginx/nginx.conf
autostart = {{ config['nginx']['autostart'] }}
stdout_events_enabled = true
stderr_events_enabled = true

[program:pushgateway]
command=/usr/local/bin/pushgateway
autostart = {{ config['pushgateway']['autostart'] }}
stdout_events_enabled = true
stderr_events_enabled = true

[program:servicekey]
environment=
  PYTHONPATH=%(ENV_QUAYDIR)s
command=python -m workers.servicekeyworker.servicekeyworker
autostart = {{ config['servicekey']['autostart'] }}
stdout_events_enabled = true
stderr_events_enabled = true

[program:manifestbackfillworker]
environment=
  PYTHONPATH=%(ENV_QUAYDIR)s
command=python -m workers.manifestbackfillworker
autostart = {{ config['manifestbackfillworker']['autostart'] }}
stdout_events_enabled = true
stderr_events_enabled = true

[program:securityscanningnotificationworker]
environment=
  PYTHONPATH=%(ENV_QUAYDIR)s
command=python -m workers.securityscanningnotificationworker
autostart = {{ config['securityscanningnotificationworker']['autostart'] }}
stdout_events_enabled = true
stderr_events_enabled = true

[program:repomirrorworker]
environment=
  PYTHONPATH=%(ENV_QUAYDIR)s
command=python -m workers.repomirrorworker.repomirrorworker
autostart = {{ config['repomirrorworker']['autostart'] }}
stdout_events_enabled = true
stderr_events_enabled = true

[program:config-editor]
environment=
  PYTHONPATH=%(ENV_QUAYDIR)s,
  CONFIG_APP_PASSWORD=%(ENV_CONFIG_APP_PASSWORD)s,
  ENV_OPERATOR_ENDPOINT=%(ENV_OPERATOR_ENDPOINT)s,
  CONFIG_EDITOR_STATIC_CONTENT_PATH=%(ENV_QUAYDIR)s/config_app/static
command=config-tool editor --config-dir /conf/stack --password %(ENV_CONFIG_APP_PASSWORD)s --operator-endpoint %(ENV_OPERATOR_ENDPOINT)s --readonly-fieldgroups %(ENV_QUAY_CONFIG_READ_ONLY_FIELD_GROUPS)s
autostart = {{ config['config-editor']['autostart'] }}
stdout_events_enabled = true
stderr_events_enabled = true
# EOF NO NEWLINE
