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

Add URL function to serve attachments directly from S3/Minio #6

Closed
wants to merge 0 commits into from

Conversation

tystuyfzand
Copy link

Adds the ability for S3/Object storage to serve files directly (authenticated, of course) instead of passing through Gitea itself.

This has many benefits, including:

  • Serving more data at once, like using S3/Object Storage as a CDN/File Host
  • Allowing Gitea to not spend time/resources serving the file by requesting it from the object storage, instead pushing it off to a different service. Related to above.

This has a single TODO item, which involves possibly determining whether to inline or attach the file, or serve it as plain text. S3/Minio support the "Content-Disposition" header via the parameter "response-content-disposition" (MinIO Docs, Amazon S3 docs - Overriding Response Header Values), as well as a few others.

routers/repo/attachment.go Outdated Show resolved Hide resolved
@lunny
Copy link
Owner

lunny commented Jun 25, 2020

Please rebase, I just force pushed to this branch

@tystuyfzand
Copy link
Author

Hopefully that worked... not terribly familiar with the rebase procedure like that.

@lunny
Copy link
Owner

lunny commented Jun 26, 2020

@tystuyfzand I have merged this PR to my branch.

GiteaBot pushed a commit that referenced this pull request Aug 7, 2023
- Currently the post processing will transform all issue indexes (such as `#6`) into a clickable link.
- This makes sense in an situation like issues or PRs,
where referencing to other issues is quite common
and only referencing their issue index is an handy and efficient way to do it.
- Currently this is also run for documents
(which is the user profile and viewing rendered files),
but in those situations it's less common to reference issues by their index and instead could mean something else.
- This patch disables this post processing for issue index for documents. Matches Github's behavior.
- Added unit tests.
- Resolves https://codeberg.org/Codeberg/Community/issues/1120

Co-authored-by: Gusted <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants