From f16f611ab34e7116dd2d35cc31553b90b3788400 Mon Sep 17 00:00:00 2001 From: tobbenb Date: Sun, 21 Aug 2016 15:10:54 +0200 Subject: [PATCH] Almost inital push --- Dockerfile | 82 ++++++++++++++++++++++++++++++++++ READMETEMPLATE.md | 59 ++++++++++++++++++++++++ root/defaults/oscam.conf | 12 +++++ root/etc/cont-init.d/30-config | 9 ++++ root/etc/services.d/oscam/run | 3 ++ root/etc/services.d/pcscd/run | 3 ++ 6 files changed, 168 insertions(+) create mode 100644 Dockerfile create mode 100644 READMETEMPLATE.md create mode 100644 root/defaults/oscam.conf create mode 100644 root/etc/cont-init.d/30-config create mode 100644 root/etc/services.d/oscam/run create mode 100644 root/etc/services.d/pcscd/run diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..bdddb0c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,82 @@ +FROM lsiobase/alpine +MAINTAINER saarg + +# add runtime dependencies required for Oscam +RUN \ + apk add --no-cache \ + libcrypto1.0 \ + libssl1.0 \ + libusb \ +# openssl \ + pcsc-lite \ + pcsc-lite-libs && \ +# usbutils && \ + +# add build time dependencies + apk add --no-cache --virtual=build-dependencies \ + curl \ + gcc \ + g++ \ + libusb-dev \ + linux-headers \ + make \ + openssl-dev \ + pcsc-lite-dev \ + subversion \ + tar && \ + +# compile oscam from source + svn checkout http://www.streamboard.tv/svn/oscam/trunk /tmp/oscam-svn && \ + cd /tmp/oscam-svn && \ + ./config.sh \ + --enable all --disable \ + CARDREADER_DB2COM \ + CARDREADER_INTERNAL \ + CARDREADER_STINGER \ + CARDREADER_STAPI \ + CARDREADER_STAPI5 \ + IPV6SUPPORT \ + LCDSUPPORT \ + LEDSUPPORT \ + READ_SDT_CHARSETS && \ + make \ + OSCAM_BIN=/usr/bin/oscam \ + NO_PLUS_TARGET=1 \ + CONF_DIR=/config \ + DEFAULT_PCSC_FLAGS="-I/usr/include/PCSC" \ + pcsc-libusb && \ + +# fix broken permissions from pcscd install. + chown root:root \ + /usr/sbin/pcscd && \ + chmod 755 \ + /usr/sbin/pcscd && \ + +# install PCSC drivers for OmniKey devices + mkdir -p \ + /tmp/omnikey && \ + curl -o \ + /tmp/omnikey.tar.gz -L \ + https://www.hidglobal.com/sites/default/files/drivers/ifdokccid_linux_x86_64-v4.2.8.tar.gz && \ + tar xzf /tmp/omnikey.tar.gz -C \ + /tmp/omnikey --strip-components=2 && \ + cd /tmp/omnikey && \ + ./install && \ + +# fix group for card readers and add abc to dialout group + groupmod -g 24 cron && \ + groupmod -g 16 dialout && \ + usermod -a -G 16 abc && \ + +# cleanup + apk del --purge \ + build-dependencies && \ + + rm -rf \ + /tmp/* + +# copy local files +COPY root/ / + +# Ports and volumes +EXPOSE 8888 diff --git a/READMETEMPLATE.md b/READMETEMPLATE.md new file mode 100644 index 0000000..4218fb6 --- /dev/null +++ b/READMETEMPLATE.md @@ -0,0 +1,59 @@ +![https://linuxserver.io](https://www.linuxserver.io/wp-content/uploads/2015/06/linuxserver_medium.png) + +The [LinuxServer.io](https://linuxserver.io) team brings you another container release featuring auto-update on startup, easy user mapping and community support. Find us for support at: +* [forum.linuxserver.io](https://forum.linuxserver.io) +* [IRC](https://www.linuxserver.io/index.php/irc/) on freenode at `#linuxserver.io` +* [Podcast](https://www.linuxserver.io/index.php/category/podcast/) covers everything to do with getting the most from your Linux Server plus a focus on all things Docker and containerisation! + +# linuxserver/oscam + +[Oscam] (http://www.streamboard.tv/oscam/) is an Open Source Conditional Access Module software used for descrambling DVB transmissions using smart cards. It's both a server and a client. + + +## Usage + +``` +docker create \ + --name=oscam \ + -v :/config \ + -e PGID= -e PUID= \ + -p 8888:8888 \ + linuxserver/oscam +``` +If you pass through a card reader, add the --device=/path/to/cardreader tag. + +**Parameters** + +* `-p 1234` - the port(s) +* `-v /config` - explain what lives here +* `-e PGID` for GroupID - see below for explanation +* `-e PUID` for UserID - see below for explanation + +It is based on alpine linux with s6 overlay, for shell access whilst the container is running do `docker exec -it /bin/bash`. + +### User / Group Identifiers + +Sometimes when using data volumes (`-v` flags) permissions issues can arise between the host OS and the container. We avoid this issue by allowing you to specify the user `PUID` and group `PGID`. Ensure the data volume directory on the host is owned by the same user you specify and it will "just work" ™. + +In this instance `PUID=1001` and `PGID=1001`. To find yours use `id user` as below: + +``` + $ id + uid=1001(dockeruser) gid=1001(dockergroup) groups=1001(dockergroup) +``` + +## Setting up the application + +To set up oscam there are numerous guides on the internet. There are too many scenarios to make a quick guide. +The webinterface is at port 8888. + +To pass through a card reader, use the --device=/path/to/cardreader. + +## Info + +* Shell access whilst the container is running: `docker exec -it container-name /bin/bash` +* To monitor the logs of the container in realtime: `docker logs -f container-name` + +## Versions + ++ **14.08.2016:** Initial release. diff --git a/root/defaults/oscam.conf b/root/defaults/oscam.conf new file mode 100644 index 0000000..1a2b1d6 --- /dev/null +++ b/root/defaults/oscam.conf @@ -0,0 +1,12 @@ +# oscam.conf generated automatically by Streamboard OSCAM 1.20-unstable_svn SVN r11268 +# Read more: http://www.streamboard.tv/svn/oscam/trunk/Distribution/doc/txt/oscam.conf.txt + +[global] +logfile = stdout + +[cache] + + +[webif] +httpport = 8888 +httpallowed = 127.0.0.1,192.168.0.0-192.168.255.255,10.0.0.0-10.255.255.255,255.255.255.255 diff --git a/root/etc/cont-init.d/30-config b/root/etc/cont-init.d/30-config new file mode 100644 index 0000000..f122d31 --- /dev/null +++ b/root/etc/cont-init.d/30-config @@ -0,0 +1,9 @@ +#!/usr/bin/with-contenv bash + +# Check if /config/oscam/oscam.conf exists +[[ ! -e /config/oscam/oscam.conf ]] && \ + (mkdir -p /config/oscam && cp /defaults/oscam.conf /config/oscam/oscam.conf) + +# permissions +chown -R abc:abc \ + /config diff --git a/root/etc/services.d/oscam/run b/root/etc/services.d/oscam/run new file mode 100644 index 0000000..d18b4c3 --- /dev/null +++ b/root/etc/services.d/oscam/run @@ -0,0 +1,3 @@ +#!/usr/bin/with-contenv bash +exec \ + s6-setuidgid abc /usr/bin/oscam -c /config/oscam diff --git a/root/etc/services.d/pcscd/run b/root/etc/services.d/pcscd/run new file mode 100644 index 0000000..7a9a65e --- /dev/null +++ b/root/etc/services.d/pcscd/run @@ -0,0 +1,3 @@ +#!/usr/bin/with-contenv bash +exec \ + s6-setuidgid root /usr/sbin/pcscd -f