Skip to content

Commit 802ed59

Browse files
committed
Add unsafe-eval for gitea.scheme.org
Sadly required by some of the third-party JavaScript frameworks Gitea is using. go-gitea/gitea#19851
1 parent 3175001 commit 802ed59

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

nginx.scm

+16-10
Original file line numberDiff line numberDiff line change
@@ -395,16 +395,22 @@
395395

396396
(static-site "video")
397397

398-
(https-server
399-
'("gitea.scheme.org")
400-
"access_log /production/gitea/log/nginx/access.log;"
401-
"error_log /production/gitea/log/nginx/error.log;"
402-
(block "location /"
403-
"proxy_pass http://localhost:9030;"
404-
"proxy_set_header Host $host;"
405-
"proxy_set_header X-Real-IP $remote_addr;"
406-
"proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;"
407-
"client_max_body_size 1G;"))
398+
(parameterize ((content-security-policy
399+
(alist-change (content-security-policy)
400+
"script-src"
401+
'("'self'"
402+
"'unsafe-inline'"
403+
"'unsafe-eval'"))))
404+
(https-server
405+
'("gitea.scheme.org")
406+
"access_log /production/gitea/log/nginx/access.log;"
407+
"error_log /production/gitea/log/nginx/error.log;"
408+
(block "location /"
409+
"proxy_pass http://localhost:9030;"
410+
"proxy_set_header Host $host;"
411+
"proxy_set_header X-Real-IP $remote_addr;"
412+
"proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;"
413+
"client_max_body_size 1G;")))
408414

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

0 commit comments

Comments
 (0)