-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Markdown Preview can't be viewed - 403 Forbidden #17408
Comments
Are you sure your session is still valid / you're still logged in after refreshing? |
Yes, after a page reload I'm still logged in, and I can do anything that a logged in user can.
There is no Sudo header set in my requests:
|
Oh, I got the header above from my browsers's developer console. Did you mean to inspect it at the server? |
Found out how to capture the requests in the Gitea container, so here is what I found.
Output:
I cut off requests that seemed to not be relevant. |
Also, there's a detail that I forgot to tell but it might be interesting to you. I use uMatrix in my browser, and unless I turn off "Forbid mixed content" for my gitea's domain, it simply blocks the request. uMatrix is a content blocker like uBlock, and the "Forbid mixed content" option blocks plain HTTP requests on HTTPS sites. My Gitea instance is accesed through HTTPS from the clients to my reverse proxy, and it's HTTP from the reverse proxy to Gitea, but that HTTP connection happens inside a Docker bridge network so it shouldn't be a big problem. And before I send this, there's an other one:
And while this happens, I'm still logged in, as a test I just changed my biography in my profile and it persisted. |
Can it be the problem that no cookies are sent in requests to /markdown? You said that you wasn't able to reproduce the problem, and others haven't complained either, so it must be something on my end. Is there a simple way I could debug the Gitea client? I see that the JS has probably been minified. |
Yeah it looks like a problem with your setup. You mentioned you can't repro on try.gitea.io, so I'd also assume it's not something your browser extensions mess up. Interestingly when I modify the request removing all cookies, I get a 404 back, not a 403 (as expected; I'm not aware of more code paths that return a 403..), so this is odd. For further support please visit the gitea discord :) |
I have both set in the main
Sorry, but I don't have access to discord, because they require phone and email verification on registerning a new account (even if it's an anonymous one). |
Gitea reads only a single file, which one should be displayed in the startup log messages.
They require both now?! That's something I wouldn't get on board with either.. |
I'm kind of surprised then that my Gitea was working at all. I'll move my settings over there and report back if the issue was fixed by this.
It's a bit complicated.I think not everyone is required both or any of these, but it seems that if your browser is configured for higher privacy (privacy.resistfingerprinting and such), they flag your IP (at least for some time) so any registrations (even from a brand new VM with a brand new browser profile) will end up in requiring you to provide these. In some circumstances they will disable your account right after the verification, but that might only happen if you use temporary mail and sms services for that. |
Well, looked up the Docker installation guide again here, and it seems above I have inserted the wrong config file. So in the end the log options did not work because I put them in the wrong place (🤦), but the other news is that at the correct place ( Aaand found the problem. It seems the value of Thank you for making me find this config value! |
Gitea Version
v1.15.5
Git Version
No response
Operating System
Raspbian Buster
How are you running Gitea?
I build Gitea myself on an x86 machine in an Ubuntu VM, for armv7 architecture, with docker buildx. I do this by cloning this repo, and without making changes running the following command:
$GITEA_VERSION here is the git tag of the version which I want to build. The container I currently run was built with this being set to
1.15.5
.When this completes, I get a tar file, which I transfer to my RPi 4, and there I can
sudo docker image load -i [image_path]
.Then I adjust my docker-compose configuration to use this new image.
Database
MySQL
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
https://gist.github.com/MPeti1/e508529515b3cbfae94b09f40087b536
Description
The problem appears in the text editor I use when creating a new issue, in the text editor of issue comments, in the text editor of wiki pages, and in the text editor of MD files of the repository too.
In the web UI, this ends in an endless "Loading..." in the place of the preview:
While debugging this problem, with my browser's developer console I've found that when I open the "Preview" tab of the editor, a request is made to
https://[domain_name]/api/v1/repos/[username]/[reponame]/markdown
, which ends up with the status "403 - Forbidden".At the same time, these 2 lines are logged in the Gitea container:
Please note, that for the log gist I tried to set the log options described here, but it did not seem to work, even though I've restarted the container.
Here is how
/etc/gitea/conf/app.ini
looks like inside the Gitea container:Screenshots
No response
The text was updated successfully, but these errors were encountered: