move to s6 overlay structure (#13)
* move to s6 overlay structure * Use alpine:latest and latest s6 * cleanup Dockerfile * use .env file on docker run * change mappings so all under one folder * Update README * change cron default to hourly to keep things updated * add section about editing xteve settings * add nice 'logging' to stdout
This commit is contained in:
14
root/etc/cont-init.d/10-adduser
Normal file
14
root/etc/cont-init.d/10-adduser
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
|
||||
groupmod -o -g "$PGID" abc
|
||||
usermod -o -u "$PUID" abc
|
||||
|
||||
echo '
|
||||
-------------------------------------
|
||||
GID/UID
|
||||
-------------------------------------'
|
||||
echo "
|
||||
User uid: $(id -u abc)
|
||||
User gid: $(id -g abc)
|
||||
-------------------------------------
|
||||
"
|
||||
11
root/etc/cont-init.d/40-install-defaults
Normal file
11
root/etc/cont-init.d/40-install-defaults
Normal file
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
|
||||
cp /defaults/sample_cron.txt /config/sample_cron.txt
|
||||
|
||||
cp -n /defaults/xteve-settings.json /xteve/settings.json
|
||||
|
||||
mkdir -p /playlists/lazystream/
|
||||
cp -n /defaults/lazystream-mlb.m3u /playlists/lazystream/lazystream-mlb.m3u
|
||||
cp -n /defaults/lazystream-mlb.xml /playlists/lazystream/lazystream-mlb.xml
|
||||
cp -n /defaults/lazystream-nhl.m3u /playlists/lazystream/lazystream-nhl.m3u
|
||||
cp -n /defaults/lazystream-nhl.xml /playlists/lazystream/lazystream-nhl.xml
|
||||
33
root/etc/cont-init.d/50-update-hosts
Normal file
33
root/etc/cont-init.d/50-update-hosts
Normal file
@@ -0,0 +1,33 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
|
||||
function prepend() {
|
||||
while read line;
|
||||
do echo "${1}${line}";
|
||||
done;
|
||||
}
|
||||
|
||||
exec 1> >(prepend "[update-hosts] ")
|
||||
|
||||
|
||||
# Update hosts file
|
||||
export IP=$(getent ahostsv4 freegamez.ga | awk '{ print $1 }' | head -1)
|
||||
|
||||
echo $IP playback.svcs.mlb.com >> /etc/hosts
|
||||
echo $IP mf.svc.nhl.com >> /etc/hosts
|
||||
echo $IP mlb-ws-mf.media.mlb.com >> /etc/hosts
|
||||
|
||||
cat /etc/hosts
|
||||
|
||||
# Update certs
|
||||
rm -f /home/abc/.gnutls/known_hosts
|
||||
rm -f /root/.gnutls/known_hosts
|
||||
|
||||
printf 'y\n' | gnutls-cli --tofu playback.svcs.mlb.com:443
|
||||
printf 'y\n' | gnutls-cli --tofu mf.svc.nhl.com:443
|
||||
printf 'y\n' | gnutls-cli --tofu mlb-ws-mf.media.mlb.com:443
|
||||
|
||||
install -D /root/.gnutls/known_hosts /home/abc/.gnutls/known_hosts
|
||||
|
||||
rm -rf /root/.gnutls
|
||||
|
||||
cat /home/abc/.gnutls/known_hosts
|
||||
9
root/etc/cont-init.d/60-chown-files
Normal file
9
root/etc/cont-init.d/60-chown-files
Normal file
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
|
||||
chown -R abc:abc /config
|
||||
chown -R abc:abc /playlists
|
||||
chown -R abc:abc /guide2go
|
||||
chown -R abc:abc /xteve
|
||||
chown -R abc:abc /tmp/xteve
|
||||
|
||||
chown -R abc:abc /home/abc
|
||||
1
root/etc/crontabs/root
Normal file
1
root/etc/crontabs/root
Normal file
@@ -0,0 +1 @@
|
||||
0 * * * * /cronjob.sh
|
||||
12
root/etc/services.d/crond/run
Normal file
12
root/etc/services.d/crond/run
Normal file
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
|
||||
CRON_FILE=/config/cron.txt
|
||||
|
||||
if [ -f "$CRON_FILE" ]; then
|
||||
. $CRON_FILE
|
||||
else
|
||||
echo "[crond-setup] No cron definition found..."
|
||||
echo "[crond-setup] By default, cronjob will run every night at midnight unless cron file is configured."
|
||||
fi
|
||||
|
||||
crond -f
|
||||
5
root/etc/services.d/xteve/run
Normal file
5
root/etc/services.d/xteve/run
Normal file
@@ -0,0 +1,5 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
|
||||
exec \
|
||||
s6-setuidgid abc /bin/bash -c \
|
||||
'xteve -port=$XTEVE_PORT -config=/xteve/'
|
||||
Reference in New Issue
Block a user