Skip to content

1.16.0 "View file" is missing line menu, but is there on try.gitea.io #18517

Closed
@flozzone

Description

@flozzone

Gitea Version

1.16.0

Git Version

2.30.2

Operating System

Centos 7

How are you running Gitea?

Deployed with Ansible as a plain docker container with second container running Apache as proxy to serve Gitea as HTTPS. The Gitea container is built from the official container at docker hub gitea/gitea:1.16.0. It is just rebuilt to provide SSL certificates for our SSO.

Dockerfile:

FROM gitea/gitea:{{ gitea_version }}
RUN apk update && apk add ca-certificates && rm -rf /var/cache/apk/*
COPY ./sso.pem /usr/local/share/ca-certificates/sso.pem
RUN update-ca-certificates

Database

PostgreSQL

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Description

Since I've upgraded to 1.16.0 the line anchors in the raw view of a file are missing. So clicking on a line number does nothing. When I counter-checked this on try.gitea.io, I could see that it works there. So the first thing that came in my mind, was that the proxy would be caching an older version, but because the javascript URL contains a version number it should automatically invalidate any cached file. Nevertheless I've restarted the proxy, but without success.

Since this cannot be reproduced on try.gitea.io, I am pretty sure this has something to do with my setup. The apache config is aligned to the one in the docs at https://docs.gitea.io/en-us/reverse-proxies/

<VirtualHost *:443>
    SSLEngine On

    Protocols h2 h2c http/1.1

    SSLCertificateFile /etc/gitea-cert/gitea.cert
    SSLCertificateKeyFile /etc/gitea-cert/gitea.key
    SSLCertificateChainFile /etc/gitea-cert/gitea-chain.cert

    RequestHeader set X-Forwarded-Proto 'https'

    ProxyPreserveHost On
    ProxyRequests Off
    AllowEncodedSlashes NoDecode

    ProxyPass / http://gitea:3000/ nocanon
</VirtualHost>

Side-note: Is the doc missing the part with Protocols h2 h2c http/1.1? I remember HTTP/2 is needed for server push on some pages.

When I try to pass an anchor to a view file URL by appending #L1, it does nothing. Is it entirely handled by JS?

No special Gitea HTML templates are defined.

Do you have any suggestion or hint?

Screenshots

Line menu on try.gitea.io at https://try.gitea.io/company-org/custom-project/src/commit/dfe059d3d4e732b10a3b8d8e64f874e4c74a0e99/file.txt#L1

image

No line menu on our installation:

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions