From e2972e5a8fb1937174845c1ff765a5379a3b363d Mon Sep 17 00:00:00 2001 From: Aetherinox Date: Sun, 1 Dec 2024 05:33:51 -0700 Subject: [PATCH] feat: add timezone env var and integrate into logs --- README.md | 18 ++++++++++++++++++ download.sh | 9 ++++++++- root/etc/s6-overlay/s6-rc.d/init-keygen/run | 2 +- run.sh | 17 +++++++++++++++-- 4 files changed, 42 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 900813ff..306370c5 100644 --- a/README.md +++ b/README.md @@ -370,6 +370,24 @@ The following volumes can be mounted with this container: | --- | --- | | `./thetvapp:/config` | Path which stores downloaded `.m3u8`, `.xml`, nginx configs, and optional SSL certificate/keys | +
+ +By mounting the volume above, you should now have access to the following folders: +- 📁 keys +- 📁 log +- 📁 nginx +- 📁 php +- 📁 www + +
+ +| Folder | Description | +| --- | --- | +| 📁 keys | Responsible for storing your ssl certificate `cert.crt` + key `cert.key` | +| 📁 log | All nginx and php logs | +| 📁 nginx | Contains `nginx.conf`, `resolver.conf`, `ssl.conf`, `site-confs` | +| 📁 php | Contains `php-local.ini`, `www2.conf` | +| 📁 www | Folder where downloaded `.m3u8`, `.xml`, and `.xml.gz` will be downloaded to |
diff --git a/download.sh b/download.sh index 63ce40f4..419dcbeb 100755 --- a/download.sh +++ b/download.sh @@ -1,7 +1,14 @@ #!/usr/bin/with-contenv bash # shellcheck shell=bash -DATE=$(date '+%m-%d-%Y %H:%M:%S') +# # +# @project thetvapp-docker +# @about download script for fetching m3u8 and xml +# @file /download.sh +# @repo https://github.com/Aetherinox/thetvapp-docker +# # + +DATE=$(TZ=${TZ} date '+%m-%d-%Y %H:%M:%S') # # # Run Download diff --git a/root/etc/s6-overlay/s6-rc.d/init-keygen/run b/root/etc/s6-overlay/s6-rc.d/init-keygen/run index da0c2933..e3abd08c 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-keygen/run +++ b/root/etc/s6-overlay/s6-rc.d/init-keygen/run @@ -8,7 +8,7 @@ # @repo https://github.com/Aetherinox/thetvapp-docker # # -SUBJECT="/C=US/ST=CA/L=NA/O=thetvapp-docker/OU=Aetherinox TheTvApp/CN=*" +SUBJECT="/C=NA/ST=NA/L=NA/O=thetvapp-docker/OU=Aetherinox TheTvApp/CN=*" if [[ -f /config/keys/cert.key && -f /config/keys/cert.crt ]]; then echo -e " SSL : Using existing keys found in /config/keys" else diff --git a/run.sh b/run.sh index 67a8daa3..c9e4da58 100755 --- a/run.sh +++ b/run.sh @@ -2,13 +2,21 @@ # shellcheck shell=bash # # -# Disable, otherwise cron asterisks will be converted to file paths. +# @project thetvapp-docker +# @about initial run script, creates cron +# @file /run.sh +# @repo https://github.com/Aetherinox/thetvapp-docker +# # + +# # +# Disable, or cron asterisks will be converted to file paths. # # set -f # # # For details see man crontabs +# # Example of job definition: # .---------------- minute (0 - 59) # | .------------- hour (0 - 23) @@ -20,12 +28,17 @@ set -f # # ARG_CRON_TIME=$(echo ${CRON_TIME}) - if [ -z "${ARG_CRON_TIME}" ]; then ARG_CRON_TIME="0/60 * * * *" fi +ARG_TZ=$(echo ${TZ}) +if [ -z "${ARG_TZ}" ]; then + ARG_TZ="Etc/UTC" +fi + echo -e " Config : Setting task to run ${ARG_CRON_TIME}" +echo -e " Setting timezone ${ARG_TZ}" echo "${ARG_CRON_TIME} sh /download.sh" > /crontab.conf crontab /crontab.conf set +f