Preview #4109

Closed
opened 2025-11-02 05:38:28 -06:00 by GiteaMirror · 10 comments
Owner

Originally created by @jdkdfjuwicvh on GitHub (Oct 13, 2019).

  • Gitea version (or commit ref): 1.9.4
  • Git version: 2.20.1
  • Operating system: Raspbian Buster + pre-release kernel (Raspberry Pi 4)
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

The preview tab of the text editor doesn't load anything.

Screenshots

screenshot cleaned

Originally created by @jdkdfjuwicvh on GitHub (Oct 13, 2019). <!-- NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue --> <!-- 1. Please speak English, this is the language all maintainers can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/gitea) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): 1.9.4 - Git version: 2.20.1 - Operating system: Raspbian Buster + pre-release kernel (Raspberry Pi 4) - Database (use `[x]`): - [ ] PostgreSQL - [x] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [x] No - [ ] Not relevant - Log gist: ## Description The preview tab of the text editor doesn't load anything. ## Screenshots ![screenshot cleaned](https://user-images.githubusercontent.com/56083768/66722374-482d9880-edfc-11e9-8ef6-480856156747.png)
Author
Owner

@zeripath commented on GitHub (Oct 13, 2019):

It appears to works on try.gitea.io

What file format are you trying to preview? What browser are you using?
What's your app.ini? Have you switched off the API?

@zeripath commented on GitHub (Oct 13, 2019): It appears to works on try.gitea.io What file format are you trying to preview? What browser are you using? What's your app.ini? Have you switched off the API?
Author
Owner

@jdkdfjuwicvh commented on GitHub (Oct 13, 2019):

I know it works on try.gitea.io. I'm just trying to preview the changes of the README. I tired with Tor browser first, but I also checked with the default profile of Firefox. In my app.ini I just added one rule: MAX_CREATION_LIMIT = 0. I didn't switch off the API, at least knowingly: doing grep 'SWAGGER' app.ini doesn't return anything so I guess the API is enabled.
NOTE: The 'Preview Changes' tab works correctly, if this can help.

@jdkdfjuwicvh commented on GitHub (Oct 13, 2019): I know it works on try.gitea.io. I'm just trying to preview the changes of the README. I tired with Tor browser first, but I also checked with the default profile of Firefox. In my app.ini I just added one rule: MAX_CREATION_LIMIT = 0. I didn't switch off the API, at least knowingly: doing grep 'SWAGGER' app.ini doesn't return anything so I guess the API is enabled. NOTE: The 'Preview Changes' tab works correctly, if this can help.
Author
Owner

@zeripath commented on GitHub (Oct 13, 2019):

Ok. Could you check what the browser is sending when you click preview?

It should send a POST message to /api/v1/repos/:username/:reponame/markdown

Is it sending that POST to the correct place?

@zeripath commented on GitHub (Oct 13, 2019): Ok. Could you check what the browser is sending when you click preview? It should send a POST message to /api/v1/repos/:username/:reponame/markdown Is it sending that POST to the correct place?
Author
Owner

@jdkdfjuwicvh commented on GitHub (Oct 13, 2019):

Emh, I'm just a teen I don't know that stuff... could you provide a very brief explanation about how to verify that? However, I'm not sure anymore about the state of the API, because when I try to load try.gitea.io/api/swagger my browser loads up a webpage, but if I try to open the "API page" of my gitea istance, my browser doesn't load anything. Does it matter?

@jdkdfjuwicvh commented on GitHub (Oct 13, 2019): Emh, I'm just a teen I don't know that stuff... could you provide a very brief explanation about how to verify that? However, I'm not sure anymore about the state of the API, because when I try to load try.gitea.io/api/swagger my browser loads up a webpage, but if I try to open the "API page" of my gitea istance, my browser doesn't load anything. Does it matter?
Author
Owner

@zeripath commented on GitHub (Oct 13, 2019):

It sounds like you've misconfigured Gitea so I'd double check that you have the configuration correct in your app.ini

@zeripath commented on GitHub (Oct 13, 2019): It sounds like you've misconfigured Gitea so I'd double check that you have the configuration correct in your app.ini
Author
Owner

@jdkdfjuwicvh commented on GitHub (Oct 13, 2019):

Sorry, but my app.ini seems to be fine (https://paste.debian.net/1106435/).
Is there another simple way to check if the API is working or not? Like another element in the page that wouldn't work without the API turned on?

@jdkdfjuwicvh commented on GitHub (Oct 13, 2019): Sorry, but my app.ini seems to be fine (https://paste.debian.net/1106435/). Is there another simple way to check if the API is working or not? Like another element in the page that wouldn't work without the API turned on?
Author
Owner

@zeripath commented on GitHub (Oct 13, 2019):

What is the URL you are using to browse to Gitea?

@zeripath commented on GitHub (Oct 13, 2019): What is the URL you are using to browse to Gitea?
Author
Owner

@jdkdfjuwicvh commented on GitHub (Oct 13, 2019):

I was using it locally, but I've just finished setting up a temporary onion service in case you want to test (idk if it can cause other problems tho) : http://f6awmtbw572jcr2jaekqqnteuirdqoag64i6dnewph5y63xpsdmfabqd.onion/

@jdkdfjuwicvh commented on GitHub (Oct 13, 2019): I was using it locally, but I've just finished setting up a temporary onion service in case you want to test (idk if it can cause other problems tho) : http://f6awmtbw572jcr2jaekqqnteuirdqoag64i6dnewph5y63xpsdmfabqd.onion/
Author
Owner

@zeripath commented on GitHub (Oct 13, 2019):

Well the tor won't work unless you tell Gitea that's its ROOT_URL is that onion address.

Similarly by locally, do you mean from a browser on the same machine as the server i.e. your browser was browsing to localhost:3000 or were you doing it across the network because again that would explain why the preview failed.

In Firefox there are likely some developer tools that you can use to check what requests your browser webpages are making. That was what I was meaning by checking what the preview page was POSTing, as I suspect that although the preview page is making a POST it is not sending it to correct place because you have incorrectly configured Gitea to say what it's ROOT_URL is.

If your server and client machines are not the same, a ROOT_URL of http://localhost:3000 is incorrect. It is certainly incorrect if you're trying to access Gitea over Tor.

@zeripath commented on GitHub (Oct 13, 2019): Well the tor won't work unless you tell Gitea that's its ROOT_URL is that onion address. Similarly by locally, do you mean from a browser on the same machine as the server i.e. your browser was browsing to localhost:3000 or were you doing it across the network because again that would explain why the preview failed. In Firefox there are likely some developer tools that you can use to check what requests your browser webpages are making. That was what I was meaning by checking what the preview page was POSTing, as I suspect that although the preview page is making a POST it is not sending it to correct place because you have incorrectly configured Gitea to say what it's ROOT_URL is. If your server and client machines are not the same, a ROOT_URL of http://localhost:3000 is incorrect. It is certainly incorrect if you're trying to access Gitea over Tor.
Author
Owner

@jdkdfjuwicvh commented on GitHub (Oct 14, 2019):

Sorry for the delay and thanks for the clear explanation. As you said, the problem was the ROOT_URL, I fixed it and now it works. Thanks for the help!

@jdkdfjuwicvh commented on GitHub (Oct 14, 2019): Sorry for the delay and thanks for the clear explanation. As you said, the problem was the ROOT_URL, I fixed it and now it works. Thanks for the help!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#4109