Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
flozzone opened this issue Feb 1, 2022 · 4 comments
Closed
Milestone

Comments

@flozzone
Copy link
Contributor

flozzone commented Feb 1, 2022

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

@lunny lunny added the type/bug label Feb 1, 2022
@lunny lunny added this to the 1.16.1 milestone Feb 1, 2022
This was referenced Feb 1, 2022
@flozzone
Copy link
Contributor Author

flozzone commented Feb 2, 2022

Do you have any explanation, why I wasn't able to reproduce this on try.gitea.io?

@flozzone
Copy link
Contributor Author

flozzone commented Feb 3, 2022

After testing this again today, it just worked. Seems its a caching issue and we just run out of TTL. Has the version in https://out-git-host/assets/js/index.js?v=63283ac5ef3618dbfa5fcf82866ca1ea been correctly updated with the upgrade? Do you see any problems in my Apache config that would cause stripped URL parameters for that JS asset? Or are these assets somehow pulled from a remote and you've just fixed it?

@zeripath zeripath removed the type/bug label Feb 3, 2022
@zeripath
Copy link
Contributor

zeripath commented Feb 3, 2022

yeah it's a caching bug that commonly occurs. I'm gonna close this issue.

@zeripath zeripath closed this as completed Feb 3, 2022
@flozzone
Copy link
Contributor Author

flozzone commented Feb 4, 2022

ok thanks, I will just wait the next time after upgrading.

@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants