From 048a918a618878f56205a67df2f9a4fbdd0571ad Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Mon, 2 Aug 2021 09:31:18 -0700 Subject: [PATCH] Upgrade gitea to 1.15.3 We move robots.txt to custom/ instead of custom/public/ as custom/public/ is now served at /assets/ via the gitea webserver and we need robots.txt at the root. Related to this we update image urls to be prefixed with AssetUrlPrefix in their paths so that if this path changes against in the future we should automatically accomodate that. Change-Id: I8ce5fe8ff342617ff156a401be8418d593fd35c4 --- docker/gitea/Dockerfile | 2 +- docker/gitea/custom/{public => }/robots.txt | 0 .../custom/templates/base/head_navbar.tmpl | 16 ++++++----- docker/gitea/custom/templates/home.tmpl | 10 +++---- .../gitea/custom/templates/repo/header.tmpl | 28 ++++++++++--------- playbooks/roles/gitea/templates/app.ini.j2 | 1 + 6 files changed, 31 insertions(+), 26 deletions(-) rename docker/gitea/custom/{public => }/robots.txt (100%) diff --git a/docker/gitea/Dockerfile b/docker/gitea/Dockerfile index 791f1cd83e..e606c3d74e 100644 --- a/docker/gitea/Dockerfile +++ b/docker/gitea/Dockerfile @@ -27,7 +27,7 @@ FROM docker.io/library/golang:1.16-buster AS build-env LABEL maintainer="infra-root@openstack.org" -ARG GITEA_VERSION="v1.14.7" +ARG GITEA_VERSION="v1.15.3" ENV TAGS "bindata $TAGS" #Build deps diff --git a/docker/gitea/custom/public/robots.txt b/docker/gitea/custom/robots.txt similarity index 100% rename from docker/gitea/custom/public/robots.txt rename to docker/gitea/custom/robots.txt diff --git a/docker/gitea/custom/templates/base/head_navbar.tmpl b/docker/gitea/custom/templates/base/head_navbar.tmpl index ea5870f9b1..1e96c6c5f4 100644 --- a/docker/gitea/custom/templates/base/head_navbar.tmpl +++ b/docker/gitea/custom/templates/base/head_navbar.tmpl @@ -1,7 +1,7 @@ @@ -72,17 +72,19 @@ -
- {{$.CsrfTokenHtml}} -
- - - {{CountFmt .NumStars}} - -
-
+ {{if not $.DisableStars}} +
+ {{$.CsrfTokenHtml}} +
+ + + {{CountFmt .NumStars}} + +
+
+ {{end}} {{if and (not .IsEmpty) ($.Permission.CanRead $.UnitTypeCode)}}
diff --git a/playbooks/roles/gitea/templates/app.ini.j2 b/playbooks/roles/gitea/templates/app.ini.j2 index 21cb861a7a..791359a844 100644 --- a/playbooks/roles/gitea/templates/app.ini.j2 +++ b/playbooks/roles/gitea/templates/app.ini.j2 @@ -32,6 +32,7 @@ LOG_SQL = false [repository] ROOT = /data/git/repositories DISABLED_REPO_UNITS = repo.issues,repo.pulls,repo.wiki,repo.projects +DISABLE_STARS = true [indexer] ISSUE_INDEXER_PATH = /data/gitea/indexers/issues.bleve