Compare commits

..

10 Commits

Author SHA1 Message Date
Gautham Varma K ca396a2cda 🔧 Remove startup from addon config 2021-09-09 14:25:38 +05:30
dependabot[bot] 0cef0e84da ⬆️ Bump setuptools from 58.0.3 to 58.0.4 in /tvheadend (#37)
Bumps [setuptools](https://github.com/pypa/setuptools) from 58.0.3 to 58.0.4.
- [Release notes](https://github.com/pypa/setuptools/releases)
- [Changelog](https://github.com/pypa/setuptools/blob/main/CHANGES.rst)
- [Commits](https://github.com/pypa/setuptools/compare/v58.0.3...v58.0.4)

---
updated-dependencies:
- dependency-name: setuptools
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-09 14:20:46 +05:30
GauthamVarmaK 18b8e3a3eb Prettified Code! 2021-09-09 08:50:30 +00:00
Gautham Varma K 0746681000 Add Raw USB Mapping 2021-09-09 14:19:58 +05:30
Gautham Varma K 1afe905387 🔨 Rewrite Add-on to make use of S6 (#36)
Restructuring of the addon to make use of the S6 overlay to make it more robust.
2021-09-09 07:05:33 +05:30
Gautham Varma K 8a0d2dbfdc ⬆️ Bump Base image from 10.0.1 to 10.0.2 (#35) 2021-09-08 20:11:20 +05:30
dependabot[bot] 1759409468 ⬆️ Bump creyD/prettier_action from 3.3 to 4.0 (#34)
Bumps [creyD/prettier_action](https://github.com/creyD/prettier_action) from 3.3 to 4.0.
- [Release notes](https://github.com/creyD/prettier_action/releases)
- [Commits](https://github.com/creyD/prettier_action/compare/v3.3...v4.0)

---
updated-dependencies:
- dependency-name: creyD/prettier_action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-08 20:07:09 +05:30
dependabot[bot] 7a31451c90 ⬆️ Bump docker/setup-buildx-action from 1.5.1 to 1.6.0 (#33)
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 1.5.1 to 1.6.0.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/v1.5.1...v1.6.0)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-08 20:06:55 +05:30
dependabot[bot] 3b5abde681 ⬆️ Bump frenck/action-addon-linter from 2.2 to 2.3 (#31)
Bumps [frenck/action-addon-linter](https://github.com/frenck/action-addon-linter) from 2.2 to 2.3.
- [Release notes](https://github.com/frenck/action-addon-linter/releases)
- [Commits](https://github.com/frenck/action-addon-linter/compare/v2.2...v2.3)

---
updated-dependencies:
- dependency-name: frenck/action-addon-linter
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-26 12:34:17 +05:30
dependabot[bot] e9adc7135d ⬆️ Bump docker/build-push-action from 2.6.1 to 2.7.0 (#30)
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 2.6.1 to 2.7.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v2.6.1...v2.7.0)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-23 11:44:32 +05:30
16 changed files with 179 additions and 116 deletions
+5
View File
@@ -6,3 +6,8 @@ updates:
schedule:
interval: daily
time: "06:00"
- package-ecosystem: "pip"
directory: "/tvheadend/"
schedule:
interval: daily
time: "06:00"
+4 -4
View File
@@ -38,7 +38,7 @@ jobs:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@v2.3.4
- name: 🚀 Run Add-on Lint
uses: frenck/action-addon-linter@v2.2
uses: frenck/action-addon-linter@v2.3
with:
community: true
path: "./${{ needs.information.outputs.target }}"
@@ -103,7 +103,7 @@ jobs:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@v2.3.4
- name: 🚀 Run Prettier
uses: creyD/prettier_action@v3.3
uses: creyD/prettier_action@v4.0
with:
prettier_options: --write **/*.{json,js,md,yaml}
env:
@@ -138,7 +138,7 @@ jobs:
- name: 🏗 Set up QEMU
uses: docker/setup-qemu-action@v1.2.0
- name: 🏗 Set up Docker Buildx
uses: docker/setup-buildx-action@v1.5.1
uses: docker/setup-buildx-action@v1.6.0
- name: 🏗 Set up CodeNotary
run: bash <(curl https://getvcn.codenotary.com -L)
- name: ️ Compose build flags
@@ -176,7 +176,7 @@ jobs:
--exit-status \
'.verification.status == 0'
- name: 🚀 Build
uses: docker/build-push-action@v2.6.1
uses: docker/build-push-action@v2.7.0
with:
push: false
context: ${{ needs.information.outputs.target }}
+2 -2
View File
@@ -81,7 +81,7 @@ jobs:
- name: 🏗 Set up QEMU
uses: docker/setup-qemu-action@v1.2.0
- name: 🏗 Set up Docker Buildx
uses: docker/setup-buildx-action@v1.5.1
uses: docker/setup-buildx-action@v1.6.0
- name: 🏗 Set up CodeNotary
run: bash <(curl https://getvcn.codenotary.com -L)
- name: ️ Compose build flags
@@ -125,7 +125,7 @@ jobs:
--exit-status \
'.verification.status == 0'
- name: 🚀 Build
uses: docker/build-push-action@v2.6.1
uses: docker/build-push-action@v2.7.0
with:
load: true
# yamllint disable rule:line-length
+23 -6
View File
@@ -1,13 +1,30 @@
ARG BUILD_FROM=ghcr.io/hassio-addons/base/amd64:10.0.1
ARG BUILD_FROM
# hadolint ignore=DL3006
FROM ${BUILD_FROM}
COPY run.sh /run.sh
RUN chmod +x /run.sh
RUN /run.sh
COPY requirements.txt /tmp/
RUN echo "Starting TVHeadend"
ENTRYPOINT ["/usr/bin/tvheadend", "--firstrun", "-u", "root", "-g", "root", "-c", "/config/tvheadend"]
RUN \
apk update \
&& apk add --no-cache --virtual .build-deps \
musl-dev=1.2.2-r3 \
gcc=10.3.1_git20210424-r2 \
g++=10.3.1_git20210424-r2 \
libxml2-dev=2.9.12-r1 \
libxslt-dev=1.1.34-r1 \
python3-dev=3.9.5-r1 \
&& apk add --no-cache \
tvheadend=4.2.8-r3 \
py3-pip=20.3.4-r1 \
libxslt=1.1.34-r1 \
&& pip3 install \
--no-cache-dir \
--prefer-binary \
-r /tmp/requirements.txt \
&& apk del --no-cache --purge .build-deps
# Copy root filesystem
COPY rootfs /
# Build arguments
ARG BUILD_ARCH
+5 -5
View File
@@ -1,9 +1,9 @@
{
"build_from": {
"aarch64": "ghcr.io/hassio-addons/base/aarch64:10.0.1",
"amd64": "ghcr.io/hassio-addons/base/amd64:10.0.1",
"armhf": "ghcr.io/hassio-addons/base/armhf:10.0.1",
"armv7": "ghcr.io/hassio-addons/base/armv7:10.0.1",
"i386": "ghcr.io/hassio-addons/base/i386:10.0.1"
"aarch64": "ghcr.io/hassio-addons/base/aarch64:10.0.2",
"amd64": "ghcr.io/hassio-addons/base/amd64:10.0.2",
"armhf": "ghcr.io/hassio-addons/base/armhf:10.0.2",
"armv7": "ghcr.io/hassio-addons/base/armv7:10.0.2",
"i386": "ghcr.io/hassio-addons/base/i386:10.0.2"
}
}
+11 -3
View File
@@ -2,12 +2,12 @@
"name": "TVHeadend",
"version": "dev",
"stage": "experimental",
"slug": "addon-tvheadend",
"slug": "tvheadend",
"description": "TV streaming server and recorder.",
"url": "https://github.com/GauthamVarmaK/addon-tvheadend",
"startup": "services",
"arch": ["aarch64", "amd64", "armhf", "armv7", "i386"],
"webui": "http://[HOST]:[PORT:9981]/",
"usb": true,
"ports": {
"9981/tcp": 9981,
"9982/tcp": 9982
@@ -16,5 +16,13 @@
"9981/tcp": "TVH Web Interface",
"9982/tcp": "TVH HTSP"
},
"map": ["config:rw"]
"map": ["config:rw"],
"options": {
"system_packages": [],
"init_commands": []
},
"schema": {
"system_packages": ["str"],
"init_commands": ["str"]
}
}
+2
View File
@@ -0,0 +1,2 @@
setuptools==58.0.4
streamlink==2.4.0
@@ -0,0 +1,24 @@
#!/usr/bin/with-contenv bashio
# ==============================================================================
# Home Assistant Community Add-on: TVHeadend
# Executes user customizations on startup
# ==============================================================================
# Install user configured/requested packages
if bashio::config.has_value 'system_packages'; then
apk update \
|| bashio::exit.nok 'Failed updating Alpine packages repository indexes'
for package in $(bashio::config 'system_packages'); do
apk add "$package" \
|| bashio::exit.nok "Failed installing system package ${package}"
done
fi
# Executes user commands on startup
if bashio::config.has_value 'init_commands'; then
while read -r cmd; do
eval "${cmd}" \
|| bashio::exit.nok "Failed executing init command: ${cmd}"
done <<< "$(bashio::config 'init_commands')"
fi
@@ -0,0 +1,60 @@
#!/usr/bin/with-contenv bashio
# ==============================================================================
# Home Assistant Community Add-on: TVHeadend
# Executes user customizations on startup
# ==============================================================================
check_webgrabplus(){
if [ -z "$(ls -A /config/tvheadend/wg++)" ]; then return 1; else return 0; fi
}
webgrabplus_install(){
if apk update; then
bashio::log.info '[Webgrab+] APK: Installing required packages.'
if apk add --no-cache --virtual .build-deps git mono --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing; then
bashio::log.info '[Webgrab+] Installing Webgrab+.'
cd /tmp \
&& wget http://webgrabplus.com/sites/default/files/download/SW/V3.2.0/WebGrabPlus_V3.2_install.tar.gz \
&& tar -zxvf WebGrabPlus_V3.2_install.tar.gz \
&& rm WebGrabPlus_V3.2_install.tar.gz \
&& mv .wg++/ /config/tvheadend/wg++ \
&& cd /config/tvheadend/wg++ \
&& ./install.sh \
&& rm -rf siteini.pack/ \
&& wget http://webgrabplus.com/sites/default/files/download/ini/SiteIniPack_current.zip \
&& unzip SiteIniPack_current.zip \
&& rm SiteIniPack_current.zip \
&& cp siteini.pack/India/* siteini.user/ \
&& wget -O /usr/bin/tv_grab_wg++ http://www.webgrabplus.com/sites/default/files/tv_grab_wg.txt \
&& sed -i 's|~/.wg++/guide.xml|/config/tvheadend/wg++/guide.xml|g' /usr/bin/tv_grab_wg++ \
&& chmod a+x /usr/bin/tv_grab_wg++
else
bashio::log.info '[Webgrab+] APK: Critical error. Unable install required packages.'
exit 1
fi
bashio::log.info '[Webgrab+] APK: Removing packages no longer required.'
apk del --no-cache --purge .build-deps
else
bashio::log.error '[Webgrab+] APK: Critical error. Unable to update pkg list. Check connectivity.'
exit 1
fi
bashio::log.info '[Webgrab+] Finsihed all APK and PIP3 updates and installs.'
}
# Ensure directory exists
if ! bashio::fs.directory_exists '/config/tvheadend/'; then
bashio::log.info "Creating default configuration directory at /config/tvheadend/"
mkdir -p /config/tvheadend/recordings
timeout 20s /usr/bin/tvheadend --firstrun -u root -g root -c /config/tvheadend
fi
if check_webgrabplus; then
bashio::log.info "[Webgrab+] Webgrab+ already installed"
else
bashio::log.info "[Webgrab+] No webgrab+ installation found - Installing webgrab+"
webgrabplus_install
chmod +x /usr/bin/restart_addon
exec /usr/bin/restart_addon
fi
bashio::log.info '[Webgrab+] Setup completed without errors!!'
+1
View File
@@ -0,0 +1 @@
0 0 * * * /config/tvheadend/wg++/run.sh
@@ -0,0 +1,9 @@
#!/usr/bin/execlineb -S0
# ==============================================================================
# Home Assistant Community Add-on: TVHeadend
# Take down the S6 supervision tree when crond fails
# ==============================================================================
if -n { s6-test $# -ne 0 }
if -n { s6-test ${1} -eq 256 }
s6-svscanctl -t /var/run/s6/services
+6
View File
@@ -0,0 +1,6 @@
#!/usr/bin/with-contenv bashio
# ==============================================================================
# Home Assistant Community Add-on: TVHeadend
# Runs the cron daemon
# ==============================================================================
exec fdmove -c 2 1 /usr/sbin/crond -f -L /var/log/cron -l 0 -c /etc/crontabs
@@ -0,0 +1,9 @@
#!/usr/bin/execlineb -S0
# ==============================================================================
# Home Assistant Community Add-on: TVHeadend
# Take down the S6 supervision tree when TVHeadend fails
# ==============================================================================
if -n { s6-test $# -ne 0 }
if -n { s6-test ${1} -eq 256 }
s6-svscanctl -t /var/run/s6/services
@@ -0,0 +1,9 @@
#!/usr/bin/with-contenv bashio
# ==============================================================================
# Home Assistant Community Add-on: TVHeadend
# Starts TVHeadend
# ==============================================================================
bashio::log.info "Starting TVHeadend..."
exec /usr/bin/tvheadend -u root -g root -c /config/tvheadend
+9
View File
@@ -0,0 +1,9 @@
#!/usr/bin/env bashio
# ==============================================================================
# Home Assistant Community Add-on: TVHeadend
# Restarts the add-on
# ==============================================================================
echo "Restarting add-on"
bashio::addon.restart
-96
View File
@@ -1,96 +0,0 @@
#!/usr/bin/env bashio
bashio::log.info "[TVHeadend] Installing TVHeadend"
apk update && apk add --no-cache tvheadend=4.2.8-r3
mkdir -p /config/tvheadend/recordings
bashio::log.info '[TVHeadend] Setup completed without errors!!'
check_webgrabplus(){
if [ -z "$(ls -A /config/tvheadend/wg++)" ]; then return 1; else return 0; fi
}
webgrabplus_install(){
if apk update; then
bashio::log.info '[Webgrab+] APK: Installing required packages.'
if apk add --no-cache --virtual .build-deps git mono --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing; then
bashio::log.info '[Webgrab+] Installing Webgrab+.'
mkdir -p ~/.wg++
ln -sf /config/tvheadend/wg++/guide.xml ~/.wg++/guide.xml
cd /tmp && \
wget http://webgrabplus.com/sites/default/files/download/SW/V3.2.0/WebGrabPlus_V3.2_install.tar.gz && \
tar -xvf WebGrabPlus_V3.2_install.tar.gz && rm WebGrabPlus_V3.2_install.tar.gz && \
mv .wg++/ /config/tvheadend/wg++ && cd /config/tvheadend/wg++ && ./install.sh
rm -rf siteini.pack/ && \
wget http://webgrabplus.com/sites/default/files/download/ini/SiteIniPack_current.zip && \
unzip SiteIniPack_current.zip && rm SiteIniPack_current.zip && \
cp siteini.pack/India/* siteini.user/
wget -O /usr/bin/tv_grab_wg++ http://www.webgrabplus.com/sites/default/files/tv_grab_wg.txt && \
chmod a+x /usr/bin/tv_grab_wg++
echo "0 0 * * * /config/tvheadend/wg++/run.sh" >> /var/spool/cron/root
crond
else
bashio::log.info '[Webgrab+] APK: Critical error. Unable install required packages.'
exit 1
fi
bashio::log.info '[Webgrab+] APK: Removing packages no longer required.'
apk del .build-deps git mono
else
bashio::log.error '[Webgrab+] APK: Critical error. Unable to update pkg list. Check connectivity.'
exit 1
fi
bashio::log.info '[Webgrab+] Finsihed all APK and PIP3 updates and installs.'
}
if check_webgrabplus; then
bashio::log.info "[Webgrab+] Webgrab+ already installed"
else
bashio::log.info "[Webgrab+] No webgrab+ installation found - Installing webgrab+"
webgrabplus_install
fi
bashio::log.info '[Webgrab+] Setup completed without errors!!'
check_streamlink () {
if [ -z "$(command -v streamlink)" ]; then return 1; else return 0; fi
}
streamlink_update () {
if pip3 install --no-cache --upgrade streamlink; then
bashio::log.info "[StreamLink] Streamlink version: $(streamlink --version)."
else
bashio::log.error '[StreamLink] Streamlink update failed!'
fi
}
streamlink_install () {
bashio::log.info '[StreamLink] APK: Updating pkg list.'
if apk update; then
bashio::log.info '[StreamLink] APK: Installing required packages.'
if apk add --no-cache py3-pip && apk add --no-cache --virtual .build-deps musl-dev gcc; then
bashio::log.info '[StreamLink] PIP3: Updating and installing required packages.'
if ! pip3 install --no-cache --upgrade setuptools; then bashio::log.error '[StreamLink] PIP3: Error while upgrading setuptools.'; fi
if ! pip3 install --no-cache streamlink; then bashio::log.error '[StreamLink] PIP3: Error while installing Streamlink.'; fi
else
bashio::log.info '[StreamLink] APK: Critical error. Unable install required packages.'
exit 1
fi
bashio::log.info '[StreamLink] APK: Removing packages no longer required.'
apk del .build-deps gcc musl-dev
else
bashio::log.error '[StreamLink] APK: Critical error. Unable to update pkg list. Check connectivity.'
exit 1
fi
bashio::log.info '[StreamLink] Finsihed all APK and PIP3 updates and installs.'
}
if check_streamlink; then
bashio::log.info '[StreamLink] Updating Streamlink...' ; streamlink_update
else
bashio::log.info '[StreamLink] Installing Streamlink...'; streamlink_install
fi
bashio::log.info '[StreamLink] Setup completed without errors!!'