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

ZeroBin for Files #57

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

ZeroBin for Files #57

wants to merge 3 commits into from

Conversation

jigarvyas
Copy link

Added support to share files via ZeroBin using the FileReader API

@jigarvyas jigarvyas closed this Aug 26, 2013
@jigarvyas jigarvyas reopened this Aug 26, 2013
@TheFiZi
Copy link

TheFiZi commented Aug 31, 2013

The ability to change the maximum file size would be nice. 2MB is not big enough.

@petterolsson
Copy link

Just merged this into my install and it seems to be working as intended with a Max file size limit of 2MB. Great addition.

@jigar
Copy link

jigar commented Sep 17, 2013

@petterolsson Glad you liked it
@TheFiZi changing the value here should help

@TheFiZi
Copy link

TheFiZi commented Sep 18, 2013

That worked. Thanks!

@gwenhastings
Copy link

really cool.. I have it running at https://zerobin.permutation.net no matter what I set https://github.com/sebsauvage/ZeroBin/blob/master/index.php#L152 to it would appear that its limited to about 512 kb nothing larger seems to work.
I opened an issue about this on your source tree as this is something I DONT think I have the skills to trace and fix myself no matter how many times I stare at firedebug screens :(

   gwen

@Hexalyse
Copy link

Hexalyse commented Dec 9, 2013

@gwenhastings Maybe the limitation is set server-side ? For example, in your PHP(-fpm) configuration, or your web server configuration.

@gwenhastings
Copy link

Hi Hex,
its a OpenBSD 5.1/AMD64 with php 5.3 server I have with other php based upload scripts doing up to 512M uploads via php quite successfully(its under apache right now)

and in addition I tried the following in the start of index.php just for this.

require_once "lib/vizhash_gd_zero.php";
ini_set('post_max_size', '10M');
ini_set('upload_max_filesize', '60M');

no it feels like the javascripts are breaking this is for firefox 25.01 and latest chrome.

           wish it was a server limitation be far easier to find and fix
           gwen

ps its at https://zerobin.permutation.net if you want to see for yourself

@ulikoehler
Copy link

I'm no PHP expert but AFAIK you can't override php.ini values with
larger values in your index.php. Could you check those variables in your
ini.php?

@gwenhastings
Copy link

to answer more exhausively.. this is a real server that I control .. down to the bare iron..

the /etc/php-5.3.ini is:
file_uploads = On
upload_tmp_dir = tmp
upload_max_filesize = 512M
post_max_size = 16M
and it fails
at anything beyond 512k for various reasons
latest is cannot create paste messages for anything over 512k
gh

@ulikoehler
Copy link

Just guessing here (sorry...), is it possible your Server (e.g. Apache) loads another php.ini with different settings? If you use some PHP application not related to ZeroBin, can you upload >512kib files?

EDIT: Sorry, you already wrote it does. This is quite strange indeed.

@ulikoehler
Copy link

Found the issue.
See https://github.com/sebsauvage/ZeroBin/blob/master/index.php#L152

I think I added a configurable value for that in my config pull request.

@gwenhastings
Copy link

naw thats NOT the issue.. and it should allow a 2mb upload and at least one person trying the code reports sucess..

and I reference that above if you read previous posts up above..

As related on the bug I filed against the source tree there are several other php based apps on this server loading up to 200 or so mb without issue, ie I built the server from the bare iron out.. compiled ALL software in use from source or ports . its the ONLY php-5.3.ini in the file system and the binary refers to it directly..no the symptoms I am seeing here are related to a software defect.. I will use firebug shortly to find out where the code is exiting at and see if I understand what is going on.

   gh

@ulikoehler
Copy link

Sorry, I saw your reference shortly after posting and edited it. I believe the issue is caused by the line referenced in the last comment. Firebug won't help you too much here, because it's used for clientside debugging.

Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.

@gwenhastings
Copy link

Actually without getting into a pissing match about debug methodologies firebug(zerobin is after all primarily javascript based in the browser) is quite useful here after I un minified all the javascript libraries involved. I seem to be chasing about 4 separate bugs at this point one in rawdeflate.js another couple in sjcl.js and possibiy another in jquery.js(I am running latest git on all of these).

Another issue is the code was NEVER as far as I know tested beyond a couple of screen sized text cut and pasties prior to file uploads being added, I suspect this is the first time that zerobin has been pushed even to 512k.
The claim above that someone has pushed 2M images I am in doubt of now. (could that individual recheck their success? with a verified file of over 1 mb?)

The precise git I am using is https://github.com/jigarvyas/ZeroBin.git should I be pulling another?

It might be of assistance for those offering to help here to run this file upload branch on a vps/vm to get a first hand look at the issues involved prior to offering assistance, that way we can talk about the same issues:) (I am sure we have enough bugs to go around for all )

