diff --git a/README.md b/README.md index 54bfb4e..684d481 100644 --- a/README.md +++ b/README.md @@ -1,26 +1,12 @@ # PeerTube app for YunoHost + [![Install Peertube with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=Peertube)

+======= -## Installation(Read it) - 1. Require dedicated domain like **peertube.domain.tld**. - 2. No LDAP support - 3. No Multi-instance - 4. No change-url possible. - 5. Peertube is under development stage,don't use it for production - 6. **Install the app by following command:** +**Shipped Version:** 1.0.0-beta.7 - $ yunohost app install https://github.com/YunoHost-Apps/peertube_ynh - 7. **root** is the admin username and the admin email is the email address given at the time of installation. - 8. **After installation change the password by this command:** - - $ cd /var/www/peertube && NODE_ENV=production npm run reset-password -- -u root - -

- PeerTube -

- -

-Decentralized video streaming platform using P2P (BitTorrent) directly in the web browser with WebTorrent. +

+PeerTube is a decentralized video streaming platform using P2P (BitTorrent) directly in the web browser, using WebTorrent.

**PeerTube is sponsored by [Framasoft](https://framatube.org/#en), a non-profit that promotes, spreads and develops free-libre software. If you want to support this project, please [consider donating them](https://soutenir.framasoft.org/en/).** @@ -29,32 +15,60 @@ Decentralized video streaming platform using P2P (BitTorrent) directly in the we Want to see in action? - * [Demo server](http://peertube.cpy.re) + * [Demo](http://peertube.cpy.re) * [Video](https://peertube.cpy.re/videos/watch/f78a97f8-a142-4ce1-a5bd-154bf9386504) to see how the "decentralization feature" looks like + * [Video](https://peertube.valvin.fr/videos/watch/e510b421-92f3-4153-aaf9-baf5166f43e8) showcasing A2HS - ## Why + +## Installation + +### Guidelines + + 1. Require dedicated domain like **peertube.domain.tld**. + 1. No LDAP support (blocked until upstream implements it) + 1. URL can not be changed once selected. + 1. Take notice that this YunoHost package *claims* the following features: + - [x] Install + - [x] Remove + - [X] Upgrade + - [X] Backup + - [X] Restore + - [X] Multi-instance + +### Install + + 1. **App can be installed by YunoHost admin interface or by the following command:** + + $ sudo yunohost app install https://github.com/YunoHost-Apps/peertube_ynh + 1. **root** is the admin username. + 1. **root Password** will be sent to the email address given at the time of the installation. + 1. **TLS** and **starttls** are disabled for the outgoing mails. If you intent to use email address not hosted on your local server,it's advised to have a proper SMTP configured with tls and starttls settings by editing **/var/www/peertube/config/porduction.yml**. + + ### Updation + 1. **App can be updated by YunoHost admin interface or by the following command:** + + $ sudo yunohost app upgrade -u https://github.com/YunoHost-Apps/peertube_ynh peertube + 1. App will backup the **home directory** for Peertube before updating which can take a lot of space on the system. It's advised to check the home folder's free space by + + $ df -h "/home" | awk 'NR==2 { print $4 }' + and comapre it with space occupied by the Peertube home directory before updating. + + $ du -hcs /home/yunohost.app/peertube | awk 'NR==2 { print $1 }' + + ## Why We can't build a FOSS video streaming alternatives to YouTube, Dailymotion, Vimeo... with a centralized software. One organization alone cannot have enough money to pay bandwidth and video storage of its server. -So we need to have a decentralized network (as [Hubzilla](https://project.hubzilla.org/page/hubzilla/hubzilla-project)([Hubzilla YunoHost](https://github.com/YunoHost-Apps/hubzilla_ynh)),[Friendica](http://friendi.ca/)([Friendica YunoHost](https://github.com/YunoHost-Apps/friendica_ynh)),[Mastodon](https://github.com/tootsuite/mastodon)([Mastodon YunoHost](https://github.com/YunoHost-Apps/mastodon_ynh)),[Diaspora](https://github.com/diaspora/diaspora)([Diaspora YunoHost](https://github.com/YunoHost-Apps/diaspora_ynh))). +So we need to have a decentralized network (as [Hubzilla](https://project.hubzilla.org/page/hubzilla/hubzilla-project) ([Hubzilla YunoHost](https://github.com/YunoHost-Apps/hubzilla_ynh)), [Friendica](http://friendi.ca/) ([Friendica YunoHost](https://github.com/YunoHost-Apps/friendica_ynh)), [Mastodon](https://github.com/tootsuite/mastodon) ([Mastodon YunoHost](https://github.com/YunoHost-Apps/mastodon_ynh)), [Diaspora](https://github.com/diaspora/diaspora) ([Diaspora YunoHost](https://github.com/YunoHost-Apps/diaspora_ynh)),[Funkwhale](https://funkwhale.audio) ([Funkwhale YunoHost](https://github.com/YunoHost-Apps/funkwhale_ynh))). But it's not enough because one video could become famous and overload the server. It's the reason why we need to use a P2P protocol to limit the server load. Thanks to [WebTorrent](https://github.com/feross/webtorrent), we can make P2P (thus bittorrent) inside the web browser right now. ### Dependencies - * **NodeJS >= 6.x** - * **npm >= 3.x** - * yarn - * OpenSSL (cli) - * PostgreSQL - * FFmpeg + * NodeJS, PostgreSQL. + * On Debian Jessie,backport is added for the ffmpeg package. +## LICENSE -## Features - -- [X] Install -- [X] Remove -- [ ] Upgrade -- [ ] Backup -- [ ] Restore +PeerTube is licensed under the GNU Affero General Public License v3.0. diff --git a/check_process b/check_process index af9b88c..78e090d 100644 --- a/check_process +++ b/check_process @@ -16,9 +16,9 @@ setup_nourl=0 setup_private=1 setup_public=1 - upgrade=0 - backup_restore=0 - multi_instance=0 + upgrade=1 + backup_restore=1 + multi_instance=1 incorrect_path=0 port_already_use=1 change_url=0 @@ -26,8 +26,8 @@ Level 1=auto Level 2=auto Level 3=auto -# Level 4: - Level 4=0 +# Level 4: not supported by upstream + Level 4=1 # Level 5: Level 5=auto Level 6=auto @@ -36,5 +36,5 @@ Level 9=0 Level 10=0 ;;; Options -Email= -Notification=none +Email=anmol@datamol.org +Notification=yes diff --git a/conf/app.src b/conf/app.src index 9d2ebdb..86eaaa3 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,6 +1,6 @@ -SOURCE_URL=https://github.com/Chocobozzz/PeerTube/archive/develop.zip -SOURCE_SUM=f7266fc1cb2a127902707ccc0978b4ae5f7a08c1e089feb479a78e3410872ec0 +SOURCE_URL=https://github.com/Chocobozzz/PeerTube/releases/download/v1.0.0-beta.7/peertube-v1.0.0-beta.7.tar.xz +SOURCE_SUM=f4764d122d10e31cad9ee0b0dda4cd150c99278ff070c3d6b650247d4fdc9fe4 SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=zip -SOURCE_IN_SUBDIR= +SOURCE_FORMAT=tar.xz +SOURCE_IN_SUBDIR=true SOURCE_FILENAME= diff --git a/conf/backports.list b/conf/backports.list new file mode 100644 index 0000000..c204862 --- /dev/null +++ b/conf/backports.list @@ -0,0 +1 @@ +deb http://httpredir.debian.org/debian jessie-backports main diff --git a/conf/nginx.conf b/conf/nginx.conf index 91aeee4..b7fe0bc 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,18 +1,37 @@ -location / { + location ~ ^/client/(.*\.(js|css|woff2|otf|ttf|woff|eot))$ { + add_header Cache-Control "public, max-age=31536000, immutable"; + + alias __FINALPATH__/client/dist/$1; + } + + location ~ ^/static/(thumbnails|avatars)/(.*)$ { + add_header Cache-Control "public, max-age=31536000, immutable"; + + alias /home/yunohost.app/__NAME__/storage/$1/$2; + } + + location / { if ($scheme = http) { rewrite ^ https://$server_name$request_uri? permanent; } - proxy_pass http://localhost:9000; + proxy_pass http://localhost:__PORT__; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - # For the video upload - client_max_body_size 2G; + # Hard limit, PeerTube does not support videos > 4GB + client_max_body_size 4G; + proxy_connect_timeout 600; + proxy_send_timeout 600; + proxy_read_timeout 600; + send_timeout 600; } - # Bypass PeerTube webseed route for better performances - location /static/webseed { + # Bypass PeerTube webseed route for better performances + location /static/webseed { + # Clients usually have 4 simultaneous webseed connections, so the real limit is 3MB/s per client + limit_rate 800k; + if ($request_method = 'OPTIONS') { add_header 'Access-Control-Allow-Origin' '*'; add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS'; @@ -27,9 +46,12 @@ location / { add_header 'Access-Control-Allow-Origin' '*'; add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS'; add_header 'Access-Control-Allow-Headers' 'Range,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type'; + + # Don't spam access log file with byte range requests + access_log off; } - alias __FINALPATH__/videos; + alias /home/yunohost.app/__NAME__/storage/videos; } # Websocket tracker @@ -42,5 +64,5 @@ location / { proxy_http_version 1.1; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $host; - proxy_pass http://localhost:9000; + proxy_pass http://localhost:__PORT__; } diff --git a/conf/production.yaml b/conf/production.yaml index 74a1063..490c43b 100644 --- a/conf/production.yaml +++ b/conf/production.yaml @@ -1,29 +1,69 @@ listen: - port: 9000 + hostname: 'localhost' + port: __PORT__ # Correspond to your reverse proxy "listen" configuration webserver: https: true hostname: '__domain__' port: 443 + +# Proxies to trust to get real client IP +# If you run PeerTube just behind a local proxy (nginx), keep 'loopback' +# If you run PeerTube behind a remote proxy, add the proxy IP address (or subnet) +trust_proxy: + - 'loopback' + # Your database name will be "peertube"+database.suffix database: hostname: 'localhost' port: 5432 - suffix: '_prod' - username: 'peertube' + suffix: '___db_name__' + username: '__db_name__' password: '__db_pwd__' +# Your object store +redis: + hostname: 'localhost' + port: 6379 + auth: null + +# SMTP server to send emails +smtp: + hostname: 'localhost' + port: 25 + username: null + password: null + tls: false + disable_starttls: true + ca_file: null # Used for self signed certificates + from_address: 'admin@__domain__' + # From the project root directory storage: - certs: 'certs/' - videos: 'videos/' - logs: 'logs/' - previews: 'previews/' - thumbnails: 'thumbnails/' - torrents: 'torrents/' - cache: 'cache/' + avatars: '/home/yunohost.app/__app__/storage/avatars/' + videos: '/home/yunohost.app/__app__/storage/videos/' + logs: '/home/yunohost.app/__app__/storage/logs/' + previews: '/home/yunohost.app/__app__/storage/previews/' + thumbnails: '/home/yunohost.app/__app__/storage/thumbnails/' + torrents: '/home/yunohost.app/__app__/storage/torrents/' + cache: '/home/yunohost.app/__app__/storage/cache/' + +log: + level: 'info' # debug/info/warning/error + +############################################################################### +# +# From this point, all the following keys can be overriden by the web interface +# (local-production.json file). If you need to change some values, prefer to +# use the web interface because the configuration will be automatically +# reloaded without any need to restart PeerTube. +# +# /!\ If you already have a local-production.json file, the modification of the +# following keys will have no effect /!\. +# +############################################################################### cache: previews: @@ -35,6 +75,10 @@ admin: signup: enabled: false limit: 10 # When the limit is reached, registrations are disabled. -1 == unlimited + filters: + cidr: # You can specify CIDR ranges to whitelist (empty = no filtering) or blacklist + whitelist: [] + blacklist: [] user: # Default value of maximum video BYTES the user can upload (does not take into account transcoded files). @@ -45,10 +89,37 @@ user: # Uses a lot of CPU! transcoding: enabled: false - threads: 2 + threads: 1 resolutions: # Only created if the original video has a higher resolution - 240p: true - 360p: true - 480p: true - 720p: true - 1080p: true + 240p: false + 360p: false + 480p: false + 720p: false + 1080p: false + +# Instance settings +instance: + name: 'PeerTube' + short_description: 'PeerTube, a federated (ActivityPub) video streaming platform using P2P (BitTorrent) directly in the web browser with WebTorrent and Angular.' + description: '' # Support markdown + terms: '' # Support markdown + default_client_route: '/videos/trending' + # By default, "do_not_list" or "blur" or "display" NSFW videos + # Could be overridden per user with a setting + default_nsfw_policy: 'do_not_list' + customizations: + javascript: '' # Directly your JavaScript code (without