diff --git a/README.md b/README.md index 69874a3..e5a1da7 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,9 @@ # PeerTube app for YunoHost [![Install Peertube with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=Peertube)

+======= +**Version 1.0.0-beta.4** +

PeerTube is a decentralized video streaming platform using P2P (BitTorrent) directly in the web browser, using WebTorrent. @@ -22,7 +25,6 @@ Want to see in action? 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. Peertube is under beta stage, **don't use it for production** 1. Take notice that this YunoHost package *claims* the following features: - [x] Install - [x] Remove @@ -33,26 +35,22 @@ Want to see in action? 1. **Install the app by following command:** $ sudo yunohost app install https://github.com/YunoHost-Apps/peertube_ynh - 1. Use **root** as the admin username and the password given while installation of the Peertube for the login. - 1. Don't forget to change the **port** if using a multi-instance for Peertube. + 1. **root** is the admin username. + 1. **Password** will be sent through the email to the admin email account given at the time of installation of the app. ## 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 + * It adds jessie-backports for ffmpeg ## LICENSE 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 fed8eaa..b2928bb 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/Chocobozzz/PeerTube/releases/download/v1.0.0-beta.1/peertube-v1.0.0-beta.1.zip -SOURCE_SUM=8e80aaa503de0d28be209375b48dd9242abec16a3bde473b684286c67e19af13 +SOURCE_URL=https://github.com/Chocobozzz/PeerTube/releases/download/v1.0.0-beta.4/peertube-v1.0.0-beta.4.zip +SOURCE_SUM=4d2b60e978c9b170c733b645440b1ea29ac8b69d85adc23c36fa58a9c9db20d6 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=true diff --git a/conf/nginx.conf b/conf/nginx.conf index 7aa8e7b..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 + # 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 8102f3f..be867e7 100644 --- a/conf/production.yaml +++ b/conf/production.yaml @@ -1,18 +1,26 @@ 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 @@ -21,22 +29,45 @@ redis: port: 6379 auth: null +# SMTP server to send emails +smtp: + hostname: null + port: 465 + username: null + password: null + tls: true + disable_starttls: false + ca_file: null # Used for self signed certificates + from_address: 'admin@__domain__' + # From the project root directory storage: - avatars: 'avatars/' - 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: - size: 1 # Max number of previews you want to cache + size: 100 # Max number of previews you want to cache admin: email: '__email__' @@ -56,16 +87,22 @@ transcoding: enabled: false threads: 2 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' - description: 'Welcome to this PeerTube instance!' # Support markdown - terms: 'No terms for now.' # Support markdown + 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