#We use wsgi by default
Alias /koji "/usr/share/koji-web/scripts/wsgi_publisher.py"
#(configuration goes in /etc/kojiweb/web.conf)

<Directory "/usr/share/koji-web/scripts/">
    Options ExecCGI
    SetHandler wsgi-script
    WSGIApplicationGroup %{GLOBAL}
    # ^ works around an OpenSSL issue
    # see: https://cryptography.io/en/latest/faq/#starting-cryptography-using-mod-wsgi-produces-an-internalerror-during-a-call-in-register-osrandom-engine
    <IfVersion < 2.4>
        Order allow,deny
        Allow from all
    </IfVersion>
    <IfVersion >= 2.4>
        Require all granted
    </IfVersion>
</Directory>

# uncomment this to enable authentication via Kerberos
# <Location /koji/login>
#     AuthType Kerberos
#     AuthName "Koji Web UI"
#     KrbMethodNegotiate on
#     KrbMethodK5Passwd off
#     KrbServiceName HTTP
#     KrbAuthRealm EXAMPLE.COM
#     Krb5Keytab /etc/httpd.keytab
#     KrbSaveCredentials off
#     Require valid-user
#     ErrorDocument 401 /koji-static/errors/unauthorized.html
# </Location>

# uncomment this to enable authentication via SSL client certificates
# <Location /koji/login>
#     SSLVerifyClient require
#     SSLVerifyDepth  10
#     SSLOptions +StdEnvVars
# </Location>

Alias /koji-static/ "/usr/share/koji-web/static/"

<Directory "/usr/share/koji-web/static/">
    Options None
    AllowOverride None
    <IfVersion < 2.4>
        Order allow,deny
        Allow from all
    </IfVersion>
    <IfVersion >= 2.4>
        Require all granted
    </IfVersion>
</Directory>
