diff --git a/docker/gitea/Dockerfile b/docker/gitea/Dockerfile
index 6a4870943b..6d2e02c066 100644
--- a/docker/gitea/Dockerfile
+++ b/docker/gitea/Dockerfile
@@ -27,13 +27,13 @@ FROM docker.io/library/golang:1.18-bullseye AS build-env
LABEL maintainer="infra-root@openstack.org"
-ARG GITEA_VERSION="v1.16.9"
+ARG GITEA_VERSION="v1.17.1"
ENV TAGS "bindata $TAGS"
#Build deps
RUN apt-get update && apt-get -y install build-essential git apt-transport-https curl gnupg2 \
&& curl -sS https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \
- && echo "deb https://deb.nodesource.com/node_14.x bullseye main" | tee /etc/apt/sources.list.d/nodesource.list \
+ && echo "deb https://deb.nodesource.com/node_16.x bullseye main" | tee /etc/apt/sources.list.d/nodesource.list \
&& apt-get update \
&& apt-get -q --option "Dpkg::Options::=--force-confold" --assume-yes install nodejs \
&& mkdir -p ${GOPATH}/src/code.gitea.io/gitea
@@ -92,8 +92,9 @@ COPY --from=build-env /go/src/code.gitea.io/gitea/docker/root /
COPY --from=build-env /go/src/code.gitea.io/gitea/gitea /app/gitea/gitea
COPY --from=build-env /go/src/code.gitea.io/gitea/environment-to-ini /usr/local/bin/environment-to-ini
-# Copy our custom templates
+# Copy our custom templates and some additional image files
COPY custom/ /custom/
+# Copy our opendev logo contents to the custom location
RUN --mount=type=bind,from=opendevorg/assets,target=/tmp/assets cp /tmp/assets/* /custom/public/img/
ENV GITEA_CUSTOM /custom
diff --git a/docker/gitea/custom/templates/base/head_navbar.tmpl b/docker/gitea/custom/templates/base/head_navbar.tmpl
index a26d6f9e56..e13ee6bfc2 100644
--- a/docker/gitea/custom/templates/base/head_navbar.tmpl
+++ b/docker/gitea/custom/templates/base/head_navbar.tmpl
@@ -1,7 +1,7 @@
-
-
+
+
- {{if .IsMirror}}
{{end}}
+ {{if $.IsPullMirror}}
+ {{$address := MirrorRemoteAddress $.Context . $.Mirror.GetRemoteName}}
+
+ {{end}}
{{if .IsFork}}
{{end}}
{{if .IsGenerated}}
{{end}}
@@ -159,7 +163,7 @@
{{svg "octicon-issue-opened"}} {{.i18n.Tr "repo.issues"}}
{{if .Repository.NumOpenIssues}}
- {{CountFmt .Repository.NumOpenIssues}}
+ {{CountFmt .Repository.NumOpenIssues}}
{{end}}
{{end}}
@@ -174,7 +178,7 @@
{{svg "octicon-git-pull-request"}} {{.i18n.Tr "repo.pulls"}}
{{if .Repository.NumOpenPulls}}
- {{CountFmt .Repository.NumOpenPulls}}
+ {{CountFmt .Repository.NumOpenPulls}}
{{end}}
{{end}}
@@ -184,11 +188,17 @@
{{svg "octicon-git-pull-request"}} Proposed changes
+ {{if .Permission.CanRead $.UnitTypePackages}}
+
+ {{svg "octicon-package"}} {{.i18n.Tr "packages.title"}}
+
+ {{end}}
+
{{ if and (not .UnitProjectsGlobalDisabled) (.Permission.CanRead $.UnitTypeProjects)}}
{{svg "octicon-project"}} {{.i18n.Tr "repo.project_board"}}
{{if .Repository.NumOpenProjects}}
- {{CountFmt .Repository.NumOpenProjects}}
+ {{CountFmt .Repository.NumOpenProjects}}
{{end}}
{{ end }}
@@ -198,7 +208,7 @@
{{svg "octicon-tag"}} {{.i18n.Tr "repo.releases"}}
{{if .NumReleases}}
- {{CountFmt .NumReleases}}
+ {{CountFmt .NumReleases}}
{{end}}
{{end}}
diff --git a/playbooks/roles/gitea/templates/app.ini.j2 b/playbooks/roles/gitea/templates/app.ini.j2
index 2358f48339..7cbbd3417f 100644
--- a/playbooks/roles/gitea/templates/app.ini.j2
+++ b/playbooks/roles/gitea/templates/app.ini.j2
@@ -40,6 +40,9 @@ DISABLE_STARS = true
; to true again.
DISABLE_PARTIAL_CLONE = false
+[packages]
+ENABLED = false
+
[indexer]
ISSUE_INDEXER_PATH = /data/gitea/indexers/issues.bleve
REPO_INDEXER_ENABLED = true
diff --git a/testinfra/test_gitea.py b/testinfra/test_gitea.py
index 594905349d..9449a8c300 100644
--- a/testinfra/test_gitea.py
+++ b/testinfra/test_gitea.py
@@ -85,6 +85,14 @@ def test_project_clone(host):
'/tmp/disk-image-builder')
assert "Cloning into '/tmp/disk-image-builder'..." in cmd.stderr
assert cmd.succeeded
+ # Check that our default of master is still honored.
+ # Gitea defaults to main as of 1.17.0.
+ cmd = host.run(
+ 'git -C /tmp/disk-image-builder '
+ 'symbolic-ref refs/remotes/origin/HEAD')
+ assert "refs/remotes/origin/master" in cmd.stdout
+ assert "refs/remotes/origin/main" not in cmd.stdout
+ assert cmd.succeeded
def test_partial_project_clone(host):
cmd = host.run(
@@ -94,6 +102,14 @@ def test_partial_project_clone(host):
'/tmp/test-system-config-clone')
assert "Cloning into '/tmp/test-system-config-clone'..." in cmd.stderr
assert cmd.succeeded
+ # Check that our default of master is still honored.
+ # Gitea defaults to main as of 1.17.0.
+ cmd = host.run(
+ 'git -C /tmp/test-system-config-clone '
+ 'symbolic-ref refs/remotes/origin/HEAD')
+ assert "refs/remotes/origin/master" in cmd.stdout
+ assert "refs/remotes/origin/main" not in cmd.stdout
+ assert cmd.succeeded
def test_gitea_screenshots(host):