Browse Source

Merge pull request #355 from GilbN/develop

1.7.2
pull/361/head 1.7.2
GilbN 3 years ago
committed by GitHub
parent
commit
6a7b1feade
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 104
      .github/workflows/docker-build.yml
  2. 8
      Dockerfile
  3. 13
      css/base/tautulli/tautulli-base.css
  4. 16
      docker/root/defaults/default
  5. 30
      docker/root/etc/cont-init.d/50-config
  6. 12
      resources/landing-page/css/custom.css
  7. 2
      resources/landing-page/css/styles.css
  8. 6
      resources/landing-page/js/scripts.js
  9. 8
      themes.py

104
.github/workflows/docker-build.yml

@ -12,15 +12,17 @@ on:
options: options:
- master - master
- develop - develop
- testing
tag: tag:
description: 'Add a tag' description: 'Add a tag'
push: push:
branches: branches:
- develop - develop
- testing
paths-ignore: paths-ignore:
- '.github/**' - '.github/**'
jobs: jobs:
push_to_ghcr_io: build-and-push-it-to-the-limit:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: checkout - name: checkout
@ -30,61 +32,81 @@ jobs:
- name: Get the version - name: Get the version
id: get_version id: get_version
run: echo ::set-output name=VERSION::${{ github.event.release.tag_name }} run: echo ::set-output name=VERSION::${{ github.event.release.tag_name }}
- name: Set current date as env variable - name: Set current date as env variable
id: date_time id: date_time
run: echo ::set-output name=NOW::$(date +'%Y-%m-%dT%H:%M:%S') run: echo ::set-output name=NOW::$(date +'%Y-%m-%dT%H:%M:%S')
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Docker meta
id: metadata
uses: docker/metadata-action@v3
with:
images: |
ghcr.io/gilbn/theme.park
gilbn/theme.park
tags: |
type=ref,event=branch
- name: Login to GitHub Container Registry - name: Login to GitHub Container Registry
uses: docker/login-action@v1 uses: docker/login-action@v1
with: with:
registry: ghcr.io registry: ghcr.io
username: ${{ github.repository_owner }} username: ${{ github.repository_owner }}
password: ${{ secrets.GH_PAT }} password: ${{ secrets.GH_PAT }}
- name: build&push master
if: ${{ github.event.release.target_commitish == 'master' }}
run: |
docker build --build-arg TP_RELEASE=${{ steps.get_version.outputs.VERSION }} --build-arg BUILD_DATE=${{ steps.date_time.outputs.NOW }} --tag ghcr.io/gilbn/theme.park --tag ghcr.io/gilbn/theme.park:${{ steps.get_version.outputs.VERSION }} .
docker push --all-tags ghcr.io/gilbn/theme.park
- name: manual build&push master
if: ${{ github.event.inputs.branch == 'master' }}
run: |
docker build --build-arg TP_RELEASE=${{ github.event.inputs.tag }} --build-arg BUILD_DATE=${{ steps.date_time.outputs.NOW }} --tag ghcr.io/gilbn/theme.park --tag ghcr.io/gilbn/theme.park:${{ github.event.inputs.tag }} .
docker push --all-tags ghcr.io/gilbn/theme.park
- name: build&push develop
if: ${{ github.ref == 'refs/heads/develop' || github.event.inputs.branch == 'develop' }}
run: |
docker build --build-arg TP_RELEASE=${{ steps.get_version.outputs.VERSION }} --build-arg BUILD_DATE=${{ steps.date_time.outputs.NOW }} --tag ghcr.io/gilbn/theme.park:develop .
docker push --all-tags ghcr.io/gilbn/theme.park
push_to_dockerhub:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${{ github.event.release.tag_name }}
- name: Set current date as env variable
id: date_time
run: echo ::set-output name=NOW::$(date +'%Y-%m-%dT%H:%M:%S')
- name: Login to Docker Hub - name: Login to Docker Hub
uses: docker/login-action@v1 uses: docker/login-action@v1
with: with:
username: ${{ secrets.DH_USER }} username: ${{ secrets.DH_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }} password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: build&push dh master
- name: build&push master
if: ${{ github.event.release.target_commitish == 'master' }} if: ${{ github.event.release.target_commitish == 'master' }}
run: | uses: docker/build-push-action@v2
docker build --build-arg TP_RELEASE=${{ steps.get_version.outputs.VERSION }} --build-arg BUILD_DATE=${{ steps.date_time.outputs.NOW }} --tag gilbn/theme.park --tag gilbn/theme.park:${{ steps.get_version.outputs.VERSION }} . with:
docker push --all-tags gilbn/theme.park context: .
- name: manual build&push dh master platforms: linux/amd64,linux/arm/v7,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: latest
labels: ${{ steps.metadata.outputs.labels }}
build-args: TP_RELEASE=${{ steps.get_version.outputs.VERSION }},BUILD_DATE=${{ steps.date_time.outputs.NOW }}
- name: manual build&push master
if: ${{ github.event.inputs.branch == 'master' }} if: ${{ github.event.inputs.branch == 'master' }}
run: | uses: docker/build-push-action@v2
docker build --build-arg TP_RELEASE=${{ github.event.inputs.tag }} --build-arg BUILD_DATE=${{ steps.date_time.outputs.NOW }} --tag gilbn/theme.park --tag gilbn/theme.park:${{ github.event.inputs.tag }} . with:
docker push --all-tags gilbn/theme.park context: .
- name: build&push dh develop platforms: linux/amd64,linux/arm/v7,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: latest, ${{ github.event.inputs.tag }}
labels: ${{ steps.metadata.outputs.labels }}
build-args: TP_RELEASE=${{ steps.get_version.outputs.VERSION }},BUILD_DATE=${{ steps.date_time.outputs.NOW }}
- name: build&push develop
if: ${{ github.ref == 'refs/heads/develop' || github.event.inputs.branch == 'develop' }} if: ${{ github.ref == 'refs/heads/develop' || github.event.inputs.branch == 'develop' }}
run: | uses: docker/build-push-action@v2
docker build --build-arg TP_RELEASE=${{ steps.get_version.outputs.VERSION }} --build-arg BUILD_DATE=${{ steps.date_time.outputs.NOW }} --tag gilbn/theme.park:develop . with:
docker push --all-tags gilbn/theme.park context: .
platforms: linux/amd64,linux/arm/v7,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
build-args: TP_RELEASE=${{ steps.get_version.outputs.VERSION }},BUILD_DATE=${{ steps.date_time.outputs.NOW }}
- name: build&push testing
if: ${{ github.ref == 'refs/heads/testing' || github.event.inputs.branch == 'testing' }}
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/amd64,linux/arm/v7,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
build-args: TP_RELEASE=${{ steps.get_version.outputs.VERSION }},BUILD_DATE=${{ steps.date_time.outputs.NOW }}

8
Dockerfile

@ -1,16 +1,16 @@
FROM ghcr.io/linuxserver/baseimage-alpine-nginx:3.14 FROM --platform=${BUILDPLATFORM} ghcr.io/linuxserver/baseimage-alpine-nginx:3.14
# set version label # set version label
ARG BUILD_DATE ARG BUILD_DATE
ARG TP_RELEASE ARG TP_RELEASE
LABEL build_version="Version:- ${VERSION} Build-date:- ${BUILD_DATE}" LABEL build_version="Version:- ${VERSION} Build-date:- ${BUILD_DATE} Platform: ${BUILDPLATFORM}"
LABEL maintainer="gilbn" LABEL maintainer="gilbn"
LABEL org.opencontainers.image.description DESCRIPTION
RUN \ RUN \
echo " ## Installing packages ## " && \ echo " ## Installing packages ## " && \
apk add --no-cache --virtual=build-dependencies \ apk add --no-cache --virtual=build-dependencies \
python3 \ python3 && \
curl && \
echo "**** install theme.park ****" && \ echo "**** install theme.park ****" && \
mkdir -p /app/themepark mkdir -p /app/themepark

13
css/base/tautulli/tautulli-base.css

@ -218,7 +218,8 @@ select,
} }
/* Buttons */ /* Buttons */
.btn-dark { .btn-dark,
.btn-dark.inactive:hover {
background-color: var(--button-color); background-color: var(--button-color);
border-color: var(--button-color); border-color: var(--button-color);
color: var(--button-text); color: var(--button-text);
@ -231,6 +232,7 @@ select,
} }
.btn-dark:active, .btn-dark:active,
.btn-dark:active:hover,
.btn-dark.active, .btn-dark.active,
.open>.dropdown-toggle.btn-dark, .open>.dropdown-toggle.btn-dark,
.btn-dark.active:focus { .btn-dark.active:focus {
@ -239,6 +241,11 @@ select,
border-color: var(--button-color-hover); border-color: var(--button-color-hover);
} }
.btn-filter.active, .btn-filter.active.focus,
.btn-filter.active:hover {
background-color: var(--button-color-hover) !important;
}
.btn:focus:not(select), .btn:focus:not(select),
.btn.focus:not(select), .btn.focus:not(select),
.btn-dark:focus:not(select), .btn-dark:focus:not(select),
@ -252,10 +259,6 @@ select,
background-color: var(--button-color-hover); background-color: var(--button-color-hover);
} }
.btn-dark.inactive:hover {
background-color: rgba(255, 255, 255, 0.08);
}
.btn-danger.btn-edit { .btn-danger.btn-edit {
background-color: rgba(255, 255, 255, 0.25); background-color: rgba(255, 255, 255, 0.25);
} }

16
docker/root/defaults/default

@ -9,17 +9,23 @@ server {
ssl_certificate /config/keys/cert.crt; ssl_certificate /config/keys/cert.crt;
ssl_certificate_key /config/keys/cert.key; ssl_certificate_key /config/keys/cert.key;
root /config/www;
index index.html index.htm index.php; index index.html index.htm index.php;
#location#/ {return 302 $scheme://TP_DOMAIN/TP_URLBASE$request_uri;}
location / { location / {
alias /config/www/;
sub_filter_types *; sub_filter_types *;
sub_filter 'https://theme-park.dev' $scheme://TP_DOMAIN; sub_filter 'https://theme-park.dev/' $scheme://TP_DOMAIN/TP_URLBASE/;
sub_filter 'http://theme-park.dev' $scheme://TP_DOMAIN; sub_filter 'http://theme-park.dev/' $scheme://TP_DOMAIN/TP_URLBASE/;
sub_filter 'https://develop.theme-park.dev' $scheme://TP_DOMAIN; sub_filter 'https://develop.theme-park.dev/' $scheme://TP_DOMAIN/TP_URLBASE/;
sub_filter 'http://develop.theme-park.dev' $scheme://TP_DOMAIN; sub_filter 'http://develop.theme-park.dev/' $scheme://TP_DOMAIN/TP_URLBASE/;
sub_filter_once off; sub_filter_once off;
try_files $uri $uri/ /index.html; try_files $uri $uri/ /index.html;
#SUBFOLDER SUBFILTERS
#sub_filter 'https://TP_DOMAIN' $scheme://TP_DOMAIN/TP_URLBASE;
#sub_filter 'http://TP_DOMAIN' $scheme://TP_DOMAIN/TP_URLBASE;
} }
# Don't cache # Don't cache

30
docker/root/etc/cont-init.d/50-config

@ -10,6 +10,7 @@ PUID=${PUID}\\n\
PGID=${PGID}\\n\ PGID=${PGID}\\n\
TZ=${TZ}\\n\ TZ=${TZ}\\n\
TP_SCHEME=${TP_SCHEME}\\n\ TP_SCHEME=${TP_SCHEME}\\n\
TP_URLBASE=${TP_URLBASE}\\n\
TP_DOMAIN=${TP_DOMAIN}\\n" TP_DOMAIN=${TP_DOMAIN}\\n"
if [[ -z ${TP_DOMAIN} ]]; then if [[ -z ${TP_DOMAIN} ]]; then
@ -18,12 +19,35 @@ if [[ -z ${TP_DOMAIN} ]]; then
fi fi
if [[ -z ${TP_SCHEME} ]]; then if [[ -z ${TP_SCHEME} ]]; then
echo 'No scheme set, defaulting to https' echo 'No scheme set, defaulting to $scheme'
TP_SCHEME='https' TP_SCHEME='$scheme'
fi fi
if [[ -z ${TP_URLBASE} ]]; then
TP_URLBASE=''
fi
# Remove forward slash
case ${TP_URLBASE} in
*"/"*)
TP_URLBASE=$(echo "${TP_URLBASE}" | sed 's/\///g')
;;
esac
DEFAULT='/defaults/default' DEFAULT='/defaults/default'
sed -i "s/TP_DOMAIN/${TP_DOMAIN} /g" ${DEFAULT} if [[ ${TP_URLBASE} ]]; then
if ! grep -q "location /${TP_URLBASE} {" "${DEFAULT}"; then
sed -i "s/location \//location \/${TP_URLBASE}/g" ${DEFAULT}
sed -i "s/TP_DOMAIN/${TP_DOMAIN}/g" ${DEFAULT}
sed -i "s/TP_URLBASE/${TP_URLBASE}/g" ${DEFAULT}
sed -i "s/#sub_filter/sub_filter/g" ${DEFAULT}
sed -i "s/#location#/location /g" ${DEFAULT}
sed -i "s/\$scheme/${TP_SCHEME}/g" ${DEFAULT}
fi
elif [[ -z ${TP_URLBASE} ]]; then
sed -i "s/TP_DOMAIN\/TP_URLBASE/${TP_DOMAIN}/g" ${DEFAULT}
sed -i "s/\$scheme/${TP_SCHEME}/g" ${DEFAULT}
fi
cp /defaults/default /config/nginx/site-confs cp /defaults/default /config/nginx/site-confs
# make our folders and links # make our folders and links

12
resources/landing-page/css/custom.css

@ -73,7 +73,15 @@ section {
background-color: rgba(0, 0, 0, 0.9); background-color: rgba(0, 0, 0, 0.9);
} }
} }
#mainNav .navbar-nav .nav-item .nav-link {
color: var(--label-text-color);
}
#mainNav .navbar-nav .nav-item .nav-link:hover,
#mainNav .navbar-nav .nav-item .nav-link:active {
color: var(--label-text-color);
opacity: .8;
}
@media (min-width: 992px) { @media (min-width: 992px) {
#mainNav { #mainNav {
box-shadow: none; box-shadow: none;
@ -127,10 +135,6 @@ section {
} }
} }
#mainNav .navbar-nav .nav-item .nav-link:hover,
#mainNav .navbar-nav .nav-item .nav-link:active {
color: var(--text-hover);
}
#mainNav .navbar-nav .nav-item .nav-link.active { #mainNav .navbar-nav .nav-item .nav-link.active {
color: var(--link-color-hover) !important; color: var(--link-color-hover) !important;

2
resources/landing-page/css/styles.css

@ -11006,7 +11006,7 @@ hr.light {
} }
#mainNav .navbar-nav .nav-item .nav-link { #mainNav .navbar-nav .nav-item .nav-link {
color: #6c757d; color: var(--label-text-color);
font-family: "Merriweather Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; font-family: "Merriweather Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
font-weight: 700; font-weight: 700;
font-size: 0.9rem; font-size: 0.9rem;

6
resources/landing-page/js/scripts.js

@ -56,7 +56,7 @@ function injectTheme(theme,container="head") {
} else html_element = document.body; } else html_element = document.body;
let themeOption = document.getElementById("theme-option") let themeOption = document.getElementById("theme-option")
let link = themeOption ? themeOption : document.createElement("link"); let link = themeOption ? themeOption : document.createElement("link");
url = "/css/theme-options" url = `${window.location.pathname}css/theme-options`
link.type = "text/css"; link.type = "text/css";
link.rel = "stylesheet"; link.rel = "stylesheet";
link.href = `${url}/${themeLower}.css`; link.href = `${url}/${themeLower}.css`;
@ -69,7 +69,7 @@ function injectTheme(theme,container="head") {
var themeOptions; var themeOptions;
function addThemeData() { function addThemeData() {
let themeJsonUrl = "/themes.json" let themeJsonUrl = "themes.json"
fetch(themeJsonUrl) fetch(themeJsonUrl)
.then(response => response.json()) .then(response => response.json())
.then(json => { .then(json => {
@ -145,7 +145,7 @@ function fadeOutIn(speed) {
} }
function updateMetaThemeColor() { function updateMetaThemeColor() {
fetch(`/css/theme-options/${Object.keys(themeOptions)[currentIndex].toLowerCase()}.css`) fetch(`${window.location.pathname}css/theme-options/${Object.keys(themeOptions)[currentIndex].toLowerCase()}.css`)
.then(response => response.text()) .then(response => response.text())
.then(text => { .then(text => {
let re = text.match("--accent-color:.*;")[0] let re = text.match("--accent-color:.*;")[0]

8
themes.py

@ -119,20 +119,20 @@ def create_json(app_folders: list = None, themes: list = None, community_themes:
def create_theme_options(): def create_theme_options():
def create_css(folder): def create_css(folder):
with open(f"{folder}/{app}/{theme.lower()}.css", "w") as create_app: with open(f"{folder}/{app}/{theme.lower()}.css", "w") as create_app:
content = f'@import url("{applications[app]["base_css"]}");\n@import url("{themes[theme]["url"]}");' content = f'@import url("{applications[app]["base_css"]}");\n@import url("{all_themes[theme]["url"]}");'
create_app.write(content) create_app.write(content)
with open("themes.json") as themes: with open("themes.json") as themes:
data = load(themes) data = load(themes)
themes = data["all-themes"] all_themes = data["all-themes"]
applications = data["applications"] applications = data["applications"]
for app in applications: for app in applications:
for theme in themes: for theme in all_themes:
folders = ["./css/base"] folders = ["./css/base"]
for folder in folders: for folder in folders:
create_css(folder) create_css(folder)
env_domain = env.get('TP_DOMAIN') env_domain = env.get('TP_DOMAIN')
scheme = env.get('TP_SCHEME','https') scheme = env.get('TP_SCHEME','https') if env.get('TP_SCHEME') != '$scheme' else 'https'
if __name__ == "__main__": if __name__ == "__main__":
app_folders = [name for name in listdir('./css/base') if isdir(join('./css/base', name))] app_folders = [name for name in listdir('./css/base') if isdir(join('./css/base', name))]

Loading…
Cancel
Save