yopass icon indicating copy to clipboard operation
yopass copied to clipboard

Configurable size for file uploading

Open okolya opened this issue 3 years ago • 5 comments

https://github.com/jhaals/yopass/blob/7fd2b38ad79fa4ca4fb47f3b424636a69ae5edd3/website/src/createSecret/Upload.tsx#L20

It would be nice to use env variable such as MAX_FILE_UPLOAD to configure maximum file size.

okolya avatar Dec 03 '21 10:12 okolya

Additional information : File limit is hard-coded in frontend and backend https://github.com/jhaals/yopass/blob/b43905591976caee9cd101ab39b7c002e2a21291/cmd/yopass-server/main.go#L26 Memcached max limit is 1 Mo, Redis has a 512 Mo limit.

sylvain-reynaud avatar Dec 20 '21 17:12 sylvain-reynaud

The limit is also in the crypto, async crypto simply cannot encrypt big messages/files. For that you need a hybrid approach.

cupcakearmy avatar Dec 23 '21 09:12 cupcakearmy

Actually you can adjust the memcached limit like this:

memcached -I 10m  # Allow objects up to 10MB

If you change the maxSize constant and run the yopass server with a bigger max-length then uploading bigger files is possible.

I don't know the exact limit for the crypto stuff though.

But having a configurable maxSize for file sizes would be absolutely possible, because I tried it in this PR: https://github.com/jhaals/yopass/pull/1154

That needs a rework though with validating the size on the server and returning an error to the client. If you feel like doing that @okolya then please go ahead! :)

dweipert-3138720606 avatar Dec 25 '21 19:12 dweipert-3138720606

@okolya If you want something that works rn you can check out a similar project I made, can configure the size there. https://github.com/cupcakearmy/cryptgeon

cupcakearmy avatar Dec 26 '21 20:12 cupcakearmy

@jhaals are there any plans to support larger file uploads in the near future?

Sudavar avatar Jan 18 '24 16:01 Sudavar