-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Add server config option for always rendering html code #683
Comments
Are you talking about a feature like #302? |
Not exactly |
More like allowing rendering of files in the repo. |
Can you explain the use case for that? I don't get it yet ;) |
I have repository with HTML templates. I would like to preview them easily without them being in a separate location. I trust all users with write access to the server, so I want to simplify things by allowing rendering it right out of the repository. |
Something like changing the
The setting |
I will open a PR |
I have opened the PR, and it is ready. I have tested the feature myself too. |
What do others think about that? I don't really like the idea to render every document/file. |
@tboerger I think that even though it is a security risk in most cases, there may be some cases, including my own, where it is needed. It really is not much of a security risk of there is only a few trusted people who are able to write to our create repositories. |
@tboerger Also, in the issue about XSS with gogs' current implementation which is a ?render parameter, the author of the issue suggests for the option to be moved to the config file gogs/gogs#3608 |
One example of people needing an option like this: gogs/gogs#2593 |
Another few examples: gogs/gogs#2283 (comment) and gogs/gogs#2283 (comment) The last one I put cannot be solved using something like GitHub pages because it involves viewing rendered raw history of a file |
IMHO this is something to solve for a separate tool. Many users don't get know how important this option can get |
What if we do not document the option?
|
I really don't like undocumented options... Someone will see it in the code and turn it on without knowing the consequences of that... I'm with @tboerger on this one, Gitea is not made to work like a CDN, there are many other projects out there that fit the purpose better. Caddy can even be setup to monitor your git-repo and automagically serve from that. |
If I am to be completely honest, I vote to remove the |
same with #685 |
Doesn't the csrf request token prevent this from being a security risk? If we make it not set the csrf cookie when sending the page, then wouldn't this be perfectly fine? |
How about clearly describing the security risk, in the current documentation ? |
@strk Yes, and also, I use this patch in my server, and many of my friends do as well. There have not been any problems so far. How should it be described? |
But my point is we can genearte files and push the files to servers. Copy my point from Gitter. And we can detect the repo's types. Hugo maybe the first type and other formats. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions. |
This issue has been automatically closed because of inactivity. You can re-open it if needed. |
[x]
):Description
I have a few repos of HTML code, in a repository on a server which only me and people I trust access. I would like there to be a server configuration option to always render html in repos. I am willing to add this feature myself.
--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/41023445-add-server-config-option-for-always-rendering-html-code?utm_campaign=plugin&utm_content=tracker%2F47456670&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F47456670&utm_medium=issues&utm_source=github).The text was updated successfully, but these errors were encountered: