Compare commits

...

6 commits

5 changed files with 20 additions and 219 deletions

View file

@ -1,125 +0,0 @@
{
"instance": {
"name": "Peertube.social",
"short_description": "Peertube instance for leftist and non-commercial content. Unlimited uploads (up to 500 MB per day)",
"description": "Please follow [@peertubesocial](https://radical.town/@peertubesocial) for news and announcements about this instance. You can also join us on [Lemmy](https://dev.lemmy.ml/c/peertube) for discussions.\n\nIf you like this instance, please consider donating via [Liberapay](https://en.liberapay.com/Peertube.social/).\n\nWe are experimenting with small batches of registrations. If signups are closed, it is to prevent spam bot accounts. We are waiting for PeerTube to implement some measure to prevent automated signups, like [issue #1946](https://github.com/Chocobozzz/PeerTube/issues/1946) or[issue #2242](https://github.com/Chocobozzz/PeerTube/issues/2242)",
"is_nsfw": false,
"default_nsfw_policy": "do_not_list",
"terms": "By using Peertube.social you agree to the following terms. These terms may be updated at any time, and you are responsible for checking forupdates periodically.\n\n- *No Illegal Content*\nThe instance is hosted in Germany. Any content that violates German law is forbidden. This includes copyright infringement, child pornography and others. Violating this rule will result in a permanent ban.\n\n- *No Commercial Content*\nAdvertisements are forbidden. Videos funded through donations are acceptable, and requesting donations is also acceptable.\n\n- *No Fascist Content*\nThis includes (but is not limited to) use of fascist iconography and support for or defense of fascist movements.\n\n- *No Anti-Communist Content*\nThis includes (but is not limited to) condemning communism or socialism or supporting anticommunist propaganda. \n\n- *No Bigotry or Hate Speech*\nSexism, Racism, LGBTphobia, Xenophobia, and discrimination or hate speech against minorities are not tolerated and will result in a ban. Content criticizing Bigotry or Hate Speech must provide sufficient warning.\n\n- *No Spam*\nUploads are limited to 500 MB per day. Submitting abnormally large amounts of videos or comments in a short time may be considered spam and is forbidden.\n\n- *Not Safe For Work (NSFW) Content*\nNSFW content is allowed, but pornography and extreme violence is forbidden. NSFW content must be marked as such to allow it to be filtered by other users. Pornographic content is allowed from other instances so long as it is properly marked as NSFW.\n\n- *No Data Scraping*\nYou are not allowed to scrape or analyze any data from this instance without explicit permission from the administrator.\n\nUsers of Peertube.social are responsible for all content posted from or uploaded to their account.\n\nAll decisions are to the discretion of the moderators.",
"code_of_conduct": "By using this instance you agree to the following Code of Conduct:\n\n- No illegal content.\n- No bigotry or hate speech, including racism, sexism, homophobia, and transphobia.\n- No spam.\n- No Harassment.\n- All NSFW content must be marked as such, and pornography is not allowed.\n- No comercial, fascist, or anti-communist content.\n- No data scraping.\n\nComments and videos which violate our ToS or CoC will be deleted, and the user will be dealt with at the moderators discretion.\n\nNote that \"reverse\"-isms are not against our CoC (e.g. \"reverse racism\", misandry, etc).\n\nPeerTube does not currently support reporting comments. If you see a comment which violates our Code of Conduct please contact us through the \"Contact Administrator\" button on our [About page](https://peertube.social/about) or by messaging us on Mastodon. Moderator @ handles can be found in the Moderatorsection.",
"creation_reason": "",
"moderation_information": "Peertube.social is moderated by [@felix](https://radical.town/@felix), [@autom](https://octodon.social/@autom), [@niquarl](https://mastodon.social/@Niquarl), and [@lesbianhacker](https://radical.town/@lesbianhacker).",
"administrator": "",
"maintenance_lifetime": "",
"business_model": "",
"hardware_information": "This instance is hosted on a 2 CPU VPS, with 4 GB RAM and 40 GB disk space ([CX21 on this page](https://www.hetzner.com/cloud)). For video storage I am using a [Hetzner storage box](https://www.hetzner.com/storage/storage-box). The RAM and disk space are more than enough, but faster CPU would always be better to speed up transcoding. Outgoing traffic is roughly 1 TB per month. Total cost is about 23 € per month (including backups and domain renewal). The instance config (with Ansible and docker-compose) is [available here](https://yerbamate.dev/nutomic/peertube-compose).\n",
"categories": [
14,
1,
11,
15,
8
],
"languages": [
"es",
"de",
"en",
"sv",
"da",
"no",
"eo"
],
"default_client_route": "/videos/local",
"customizations": {
"javascript": "",
"css": ".video-miniature .views {\n display: none;\n}\n.create-an-account {\n display: none;\n}\n.create-account-button {\n display: none !important;\n}"
}
},
"theme": {
"default": "default"
},
"services": {
"twitter": {
"username": "@Chocobozzz",
"whitelisted": false
}
},
"cache": {
"previews": {
"size": 1000000
},
"captions": {
"size": 50000
}
},
"signup": {
"enabled": true,
"limit": 10000,
"requires_email_verification": true
},
"import": {
"videos": {
"http": {
"enabled": true
},
"torrent": {
"enabled": false
}
}
},
"admin": {
"email": "info@peertube.social"
},
"contact_form": {
"enabled": true
},
"user": {
"video_quota": -1,
"video_quota_daily": 524288000
},
"transcoding": {
"enabled": true,
"threads": 2,
"allow_additional_extensions": true,
"allow_audio_files": true,
"resolutions": {
"0p": true,
"240p": true,
"360p": true,
"480p": true,
"720p": true,
"1080p": true,
"2160p": false
},
"hls": {
"enabled": false
},
"webtorrent": {
"enabled": true
}
},
"auto_blacklist": {
"videos": {
"of_users": {
"enabled": true
}
}
},
"followers": {
"instance": {
"enabled": true,
"manual_approval": true
}
},
"followings": {
"instance": {
"auto_follow_back": {
"enabled": false
},
"auto_follow_index": {
"enabled": false,
"index_url": "https://instances.joinpeertube.org"
}
}
}
}

