Package: pleaseshare
PleaseShare is a file-sharing website that aims to decentralize
file-sharing through the use of bittorrent, DHT, and webseeds.A demo instance is available atshare.jeproteste.info.Get startedRetrieve the project fromgitorious,github, ormy own git server:$ git clone git://gitorious.org/pleaseshare/pleaseshare.gitThen install the dependencies (assuming you are using a virtualenv):$ cd pleaseshare
$ pip install -r requirements.txtYou also needPython 3.4.After this, you can start coding, testing, translating (see the bottom section of this page for details), etc.Install(do the Get started thing before that)First, copy thepleaseshare/default_settings.pyfile topleaseshare/local_settings.cfgand edit it to fit your needs. Alternatively, you can set the$PLEASESHARE_CONFIGenvironment variable to the absolute path of your config file (if alocal_settings.cfgfile
is present, it will still override it, though). Every option is commented and has a purpose,
and you MUST consider changing the following:SECRET_KEYandWTF_CSRF_SECRET_KEY, both set to the value of a localkeyvariableSQLALCHEMY_DATABASE_URIfor database connection settingsMAX_CONTENT_LENGTHfor the maximal upload file sizeOnce everything is set, you only have to create the database:$ ./make_db.pyIn order to deploy PleaseShare, you can follow the flaskdeployment guide.My favourite deployment option is uwsgi with nginx or lighttpd.Example uwsgi+nginx deploymentuwsgi.inifile:[uwsgi]
socket = 127.0.0.1:4444
master = true
plugin = python3
chdir = /home/flask/pleaseshare/
module = pleaseshare:app
processes = 4Nginx configuration section:server {
    listen                  80;
    server_name             share.example.com;
    client_max_body_size    50m;

    location / {
        include             uwsgi_params;
        uwsgi_pass          127.0.0.1:4444;
    }
}

server {
    listen                  80;
    server_name             files.example.com;

    location / {
        root                /home/flask/pleaseshare/uploads/;
        autoindex           off;
    }
}(assumingUPLOAD_FOLDERis set to"uploads", andUPLOADED_FILES_URLto"http://files.example.com/")I also usually usesupervisordto manage my python web applications:[program:share]
command=uwsgi uwsgi.ini
directory=/home/flask/pleaseshare/
user=flask
redirect_stderr=true
autostart=true
autorestart=trueBut manually runninguwsgi uwsgi.iniworks fine too.MiscSome indications about how webseeds work might be in order.When the torrent has a single file, then it’s easy: the webseed is the complete url of the file.When the torrent is multifile, then the webseed url is the url of the parent directory (I’m talking about the torrents in PleaseShare, which are always contained in a parent directory named after the archive name).For example, you upload a toto.tar.gz archive, you will have a url like /view/48a3-[…]/,
containing a ‘toto’ directory, which will contain the files inside the archive.The webseed url shouldnotcontain the ‘toto’ directory, but the parent
level; and, of course, file indexing should be disabled, or the file generated
by the webserver might cause problems to some torrent clients.So let’s say you want to add a source to the torrent using your personal
webserver (again for the toto.tar.gz torrent), you will have to put something
like that as a webseed:http://my.example.com/uploads/which will contain atotodirectory.Reporting bugsAs of now, no public bug tracker is available, but you can come report bugs or say a nice thing or
two on the XMPP chatroomshare@chat.jeproteste.info. You can also send me emails topleaseshare@mathieui.net.LicensePleaseShare is released under the terms of theGNU Affero General
Public License v3.PleaseShare also contains some files from theDeluge torrent client,
which is licenced under theGNU General Public Licence v3.Contributorsmathieui - main developerCynddl - UI design magickaliko - fixesNotes on translatingpybabel is currentlybroken on python 3.4, so you will need to patch babel 1.3 with:diff --git a/babel/messages/frontend.py b/babel/messages/frontend.py
index 144bc98..94e09e9 100755
--- a/babel/messages/frontend.py
+++ b/babel/messages/frontend.py
@@ -128,7 +128,7 @@ class compile_catalog(Command):

         for idx, (locale, po_file) in enumerate(po_files):
             mo_file = mo_files[idx]
-            infile = open(po_file, 'r')
+            infile = open(po_file, 'rb')
             try:
                 catalog = read_po(infile, locale)
             finally:
@@ -439,7 +439,7 @@ class init_catalog(Command):
         log.info('creating catalog %r based on %r', self.output_file,
                  self.input_file)

-        infile = open(self.input_file, 'r')
+        infile = open(self.input_file, 'rb')
         try:
             # Although reading from the catalog template, read_po must be fed
             # the locale in order to correctly calculate plurals
@@ -554,7 +554,7 @@ class update_catalog(Command):
         if not domain:
             domain = os.path.splitext(os.path.basename(self.input_file))[0]

-        infile = open(self.input_file, 'U')
+        infile = open(self.input_file, 'rb')
         try:
             template = read_po(infile)
         finally:
@@ -566,7 +566,7 @@ class update_catalog(Command):
         for locale, filename in po_files:
             log.info('updating catalog %r based on %r', filename,
                      self.input_file)
-            infile = open(filename, 'U')
+            infile = open(filename, 'rb')
             try:
                 catalog = read_po(infile, locale=locale, domain=domain)
             finally:
@@ -577,7 +577,7 @@ class update_catalog(Command):
             tmpname = os.path.join(os.path.dirname(filename),
                                    tempfile.gettempprefix() +
                                    os.path.basename(filename))
-            tmpfile = open(tmpname, 'w')
+            tmpfile = open(tmpname, 'wb')
             try:
                 try:
                     write_po(tmpfile, catalog,
@@ -760,7 +760,7 @@ class CommandLineInterface(object):

         for idx, (locale, po_file) in enumerate(po_files):
             mo_file = mo_files[idx]
-            infile = open(po_file, 'r')
+            infile = open(po_file, 'rb')
             try:
                 catalog = read_po(infile, locale)
             finally:
@@ -1121,7 +1121,7 @@ class CommandLineInterface(object):
             tmpname = os.path.join(os.path.dirname(filename),
                                    tempfile.gettempprefix() +
                                    os.path.basename(filename))
-            tmpfile = open(tmpname, 'w')
+            tmpfile = open(tmpname, 'wb')
             try:
                 try:
                     write_po(tmpfile, catalog,After that, you should be able to runmake transto extract/update
translations, andmake compiletransto generate an up-to-date.mofile.