README.md 3.7 KB
Newer Older
prx's avatar
prx committed
1 2 3
Don't panic
===========

prx's avatar
prx committed
4 5 6 7
Dontpanic is a python app to look for any movie or serie and watch them
in "streaming". It looks like popcorntime, but doesn't depend of a
centralized api.

prx's avatar
prx committed
8
![apercu de dontpanic](http://3hg.toile-libre.org/dontpanic/Images/dontpanic1.png)
prx's avatar
prx committed
9 10 11 12

Installation
------------

prx's avatar
prx committed
13
To use it, get the source archive
prx's avatar
prx committed
14

prx's avatar
prx committed
15
    wget https://framagit.org/Thuban/dontpanic/repository/master/archive.tar.gz
prx's avatar
prx committed
16

17 18
then install these dependencies : 

prx's avatar
prx committed
19
    python3-bs4 python3-libtorrent python3-requests python3-bottle sqlite3 gettext xdg-utils
20

prx's avatar
prx committed
21 22 23
Usage
-----

24
You can run dontpanic for a single user with : 
prx's avatar
prx committed
25

prx's avatar
prx committed
26
    ./dontpanic 
prx's avatar
prx committed
27

prx's avatar
prx committed
28 29
or with

30
    python3 dontpanic.py
prx's avatar
prx committed
31

prx's avatar
prx committed
32
It will open your browser to the dontpanic page.
prx's avatar
prx committed
33

prx's avatar
prx committed
34 35 36

My download doesn't start
-------------------------
Tankypon's avatar
Tankypon committed
37
Be sure to choose a file with a lot of peers.
prx's avatar
prx committed
38

39 40
Deploy on a server
------------------
Tankypon's avatar
Tankypon committed
41
You can run dontpanic on your server and make it available for world. To
prx's avatar
prx committed
42
do so, you have to use an adapter like [cherrypy](http://www.cherrypy.org/) or tornado.
43

44
    ./dontpanic -adapter administrator admin_password
prx's avatar
prx committed
45

46 47
or

48
    python3 dontpanic-server.py -adapter administrator admin_password
49

prx's avatar
prx committed
50
Change `-adapter` to the one you want to use, i.e. `-cherrypy`. Below,
Tankypon's avatar
Tankypon committed
51
you can find some adapters (see
prx's avatar
prx committed
52 53
[here](http://bottlepy.org/docs/dev/deployment.html#switching-the-server-backend)
for a full list):
54

Tankypon's avatar
Tankypon committed
55 56
-  `-cherrypy` is multi-threaded (recommended). Install python-cherrypy3 to use it.
- `-paste`  is multi-threaded. Instal python-paste to use it.
prx's avatar
prx committed
57
- `-tornado` : install python-tornado
58
- ...
59

Tankypon's avatar
Tankypon committed
60
You can use `-auto` to let dontpanic (bottle) choose the first available
prx's avatar
prx committed
61 62
adapter.

63 64 65 66 67
Use SSL (https):
----------------
To do it correctly, you might want to read your adapter documentation.

An easy way is to use apache or nginx as a reverse proxy.
68
For cherrypy, it's documented [here](http://docs.cherrypy.org/en/latest/deploy.html#reverse-proxying).
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117

Below, find a working nginx configuration using ssl with cherrypy : 




    upstream apps {
        server 127.0.0.1:8080;
    }

    gzip_http_version 1.0;
    gzip_proxied      any;
    gzip_min_length   500;
    gzip_disable      "MSIE [1-6]\.";
    gzip_types        text/plain text/xml text/css
                    text/javascript
                    application/javascript;


    server {
        listen 80;
        server_name localhost;
        return 301 https://$server_name$request_uri;  # enforce https
    }

    server {
        listen 443 ssl;
        server_name  localhost;

        ssl_certificate /etc/ssl/certs/ssl-cert-snakeoil.pem;
        ssl_certificate_key /etc/ssl/private/ssl-cert-snakeoil.key;

    location / {
        proxy_pass         http://apps;
        proxy_redirect     off;
        proxy_set_header   Host $host;
        proxy_set_header   X-Real-IP $remote_addr;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header   X-Forwarded-Host $server_name;
    }
    }


Of course, replace `localhost`, `8080` and ssl variables to fit your
configuration.

In this case, dontpanic was started with : 

    python dontpanic-server.py -cherrypy admin password 8080
prx's avatar
prx committed
118

prx's avatar
prx committed
119 120 121
Warning
----------

122 123
If you deploy dontpanic on a server, make sure the database is not
readable by world. The database is by default in
124 125
~/.dontpanic/databaz.db. Follow 
[bottle instructions](http://bottlepy.org/docs/dev/deployment.html).
126 127 128

Remember, the admin page is /_admin

prx's avatar
prx committed
129 130 131 132 133 134 135 136 137
Creating debian package
-----------------------

To create the debian package, use equivs : 

    equivs-build eqctl

Add `-f` to sign the package.

prx's avatar
prx committed
138 139
Thanks
------
prx's avatar
prx committed
140
- Thanks to imdb, piratebay, btdigg, torrentproject and other search engines for results.
prx's avatar
prx committed
141 142
- Thanks to [thesubdb](http://thesubdb.com/) for providing subtitles to
  opensources projects
prx's avatar
prx committed
143
- Thanks to Douglas Adams for inspiration