View file

@ -28,10 +28,9 @@
- name: copy files
copy: src={{item.src}} dest={{item.dest}} mode={{item.mode}} force={{item.force}}
with_items:
- { src: 'files/docker-daemon.json', dest: '/etc/docker/daemon.json', mode: '0644', force: 'yes' }
- { src: 'files/local-production.json', dest: '/peertube/volumes/config/local-production.json', mode: '0644', force: 'yes' }
- { src: 'files/send-email-to-users.bash', dest: '/peertube/send-email-to-users.bash', mode: '755', force: 'yes' }
- { src: 'files/email-template.txt', dest: '/peertube/email-template.txt', mode: '0644', force: 'no' }
- { src: '../files/docker-daemon.json', dest: '/etc/docker/daemon.json', mode: '0644', force: 'yes' }
- { src: '../files/send-email-to-users.bash', dest: '/peertube/send-email-to-users.bash', mode: '755', force: 'yes' }
- { src: '../files/email-template.txt', dest: '/peertube/email-template.txt', mode: '0644', force: 'no' }
- name: get latest peertube version from github
uri:
@ -51,10 +50,10 @@
- name: add all template files
template: src={{item.src}} dest={{item.dest}} mode={{item.mode}}
with_items:
- { src: 'templates/docker-compose.yml.j2', dest: '/peertube/docker-compose.yml', mode: '0644' }
- { src: 'templates/nginx.conf.j2', dest: '/peertube/nginx.conf', mode: '0644' }
- { src: 'templates/env.j2', dest: '/peertube/.env', mode: '0600' }
- { src: 'templates/peertube-production.yaml.j2', dest: '/peertube/volumes/config/production.yaml', mode: '0600' }
- { src: '../templates/docker-compose.yml.j2', dest: '/peertube/docker-compose.yml', mode: '0644' }
- { src: '../templates/nginx.conf.j2', dest: '/peertube/nginx.conf', mode: '0644' }
- { src: '../templates/env.j2', dest: '/peertube/.env', mode: '0600' }
- { src: '../templates/peertube-production.yaml.j2', dest: '/peertube/volumes/config/production.yaml', mode: '0600' }
vars:
peertube_version: "{{ peertube_version_response.json.tag_name }}"

View file

@ -17,6 +17,8 @@ services:
peertube:
image: chocobozzz/peertube:{{ peertube_version }}-buster
ports:
- "1935:1935"
env_file:
- .env
volumes:

