Adds peertube app.

This commit is contained in:
2026-06-19 21:33:20 +00:00
parent 424e57baec
commit c2efed5937
10 changed files with 345 additions and 0 deletions

5
peertube/app.yaml Normal file
View File

@@ -0,0 +1,5 @@
name: peertube
is: peertube
description: PeerTube is a self-hosted, federated video platform that lets you create your own video streaming site with ActivityPub federation support.
icon: https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/peertube.svg
latest: "8"

View File

@@ -0,0 +1,41 @@
# PeerTube
PeerTube is a federated, self-hosted video platform. Videos are served using WebTorrent to reduce bandwidth load on the server.
## Dependencies
- **PostgreSQL** - Database for storing video metadata and accounts
- **Redis** - Used for caching and job queuing
- **SMTP** - For account verification and notifications
## Configuration
Key settings in `config.yaml`:
- **domain** - Where PeerTube will be accessible
- **storage** - Persistent volume size for video files (default: `5Gi`)
- **db.name** - Database name (default: `peertube`)
- **smtp** - Email settings inherited from your Wild Cloud SMTP service
## First-Time Setup
1. Add and deploy the app:
```bash
wild app add peertube
wild app deploy peertube
```
2. Log in with the root admin account:
- **Username**: `root`
- **Password**: value of `adminPassword` in your `secrets.yaml`
3. Complete the setup wizard that appears on first login (instance name, description, etc.).
4. Start uploading videos or configure federation with other PeerTube instances.
## Notes
- Increase `storage` significantly if you plan to host many videos — video files can be large
- The `secretKey` is auto-generated and used for signing tokens
- Federation with other PeerTube instances is opt-in and configured per-instance
- Live streaming requires additional UDP port configuration on your router

View File

@@ -0,0 +1,61 @@
apiVersion: batch/v1
kind: Job
metadata:
name: peertube-db-init
labels:
component: db-init
spec:
template:
metadata:
labels:
component: db-init
spec:
restartPolicy: OnFailure
securityContext:
runAsNonRoot: true
runAsUser: 999
runAsGroup: 999
seccompProfile:
type: RuntimeDefault
containers:
- name: postgres-init
image: postgres:17
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
readOnlyRootFilesystem: false
env:
- name: PGHOST
value: {{ .db.host }}
- name: PGUSER
value: postgres
- name: PGPASSWORD
valueFrom:
secretKeyRef:
name: peertube-secrets
key: postgres.password
- name: DB_NAME
value: {{ .db.name }}
- name: DB_USER
value: {{ .db.user }}
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: peertube-secrets
key: dbPassword
command:
- /bin/bash
- -c
- |
set -e
until pg_isready; do sleep 2; done
psql -c "CREATE DATABASE ${DB_NAME};" || echo "Database already exists"
psql -c "CREATE USER ${DB_USER} WITH PASSWORD '${DB_PASSWORD}';" || echo "User already exists"
psql -c "ALTER USER ${DB_USER} WITH PASSWORD '${DB_PASSWORD}';"
psql -c "GRANT ALL PRIVILEGES ON DATABASE ${DB_NAME} TO ${DB_USER};"
psql -d ${DB_NAME} -c "GRANT ALL ON SCHEMA public TO ${DB_USER};"
psql -d ${DB_NAME} -c "CREATE EXTENSION IF NOT EXISTS pg_trgm;" || true
psql -d ${DB_NAME} -c "CREATE EXTENSION IF NOT EXISTS unaccent;" || true
echo "Done"

View File

@@ -0,0 +1,135 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: peertube
namespace: {{ .namespace }}
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
component: web
template:
metadata:
labels:
component: web
spec:
securityContext:
runAsNonRoot: true
runAsUser: 999
runAsGroup: 999
fsGroup: 999
seccompProfile:
type: RuntimeDefault
containers:
- name: peertube
image: chocobozzz/peertube:v8.2.1
ports:
- name: http
containerPort: 9000
protocol: TCP
env:
- name: PEERTUBE_WEBSERVER_HOSTNAME
value: {{ .domain }}
- name: PEERTUBE_WEBSERVER_HTTPS
value: "true"
- name: PEERTUBE_WEBSERVER_PORT
value: "443"
- name: PEERTUBE_SECRET
valueFrom:
secretKeyRef:
name: peertube-secrets
key: secretKey
- name: PEERTUBE_DB_HOSTNAME
value: {{ .db.host }}
- name: PEERTUBE_DB_PORT
value: "{{ .db.port }}"
- name: PEERTUBE_DB_NAME
value: {{ .db.name }}
- name: PEERTUBE_DB_USERNAME
value: {{ .db.user }}
- name: PEERTUBE_DB_PASSWORD
valueFrom:
secretKeyRef:
name: peertube-secrets
key: dbPassword
- name: PEERTUBE_DB_SSL
value: "false"
- name: REDIS_PASSWORD
valueFrom:
secretKeyRef:
name: peertube-secrets
key: redis.password
- name: PEERTUBE_REDIS_HOSTNAME
value: {{ .redis.host }}
- name: PEERTUBE_REDIS_AUTH
valueFrom:
secretKeyRef:
name: peertube-secrets
key: redis.password
- name: PEERTUBE_SMTP_HOSTNAME
value: {{ .smtp.host }}
- name: PEERTUBE_SMTP_PORT
value: "{{ .smtp.port }}"
- name: PEERTUBE_SMTP_FROM
value: {{ .smtp.from }}
- name: PEERTUBE_SMTP_USERNAME
value: {{ .smtp.user }}
- name: PEERTUBE_SMTP_PASSWORD
valueFrom:
secretKeyRef:
name: peertube-secrets
key: smtpPassword
- name: PEERTUBE_SMTP_TLS
value: "false"
- name: PEERTUBE_SMTP_DISABLE_STARTTLS
value: "false"
- name: PEERTUBE_ADMIN_EMAIL
value: {{ .smtp.from }}
- name: PT_INITIAL_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: peertube-secrets
key: adminPassword
- name: PEERTUBE_TRUST_PROXY
value: '["loopback", "linklocal", "uniquelocal"]'
resources:
limits:
cpu: "2"
ephemeral-storage: 2Gi
memory: 2Gi
requests:
cpu: 50m
ephemeral-storage: 100Mi
memory: 256Mi
volumeMounts:
- name: peertube-data
mountPath: /data
livenessProbe:
httpGet:
path: /api/v1/ping
port: 9000
initialDelaySeconds: 60
timeoutSeconds: 5
periodSeconds: 30
failureThreshold: 6
readinessProbe:
httpGet:
path: /api/v1/ping
port: 9000
initialDelaySeconds: 30
timeoutSeconds: 5
periodSeconds: 15
failureThreshold: 3
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
readOnlyRootFilesystem: false
volumes:
- name: peertube-data
persistentVolumeClaim:
claimName: peertube-data
restartPolicy: Always

View File

@@ -0,0 +1,26 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: peertube
namespace: {{ .namespace }}
annotations:
external-dns.alpha.kubernetes.io/target: {{ .externalDnsDomain }}
external-dns.alpha.kubernetes.io/cloudflare-proxied: "false"
external-dns.alpha.kubernetes.io/ttl: "60"
spec:
ingressClassName: traefik
rules:
- host: {{ .domain }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: peertube
port:
number: 80
tls:
- hosts:
- {{ .domain }}
secretName: {{ .tlsSecretName }}

View File

@@ -0,0 +1,16 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: {{ .namespace }}
labels:
- includeSelectors: true
pairs:
app: peertube
managedBy: kustomize
partOf: wild-cloud
resources:
- namespace.yaml
- db-init-job.yaml
- pvc.yaml
- deployment.yaml
- service.yaml
- ingress.yaml

View File

@@ -0,0 +1,33 @@
version: 8.2.1-1
requires:
- name: postgres
- name: redis
- name: smtp
defaultConfig:
namespace: peertube
externalDnsDomain: '{{ .cloud.domain }}'
domain: peertube.{{ .cloud.domain }}
tlsSecretName: wildcard-wild-cloud-tls
storage: 5Gi
db:
host: '{{ .apps.postgres.host }}'
port: '{{ .apps.postgres.port }}'
name: peertube
user: peertube
redis:
host: '{{ .apps.redis.host }}'
smtp:
host: '{{ .apps.smtp.host }}'
port: '{{ .apps.smtp.port }}'
from: '{{ .apps.smtp.from }}'
user: '{{ .apps.smtp.user }}'
defaultSecrets:
- key: adminPassword
- key: secretKey
- key: dbPassword
- key: dbUrl
default: 'postgresql://{{ .app.db.user }}:{{ .secrets.dbPassword }}@{{ .app.db.host }}:{{ .app.db.port }}/{{ .app.db.name }}?sslmode=disable'
- key: smtpPassword
requiredSecrets:
- postgres.password
- redis.password

View File

@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: {{ .namespace }}

View File

@@ -0,0 +1,11 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: peertube-data
namespace: {{ .namespace }}
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: {{ .storage }}

View File

@@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: peertube
namespace: {{ .namespace }}
spec:
selector:
component: web
ports:
- name: http
port: 80
targetPort: 9000
protocol: TCP