Comments (10)
Greetings,
thanks for your continued patience as well as your feedback on the new version.
matt_schwartz pointed out that should the file size be larger than the limit set on the privatebin a timeout message is received
There might be several factors at play here. For once, any reverse proxy in the chain could be able to reject that request as well as privatebin as the final instance. Privatebin is not really suited for huge files since the decryption inside the browser will fail at some point. Also keep in mind that the size of the file must be well below the limit since it needs to be base64 encoded which blows up the size. If you suspect that pbcli might be at fault here I am happy to look into that tho.
if the user presses yes to the prompt and the privatebin set as host doesnt have a limit would it be beneficial to prompt the user again with are you sure? should the file being uploaded via pbcli be a couple of GB in size?
Unfortunately, we are not able to query the privatebin instance for the configured limit, so we as the client will never know.
Additionally, I do not see the benefit of a second hard baked check, since the user already confirmed it. The second check would need to be disabled inside a CICD pipeline anyways, since otherwise there would be no way to upload bigger files from inside.
If you feel otherwise I am happy to hear more thoughts on that.
In any case, since no regressions were reported, I will promote this release candidate on the weekend and also push the new version to cargo and the AUR (and in turn, close this issue once released)
Best Regards
Mydayyy
from pbcli.
Well its all good for me. no issues here
from pbcli.
Greetings,
thank you for creating this issue.
A feature like this is certainly possible, however I would see this as an entirely opt-in feature and not a default setting, meaning not setting anything would result in no warning. Additionally it is not possible (as far as I know) to retrieve the sizeLimit setting from the target privatebin instance, meaning that value is entirely user configured.
Do you have a proposal for the flag name? I was thinking something along the lines of --warn-filesize-limit 5mb
.
Best Regards
Mydayyy
from pbcli.
Greetings,
thank you for creating this issue.
A feature like this is certainly possible, however I would see this as an entirely opt-in feature and not a default setting, meaning not setting anything would result in no warning. Additionally it is not possible (as far as I know) to retrieve the sizeLimit setting from the target privatebin instance, meaning that value is entirely user configured.
Do you have a proposal for the flag name? I was thinking something along the lines of
--warn-filesize-limit 5mb
.Best Regards Mydayyy
Hi,
Thanks for the super quick reply.
Not being able to get the file size limit of the privatebin is fine, should this be packaged by any distro then I would assume that the distro peeps would know what the filesize limit is on their instance and can implement the flag in the config themselves in the package.
I am honoured regarding feedback on the flag itself, personally I tend to keep my aliases thematic and simple, I would assume the warning would present itself should the set limit be reached or exceeded anyway so perhaps --size-limit or --fslimit.
I really appreciate the work that has been put into this.
Thank You.
from pbcli.
Greetings,
thank you for getting back to me on that. I believe I will go with --size-limit
since in my mind fs
usually refers to filesystem and therefore fslimit
could be confusing. I will proceed to implement it as an optional parameter defaulting to zero meaning no limit as I mentioned above.
I expect I should find the time somewhere in march to implement that. I would also also upgrade all the dependencies of pbcli since I expect a lot of new versions came out since and I believe clap is out of beta.
Best Regards
Mydayyy
from pbcli.
Greetings,
thank you for your patience.
I implemented the feature and published a release candidate for 2.3.0. If you have time and want to test it I would be happy to hear feedback.
Implementation details: We are checking the size twice. One time before the base64 encode the provided file, in order to prevent unnecessarily encoding a file which would be too large anyways. The second check is done after the data to be sent is assembled (paste text, attachment base64 encoded).
If any of those checks fail the command will ask whether to proceed. If running without an attached terminal (e.g CICD) the command will simply fail.
Link to rc: https://github.com/Mydayyy/pbcli/releases/tag/v2.3.0-rc.1
Example usages:
pbcli --upload FILENAME --size-limit 1047983
pbcli --upload FILENAME --size-limit 10mb
pbcli --upload FILENAME --size-limit 2GB
pbcli --upload FILENAME --size-limit 1kb
pbcli --upload FILENAME --size-limit 500KB
If no additional issues arise, I will proceed to turn the rc into a release. Additionally I decided to not update the dependencies for this release since that change is slightly bigger than expected and should in my opininion be done in a separate release.
Best Regards
Mydayyy
from pbcli.
Hi,
My apologies I have been in the thick of it irl.
I have notified matte_schwartz and the Nobara Project Discord regulars.
I am assuming that like the --host flag the config file will need --size-limit=?
Thanks in Advance
from pbcli.
Greetings,
yes that is correct. That flag needs to be passed like all the others. Optionally in can also be put in the config file. The behavior.
Please be aware that this flag currently is only available in the pre-release version. On the weekend, should I not learn of any regression or bugs I would proceed to release the v2.3.0.
Best Regards
Mydayyy
from pbcli.
Hi,
Happy to report that I haven't had any issues running the release client as a normal user would i.e. journalctl -b 0 | pbcli --upload /path/to/image.png with a 5MB limit set, matte_schwartz may be a little more in depth with their testing with njust.
I did notice that if you try to upload a file larger than the file size limit you will be prompted regarding it but will be allowed to continue if you press yes, matt_schwartz pointed out that should the file size be larger than the limit set on the privatebin a timeout message is received (I know, privatebin limit isnt your monkeys nor your circus) if the user presses yes to the prompt and the privatebin set as host doesnt have a limit would it be beneficial to prompt the user again with are you sure? should the file being uploaded via pbcli be a couple of GB in size?
Sort of like a if file size > 1GB then double check if the user really wants to upload ... kind of a hard baked in file size = prompt thing sorry I am obviously not a programmer nor have I tried to upload a massive file to test this so it may be in pbcli already.
Love the work and thank you
from pbcli.
Greetings,
PBCLI 2.3.0 has been promoted to a release here as well as released on the aur and crates
Best Regards
Mydayyy
from pbcli.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pbcli.