apiVersion: v1
kind: ConfigMap
metadata:
  name: "resultsdb-frontend-app-config"
  labels:
    app: resultsdb
    service: web
data:
  settings.py: |-
    import os    
{% if env == 'staging' %}
    RDB_URL = '{{ stg_resultsdb_frontend_api_url }}'
{% else %}
    RDB_URL = '{{ prod_resultsdb_frontend_api_url }}'
{% endif %}
    SECRET_KEY = os.environ['RESULTSDB_FRONTEND_SECRET_KEY']

    FILE_LOGGING = False
    LOGFILE = '/var/log/resultsdb_frontend/resultsdb_frontend.log'
    SYSLOG_LOGGING = False
    STREAM_LOGGING = True
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: "resultsdb-frontend-httpd-config"
  labels:
    app: resultsdb
    service: web
data:
  resultsdb_frontend.conf: |-
    RequestHeader unset X-Forwarded-Host
    WSGIDaemonProcess resultsdb_frontend user=apache group=apache threads=5
    WSGIScriptAlias / /usr/share/resultsdb_frontend/resultsdb_frontend.wsgi
    WSGISocketPrefix /tmp/wsgi
    
    <Directory /usr/share/resultsdb_frontend>
        WSGIProcessGroup resultsdb_frontend 
        WSGIApplicationGroup %{GLOBAL}
        WSGIScriptReloading On
    
        Order deny,allow
        Allow from all
        <IfModule mod_authz_core.c>
            # Apache 2.4
            Require all granted
        </IfModule>
        <IfModule !mod_auth_core.c>
          Order allow,deny
          Allow from all
        </IfModule>
    </Directory> 
