feat(peertube): Add PeerTube video platform package

New secubox-app-peertube package for self-hosted video streaming:

- LXC Debian container with PostgreSQL, Redis, Node.js, FFmpeg
- peertubectl control script with install/update/emancipate commands
- UCI configuration for server, transcoding, live streaming, storage
- procd init script with respawn support
- HAProxy integration with WebSocket and extended timeouts
- RTMP live streaming support (optional)
- S3/object storage support (configurable)
- Admin commands for user management
- Backup/restore functionality

Commands:
  peertubectl install              - Create LXC container with full stack
  peertubectl emancipate <domain>  - Full exposure with HAProxy + ACME
  peertubectl admin create-user    - Create user accounts
  peertubectl live enable          - Enable RTMP live streaming
  peertubectl backup/restore       - Database backup

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
CyberMind-FR 2026-02-15 05:43:22 +01:00
parent daa755986e
commit dcc34c8bf6
4 changed files with 1208 additions and 0 deletions

View File

@ -0,0 +1,45 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=secubox-app-peertube
PKG_RELEASE:=1
PKG_VERSION:=1.0.0
PKG_ARCH:=all
PKG_MAINTAINER:=CyberMind Studio <contact@cybermind.fr>
PKG_LICENSE:=AGPL-3.0
include $(INCLUDE_DIR)/package.mk
define Package/secubox-app-peertube
SECTION:=net
CATEGORY:=Network
PKGARCH:=all
SUBMENU:=SecuBox Apps
TITLE:=SecuBox PeerTube Video Platform
DEPENDS:=+lxc +lxc-common +wget-ssl +tar +jsonfilter
endef
define Package/secubox-app-peertube/description
PeerTube federated video streaming platform.
Runs in an LXC Debian container with PostgreSQL, Redis, and Node.js.
Supports video hosting, live streaming, and ActivityPub federation.
endef
define Package/secubox-app-peertube/conffiles
/etc/config/peertube
endef
define Build/Compile
endef
define Package/secubox-app-peertube/install
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_CONF) ./files/etc/config/peertube $(1)/etc/config/peertube
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/etc/init.d/peertube $(1)/etc/init.d/peertube
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) ./files/usr/sbin/peertubectl $(1)/usr/sbin/peertubectl
endef
$(eval $(call BuildPackage,secubox-app-peertube))

View File

@ -0,0 +1,45 @@
config peertube 'main'
option enabled '0'
option data_path '/srv/peertube'
option videos_path '/srv/peertube/videos'
option memory_limit '2048'
option timezone 'Europe/Paris'
config peertube 'server'
option hostname 'peertube.local'
option port '9000'
option https '1'
option webserver_hostname ''
config peertube 'live'
option enabled '0'
option rtmp_port '1935'
option max_duration '7200'
option allow_replay '1'
option transcoding_enabled '1'
config peertube 'transcoding'
option enabled '1'
option threads '2'
option allow_audio_files '1'
option hls_enabled '1'
list resolutions '480p'
list resolutions '720p'
config peertube 'storage'
option external_enabled '0'
option s3_endpoint ''
option s3_region ''
option s3_bucket ''
option s3_access_key ''
option s3_secret_key ''
config peertube 'network'
option domain ''
option haproxy '0'
option haproxy_ssl '1'
option firewall_wan '0'
config peertube 'admin'
option email 'admin@localhost'
option initial_password ''

View File

@ -0,0 +1,35 @@
#!/bin/sh /etc/rc.common
START=95
STOP=10
USE_PROCD=1
SERVICE_BIN="/usr/sbin/peertubectl"
start_service() {
local enabled
config_load peertube
config_get enabled main enabled 0
[ "$enabled" = "1" ] || return 0
procd_open_instance
procd_set_param command "$SERVICE_BIN" service-run
procd_set_param respawn 3600 5 5
procd_set_param stdout 1
procd_set_param stderr 1
procd_close_instance
}
stop_service() {
"$SERVICE_BIN" service-stop >/dev/null 2>&1
}
reload_service() {
stop
start
}
service_triggers() {
procd_add_reload_trigger "peertube"
}

File diff suppressed because it is too large Load Diff