Skip to content

Commit 97935e5

Browse files
committed
Added documentation, removed some options
1 parent 0d81a35 commit 97935e5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+2972
-194
lines changed

README.rst

Lines changed: 47 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
11
0bin
22
====
33

4-
Have a try here: <a href="http://0bin.net">0bin.net</a>
5-
64
0bin is a client side encrypted pastebin that can run without a database.
75

8-
It allows anybody to host a pastebin while welcoming any type of content to be pasted in it. The idea is that one can (probably...) not be legally entitled to <a href="http://www.zdnet.com/blog/security/pastebin-to-hunt-for-hacker-pastes-anonymous-cries-censorship/11336">moderate the pastebin content</a> as he/she has no way to decrypt it.
6+
* Try it: `0bin.net <http://0bin.net>`_
7+
* Get the `source on github <https://github.com/sametmax/0bin>`_
8+
* `Report a bug <https://github.com/sametmax/0bin/issues>`_
9+
10+
0bin allows anybody to host a pastebin while welcoming any type of content to
11+
be pasted in it. The idea is that one can (probably...) not be legally entitled
12+
to `moderate the pastebin content`_ as he/she has no way to decrypt it.
13+
14+
It's an Python implementation of the
15+
`zerobin project`_. It's easy to
16+
install even if you know nothing about Python.
917

10-
It's an Python implementation of the <a href="https://github.com/sebsauvage/ZeroBin/">zerobin project</a>. It's easy to install even if you know nothing about Python.
18+
For now tested with IE9, and the last opera, safari, chrome and FF.
1119

1220
How it works
1321
=============
@@ -33,17 +41,30 @@ Key points:
3341
- all operations, including code coloration, must happens on the client;
3442
- the server is no more than a fancy recipient for the encrypted data.
3543

44+
Other features
45+
======================
46+
47+
- automatic code coloration (no need to specify);
48+
- pastebin expiration: 1 day, 1 month or never;
49+
- burn after reading: the paste is destroyed after the first reading;
50+
- clone paste: you can't edit a paste, but you can duplicate any of them;
51+
- code upload: if a file is too big, you can upload it instead of using copy/paste;
52+
- copy paste to clipboard in a click;
53+
- get paste short URL in a click;
54+
- own previous pastes history;
55+
- visual hash of a paste to easily tell it appart from others in a list.
3656

3757
Technologies used
3858
==================
3959

40-
- <a href="https://en.wikipedia.org/wiki/Python_(programming_language)">Python</a>
41-
- <a href="http://bottlepy.org/">The Bottle Python Web microframework</a>
42-
- <a href="http://crypto.stanford.edu/sjcl/">SJCL</a> (js crypto tools)
43-
- <a href="http://jquery.com/">jQuery</a>
44-
- <a href="http://twitter.github.com/bootstrap/">Bootstrap</a>, the twitter css framework
45-
- <a href="https://github.com/sametmax/VizHash.js">VizHash.js</a> to create visual hashes from pastes
46-
- Cherrypy (server only)
60+
- Python_
61+
- `The Bottle Python Web microframework`_
62+
- SJCL_ (js crypto tools)
63+
- jQuery_
64+
- Bootstrap_, the Twitter HTML5/CSS3 framework
65+
- VizHash.js_ to create visual hashes from pastes
66+
- Cherrypy_ (server only)
67+
4768

4869
Known issues
4970
============
@@ -56,6 +77,18 @@ Known issues
5677
What does 0bin not implement?
5778
=================================
5879

59-
* Request throttling. It would be inefficient to do it at the app level, and web servers have robust implementations.
60-
* Hash collision prevention: the ratio "probability it happens/consequence seriousness" <a href="http://stackoverflow.com/questions/201705/how-many-random-elements-before-md5-produces-collisions">is not worth it</a>
61-
* Comments: for now. It's on the todo list.
80+
* Request throttling. It would be inefficient to do it at the app level, and web servers have robust implementations for it.
81+
* Hash collision prevention: the ratio "probability it happens/consequence seriousness" `is not worth it`_
82+
* Comments: it was initially planed. But comes with a lot of issues so we chose to focus on lower handing fruits.
83+
84+
85+
.. _moderate the pastebin content: http://www.zdnet.com/blog/security/pastebin-to-hunt-for-hacker-pastes-anonymous-cries-censorship/11336
86+
.. _zerobin project: https://github.com/sebsauvage/ZeroBin/
87+
.. _Python: https://en.wikipedia.org/wiki/Python_(programming_language)
88+
.. _The Bottle Python Web microframework: http://bottlepy.org/
89+
.. _SJCL: http://crypto.stanford.edu/sjcl/
90+
.. _jQuery: http://jquery.com/
91+
.. _Bootstrap: http://twitter.github.com/bootstrap/
92+
.. _VizHash.js: https://github.com/sametmax/VizHash.js
93+
.. _Cherrypy: http://www.cherrypy.org/ (server only)
94+
.. _is not worth it: http://stackoverflow.com/questions/201705/how-many-random-elements-before-md5-produces-collisions
5.01 KB
Binary file not shown.
8.48 KB
Binary file not shown.

