Skip to content

Commit bde455f

Browse files
committed
Initial import
1 parent 18c1142 commit bde455f

3 files changed

Lines changed: 295 additions & 0 deletions

File tree

.github/workflows/release.yaml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Publish Docker image
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
push_to_registry:
10+
name: Push Docker image to Docker Hub
11+
runs-on: ubuntu-latest
12+
permissions:
13+
packages: write
14+
contents: read
15+
attestations: write
16+
id-token: write
17+
18+
steps:
19+
- name: Check out the repo
20+
uses: actions/checkout@v4
21+
22+
- name: Set up Docker Buildx
23+
uses: docker/setup-buildx-action@v3
24+
25+
- name: Log in to Docker Hub
26+
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
27+
with:
28+
username: ${{ secrets.DOCKERHUB_USERNAME }}
29+
password: ${{ secrets.DOCKERHUB_PASSWORD }}
30+
31+
- name: Extract Docker metadata
32+
id: meta
33+
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
34+
with:
35+
images: adventuresintech/mythweb-docker
36+
tags: |
37+
type=raw,value=${{ github.ref_name }}
38+
type=raw,value=latest
39+
40+
- name: Build and push multi-arch Docker image
41+
id: push
42+
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
43+
with:
44+
context: .
45+
file: ./Dockerfile
46+
push: true
47+
platforms: linux/amd64,linux/arm64
48+
tags: ${{ steps.meta.outputs.tags }}
49+
labels: ${{ steps.meta.outputs.labels }}
50+
51+
- name: Generate artifact attestation
52+
uses: actions/attest-build-provenance@v2
53+
with:
54+
subject-name: index.docker.io/adventuresintech/mythweb-docker
55+
subject-digest: ${{ steps.push.outputs.digest }}
56+
push-to-registry: true

Dockerfile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
FROM php:8.2-apache
2+
3+
RUN a2enmod rewrite
4+
RUN a2enmod env
5+
RUN a2enmod deflate
6+
RUN a2enmod headers
7+
8+
RUN docker-php-ext-install mysqli && docker-php-ext-enable mysqli
9+
10+
LABEL maintainer="Andrew Eacott <andrew@marmoset.org>"
11+
12+
RUN apt-get update && apt-get install -y git
13+
14+
ARG REPO_URL=https://github.com/MythTV/mythweb.git
15+
ARG REPO_TAG=v34.0
16+
RUN git clone --branch ${REPO_TAG} --depth 1 ${REPO_URL} .
17+
18+
ENV MYTHTV_BRANCH=fixes/34
19+
ENV MYTHTV_SCM_BASE=https://raw.githubusercontent.com/MythTV/mythtv/${MYTHTV_BRANCH}
20+
21+
RUN mkdir -p /var/www/html/classes && \
22+
curl -sSL ${MYTHTV_SCM_BASE}/mythtv/bindings/php/MythBackend.php -o /var/www/html/classes/MythBackend.php && \
23+
curl -sSL ${MYTHTV_SCM_BASE}/mythtv/bindings/php/MythBase.php -o /var/www/html/classes/MythBase.php && \
24+
curl -sSL ${MYTHTV_SCM_BASE}/mythtv/bindings/php/MythFrontend.php -o /var/www/html/classes/MythFrontend.php && \
25+
curl -sSL ${MYTHTV_SCM_BASE}/mythtv/bindings/php/MythTV.php -o /var/www/html/classes/MythTV.php && \
26+
curl -sSL ${MYTHTV_SCM_BASE}/mythtv/bindings/php/MythTVChannel.php -o /var/www/html/classes/MythTVChannel.php && \
27+
curl -sSL ${MYTHTV_SCM_BASE}/mythtv/bindings/php/MythTVProgram.php -o /var/www/html/classes/MythTVProgram.php && \
28+
curl -sSL ${MYTHTV_SCM_BASE}/mythtv/bindings/php/MythTVRecording.php -o /var/www/html/classes/MythTVRecording.php && \
29+
curl -sSL ${MYTHTV_SCM_BASE}/mythtv/bindings/php/MythTVStorageGroup.php -o /var/www/html/classes/MythTVStorageGroup.php && \
30+
chown -R www-data:www-data /var/www/html && \
31+
chmod -R 755 /var/www/html
32+
33+
COPY mythweb.conf /etc/apache2/sites-enabled/

mythweb.conf

Lines changed: 206 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,206 @@
1+
#
2+
# CHANGE THESE PATHS TO MATCH YOUR MYTHWEB INSTALLATION DIRECTORY! e.g.
3+
#
4+
# /var/www
5+
# /home/www/htdocs
6+
# /var/www/html/mythweb
7+
# /srv/www/htdocs/mythweb
8+
#
9+
<Directory "/var/www/html/data">
10+
Options +FollowSymLinks +IncludesNoExec
11+
</Directory>
12+
<Directory "/var/www/html" >
13+
14+
############################################################################
15+
# I *strongly* urge you to turn on authentication for MythWeb. It is disabled
16+
# by default because it requires you to set up your own password file. Please
17+
# see the man page for htdigest and then configure the following four directives
18+
# to suit your authentication needs.
19+
#
20+
# AuthType Digest
21+
# AuthName "MythTV"
22+
# AuthUserFile /var/www/htdigest
23+
# Require valid-user
24+
# BrowserMatch "MSIE" AuthDigestEnableQueryStringHack=On
25+
# Order allow,deny
26+
# Satisfy any
27+
#
28+
# * If you're running Apache earlier than 2.2, you will need to use
29+
# the AuthDigestFile command instead of AuthUserFile (3rd line above).
30+
#
31+
############################################################################
32+
# Some special instructions for the MythWeb controller files
33+
#
34+
<Files mythweb.*>
35+
36+
#
37+
# Use the following environment settings to tell MythWeb where you want it to
38+
# look to connect to the database, the name of the database to connect to, and
39+
# the authentication info to use to connect. The defaults will usually work
40+
# fine unless you've changed mythtv's config.xml file, or are running MythWeb on
41+
# a different server from your main backend. Make sure you have mod_env enabled.
42+
#
43+
# This is unneeded due to the upnp setup via the backend
44+
#
45+
setenv db_server ${db_server}
46+
setenv db_name ${db_name}
47+
setenv db_login ${db_login}
48+
setenv db_password ${db_password}
49+
50+
#
51+
# By default, MythWeb uses the hostname program to look up the hostname of the
52+
# machine it runs on. If this reports incorrect data, or you run MythWeb on a
53+
# machine without the hostname program, set this to your current hostname.
54+
#
55+
# setenv hostname "my_mythbox"
56+
#
57+
58+
# By default, php will always search the current directory for include files,
59+
# but if you wish to install these directories outside of the current path
60+
# (eg. for security reasons), set this variable to the directory that
61+
# contains the directories like languages and templates. eg.
62+
#
63+
# setenv include_path "/usr/share/mythweb"
64+
65+
# If you want MythWeb to email php/database errors (and a backtrace) to you,
66+
# uncomment and set the email address below.
67+
#
68+
# setenv error_email "mythweb_errors@example.com"
69+
#
70+
71+
# If your local file system is something other than UTF-8, set this variable
72+
# so that the music and video portions of MythWeb can provide proper links
73+
# to your downloadable files.
74+
#
75+
# setenv fs_encoding "ISO-8859-1"
76+
77+
</Files>
78+
79+
############################################################################
80+
# The following settings relate to PHP config.
81+
#
82+
83+
<Files *.php>
84+
85+
# These settings are intended for apache 2.x. If your version of apache
86+
# doesn't support php_value, or things like memory_limit aren't working
87+
# as expected, then use these settings as examples for your own php.ini
88+
# files.
89+
# php_value safe_mode 0
90+
# php_value register_globals 0
91+
# php_value magic_quotes_gpc 0
92+
php_value file_uploads 0
93+
php_value allow_url_fopen On
94+
95+
php_value zlib.output_handler Off
96+
# php_value output_handler NULL
97+
98+
# If you have a large number of channels, you may need to increase
99+
# this value to prevent PHP from running out of memory during
100+
# searches. The default is 64M.
101+
php_value memory_limit 64M
102+
# php_value memory_limit 128M
103+
# php_value memory_limit 256M
104+
# php_value memory_limit 512M
105+
106+
# If you have a large number of channels, php may timeout creating
107+
# complex pages, so you will need to increase the amount of time
108+
# php has to create the page. The default is 30 seconds.
109+
php_value max_execution_time 30
110+
# php_value max_execution_time 60
111+
# php_value max_execution_time 120
112+
113+
# Note: php_flag does not work in older versions of php
114+
# php_flag output_handler "NULL"
115+
116+
php_value display_startup_errors On
117+
php_value display_errors On
118+
119+
</Files>
120+
121+
############################################################################
122+
# The settings below relate specifically to mod_rewrite and the rewrite
123+
# engine used to make the MythWeb user experience a little easier to deal
124+
# with by simplifying the URLs needed to access the various sections. Do
125+
# not touch these settings unless you really know what you're doing..
126+
#
127+
128+
# Turn on the rewrite engine
129+
RewriteEngine on
130+
131+
# If MythWeb is installed outside of the document root (eg. using Alias) then
132+
# you will need to set this directive to the base URL that MythWeb is visible
133+
# from externally. If you do not, the web server will return 'not found'.
134+
# RewriteBase /mythweb
135+
136+
# Skip out early if we've already been through rewrites,
137+
# or if this is a /css/, /js/ or /cache/ directory request.
138+
RewriteRule ^(css|data|images|js|themes|skins|README|INSTALL|[a-z_]+\.(php|pl))(/|$) - [L]
139+
140+
# Redirect /pl/ requests to the perl cgi handler.
141+
RewriteRule ^(pl(/.*)?)$ mythweb.pl/$1 [QSA,L]
142+
143+
# Redirect most of the remaining URL requests to the main mythweb script.
144+
# It will then handle any requests given to it.
145+
RewriteRule ^(.+)$ mythweb.php/$1 [QSA,L]
146+
147+
# If you're experiencing trouble with the previous two lines in your copy of
148+
# apache, you could instead use something like:
149+
# RewriteRule ^(pl(/.*)?)$ mythweb.pl?PATH_INFO=/$1 [L,QSA]
150+
# RewriteRule ^(.+)$ mythweb.php?PATH_INFO=/$1 [L,QSA]
151+
152+
# Catch anything else that comes through and send it to mythweb.php with no parameters.
153+
RewriteRule ^(.*)$ mythweb.php [QSA,L]
154+
155+
############################################################################
156+
# You really shouldn't need to edit anything below this line, so please
157+
# don't unless you know what you're doing.
158+
#
159+
160+
# Allow .htaccess to override whatever it wants from the server config.
161+
AllowOverride All
162+
163+
# Allow browsers to follow symlinks that point outside of the web document
164+
# tree. This is how we access music, videos, etc.
165+
Options FollowSymLinks
166+
167+
# MythTV now uses the correct file suffix for mpeg files, so all .nuv files
168+
# should actually be NuppleVideo. However, apache probably doesn't know what
169+
# those are, so we should tell it.
170+
AddType video/nuppelvideo .nuv
171+
172+
# Specify the MIME type for favicon.ico in case the server configuration
173+
# doesn't or in case the server configuration uses the IANA-approved MIME type
174+
# (image/vnd.microsoft.icon)--which most browsers won't recognize.
175+
AddType image/x-icon .ico
176+
177+
# Enable mod_deflate. This works MUCH more reliably than PHP's built-in
178+
# gzip/Zlib compressors. It is disabled here because many distros seem not
179+
# to enable mod_deflate by default, but I strongly recommend that you
180+
# enable this section.
181+
#
182+
# BrowserMatch ^Mozilla/4 gzip-only-text/html
183+
# BrowserMatch ^Mozilla/4\.0[678] no-gzip
184+
# BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
185+
#
186+
# AddOutputFilterByType DEFLATE text/html
187+
# AddOutputFilterByType DEFLATE text/css
188+
# AddOutputFilterByType DEFLATE application/x-javascript
189+
190+
# This is helpful for mod_deflate -- it prevents proxies from changing
191+
# the user agent to/from this server, which can prevent compression from
192+
# being enabled. It is disabled here because many distros seem not to
193+
# enable mod_headers by default, but I recommend that you enable it.
194+
#
195+
# Header append Vary User-Agent env=!dont-vary
196+
197+
# Set up the perl handler so we can stream properly. Do not use mod_perl
198+
# because it has a tendency to hold onto child processes, which causes
199+
# problems if the browser closes on an in-progress stream.
200+
#
201+
<Files *.pl>
202+
SetHandler cgi-script
203+
Options +ExecCGI
204+
</Files>
205+
206+
</Directory>

0 commit comments

Comments
 (0)