View file

@ -15,9 +15,6 @@ http {
}
}
proxy_cache_path /var/cache/peertube_frontend levels=1:2 keys_zone=peertube_frontend_cache:10m max_size=100m use_temp_path=off;
proxy_cache_path /var/cache/peertube_video levels=1:2 keys_zone=peertube_video_cache:10m max_size={{ cache_size_gb }}g use_temp_path=off;
geo $bad_user {
default 0;
103.114.191.0/24 1;
@ -82,69 +79,11 @@ ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECD
proxy_read_timeout 600;
send_timeout 600;
# https://www.nginx.com/blog/nginx-caching-guide/
proxy_cache peertube_frontend_cache;
proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504;
proxy_cache_revalidate on;
proxy_cache_lock on;
proxy_cache_min_uses 5;
#add_header X-Cached $upstream_cache_status;
location ~ ^/client/(.*\.(js|css|woff2|otf|ttf|woff|eot))$ {
proxy_pass http://peertube:9000;
add_header Cache-Control "public, max-age=31536000, immutable";
}
}
location ~ ^/static/(webseed|redundancy|streaming-playlists)/ {
# NOTE: Its not possible to use proxy_cache for files that are served from disk without complicated workarounds
# Anyway caching is not a great idea because files are changed on disk after transcoding.
#slice 1m;
#proxy_cache peertube_video_cache;
#proxy_cache_valid 206 1h;
#proxy_cache_key $uri$is_args$args$slice_range;
#proxy_set_header Range $slice_range;
#proxy_http_version 1.1;
#proxy_pass http://peertube:9000;
# required workaround for https://github.com/Chocobozzz/PeerTube/issues/1777
#proxy_ignore_headers Cache-Control;
# for debugging
#add_header X-Cache-Status $upstream_cache_status;
# Clients usually have 4 simultaneous webseed connections, so the real limit is 3MB/s per client
set $peertube_limit_rate 800k;
# Increase rate limit in HLS mode, because we don't have multiple simultaneous connections
if ($request_uri ~ -fragmented.mp4$) {
set $peertube_limit_rate 5000k;
}
if ($request_method = 'OPTIONS') {
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';
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Type' 'text/plain charset=UTF-8';
add_header 'Content-Length' 0;
return 204;
}
if ($request_method = 'GET') {
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;
}
root /data-external;
rewrite ^/static/webseed/(.*)$ /videos/$1 break;
rewrite ^/static/redundancy/(.*)$ /redundancy/$1 break;
rewrite ^/static/streaming-playlists/(.*)$ /streaming-playlists/$1 break;
try_files $uri /;
}
# Websocket tracker
location /tracker/socket {
# Peers send a message to the tracker every 15 minutes

View file

@ -74,30 +74,16 @@ trending:
videos:
interval_days: 7 # Compute trending videos for the last x days
# Cache remote videos on your server, to help other instances to broadcast the video
# You can define multiple caches using different sizes/strategies
# Once you have defined your strategies, choose which instances you want to cache in admin -> manage follows -> following
redundancy:
views:
videos:
check_interval: '1 hour' # How often you want to check new videos to cache
strategies:
-
size: '20GB'
# Minimum time the video must remain in the cache. Only accept values > 10 hours (to not overload remote instances)
min_lifetime: '12 hours'
strategy: 'most-views' # Cache videos that have the most views
-
size: '20GB'
# Minimum time the video must remain in the cache. Only accept values > 10 hours (to not overload remote instances)
min_lifetime: '12 hours'
strategy: 'trending' # Cache trending videos
-
size: '0GB'
# Minimum time the video must remain in the cache. Only accept values > 10 hours (to not overload remote instances)
min_lifetime: '24 hours'
strategy: 'recently-added' # Cache recently added videos
min_views: 10 # Having at least x views
# PeerTube creates a database entry every hour for each video to track views over a period of time
# This is used in particular by the Trending page
# PeerTube could remove old remote video views if you want to reduce your database size (video view counter will not be altered)
# -1 means no cleanup
# Other values could be '6 months' or '30 days' etc (PeerTube will periodically delete old entries from database)
remote:
max_age: '30 days'
csp:
enabled: true
report_only: true
federation:
videos:
federate_unlisted: false