caddy icon indicating copy to clipboard operation
caddy copied to clipboard

Increasing the limit for file_server

Open shock0572 opened this issue 1 year ago • 2 comments

We're currently using Caddy to browse and search through its file server interface a series of debugging symbols. Each one of the directories is over 13000 hashes per symbols and we're hitting this limitation:

https://github.com/caddyserver/caddy/blob/2cac3c5491e6428441ecf668cc4f5a86e67ed9b3/modules/caddyhttp/fileserver/browse.go#L148

would it be possible to increase it, maybe in the file_server directive, as an attribute of browse? (max_limit?)

file_server {
    browse max_limit BIG_NUMBER
}

I know that they're reachable and they can be downloaded, but it would be cool if we could set that limit on our own

shock0572 avatar Oct 18 '24 19:10 shock0572

Yep, definitely possible to make this configurable -- which I would prefer over increasing it. Just note that the larger this number is, the slower the performance is.

There are probably faster ways to list large directories (some sort of pagination), but that would be a slightly bigger task.

mholt avatar Oct 18 '24 20:10 mholt

PRs welcome to make it configurable, should be trivial to implement. It would probably look more like this:

file_server {
	browse {
		file_limit <num>
	}
}

francislavoie avatar Oct 18 '24 21:10 francislavoie

The PR that fixes the issue is now submitted. We can either close the issue now or wait for the release of the version that has the fix.

atakanyenel avatar Nov 05 '24 16:11 atakanyenel