Update integration
This commit is contained in:
parent
9423092bc6
commit
d151b80b6d
5 changed files with 54 additions and 169 deletions
|
@ -1,155 +0,0 @@
|
||||||
daemon off;
|
|
||||||
error_log /dev/stderr;
|
|
||||||
user nobody nobody;
|
|
||||||
|
|
||||||
events {}
|
|
||||||
|
|
||||||
http {
|
|
||||||
##
|
|
||||||
# Basic Settings
|
|
||||||
##
|
|
||||||
sendfile on;
|
|
||||||
tcp_nopush on;
|
|
||||||
tcp_nodelay on;
|
|
||||||
keepalive_timeout 65;
|
|
||||||
types_hash_max_size 2048;
|
|
||||||
client_body_temp_path /tmp/nginx-cache-client 1 2;
|
|
||||||
proxy_temp_path /tmp/nginx-cache-proxy 1 2;
|
|
||||||
|
|
||||||
#
|
|
||||||
# SSL Settings
|
|
||||||
##
|
|
||||||
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
|
|
||||||
ssl_prefer_server_ciphers on;
|
|
||||||
|
|
||||||
##
|
|
||||||
# Gzip Settings
|
|
||||||
##
|
|
||||||
gzip on;
|
|
||||||
|
|
||||||
access_log /dev/stdout;
|
|
||||||
server_names_hash_bucket_size 64;
|
|
||||||
|
|
||||||
upstream backend {
|
|
||||||
server 127.0.0.1:9000;
|
|
||||||
}
|
|
||||||
|
|
||||||
server {
|
|
||||||
# In production you should use TLS instead of plain HTTP
|
|
||||||
listen [::]:443 http2 ssl;
|
|
||||||
|
|
||||||
# should be the endpoint you want
|
|
||||||
# aws uses s3.amazonaws.com for example
|
|
||||||
server_name garage.example.com;
|
|
||||||
|
|
||||||
location / {
|
|
||||||
proxy_pass http://s3_backend;
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
server {
|
|
||||||
listen [::]:80;
|
|
||||||
|
|
||||||
server_name peertube.localhost;
|
|
||||||
|
|
||||||
##
|
|
||||||
# Application
|
|
||||||
##
|
|
||||||
|
|
||||||
location @api {
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
|
|
||||||
client_max_body_size 100k; # default is 1M
|
|
||||||
|
|
||||||
proxy_connect_timeout 10m;
|
|
||||||
proxy_send_timeout 10m;
|
|
||||||
proxy_read_timeout 10m;
|
|
||||||
send_timeout 10m;
|
|
||||||
|
|
||||||
proxy_pass http://backend;
|
|
||||||
}
|
|
||||||
|
|
||||||
location / {
|
|
||||||
try_files /dev/null @api;
|
|
||||||
}
|
|
||||||
|
|
||||||
location = /api/v1/videos/upload-resumable {
|
|
||||||
client_max_body_size 0;
|
|
||||||
proxy_request_buffering off;
|
|
||||||
|
|
||||||
try_files /dev/null @api;
|
|
||||||
}
|
|
||||||
|
|
||||||
location = /api/v1/videos/upload {
|
|
||||||
limit_except POST HEAD { deny all; }
|
|
||||||
|
|
||||||
# This is the maximum upload size, which roughly matches the maximum size of a video file.
|
|
||||||
# Note that temporary space is needed equal to the total size of all concurrent uploads.
|
|
||||||
# This data gets stored in /var/lib/nginx by default, so you may want to put this directory
|
|
||||||
# on a dedicated filesystem.
|
|
||||||
client_max_body_size 12G; # default is 1M
|
|
||||||
add_header X-File-Maximum-Size 8G always; # inform backend of the set value in bytes before mime-encoding (x * 1.4 >= client_max_body_size)
|
|
||||||
|
|
||||||
try_files /dev/null @api;
|
|
||||||
}
|
|
||||||
|
|
||||||
location ~ ^/api/v1/(videos|video-playlists|video-channels|users/me) {
|
|
||||||
client_max_body_size 6M; # default is 1M
|
|
||||||
add_header X-File-Maximum-Size 4M always; # inform backend of the set value in bytes before mime-encoding (x * 1.4 >= client_max_body_size)
|
|
||||||
|
|
||||||
try_files /dev/null @api;
|
|
||||||
}
|
|
||||||
|
|
||||||
##
|
|
||||||
# Websocket
|
|
||||||
##
|
|
||||||
|
|
||||||
location @api_websocket {
|
|
||||||
proxy_http_version 1.1;
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
|
||||||
proxy_set_header Connection "upgrade";
|
|
||||||
|
|
||||||
proxy_pass http://backend;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /socket.io {
|
|
||||||
try_files /dev/null @api_websocket;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /tracker/socket {
|
|
||||||
# Peers send a message to the tracker every 15 minutes
|
|
||||||
# Don't close the websocket before then
|
|
||||||
proxy_read_timeout 15m; # default is 60s
|
|
||||||
|
|
||||||
try_files /dev/null @api_websocket;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
server {
|
|
||||||
listen [::]:80;
|
|
||||||
|
|
||||||
server_name peertube-video.garage.localhost peertube-playlist.garage.localhost;
|
|
||||||
|
|
||||||
|
|
||||||
location / {
|
|
||||||
add_header Access-Control-Allow-Origin *;
|
|
||||||
add_header Access-Control-Max-Age 3600;
|
|
||||||
add_header Access-Control-Expose-Headers Content-Length;
|
|
||||||
add_header Access-Control-Allow-Headers Range;
|
|
||||||
if ($request_method !~ ^(GET|HEAD)$ ) {
|
|
||||||
return 200;
|
|
||||||
}
|
|
||||||
proxy_pass http://127.0.0.1:3902;
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
16
peertube/README.md
Normal file
16
peertube/README.md
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
You need a corectly configured and running Garage instance.
|
||||||
|
Check the doc, in Peertube's section, to see how.
|
||||||
|
|
||||||
|
Then run
|
||||||
|
|
||||||
|
```bash
|
||||||
|
nix-shell
|
||||||
|
```
|
||||||
|
|
||||||
|
Then you will probably want to execute commands one by one, so:
|
||||||
|
|
||||||
|
```
|
||||||
|
cat shell.nix
|
||||||
|
```
|
||||||
|
|
||||||
|
And execute c
|
20
peertube/config.toml
Normal file
20
peertube/config.toml
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
metadata_dir = "/tmp/meta"
|
||||||
|
data_dir = "/tmp/data"
|
||||||
|
|
||||||
|
replication_mode = "none"
|
||||||
|
|
||||||
|
rpc_bind_addr = "[::]:3901"
|
||||||
|
rpc_public_addr = "127.0.0.1:3901"
|
||||||
|
rpc_secret = "1799bccfd7411eddcf9ebd316bc1f5287ad12a68094e1c6ac6abde7e6feae1ec"
|
||||||
|
|
||||||
|
bootstrap_peers = []
|
||||||
|
|
||||||
|
[s3_api]
|
||||||
|
s3_region = "garage"
|
||||||
|
api_bind_addr = "[::]:3900"
|
||||||
|
root_domain = ".s3.garage.localhost"
|
||||||
|
|
||||||
|
[s3_web]
|
||||||
|
bind_addr = "[::]:3902"
|
||||||
|
root_domain = ".web.garage.localhost"
|
||||||
|
index = "index.html"
|
|
@ -1,11 +1,11 @@
|
||||||
listen:
|
listen:
|
||||||
hostname: 'localhost'
|
hostname: '0.0.0.0'
|
||||||
port: 9000
|
port: 9000
|
||||||
|
|
||||||
# Correspond to your reverse proxy server_name/listen configuration (i.e., your public PeerTube instance URL)
|
# Correspond to your reverse proxy server_name/listen configuration (i.e., your public PeerTube instance URL)
|
||||||
webserver:
|
webserver:
|
||||||
https: false
|
https: false
|
||||||
hostname: 'localhost'
|
hostname: 'peertube.localhost'
|
||||||
port: 9000
|
port: 9000
|
||||||
|
|
||||||
rates_limit:
|
rates_limit:
|
||||||
|
@ -34,7 +34,7 @@ trust_proxy:
|
||||||
|
|
||||||
# Your database name will be database.name OR "peertube"+database.suffix
|
# Your database name will be database.name OR "peertube"+database.suffix
|
||||||
database:
|
database:
|
||||||
hostname: '/home/quentin/Documents/dev/deuxfleurs/garage-tests'
|
hostname: '/home/quentin/Documents/dev/integration-garage'
|
||||||
name: 'peertube'
|
name: 'peertube'
|
||||||
username: 'quentin'
|
username: 'quentin'
|
||||||
pool:
|
pool:
|
||||||
|
@ -91,12 +91,12 @@ storage:
|
||||||
client_overrides: '/tmp/peertube/storage/client-overrides/'
|
client_overrides: '/tmp/peertube/storage/client-overrides/'
|
||||||
|
|
||||||
object_storage:
|
object_storage:
|
||||||
enabled: false
|
enabled: true
|
||||||
|
|
||||||
# Without protocol, will default to HTTPS
|
# Without protocol, will default to HTTPS
|
||||||
endpoint: '' # 's3.amazonaws.com' or 's3.fr-par.scw.cloud' for example
|
endpoint: 'http://s3.garage.localhost:3900' # 's3.amazonaws.com' or 's3.fr-par.scw.cloud' for example
|
||||||
|
|
||||||
region: 'us-east-1'
|
region: 'garage'
|
||||||
|
|
||||||
credentials:
|
credentials:
|
||||||
# You can also use AWS_ACCESS_KEY_ID env variable
|
# You can also use AWS_ACCESS_KEY_ID env variable
|
||||||
|
@ -108,20 +108,20 @@ object_storage:
|
||||||
max_upload_part: 2GB
|
max_upload_part: 2GB
|
||||||
|
|
||||||
streaming_playlists:
|
streaming_playlists:
|
||||||
bucket_name: 'streaming-playlists'
|
bucket_name: 'peertube-playlists'
|
||||||
|
|
||||||
# Allows setting all buckets to the same value but with a different prefix
|
# Allows setting all buckets to the same value but with a different prefix
|
||||||
prefix: '' # Example: 'streaming-playlists:'
|
prefix: '' # Example: 'streaming-playlists:'
|
||||||
|
|
||||||
# Base url for object URL generation, scheme and host will be replaced by this URL
|
# Base url for object URL generation, scheme and host will be replaced by this URL
|
||||||
# Useful when you want to use a CDN/external proxy
|
# Useful when you want to use a CDN/external proxy
|
||||||
base_url: '' # Example: 'https://mirror.example.com'
|
base_url: 'http://peertube-playlists.web.garage.localhost:3902' # Example: 'https://mirror.example.com'
|
||||||
|
|
||||||
# Same settings but for webtorrent videos
|
# Same settings but for webtorrent videos
|
||||||
videos:
|
videos:
|
||||||
bucket_name: 'videos'
|
bucket_name: 'peertube-videos'
|
||||||
prefix: ''
|
prefix: ''
|
||||||
base_url: ''
|
base_url: 'http://peertube-videos.web.garage.localhost:3902'
|
||||||
|
|
||||||
log:
|
log:
|
||||||
level: 'info' # 'debug' | 'info' | 'warn' | 'error'
|
level: 'info' # 'debug' | 'info' | 'warn' | 'error'
|
|
@ -6,7 +6,7 @@ with pkgs; mkShell {
|
||||||
shellHook = ''
|
shellHook = ''
|
||||||
PEERTUBE=${peertube}
|
PEERTUBE=${peertube}
|
||||||
function deploy {
|
function deploy {
|
||||||
rm -rf /tmp/peertube
|
rm -rf /tmp/{psql,peertube}
|
||||||
mkdir -p /tmp/peertube/{config,storage}
|
mkdir -p /tmp/peertube/{config,storage}
|
||||||
cp -r $PEERTUBE /tmp/peertube/code
|
cp -r $PEERTUBE /tmp/peertube/code
|
||||||
mkdir /tmp/psql
|
mkdir /tmp/psql
|
||||||
|
@ -17,13 +17,17 @@ with pkgs; mkShell {
|
||||||
psql -h $PWD peertube -c "CREATE EXTENSION unaccent;"
|
psql -h $PWD peertube -c "CREATE EXTENSION unaccent;"
|
||||||
cp $PEERTUBE/config/default.yaml /tmp/peertube/config/default.yaml
|
cp $PEERTUBE/config/default.yaml /tmp/peertube/config/default.yaml
|
||||||
cp production.yaml /tmp/peertube/config/production.yaml
|
cp production.yaml /tmp/peertube/config/production.yaml
|
||||||
echo "edit production.yaml"
|
echo "you must set aws keys in the peertube's config. opening vim in 3 seconds."
|
||||||
# redis-server
|
sleep 3
|
||||||
echo "Launch redis-server in a separate shell"
|
vim "/tmp/peertube/config/production.yaml"
|
||||||
|
echo "Launch redis-server"
|
||||||
|
redis-server &
|
||||||
|
sleep 3
|
||||||
cd /tmp/peertube/code
|
cd /tmp/peertube/code
|
||||||
export NODE_ENV=production
|
export NODE_ENV=production
|
||||||
export NODE_CONFIG_DIR=/tmp/peertube/config
|
export NODE_CONFIG_DIR=/tmp/peertube/config
|
||||||
node dist/server.js
|
node dist/server.js
|
||||||
|
# npm run reset-password -- -u root # to set/change root password
|
||||||
# pg_ctl -D /tmp/psql stop
|
# pg_ctl -D /tmp/psql stop
|
||||||
# stop redis
|
# stop redis
|
||||||
}
|
}
|
Loading…
Reference in a new issue