docs/.build/doctrees/en/intro.doctree

112 Bytes
Binary file not shown.
7.54 KB
Binary file not shown.
22.9 KB
Binary file not shown.
2.46 KB
Binary file not shown.
1.96 KB
Binary file not shown.
18.9 KB
Binary file not shown.
5.75 KB
Binary file not shown.
8.96 KB
Binary file not shown.

docs/.build/doctrees/fr/intro.doctree

1.11 KB
Binary file not shown.
8.37 KB
Binary file not shown.
23.5 KB
Binary file not shown.
2.47 KB
Binary file not shown.
2.24 KB
Binary file not shown.

docs/.build/doctrees/index.doctree

-560 Bytes
Binary file not shown.
Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,39 @@
1-
=========================
2-
Installation with Apache
3-
=========================
1+
=============
2+
Apache setup
3+
=============
4+
5+
Apache is slower, heavier and more complicated to setup than Nginx. But it's also
6+
much more famous:
7+
8+
- more people will be able to help you on forums;
9+
- your hosting will most probably support Apache;
10+
- the configuration file syntax is familiar to a lot of people.
11+
12+
An Apache setup is still much more robust and secure than an easy installation.
13+
14+
Une installation apache est aussi beaucoup plus solide et sécurisé qu'une
15+
installation facile. You'll benefit from having:
16+
17+
- the possiblity to have several projects listening to the port 80;
18+
- several Apache module at your disposal (like requests throttling);
19+
- Apache robustness in front end: it's secure, and there is much less chance
20+
it will crash under heavy load;
21+
- your web site processes won't run with admin rights, even if --user doesn't
22+
work on your OS.
23+
24+
25+
Mod_wsgi
26+
==========
27+
28+
The modern Web Python servers all work the same way, following an norm for
29+
interfacing: WSGI.
30+
31+
This is the most performante solution, and the best to use. But it will require
32+
the setup of the Apache module mod_wsgi. If you don't know how to do this, or
33+
if you can't do it (E.G: your hosting won't let you), you need to go for
34+
the CGI setup.
35+
36+
==========
37+
38+
This setup is considered as slow, but you will still benefit from Apache
39+
robustness.
Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,58 @@
11
====================
22
Easiest installation
3-
====================
3+
====================
4+
5+
These solution are easy all will be able to handle a personnal website traffic.
6+
For more robust and secure solutions, see Apache et Nginx setups.
7+
8+
10 seconds setup (if you know Python already)
9+
===============================================
10+
11+
pip install zerobin
12+
zerobin --host 0.0.0.0 --port 80 --compressed-static # as admin
13+
14+
30 seconds setup (for anybody)
15+
===============================
16+
17+
- Make sure you have Python 2.6 or 2.7 (`python --version`)
18+
- Download the last zip of the sources code.
19+
- Extract all of it where you wish the site to be stored.
20+
- Go to the extracted files.
21+
- Run `python zerobin.py --host 0.0.0.0 --port 80 --compressed-static`
22+
with the admin rights.
23+
24+
On ubuntu, this is a one liner::
25+
26+
wget stuff && unzip zerobin.zip && cd zerobin && sudo python zerobin.py --host 0.0.0.0 --port 80 --compressed-static
27+
28+
Check out for more configuration options.
29+
30+
Run 0bin in background
31+
=======================
32+
33+
0bin doesn't come with something built in for this. You have several solutions:
34+
35+
For a small website:
36+
37+
Just make it a shell background process. E.G in GNU/Linux::
38+
39+
nohup python zerobin.py --host 0.0.0.0 --port 80 --compressed-static &
40+
41+
Or run it in a screen.
42+
43+
For a big Website:
44+
45+
- setup 0bin with Apache;
46+
- setup 0bin with supervisord (best way to do it);
47+
48+
.. Note::
49+
50+
You can even use zerobin on your private local network from your laptop.
51+
52+
Make sure you firewall won't block the port, and run::
53+
54+
python zerobin.py --host 0.0.0.0 --port 8000
55+
56+
0bin will now be accessible from http://your.local.ip.address:8000.
57+
58+
This can be very cool way to share code in a companie or during a code sprint.

