Browse Source

Merge pull request #401 from GilbN/develop

1.9.9
pull/404/head 1.9.9
GilbN 3 years ago
committed by GitHub
parent
commit
80c6d7b30c
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 1178
      css/base/qbittorrent/qbittorrent-base.css
  2. 2
      docker-mods/qbittorrent/root/etc/cont-init.d/98-themepark
  3. 4
      docker/root/defaults/default
  4. 32
      docker/root/etc/cont-init.d/50-config
  5. 4
      fetch.sh
  6. 1
      linux-amd64.Dockerfile
  7. 1
      linux-arm-v7.Dockerfile
  8. 1
      linux-arm64.Dockerfile
  9. 2
      themes.py

1178
css/base/qbittorrent/qbittorrent-base.css

File diff suppressed because it is too large

2
docker-mods/qbittorrent/root/etc/cont-init.d/98-themepark

@ -92,6 +92,8 @@ fi
sed_file(){
sed -i "s/<\/body>/<link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/base\/qbittorrent\/qbittorrent-base.css'><\/body> /g" $1
sed -i "s/<\/body>/<link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/${THEME_TYPE}\/${TP_THEME}.css'><\/body> /g" $1
sed -i "s/<\/head>/<link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/base\/qbittorrent\/qbittorrent-base.css'><\/head> /g" $1
sed -i "s/<\/head>/<link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/${THEME_TYPE}\/${TP_THEME}.css'><\/head> /g" $1
printf 'Stylesheet set to %s on %s\n\n' "${TP_THEME}" "$1"
}

4
docker/root/defaults/default

@ -13,7 +13,7 @@ server {
location / {
alias /config/www/;
try_files $uri $uri/ /index.html;
try_files $uri $uri/;
}
location /themepark {return 302 $scheme://$http_host/themepark/;}
location /themepark/ {
@ -22,7 +22,7 @@ server {
sub_filter 'url("/css/' 'url("/themepark/css/';
sub_filter 'url(/resources/' 'url(/themepark/resources/';
sub_filter_once off;
try_files $uri $uri/ /index.html;
try_files $uri $uri/;
}
# Don't cache

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

@ -1,11 +1,23 @@
#!/usr/bin/with-contenv bash
echo '------------------'
echo '| theme.park |'
echo '------------------'
echo '
----------------------------------------------------------------------------------------
dP dP dP
88 88 88
d8888P 88d888b. .d8888b. 88d8b.d8b. .d8888b. 88d888b. .d8888b. 88d888b. 88 .dP
88 88 `88 88ooood8 88 88 88 88ooood8 88. `88 88 `88 88 `88 88888.
88 88 88 88. ... 88 88 88 88. ... 88. .88 88 88 88 88 `8b.
dP dP dP `88888P dP dP dP `88888P 88 88Y888P `88888P8 dP dP `YP
88
dP
Made by @gilbN
https://theme-park.dev
----------------------------------------------------------------------------------------'
# Display variables for troubleshooting
echo -e "Variables set:\\n\
echo -e "[theme.park-init] Variables set:\\n\
PUID=${PUID}\\n\
PGID=${PGID}\\n\
TZ=${TZ}\\n\
@ -29,8 +41,10 @@ cp /defaults/default /config/nginx/site-confs
# make our folders and links
mkdir -p \
/config/www/{css,resources}
/config/www/{css,resources} \
/config/docker-mods
echo '[theme.park-init] Copying theme files'
# copy theme files
cp -R /app/themepark/css /config/www
cp -R /app/themepark/resources /config/www
@ -38,7 +52,13 @@ cp /app/themepark/index.html /config/www
cp /app/themepark/themes.py /config/www
cp /app/themepark/CNAME /config/www
echo 'Creating CSS files'
echo '[theme.park-init] Copying mods into /config/docker-mods'
# copy mods
for folder in /app/themepark/docker-mods/*; do \
cp /app/themepark/docker-mods/"${folder##*/}"/root/etc/cont-init.d/98-themepark /config/docker-mods/98-themepark-"${folder##*/}"; \
done
echo '[theme.park-init] Running themes.py and creating CSS files'
python3 /config/www/themes.py
# permissions

4
fetch.sh

@ -11,7 +11,7 @@ mkdir -p "$DIR"
printf "\nSaving mods into $DIR\n\n"
jq -r 'to_entries | map(.key + "|" + (.value | tostring)) | .[]' <<< "$MODS" | \
while IFS='|' read key value; do
curl "$value" --create-dirs --output "$DIR/$key" --silent
curl "$value" --create-dirs --output "$DIR/98-themepark-$key" --silent
echo "Fetched $key script"
done
chmod go+rx $DIR
chmod -R +x $DIR

1
linux-amd64.Dockerfile

@ -18,6 +18,7 @@ apk add --no-cache --virtual=runtime-dependencies \
WORKDIR /app
COPY css/ /app/themepark/css/
COPY resources/ /app/themepark/resources/
COPY docker-mods/ /app/themepark/docker-mods/
COPY themes.py index.html CNAME /app/themepark/
COPY docker/root/ /

1
linux-arm-v7.Dockerfile

@ -18,6 +18,7 @@ apk add --no-cache --virtual=runtime-dependencies \
WORKDIR /app
COPY css/ /app/themepark/css/
COPY resources/ /app/themepark/resources/
COPY docker-mods/ /app/themepark/docker-mods/
COPY themes.py index.html CNAME /app/themepark/
COPY docker/root/ /

1
linux-arm64.Dockerfile

@ -18,6 +18,7 @@ apk add --no-cache --virtual=runtime-dependencies \
WORKDIR /app
COPY css/ /app/themepark/css/
COPY resources/ /app/themepark/resources/
COPY docker-mods/ /app/themepark/docker-mods/
COPY themes.py index.html CNAME /app/themepark/
COPY docker/root/ /

2
themes.py

@ -150,7 +150,7 @@ scheme = env.get('TP_SCHEME','https') if env.get('TP_SCHEME') else 'https'
if __name__ == "__main__":
app_folders = [name for name in listdir('./css/base') if isdir(join('./css/base', name))]
themes = [name for name in listdir('./css/theme-options') if isfile(join('./css/theme-options', name))]
docker_mods = [name for name in listdir('./docker-mods') if isdir(join('./docker-mods', name))]
docker_mods = [name for name in listdir('./docker-mods')] if isdir('./docker-mods') else []
community_themes = [name for name in listdir('./css/community-theme-options') if isfile(join('./css/community-theme-options', name))]
develop = True if isdir(".git") and subprocess.check_output(["git", "symbolic-ref", "--short", "HEAD"]).decode('ascii').strip() == "develop" else False
if env_domain:

Loading…
Cancel
Save