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

Thuban's avatar
Thuban 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.

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

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

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

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

Thuban's avatar
Thuban committed
17
18
then install these dependencies : 

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

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

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

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

Thuban's avatar
Thuban committed
28
29
or with

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

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

Thuban's avatar
Thuban 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.
Thuban's avatar
Thuban 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
Thuban's avatar
Thuban 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
Thuban's avatar
Thuban committed
45

46
47
or

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

Thuban's avatar
Thuban 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
Thuban's avatar
Thuban 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.
Thuban's avatar
Thuban 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
Thuban's avatar
Thuban 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
Thuban's avatar
Thuban committed
118

Thuban's avatar
Thuban 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

Thuban's avatar
Thuban 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.

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