The environment has been running zerobin since 0.15 I have rebuilt both sjcl.js and jquery.js from scratch and un-minified for debugging.

I have used 3 different browsers to test from the OSX environment and will transfer both server code and browser environment to a latest SVN debian vm today for further datapoints. The problems are consistent to say the least.
I will also try with nginx and php-fpm later today.

 gh

@nitmir
Copy link

nitmir commented Dec 11, 2013

This file https://www.genua.fr/ZeroBin/?ec85e9142df2efaa#3aCU4HQu086l4MgsSPB2ETFRXmoY5yH7dBjfP0S6IAY= is up to 932KB and this one, https://www.genua.fr/ZeroBin/?5ca3731acd3ccbe2#PcApMx3jwiwlf2YygxcFmcrOTzsnhbKfd2xg9qDZ+Cs= up to 2,9MB

So, you can be sure now of the claim above that someone has pushed 2M images.

For the record, I just pull https://github.com/jigarvyas/ZeroBin.git into my clone of sebsauvage/ZeroBin and edit the line https://github.com/sebsauvage/ZeroBin/blob/master/index.php#L152.
Note that the size tested by ZeroBin is not the size of the file, but the size of a json object posted, contening a field with the base64 encoded cipher of the file.

For example, for the 2,9MB file, the posted content size is 5,2MB.

@Hexalyse
Copy link

Another issue is the code was NEVER as far as I know tested beyond a couple of screen sized text cut and pasties prior to file uploads being added, I suspect this is the first time that zerobin has been pushed even to 512k.

Not entirely true. I myself used Zerobin to paste very large text files, way more than 2MB of text (for which I had to edit the line @ulikoehler mentionned in his previous comment), and I had no problem with it. Just tried with a 6MB+ text file here : https://hexrandom.com/zerobin/?6ba30ec288877d5a#2Zoa1hfx6pPC6u6+0JihvLuik8LyyH5VvFGUksC2Wdo=

My installation runs on Nginx with php-fpm.

EDIT : well, somebody was faster than me, and posted while I was writing and doing some extended tests ;)
BTW, during my tests, I noticed that ascii text files with a lot of pattern repetition are compressed a LOT during encryption, with 8MB files resulting in a few hundreds kB. This is why I uploaded these randomly-generated ascii characters.

@gwenhastings
Copy link

ARGHHHH!!!!! this appears to be an OpenBSD 5.1 Php5.3 bug as it fails in exactly the same way as my production server , I just finished testing on a one off VM I installed just to check the release code..(for openbsd etc)(Time to try testing on 5.4 and upgrading of that server(about 8500 miles distant etc)), thanx for the additional data points as I was beginning to think it was me(I dont have time to go down the rabbit hole on this bug, I will simply reinstall and test the file version of Zerobin on a linux VM and expose that to the outside via vpn tunnel) Thanx for all of your assistance and datapoints of working installs..

@gwenhastings
Copy link

double argh.. its NOT a bug its suhosin!ARGH!!!

put:

php_value upload_max_filesize 32M
php_value post_max_size 32M
php_value max_execution_time 200
php_value max_input_time 200
php_value memory_limit 1024M
php_flag suhosin.simulation On

in an .htaccess fle to turn off OpenBSD php 5.3 default suhosin install

Thanx all for your help and additional datapoints..
zerobin.permutation.net is back up(albeit with smaller file limits(sorry kids small server)..

 gwen

@gwenhastings
Copy link

further updates is that the directive suhosin.simulation On does NOT work in an .htaccess file only as a php_admin_flag within a\ < Directory > ... scope as per http://stackoverflow.com/questions/11537965/php-flag-in-htaccess

gwen

sigh now testing for much larger files ie 4 mb 8 mb 16 mb 32 mb etc

@gwenhastings
Copy link

further updates..
found had to change
suhosin.post.max_value_length = 16000000
suhosin.request.max_value_length = 16000000
and then could co exist with suhosin.simulation Off[default setting]

BTW really loving this patch.. have been wanting the file upload feature to provide services to NGO's in conflict areas via TOR..
Thanx again...

@gwenhastings
Copy link

Hmm there seems to be an issue with TBB(Tor browser Bundle) on OSX.. an "external application is needed to handle this content windows come up with a load of x64 data.. but no OK or cancel button ever. ie this patch works perfectly in normal firefox.. so suspect tbb changes parameters in about:config

@gwenhastings
Copy link

New Issue.. when uploading files such as mobi because of no mime type embeddment or errors in same if used .mobi files attempt to download as .bin

@gwenhastings
Copy link

Additional new issue when both a file paste and a text paste are attempted together then only the text paste is processed, the file paste is ignored(perhaps they should be folded into a multipart document format? or some other appropriate handling?)

This was referenced Aug 26, 2015
Closed
@elrido elrido mentioned this pull request Sep 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants