Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
sullrich committed Jul 18, 2023
0 parents commit f4e0758
Show file tree
Hide file tree
Showing 53 changed files with 4,370 additions and 0 deletions.
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -f Dockerfile -t sullrich/androidhdmi-for-channels . --push --no-cache
FROM golang:bullseye AS builder
RUN apt update && apt install -y git
RUN mkdir -p /go/src/github.com/sullrich
WORKDIR /go/src/github.com/sullrich
RUN git clone https://github.com/sullrich/androidhdmi-for-channels .
RUN go build -o /opt/androidhdmi-for-channels

FROM debian:latest
RUN apt update && apt install -y adb curl iputils-ping
#RUN mkdir -p /opt/scripts /tmp/scripts /tmp/m3u /tmp/html
RUN mkdir -p /opt/scripts /tmp/scripts /tmp/m3u /opt/html /opt/static
#WORKDIR /opt/scripts
WORKDIR /opt
COPY --from=builder /opt/androidhdmi-for-channels* /opt
#COPY docker-start.sh ..
COPY docker-start.sh .
COPY scripts /tmp/scripts
COPY m3u/* /tmp/m3u
#COPY html/* /tmp/html
COPY html/* /opt/html
COPY static/* /opt/static
EXPOSE 7654
#CMD ../docker-start.sh
CMD ./docker-start.sh
8 changes: 8 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Unless noted at the top of each file, Copyright 2023 Fancy Bits, LLC

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
![example workflow](https://github.com/sullrich/androidhdmi-for-channels/actions/workflows/go.yml/badge.svg)
![Discord](https://img.shields.io/discord/832433862884982885?color=7289da&label=discord&style=plastic)

### This is a fork of https://github.com/tmm1/androidhdmi-for-channels with these features:

0. ENV variable support
1. Standardize and improve script durability / reliability
2. Allow multiple tuners from one set of scripts
3. Allowing the tuner and encoder information to be dynamically set. Useful for docker containers, etc
4. Support for FireTV and Hulu
5. Test each pre script and if fails move on to next tuner before giving up
6. M3U file serving with templating for IP Address
7. Docker support
8. Application based tuners (IE: hauppauge colossus 2)
9. E-Mail alerts on failures
10. Global logging to disk with rotation
11. Logging endpoint /logs for moments you do not have access to console with dynamic refresh!
12. Webhook support on failure use $reason variable in URL.
13. Custom script support - drop in your scripts and set STREAMER_APP env variable to match dir location
99. ... and more to come!

#### Docker Instructions

1. Download the Docker convenience script:
$ curl -fsSL https://get.docker.com -o get-docker.sh
2. Install Docker:
$ sudo sh get-docker.sh
3. Install Portainer:
$ sudo docker run -d -p 8000:8000 -p 9000:9000 -p 9443:9443 --name portainer \
--restart=always \
-v /var/run/docker.sock:/var/run/docker.sock \
-v portainer_data:/data \
cr.portainer.io/portainer/portainer-ce:latest
4. Configure Portainer and add androidhdmi-for-channels.yml via Portainer-Stacks:
https://<hostname or IP of server>:9443
5. Add environment variable values to bottom section of Portainer-Stacks as defined in Docker compose.
6. Deploy container.
Use re-pull image and redeploy slider if the container has been updated since the last time you downloaded it.
7. Check Portainer log for running container using Quick Actions button from Container list to check for errors.

#### Developer Instructions
First see https://github.com/sullrich/androidhdmi-for-channels/blob/main/getting_started.txt

32 changes: 32 additions & 0 deletions androidhdmi-for-channels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
version: '3.9'
services:
androidhdmi-for-channels:
image: bnhf/androidhdmi-for-channels:alpha
container_name: ah4channels-alpha
hostname: ah4channels
dns_search: localdomain # Specify the name of your LAN's domain, usually local or localdomain
ports:
- 5037:5037 # Port used by adb-server
- 7654:7654 # Port used by Channels androidhdmi-for-channels proxy
environment:
- IPADDRESS=${IPADDRESS} # Hostname or IP address to be used in M3U file
- NUMBER_TUNERS=${NUMBER_TUNERS} # Number of tuners you'd like defined 1, 2, 3 or 4 supported
- TUNER1_IP=${TUNER1_IP} # Streaming device #1 with adb port in the form hostname:port or ip:port
- TUNER2_IP=${TUNER2_IP} # Streaming device #2 with adb port in the form hostname:port or ip:port
- TUNER3_IP=${TUNER3_IP} # Streaming device #3 with adb port in the form hostname:port or ip:port
- TUNER4_IP=${TUNER4_IP} # Streaming device #4 with adb port in the form hostname:port or ip:port
- ENCODER1_URL=${ENCODER1_URL} # Full URL for tuner #1 in the form http://hostname/stream or http://ip/stream
- ENCODER2_URL=${ENCODER2_URL} # Full URL for tuner #2 in the form http://hostname/stream or http://ip/stream
- ENCODER3_URL=${ENCODER3_URL} # Full URL for tuner #3 in the form http://hostname/stream or http://ip/stream
- ENCODER4_URL=${ENCODER4_URL} # Full URL for tuner #4 in the form http://hostname/stream or http://ip/stream
- STREAMER_APP=${STREAMER_APP} # Streaming device name and streaming app you're using in the form streamer/app (use lowercase with slash between as shown)
# - ALERT_SMTP_SERVER="smtp.gmail.com:587"
# - ALERT_AUTH_SERVER="smtp.gmail.com"
# - ALERT_EMAIL_FROM=""
# - ALERT_EMAIL_PASS=""
# - ALERT_EMAIL_TO=""
# - ALERT_WEBHOOK_URL=""
volumes:
- /data/androidhdmi-for-channels:/opt/scripts # pre/stop/bmitune.sh scripts will be stored in this bound host directory under streamer/app
- /data/adb:/root/.android # Persistent data directory for adb keys
restart: unless-stopped
Loading

0 comments on commit f4e0758

Please sign in to comment.