docs/.build/html/_sources/en/intro.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,15 @@ Technologies used
5454
- `The Bottle Python Web microframework`_
5555
- SJCL_ (js crypto tools)
5656
- jQuery_
57-
- Bootstrap_, the twitter HTML5/CSS3 framework
57+
- Bootstrap_, the Twitter HTML5/CSS3 framework
5858
- VizHash.js_ to create visual hashes from pastes
5959
- Cherrypy_ (server only)
6060

6161

6262
Known issues
6363
============
6464

65-
- 0bin use several HTML5/CSS3 features that are not widely supported. In that case we handle the degradation as gracefully as we can.
65+
- 0bin uses several HTML5/CSS3 features that are not widely supported. In that case we handle the degradation as gracefully as we can.
6666
- The "copy to clipboard" feature is buggy under linux. It's flash, so we won't fix it. Better wait for the HTML5 clipboard API to be implemented in major browsers.
6767
- The pasted content size limit check is not accurate. It's just a safety net, so we thinks it's ok.
6868
- Some url shorteners and other services storing URLs break the encryption key. We will sanitize the URL as much as we can, but there is a limit to what we can do.
@@ -71,7 +71,7 @@ What does 0bin not implement?
7171
=================================
7272

7373
* Request throttling. It would be inefficient to do it at the app level, and web servers have robust implementations for it.
74-
* Hash collision: the ratio "probability it happens/consequence seriousness" <a href="http://stackoverflow.com/questions/201705/how-many-random-elements-before-md5-produces-collisions"is not worth it</a
74+
* Hash collision prevention: the ratio "probability it happens/consequence seriousness" `is not worth it`_
7575
* Comments: it was initially planed. But comes with a lot of issues so we chose to focus on lower handing fruits.
7676

7777

@@ -83,4 +83,5 @@ What does 0bin not implement?
8383
.. _jQuery: http://jquery.com/
8484
.. _Bootstrap: http://twitter.github.com/bootstrap/
8585
.. _VizHash.js: https://github.com/sametmax/VizHash.js
86-
.. _Cherrypy: http://www.cherrypy.org/ (server only)
86+
.. _Cherrypy: http://www.cherrypy.org/ (server only)
87+
.. _is not worth it: http://stackoverflow.com/questions/201705/how-many-random-elements-before-md5-produces-collisions
Lines changed: 64 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,64 @@
1-
========================
2-
Installing with Nginx
3-
========================
1+
============
2+
Nginx setup
3+
============
4+
5+
Nginx is a very popular choice to serve a Python project:
6+
7+
- It's fast.
8+
- It's lightweight.
9+
- Configuration files are simple.
10+
11+
If you have your own server, it's the best choice. If not, try the easiest
12+
setup, or the Apache setup.
13+
14+
Nginx doesn't run any Python process, it only serve requests from outside to
15+
the Python server.
16+
17+
Therefor there are two steps:
18+
19+
- Run the Python process.
20+
- Run Nginx.
21+
22+
You will benefit from having:
23+
24+
- the possiblity to have several projects listening to the port 80;
25+
- several Apache module at your disposal (like requests throttling);
26+
- Apache robustness in front end: it's secure, and there is much less chance
27+
it will crash under heavy load;
28+
- your web site processes won't run with admin rights, even if --user doesn't
29+
work on your OS;
30+
- the ability to manage a Python process without touching Nginx or the other
31+
processes. It's very handy for updates.
32+
33+
The Python process
34+
==================
35+
36+
Run 0bin as usual, but this time make it listen to a local port and host. E.G::
37+
38+
zerobin --host 127.0.0.1 --port 8000
39+
40+
In PHP, when you edit a file, the changes are immediatly visible. In Python,
41+
the whole code is often loaded in memory for performance reasons. This means
42+
you have to restart the Python process to see the changes effect. Having a
43+
separate process let you do this without having to restart the server.
44+
45+
Nginx
46+
======
47+
48+
Nginx can be installed with you usual package manager, so we won't cover
49+
installing it.
50+
51+
Vous must create a Nginx configuration file for 0bin. On GNU/Linux, they usually
52+
go into /etc/nginx/conf.d/. Name it zerobin.conf.
53+
54+
The minimal file to run the site is:
55+
56+
But you can make some adjustement to get better perfomances:
57+
58+
59+
60+
61+
62+
63+
64+

0 commit comments

Comments
 (0)