diff --git a/roles/distgit/pagure/templates/pagure.cfg b/roles/distgit/pagure/templates/pagure.cfg index faf34abcb6..8db0e20ad9 100644 --- a/roles/distgit/pagure/templates/pagure.cfg +++ b/roles/distgit/pagure/templates/pagure.cfg @@ -300,6 +300,18 @@ ADMIN_API_ACLS = [ PROJECT_NAME_REGEX = '^[a-zA-z0-9_][a-zA-Z0-9-_\.+]*$' + +{% if env == 'staging' %} +CSP_HEADERS = ( + "default-src 'self'; " + "script-src 'self' '{nonce_script}' https://apps.stg.fedoraproject.org https://mdapi.stg.fedoraproject.org https://transtats.stg.fedoraproject.org; " + "style-src 'self' '{nonce_style}'; " + "object-src 'none'; " + "base-uri 'self'; " + "img-src 'self' https:; " + "connect-src 'self' https://pdc.stg.fedoraproject.org https://apps.stg.fedoraproject.org https://mdapi.stg.fedoraproject.org https://transtats.stg.fedoraproject.org https://bodhi.stg.fedoraproject.org;" +) +{% else %} CSP_HEADERS = ( "default-src 'self'; " "script-src 'self' '{nonce_script}' https://apps.fedoraproject.org https://mdapi.fedoraproject.org https://transtats.fedoraproject.org; " @@ -309,5 +321,6 @@ CSP_HEADERS = ( "img-src 'self' https:; " "connect-src 'self' https://pdc.fedoraproject.org https://apps.fedoraproject.org https://mdapi.fedoraproject.org https://transtats.fedoraproject.org https://bodhi.fedoraproject.org;" ) +{% endif %} {% include "pagure_shared.cfg" %}