summaryrefslogtreecommitdiffstats
path: root/roles/beaker/server/templates/beaker-server.conf
blob: 0e8d4f6ee45a4959414cfdbf2e7c474da4bfea36 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# Unencrypted access is bad
# Un-comment the following to force https connections
RewriteEngine on
#RewriteCond %{REQUEST_URI} !^/rpms/.* [NC]
#RewriteCond %{REQUEST_URI} !^/repos/.* [NC]
#RewriteCond %{REQUEST_URI} !^/harness/.* [NC]
#RewriteCond %{REQUEST_URI} !^/kickstart/.* [NC]
#RewriteCond %{REQUEST_URI} !/ipxe-script$ [NC]
#RewriteCond %{HTTPS} off
#RewriteRule ^/(.*) https://%{HTTP_HOST}%{REQUEST_URI}
#RewriteRule   ^/bkr$  /bkr/   [R]

Alias /static /usr/share/bkr/server/static
Alias /assets/generated /var/cache/beaker/assets
Alias /assets /usr/share/bkr/server/assets
Redirect permanent /apidoc http://beaker-project.org/docs/server-api
Alias /logs /var/www/beaker/logs
Alias /rpms /var/www/beaker/rpms
Alias /repos /var/www/beaker/repos
Alias /harness /var/www/beaker/harness

<Directory "/var/www/beaker/logs">
    <Files "*.log">
        ForceType text/plain
    </Files>
</Directory>

# To work around a thread safety issue in TurboGears where HTTP requests will
# sometimes fail with NoApplicableMethods during application startup, it is
# recommended to set threads=1 here.
# See https://bugzilla.redhat.com/show_bug.cgi?id=796037 for details.
WSGIDaemonProcess beaker-server user=apache group=apache display-name=beaker-server maximum-requests=1000 processes=8 threads=1
WSGISocketPrefix /var/run/wsgi
WSGIRestrictStdout On
WSGIRestrictSignal Off
WSGIPythonOptimize 2
WSGIPassAuthorization On

WSGIScriptAlias / /usr/share/bkr/beaker-server.wsgi

<Directory /usr/share/bkr>
    WSGIApplicationGroup beaker-server
    WSGIProcessGroup beaker-server
    <IfModule mod_authz_core.c>
        # Apache 2.4
        Require all granted
    </IfModule>
    <IfModule !mod_authz_core.c>
        # Apache 2.2
        Order deny,allow
        Allow from all
    </IfModule>
</Directory>

<Directory /var/cache/beaker/assets>
    <IfModule mod_authz_core.c>
        # Apache 2.4
        Require all granted
    </IfModule>
    <IfModule !mod_authz_core.c>
        # Apache 2.2
        Order deny,allow
        Allow from all
    </IfModule>
    # Generated assets have a content hash in their filename so they can
    # safely be cached forever.
    ExpiresActive on
    ExpiresDefault "access plus 1 year"
</Directory>

# Humans will be accessing the application using a CNAME through a reverse
# proxy doing SSL termination. We need to make mellon aware of that since it
# does some sanity checks on the destination URL.
ServerName https://{{ beaker_server_cname }}
UseCanonicalName on

<Location />
    MellonEnable "info"
    MellonSPPrivateKeyFile "/etc/httpd/saml2/{{ beaker_server_cname }}/certificate.key"
    MellonSPCertFile "/etc/httpd/saml2/{{ beaker_server_cname }}/certificate.pem"
    MellonSPMetadataFile "/etc/httpd/saml2/{{ beaker_server_cname }}/metadata.xml"
    MellonIdPMetadataFile "/etc/httpd/saml2/{{ beaker_server_cname }}/idp-metadata.xml"
    MellonEndpointPath /saml2
    MellonVariable "saml-sesion-cookie"
    MellonsecureCookie On
    MellonUser "NAME_ID"
    MellonIdP "IDP"
    MellonSetEnvNoPrefix "REMOTE_USER_FULLNAME" "fullname"
    MellonSetEnvNoPrefix "REMOTE_USER_EMAIL" "email"
    MellonSessionLength 3600
</Location>

<Location /login>
    MellonEnable "auth"
    Header append Cache-Control "no-cache"
</Location>