Skip to content

Commit

Permalink
Add unsafe-eval for gitea.scheme.org
Browse files Browse the repository at this point in the history
Sadly required by some of the third-party JavaScript frameworks Gitea
is using. go-gitea/gitea#19851
  • Loading branch information
lassik committed Jan 31, 2023
1 parent 3175001 commit 802ed59
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions nginx.scm
Original file line number Diff line number Diff line change
Expand Up @@ -395,16 +395,22 @@

(static-site "video")

(https-server
'("gitea.scheme.org")
"access_log /production/gitea/log/nginx/access.log;"
"error_log /production/gitea/log/nginx/error.log;"
(block "location /"
"proxy_pass http://localhost:9030;"
"proxy_set_header Host $host;"
"proxy_set_header X-Real-IP $remote_addr;"
"proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;"
"client_max_body_size 1G;"))
(parameterize ((content-security-policy
(alist-change (content-security-policy)
"script-src"
'("'self'"
"'unsafe-inline'"
"'unsafe-eval'"))))
(https-server
'("gitea.scheme.org")
"access_log /production/gitea/log/nginx/access.log;"
"error_log /production/gitea/log/nginx/error.log;"
(block "location /"
"proxy_pass http://localhost:9030;"
"proxy_set_header Host $host;"
"proxy_set_header X-Real-IP $remote_addr;"
"proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;"
"client_max_body_size 1G;")))

(block "map $go_scheme_source $go_scheme_target"
"include /production/go/nginx/map.conf;")
Expand Down

0 comments on commit 802ed59

Please sign in to comment.