homepage/sites/coderdojo/httpd.conf

45 lines
1.4 KiB
ApacheConf

server.modules += ( "mod_accesslog", "mod_alias", "mod_cgi", "mod_redirect", "mod_rewrite", "mod_setenv" )
server.port = 80
# See here: https://redmine.lighttpd.net/boards/2/topics/8382
accesslog.filename = "/dev/fd/3"
include "@mimetypes@"
server.document-root = "@site@"
index-file.names = ( "index.html" )
setenv.set-response-header += (
"Content-Security-Policy" => "default-src 'self'; image-src 'self' https://photos.gutwe.in; script-src 'self' 'eval' 'unsafe-inline' https://hcaptcha.com https://*.hcaptcha.com; frame-src 'self' https://hcaptcha.com https://*.hcaptcha.com; style-src 'self' https://hcaptcha.com https://*.hcaptcha.com; connect-src 'self' https://hcaptcha.com https://*.hcaptcha.com; frame-ancestors 'none'",
)
#
# CGI / form handling
#
$HTTP["request-method"] =~ "GET|POST" {
url.rewrite = (
"^/anmelden" => "/cgi-bin/form.py",
)
}
$HTTP["url"] =~ "^/cgi-bin/" {
alias.url += ( "/cgi-bin" => "@cgibin@" )
static-file.exclude-extensions = ( ".py" )
cgi.assign = ( ".py" => "@python@/bin/python" )
cgi.execute-x-only = "enable"
cgi.x-sendfile = "enable"
cgi.x-sendfile-docroot = ( "@site@" )
setenv.set-environment = (
"SITE_DIRECTORY" => "@site@",
"ZAMMAD_URL" => env.ZAMMAD_URL,
"ZAMMAD_TOKEN" => env.ZAMMAD_TOKEN,
"ZAMMAD_GROUP" => env.ZAMMAD_GROUP,
"HCAPTCHA_SITE_KEY" => env.HCAPTCHA_SITE_KEY,
"HCAPTCHA_SECRET_KEY" => env.HCAPTCHA_SECRET_KEY,
)
}