mirror of
https://github.com/gilbN/theme.park.git
synced 2024-09-11 11:22:24 +02:00
commit
6a7b1feade
110
.github/workflows/docker-build.yml
vendored
110
.github/workflows/docker-build.yml
vendored
@ -12,15 +12,17 @@ on:
|
||||
options:
|
||||
- master
|
||||
- develop
|
||||
- testing
|
||||
tag:
|
||||
description: 'Add a tag'
|
||||
push:
|
||||
branches:
|
||||
- develop
|
||||
- testing
|
||||
paths-ignore:
|
||||
- '.github/**'
|
||||
jobs:
|
||||
push_to_ghcr_io:
|
||||
build-and-push-it-to-the-limit:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: checkout
|
||||
@ -30,61 +32,81 @@ jobs:
|
||||
- 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: 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
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
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
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ secrets.DH_USER }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
- name: build&push dh 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 gilbn/theme.park --tag gilbn/theme.park:${{ steps.get_version.outputs.VERSION }} .
|
||||
docker push --all-tags gilbn/theme.park
|
||||
- name: manual build&push dh 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 gilbn/theme.park --tag gilbn/theme.park:${{ github.event.inputs.tag }} .
|
||||
docker push --all-tags gilbn/theme.park
|
||||
- name: build&push dh 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 gilbn/theme.park:develop .
|
||||
docker push --all-tags gilbn/theme.park
|
||||
|
||||
- name: build&push master
|
||||
if: ${{ github.event.release.target_commitish == 'master' }}
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
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' }}
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
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' }}
|
||||
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 }}
|
||||
|
||||
- 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 }}
|
||||
|
@ -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
|
||||
ARG BUILD_DATE
|
||||
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 org.opencontainers.image.description DESCRIPTION
|
||||
|
||||
RUN \
|
||||
echo " ## Installing packages ## " && \
|
||||
apk add --no-cache --virtual=build-dependencies \
|
||||
python3 \
|
||||
curl && \
|
||||
python3 && \
|
||||
echo "**** install theme.park ****" && \
|
||||
mkdir -p /app/themepark
|
||||
|
||||
|
@ -218,7 +218,8 @@ select,
|
||||
}
|
||||
|
||||
/* Buttons */
|
||||
.btn-dark {
|
||||
.btn-dark,
|
||||
.btn-dark.inactive:hover {
|
||||
background-color: var(--button-color);
|
||||
border-color: var(--button-color);
|
||||
color: var(--button-text);
|
||||
@ -231,6 +232,7 @@ select,
|
||||
}
|
||||
|
||||
.btn-dark:active,
|
||||
.btn-dark:active:hover,
|
||||
.btn-dark.active,
|
||||
.open>.dropdown-toggle.btn-dark,
|
||||
.btn-dark.active:focus {
|
||||
@ -239,6 +241,11 @@ select,
|
||||
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-dark:focus:not(select),
|
||||
@ -252,10 +259,6 @@ select,
|
||||
background-color: var(--button-color-hover);
|
||||
}
|
||||
|
||||
.btn-dark.inactive:hover {
|
||||
background-color: rgba(255, 255, 255, 0.08);
|
||||
}
|
||||
|
||||
.btn-danger.btn-edit {
|
||||
background-color: rgba(255, 255, 255, 0.25);
|
||||
}
|
||||
|
@ -9,17 +9,23 @@ server {
|
||||
ssl_certificate /config/keys/cert.crt;
|
||||
ssl_certificate_key /config/keys/cert.key;
|
||||
|
||||
root /config/www;
|
||||
index index.html index.htm index.php;
|
||||
|
||||
#location#/ {return 302 $scheme://TP_DOMAIN/TP_URLBASE$request_uri;}
|
||||
|
||||
location / {
|
||||
alias /config/www/;
|
||||
sub_filter_types *;
|
||||
sub_filter 'https://theme-park.dev' $scheme://TP_DOMAIN;
|
||||
sub_filter 'http://theme-park.dev' $scheme://TP_DOMAIN;
|
||||
sub_filter 'https://develop.theme-park.dev' $scheme://TP_DOMAIN;
|
||||
sub_filter 'http://develop.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/TP_URLBASE/;
|
||||
sub_filter 'https://develop.theme-park.dev/' $scheme://TP_DOMAIN/TP_URLBASE/;
|
||||
sub_filter 'http://develop.theme-park.dev/' $scheme://TP_DOMAIN/TP_URLBASE/;
|
||||
sub_filter_once off;
|
||||
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
|
||||
|
@ -10,6 +10,7 @@ PUID=${PUID}\\n\
|
||||
PGID=${PGID}\\n\
|
||||
TZ=${TZ}\\n\
|
||||
TP_SCHEME=${TP_SCHEME}\\n\
|
||||
TP_URLBASE=${TP_URLBASE}\\n\
|
||||
TP_DOMAIN=${TP_DOMAIN}\\n"
|
||||
|
||||
if [[ -z ${TP_DOMAIN} ]]; then
|
||||
@ -18,12 +19,35 @@ if [[ -z ${TP_DOMAIN} ]]; then
|
||||
fi
|
||||
|
||||
if [[ -z ${TP_SCHEME} ]]; then
|
||||
echo 'No scheme set, defaulting to https'
|
||||
TP_SCHEME='https'
|
||||
echo 'No scheme set, defaulting to $scheme'
|
||||
TP_SCHEME='$scheme'
|
||||
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'
|
||||
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
|
||||
|
||||
# make our folders and links
|
||||
|
@ -73,7 +73,15 @@ section {
|
||||
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) {
|
||||
#mainNav {
|
||||
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 {
|
||||
color: var(--link-color-hover) !important;
|
||||
|
@ -11006,7 +11006,7 @@ hr.light {
|
||||
}
|
||||
|
||||
#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-weight: 700;
|
||||
font-size: 0.9rem;
|
||||
|
@ -56,7 +56,7 @@ function injectTheme(theme,container="head") {
|
||||
} else html_element = document.body;
|
||||
let themeOption = document.getElementById("theme-option")
|
||||
let link = themeOption ? themeOption : document.createElement("link");
|
||||
url = "/css/theme-options"
|
||||
url = `${window.location.pathname}css/theme-options`
|
||||
link.type = "text/css";
|
||||
link.rel = "stylesheet";
|
||||
link.href = `${url}/${themeLower}.css`;
|
||||
@ -69,7 +69,7 @@ function injectTheme(theme,container="head") {
|
||||
var themeOptions;
|
||||
|
||||
function addThemeData() {
|
||||
let themeJsonUrl = "/themes.json"
|
||||
let themeJsonUrl = "themes.json"
|
||||
fetch(themeJsonUrl)
|
||||
.then(response => response.json())
|
||||
.then(json => {
|
||||
@ -145,7 +145,7 @@ function fadeOutIn(speed) {
|
||||
}
|
||||
|
||||
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(text => {
|
||||
let re = text.match("--accent-color:.*;")[0]
|
||||
|
@ -119,20 +119,20 @@ def create_json(app_folders: list = None, themes: list = None, community_themes:
|
||||
def create_theme_options():
|
||||
def create_css(folder):
|
||||
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)
|
||||
with open("themes.json") as themes:
|
||||
data = load(themes)
|
||||
themes = data["all-themes"]
|
||||
all_themes = data["all-themes"]
|
||||
applications = data["applications"]
|
||||
for app in applications:
|
||||
for theme in themes:
|
||||
for theme in all_themes:
|
||||
folders = ["./css/base"]
|
||||
for folder in folders:
|
||||
create_css(folder)
|
||||
|
||||
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__":
|
||||
app_folders = [name for name in listdir('./css/base') if isdir(join('./css/base', name))]
|
||||
|
Loading…
Reference in New Issue
Block a user