From d0a42af7ff832cdea84dbd99b5b254383a4390c7 Mon Sep 17 00:00:00 2001 From: wxiaoguang <29147+wxiaoguang@noreply.gitea.com> Date: Thu, 20 Aug 2026 07:56:43 +0000 Subject: [PATCH] Customizing Gitea: add "nonce" to script tags (#520) Reviewed-on: https://gitea.com/gitea/docs/pulls/520 Reviewed-by: silverwind <2021+silverwind@noreply.gitea.com> --- docs/administration/customizing-gitea.md | 18 ++++++++++-------- .../administration/customizing-gitea.md | 18 ++++++++++-------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/docs/administration/customizing-gitea.md b/docs/administration/customizing-gitea.md index 8b3e7541..597857fc 100644 --- a/docs/administration/customizing-gitea.md +++ b/docs/administration/customizing-gitea.md @@ -85,6 +85,8 @@ To obtain any embedded file (including templates), the [`gitea embedded` tool](. Be aware that any statement contained inside `{{` and `}}` are Gitea's template syntax and shouldn't be touched without fully understanding these components. +Gitea pages are protected by Content-Security-Policy, use `` for script tags. + ### Customizing startpage / homepage Copy [`home.tmpl`](https://github.com/go-gitea/gitea/blob/main/templates/home.tmpl) for your version of Gitea from `templates` to `$GITEA_CUSTOM/templates`. @@ -139,7 +141,7 @@ copy JavaScript files from https://gitea.com/davidsvantesson/plantuml-code-highl `$GITEA_CUSTOM/public/assets/` folder. Then add the following to `$GITEA_CUSTOM/templates/custom/footer.tmpl`: ```html -` for script tags. + ### Customizing startpage / homepage Copy [`home.tmpl`](https://github.com/go-gitea/gitea/blob/main/templates/home.tmpl) for your version of Gitea from `templates` to `$GITEA_CUSTOM/templates`. @@ -139,7 +141,7 @@ copy JavaScript files from https://gitea.com/davidsvantesson/plantuml-code-highl `$GITEA_CUSTOM/public/assets/` folder. Then add the following to `$GITEA_CUSTOM/templates/custom/footer.tmpl`: ```html -