mirror of
https://github.com/meeb/tubesync.git
synced 2025-06-24 22:16:37 +00:00
Merge pull request #1005 from tcely/patch-12
Add Proof-of-Origin Token plugin framework
This commit is contained in:
commit
6fa142bec3
2
Pipfile
2
Pipfile
@ -24,3 +24,5 @@ yt-dlp = {extras = ["default", "curl-cffi"], version = "*"}
|
|||||||
emoji = "*"
|
emoji = "*"
|
||||||
brotli = "*"
|
brotli = "*"
|
||||||
html5lib = "*"
|
html5lib = "*"
|
||||||
|
yt-dlp-get-pot = "*"
|
||||||
|
bgutil-ytdlp-pot-provider = "*"
|
||||||
|
@ -5,6 +5,8 @@ worker_processes auto;
|
|||||||
worker_cpu_affinity auto;
|
worker_cpu_affinity auto;
|
||||||
pid /run/nginx.pid;
|
pid /run/nginx.pid;
|
||||||
|
|
||||||
|
env YT_POT_BGUTIL_BASE_URL;
|
||||||
|
|
||||||
events {
|
events {
|
||||||
worker_connections 1024;
|
worker_connections 1024;
|
||||||
}
|
}
|
||||||
@ -135,4 +137,7 @@ http {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Proof-of-Origin Token Server
|
||||||
|
include /etc/nginx/token_server.conf;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
29
config/root/etc/nginx/token_server.conf
Normal file
29
config/root/etc/nginx/token_server.conf
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
upstream token_server {
|
||||||
|
server 127.0.0.2:4416 down;
|
||||||
|
}
|
||||||
|
|
||||||
|
server {
|
||||||
|
|
||||||
|
# Ports
|
||||||
|
listen 4416;
|
||||||
|
listen [::]:4416;
|
||||||
|
|
||||||
|
# Server domain name
|
||||||
|
server_name _;
|
||||||
|
|
||||||
|
set_by_lua_block $pot_url {
|
||||||
|
local default = 'http://token_server'
|
||||||
|
local url = os.getenv('YT_POT_BGUTIL_BASE_URL')
|
||||||
|
if not url then
|
||||||
|
return default
|
||||||
|
end
|
||||||
|
if #url and url:find('://') then
|
||||||
|
return url
|
||||||
|
end
|
||||||
|
return default
|
||||||
|
}
|
||||||
|
|
||||||
|
location / {
|
||||||
|
proxy_pass $pot_url;
|
||||||
|
}
|
||||||
|
}
|
@ -2,4 +2,15 @@
|
|||||||
|
|
||||||
cd /
|
cd /
|
||||||
|
|
||||||
|
https="${TUBESYNC_POT_HTTPS:+https}"
|
||||||
|
ip_address="${TUBESYNC_POT_IPADDR:-${POTSERVER_PORT_4416_TCP_ADDR}}"
|
||||||
|
: "${TUBESYNC_POT_PORT:=${POTSERVER_PORT_4416_TCP_PORT}}"
|
||||||
|
port="${TUBESYNC_POT_PORT:+:}${TUBESYNC_POT_PORT}"
|
||||||
|
|
||||||
|
if [ -n "${ip_address}" ]
|
||||||
|
then
|
||||||
|
YT_POT_BGUTIL_BASE_URL="${https:-http}://${ip_address}${port}"
|
||||||
|
export YT_POT_BGUTIL_BASE_URL
|
||||||
|
fi
|
||||||
|
|
||||||
exec /usr/bin/openresty -c /etc/nginx/nginx.conf -e stderr
|
exec /usr/bin/openresty -c /etc/nginx/nginx.conf -e stderr
|
||||||
|
@ -8,7 +8,7 @@ CONFIG_BASE_DIR = BASE_DIR
|
|||||||
DOWNLOADS_BASE_DIR = BASE_DIR
|
DOWNLOADS_BASE_DIR = BASE_DIR
|
||||||
|
|
||||||
|
|
||||||
VERSION = '0.15.2'
|
VERSION = '0.15.3'
|
||||||
SECRET_KEY = ''
|
SECRET_KEY = ''
|
||||||
DEBUG = False
|
DEBUG = False
|
||||||
ALLOWED_HOSTS = []
|
ALLOWED_HOSTS = []
|
||||||
|
Loading…
Reference in New Issue
Block a user