You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gitea/modules
Henrique Pimentel f7125ab61a
Add `MAX_ROWS` option for CSV rendering (#30268)
This solution implements a new config variable MAX_ROWS, which
corresponds to the “Maximum allowed rows to render CSV files. (0 for no
limit)” and rewrites the Render function for CSV files in markup module.
Now the render function only reads the file once, having MAX_FILE_SIZE+1
as a reader limit and MAX_ROWS as a row limit. When the file is larger
than MAX_FILE_SIZE or has more rows than MAX_ROWS, it only renders until
the limit, and displays a user-friendly warning informing that the
rendered data is not complete, in the user's language.

---

Previously, when a CSV file was larger than the limit, the render
function lost its function to render the code. There were also multiple
reads to the file, in order to determine its size and render or
pre-render.

The warning: ![image](https://s3.amazonaws.com/i.snag.gy/vcKh90.jpg)
8 months ago
..
actions Resolve lint for unused parameter and unnecessary type arguments (#30750) 9 months ago
activitypub Upgrade to golangci-lint@v1.55.0 (#27756) 1 year ago
analyze Rename code_langauge.go to code_language.go (#26377) 2 years ago
assetfs Use `Set[Type]` instead of `map[Type]bool/struct{}`. (#26804) 1 year ago
auth Remove external API calls in `TestPassword` (#30716) 9 months ago
avatar Use `crypto/sha256` (#29386) 12 months ago
badge Implement actions badge svgs (#28102) 12 months ago
base Refactor sha1 and time-limited code (#31023) 9 months ago
cache Fix missing memcache import (#31105) 9 months ago
charset Render embedded code preview by permlink in markdown (#30234) 10 months ago
container Add container.FilterSlice function (#30339) 10 months ago
csv Render embedded code preview by permlink in markdown (#30234) 10 months ago
dump Refactor "dump" sub-command (#30240) 10 months ago
emoji Update emoji set to Unicode 15 (#25595) 2 years ago
eventsource Final round of `db.DefaultContext` refactor (#27587) 1 year ago
generate Refactor JWT secret generating & decoding code (#29172) 12 months ago
git Refactor sha1 and time-limited code (#31023) 9 months ago
gitgraph More `db.DefaultContext` refactor (#27265) 1 year ago
gitrepo Use repo as of renderctx's member rather than a repoPath on metas (#29222) 8 months ago
graceful Remove unused error in graceful manager (#29871) 11 months ago
hcaptcha Consume hcaptcha and pwn deps (#22610) 2 years ago
highlight Add option to disable ambiguous unicode characters detection (#28454) 1 year ago
hostmatcher Support allowed hosts for webhook to work with proxy (#27655) 1 year ago
html Refactor backend SVG package and add tests (#26335) 2 years ago
httpcache Also match weakly validated ETags (#28957) 1 year ago
httplib Improve reverse proxy documents and clarify the AppURL guessing behavior (#31003) 9 months ago
indexer Rename project board -> column to make the UI less confusing (#30170) 9 months ago
issue/template Support setting the `default` attribute of the issue template dropdown field (#31045) 9 months ago
json Replace `interface{}` with `any` (#25686) 2 years ago
label Make label templates have consistent behavior and priority (#23749) 2 years ago
lfs Make sure git version&feature are always prepared (#30877) 9 months ago
log Add some tests to clarify the "must-change-password" behavior (#30693) 10 months ago
markup Add `MAX_ROWS` option for CSV rendering (#30268) 8 months ago
mcaptcha Implement FSFE REUSE for golang files (#21840) 2 years ago
metrics Rename project board -> column to make the UI less confusing (#30170) 9 months ago
migration Refactor locale&string&template related code (#29165) 12 months ago
nosql Update tool dependencies, lock govulncheck and actionlint (#25655) 2 years ago
optional Resolve lint for unused parameter and unnecessary type arguments (#30750) 9 months ago
options Use a general approach to access custom/static/builtin assets (#24022) 2 years ago
packages Azure blob storage support (#30995) 8 months ago
paginator Use more specific test methods (#24265) 2 years ago
pprof Implement FSFE REUSE for golang files (#21840) 2 years ago
private Move database operations of merging a pull request to post receive hook and add a transaction (#30805) 9 months ago
process Update misspell to 0.5.1 and add `misspellings.csv` (#30573) 10 months ago
proxy Use proxy for pull mirror (#22771) 2 years ago
proxyprotocol Implement FSFE REUSE for golang files (#21840) 2 years ago
public Refactor CORS handler (#28587) 1 year ago
queue Fix queue test (#30646) 10 months ago
recaptcha Implement FSFE REUSE for golang files (#21840) 2 years ago
references Fix markdown rendering when mentioning users (#30795) 9 months ago
regexplru Upgrade go dependencies (#25819) 2 years ago
repository Move database operations of merging a pull request to post receive hook and add a transaction (#30805) 9 months ago
secret Use `crypto/sha256` (#29386) 12 months ago
session Improve oauth2 client "preferred username field" logic and the error handling (#30622) 10 months ago
setting Add `MAX_ROWS` option for CSV rendering (#30268) 8 months ago
sitemap Fix sitemap (#22272) 2 years ago
ssh Remove SSH workaround (#27893) 1 year ago
storage Azure blob storage support (#30995) 8 months ago
structs Document possible action types for the user activity feed API (#31196) 8 months ago
svg Refactor markdown attention render (#29984) 11 months ago
sync Implement FSFE REUSE for golang files (#21840) 2 years ago
system Replace more db.DefaultContext (#27628) 1 year ago
templates Fix markdown rendering when mentioning users (#30795) 9 months ago
test Move web/api context related testing function into a separate package (#26859) 1 year ago
testlogger Replace `interface{}` with `any` (#25686) 2 years ago
timeutil Refactor "dump" sub-command (#30240) 10 months ago
translation Render embedded code preview by permlink in markdown (#30234) 10 months ago
turnstile Add new captcha: cloudflare turnstile (#22369) 2 years ago
typesniffer Detect ogg mime-type as audio or video (#26494) 2 years ago
updatechecker Replace more db.DefaultContext (#27628) 1 year ago
uri Implement FSFE REUSE for golang files (#21840) 2 years ago
user Implement FSFE REUSE for golang files (#21840) 2 years ago
util Azure blob storage support (#30995) 8 months ago
validation Check blocklist for emails when adding them to account (#26812) 1 year ago
web Use maintained gziphandler (#30592) 10 months ago
webhook Fix schedule tasks bugs (#28691) 1 year ago