mirror of
https://github.com/TheBinaryNinja/tvapp2.git
synced 2026-06-04 05:15:42 -04:00
build: push tvapp v2 docker files
This commit is contained in:
@@ -1,9 +1,19 @@
|
||||
───────────────────────────────────────────────────────────────
|
||||
TheTvApp Docker Container
|
||||
───────────────────────────────────────────────────────────────
|
||||
This container automatically downloads the m3u8 and xml
|
||||
guide data from
|
||||
- https://github.com/dtankdempse/thetvapp-m3u
|
||||
──────────────────────────────────────────────────────────────────────────────────────────
|
||||
TVApp2 Docker Image
|
||||
──────────────────────────────────────────────────────────────────────────────────────────
|
||||
The TvApp2 image allows you to fetch m3u playlist and EPG data for numerous
|
||||
IPTV services online.
|
||||
|
||||
Once the data is downloaded, you can access the files from
|
||||
the container's webserver.
|
||||
Once the files are fetched by the image, you can visit the self-hosted webpage,
|
||||
copy the links to the m3u and EPG files; and add them to your favorite IPTV app
|
||||
such as Jellyfin, Plex, or Emby.
|
||||
|
||||
For more information about this project; visit the links below:
|
||||
|
||||
TVApp2 Repo https://git.binaryninja.net/pub_projects/tvapp2
|
||||
Base Alpine Image https://github.com/Aetherinox/docker-base-alpine
|
||||
|
||||
If you are making this container available on a public-facing domain,
|
||||
please consider using Traefik and Authentik to protect this container from
|
||||
outside access. Your M3U and EPG files will be available for the public to
|
||||
download and use.
|
||||
|
||||
@@ -4,34 +4,29 @@
|
||||
PUID=${PUID:-911}
|
||||
PGID=${PGID:-911}
|
||||
|
||||
if [[ -z ${AETHERX_READ_ONLY_FS} ]] && [[ -z ${AETHERX_NON_ROOT_USER} ]]; then
|
||||
groupmod -o -g "$PGID" abc
|
||||
usermod -o -u "$PUID" abc
|
||||
if [[ -z ${TVAPP_READ_ONLY_FS} ]] && [[ -z ${TVAPP_NON_ROOT_USER} ]]; then
|
||||
groupmod -o -g "$PGID" dockerx
|
||||
usermod -o -u "$PUID" dockerx
|
||||
fi
|
||||
|
||||
if { [[ -z ${AETHERX_READ_ONLY_FS} ]] && [[ -z ${AETHERX_NON_ROOT_USER} ]]; } || [[ ! ${LSIO_FIRST_PARTY} = "true" ]]; then
|
||||
if { [[ -z ${TVAPP_READ_ONLY_FS} ]] && [[ -z ${TVAPP_NON_ROOT_USER} ]]; } || [[ ! ${TVAPP_FIRST_PARTY} = "true" ]]; then
|
||||
cat /etc/s6-overlay/s6-rc.d/init-adduser/branding
|
||||
else
|
||||
cat /run/branding
|
||||
fi
|
||||
|
||||
if [[ -z ${AETHERX_NON_ROOT_USER} ]]; then
|
||||
echo "
|
||||
User ID ........... $(id -u abc)
|
||||
Group ID .......... $(id -g abc)"
|
||||
if [[ -z ${TVAPP_NON_ROOT_USER} ]]; then
|
||||
echo ""
|
||||
echo " User:Group $(id -u dockerx):$(id -g dockerx)"
|
||||
else
|
||||
echo "
|
||||
User ID ........... $(stat /run -c %u)
|
||||
Group ID .......... $(stat /run -c %g)"
|
||||
echo " User:Group $(stat /run -c %u):$(stat /run -c %g)"
|
||||
fi
|
||||
echo "
|
||||
Port HTTP ......... $(echo $PORT_HTTP)
|
||||
Port HTTPS ........ $(echo $PORT_HTTPS)"
|
||||
echo " (Ports) HTTP/HTTPS $(echo $PORT_HTTP)"
|
||||
echo ""
|
||||
echo '──────────────────────────────────────────────────────────────────────────────────────────'
|
||||
|
||||
echo '───────────────────────────────────────────────────────────────'
|
||||
|
||||
if [[ -z ${AETHERX_READ_ONLY_FS} ]] && [[ -z ${AETHERX_NON_ROOT_USER} ]]; then
|
||||
lsiown abc:abc /app
|
||||
lsiown abc:abc /config
|
||||
lsiown abc:abc /defaults
|
||||
if [[ -z ${TVAPP_READ_ONLY_FS} ]] && [[ -z ${TVAPP_NON_ROOT_USER} ]]; then
|
||||
aetherxown dockerx:dockerx /app
|
||||
aetherxown dockerx:dockerx /config
|
||||
aetherxown dockerx:dockerx /defaults
|
||||
fi
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
# shellcheck shell=bash
|
||||
|
||||
for cron_user in abc root; do
|
||||
if [[ -z ${AETHERX_READ_ONLY_FS} ]] && [[ -z ${AETHERX_NON_ROOT_USER} ]]; then
|
||||
for cron_user in dockerx root; do
|
||||
if [[ -z ${TVAPP_READ_ONLY_FS} ]] && [[ -z ${TVAPP_NON_ROOT_USER} ]]; then
|
||||
if [[ -f "/etc/crontabs/${cron_user}" ]]; then
|
||||
lsiown "${cron_user}":"${cron_user}" "/etc/crontabs/${cron_user}"
|
||||
aetherxown "${cron_user}":"${cron_user}" "/etc/crontabs/${cron_user}"
|
||||
crontab -u "${cron_user}" "/etc/crontabs/${cron_user}"
|
||||
fi
|
||||
fi
|
||||
@@ -38,7 +38,8 @@ for cron_user in abc root; do
|
||||
# set perms and import user crontabs
|
||||
# #
|
||||
|
||||
lsiown "${cron_user}":"${cron_user}" "/config/crontabs/${cron_user}"
|
||||
aetherxown "${cron_user}":"${cron_user}" "/config/crontabs/${cron_user}"
|
||||
crontab -u "${cron_user}" "/config/crontabs/${cron_user}"
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
@@ -6,17 +6,17 @@ SCRIPTS_DIR="/custom-cont-init.d"
|
||||
|
||||
# Make sure custom init directory exists and has files in it
|
||||
if [[ -e "${SCRIPTS_DIR}" ]] && [[ -n "$(/bin/ls -A ${SCRIPTS_DIR} 2>/dev/null)" ]]; then
|
||||
echo -e " Loader : Custom files found, loading them ..."
|
||||
echo -e " Loader : Plugins found, loading them ..."
|
||||
for SCRIPT in "${SCRIPTS_DIR}"/*; do
|
||||
NAME="$(basename "${SCRIPT}")"
|
||||
if [[ -f "${SCRIPT}" ]]; then
|
||||
echo -e " Loader : Executing ..."
|
||||
/bin/bash "${SCRIPT}"
|
||||
echo -e " Loader : ${NAME}: Exited $?"
|
||||
echo -e " Loader : ${NAME}: Ran Successfully with code [$?]"
|
||||
elif [[ ! -f "${SCRIPT}" ]]; then
|
||||
echo -e " Loader : ${NAME}: Not a valid file"
|
||||
fi
|
||||
done
|
||||
else
|
||||
echo -e " Loader : No custom files found, skipping..."
|
||||
echo -e " Loader : No Plugins found, skipping..."
|
||||
fi
|
||||
|
||||
@@ -2,13 +2,15 @@
|
||||
# shellcheck shell=bash
|
||||
|
||||
# #
|
||||
# @project thetvapp-docker
|
||||
# @about Manages self-signed ssl certificates
|
||||
# @file /root/etc/s6-overlay/s6-rc.d/init-keygen/run
|
||||
# @repo https://github.com/Aetherinox/thetvapp-docker
|
||||
# @project tvapp2
|
||||
# @usage docker image which allows you to download a m3u playlist and EPG guide data for the
|
||||
# IPTV service TheTvApp.
|
||||
# @file nginx.conf.sample
|
||||
# @repo https://github.com/Aetherinox/docker-base-alpine
|
||||
# https://git.binaryninja.net/pub_projects/tvapp2
|
||||
# #
|
||||
|
||||
SUBJECT="/C=NA/ST=NA/L=NA/O=thetvapp-docker/OU=Aetherinox TheTvApp/CN=*"
|
||||
SUBJECT="/C=NA/ST=NA/L=NA/O=BinaryNinja/OU=TVApp2 Docker Image/CN=*"
|
||||
if [[ -f /config/keys/cert.key && -f /config/keys/cert.crt ]]; then
|
||||
echo -e " SSL : Using existing keys found in /config/keys"
|
||||
else
|
||||
|
||||
@@ -1 +1 @@
|
||||
# This file doesn't do anything, it's just the end of the mod init process
|
||||
# Empty placeholder for end of mod init process
|
||||
|
||||
@@ -1,108 +1,2 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
# shellcheck shell=bash
|
||||
|
||||
# #
|
||||
# precreate log files
|
||||
# #
|
||||
|
||||
for file in /config/log/nginx/access.log /config/log/nginx/error.log; do
|
||||
if [[ ! -f "${file}" ]]; then
|
||||
touch "${file}"
|
||||
fi
|
||||
done
|
||||
|
||||
# #
|
||||
# copy default config files if they don't exist
|
||||
# #
|
||||
|
||||
if [[ ! -f /config/nginx/nginx.conf ]]; then
|
||||
cp /defaults/nginx/nginx.conf.sample /config/nginx/nginx.conf
|
||||
fi
|
||||
|
||||
if [[ ! -f /config/nginx/ssl.conf ]]; then
|
||||
cp /defaults/nginx/ssl.conf.sample /config/nginx/ssl.conf
|
||||
fi
|
||||
|
||||
if [[ ! -f /config/nginx/site-confs/default.conf ]]; then
|
||||
cp /defaults/nginx/site-confs/default.conf.sample /config/nginx/site-confs/default.conf
|
||||
fi
|
||||
|
||||
# #
|
||||
# force nginx.conf to include site-confs/*.conf instead of site-confs/*
|
||||
# #
|
||||
|
||||
sed -i -E "s#^(\s*)include /config/nginx/site-confs/\*;#\1include /config/nginx/site-confs/\*.conf;#" /config/nginx/nginx.conf
|
||||
|
||||
# #
|
||||
# copy index.html if no index file exists
|
||||
# #
|
||||
|
||||
INDEX_EXISTS=false
|
||||
for file in /config/www/index.*; do
|
||||
if [[ -e "${file}" ]]; then
|
||||
INDEX_EXISTS=true
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
THEME_EXISTS=false
|
||||
for file in /config/www/theme/*; do
|
||||
if [[ -e "${file}" ]]; then
|
||||
THEME_EXISTS=true
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
# dont add an index, we want fancy indexing
|
||||
# if [[ ${INDEX_EXISTS} == false ]] && grep -Eq '^\s*index[^#]*index\.html' /config/nginx/**/*.conf; then
|
||||
# cp /defaults/www/index.html /config/www/index.html
|
||||
# fi
|
||||
|
||||
if [[ ${THEME_EXISTS} == false ]]; then
|
||||
cp -r /defaults/www/theme /config/www/
|
||||
fi
|
||||
|
||||
# #
|
||||
# copy pre-generated dhparams or generate if needed
|
||||
# #
|
||||
|
||||
if [[ ! -f /config/nginx/dhparams.pem ]]; then
|
||||
cp /defaults/nginx/dhparams.pem /config/nginx/dhparams.pem
|
||||
fi
|
||||
|
||||
if ! grep -q 'PARAMETERS' "/config/nginx/dhparams.pem"; then
|
||||
curl -o /config/nginx/dhparams.pem -L "https://ssl-config.mozilla.org/ffdhe4096.txt"
|
||||
fi
|
||||
|
||||
# #
|
||||
# Set resolver, ignore ipv6 addresses
|
||||
# #
|
||||
|
||||
touch /config/nginx/resolver.conf
|
||||
if ! grep -q 'resolver' /config/nginx/resolver.conf; then
|
||||
RESOLVERRAW=$(awk 'BEGIN{ORS=" "} $1=="nameserver" {print $2}' /etc/resolv.conf)
|
||||
for i in ${RESOLVERRAW}; do
|
||||
if [[ "$(awk -F ':' '{print NF-1}' <<<"${i}")" -le 2 ]]; then
|
||||
RESOLVER="${RESOLVER} ${i}"
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ -z "${RESOLVER}" ]]; then
|
||||
RESOLVER="127.0.0.11"
|
||||
fi
|
||||
|
||||
echo "[ Resolver ]: Setting to ${RESOLVER}"
|
||||
RESOLVEROUTPUT="# This file is auto-generated only on first start, based on the container's /etc/resolv.conf file. Feel free to modify it as you wish.\n\nresolver ${RESOLVER} valid=30s;"
|
||||
echo -e "${RESOLVEROUTPUT}" >/config/nginx/resolver.conf
|
||||
fi
|
||||
|
||||
# #
|
||||
# Set worker_processes
|
||||
# #
|
||||
|
||||
touch /config/nginx/worker_processes.conf
|
||||
if ! grep -q 'worker_processes' /config/nginx/worker_processes.conf; then
|
||||
WORKER_PROCESSES=$(nproc)
|
||||
echo "[ Worker ]: Setting worker_processes to ${WORKER_PROCESSES}"
|
||||
echo -e "# This file is auto-generated only on first start, based on the cpu cores detected. Feel free to change it to any other number or to auto to let nginx handle it automatically.\n\nworker_processes ${WORKER_PROCESSES};" >/config/nginx/worker_processes.conf
|
||||
fi
|
||||
|
||||
@@ -2,17 +2,17 @@
|
||||
# shellcheck shell=bash
|
||||
|
||||
# permissions
|
||||
lsiown -R abc:abc \
|
||||
aetherxown -R dockerx:dockerx \
|
||||
/var/lib/nginx \
|
||||
/var/tmp/nginx
|
||||
|
||||
lsiown -R abc:abc \
|
||||
aetherxown -R dockerx:dockerx \
|
||||
/config/keys \
|
||||
/config/log \
|
||||
/config/nginx \
|
||||
/config/php
|
||||
|
||||
lsiown abc:abc \
|
||||
aetherxown dockerx:dockerx \
|
||||
/config/www
|
||||
|
||||
chmod -R g+w \
|
||||
|
||||
@@ -2,27 +2,10 @@
|
||||
# shellcheck shell=bash
|
||||
|
||||
# #
|
||||
# @project thetvapp-docker
|
||||
# @about Manages sample files such as nginx
|
||||
# @file /root/etc/s6-overlay/s6-rc.d/init-samples/run
|
||||
# @repo https://github.com/Aetherinox/thetvapp-docker
|
||||
# @project tvapp2
|
||||
# @usage docker image which allows you to download a m3u playlist and EPG guide data for the
|
||||
# IPTV service TheTvApp.
|
||||
# @file nginx.conf.sample
|
||||
# @repo https://github.com/Aetherinox/docker-base-alpine
|
||||
# https://git.binaryninja.net/pub_projects/tvapp2
|
||||
# #
|
||||
|
||||
# remove old samples
|
||||
find /config/nginx/ \
|
||||
-name "*.conf.sample" \
|
||||
-type f \
|
||||
-delete
|
||||
|
||||
# copy new samples
|
||||
find /defaults/nginx/ \
|
||||
-maxdepth 3 \
|
||||
-name "*.conf.sample" \
|
||||
-type f \
|
||||
-exec cp "{}" /config/nginx/ \;
|
||||
|
||||
find /defaults/nginx/site-confs/ \
|
||||
-maxdepth 1 \
|
||||
-name "*.conf.sample" \
|
||||
-type f \
|
||||
-exec cp "{}" /config/nginx/site-confs/ \;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
# shellcheck shell=bash
|
||||
|
||||
if builtin command -v crontab >/dev/null 2>&1 && [[ -n "$(crontab -l -u abc 2>/dev/null || true)" || -n "$(crontab -l -u root 2>/dev/null || true)" ]]; then
|
||||
if builtin command -v crontab >/dev/null 2>&1 && [[ -n "$(crontab -l -u dockerx 2>/dev/null || true)" || -n "$(crontab -l -u root 2>/dev/null || true)" ]]; then
|
||||
if builtin command -v busybox >/dev/null 2>&1 && [[ $(busybox || true) =~ [[:space:]](crond)([,]|$) ]]; then
|
||||
exec busybox crond -f -S -l 5
|
||||
elif [[ -f /usr/bin/apt ]] && [[ -f /usr/sbin/cron ]]; then
|
||||
|
||||
@@ -13,4 +13,4 @@ if pgrep -f "[n]ginx:" >/dev/null; then
|
||||
sleep 1
|
||||
fi
|
||||
|
||||
exec /usr/sbin/nginx
|
||||
# exec /usr/sbin/nginx
|
||||
|
||||
Reference in New Issue
Block a user