Comments (20)
FYI I recently released a plugin that began as a fork of traefik/plugin-rewritebody. It is now publicly available here: packruler/rewrite-body.
Check out the Examples page in the wiki for a quick example for implementation of the plugin.
from theme.park.
I found that plug-in yesterday. I’ll give it a go this week.
from theme.park.
It seems that traefik/plugin-rewritebody#12 no longer causes issues with injecting styles. However traefik/plugin-rewritebody#13 causes the plugin to fail for some containers.
(ETA: I've just spent a bit more time playing around with this minimal example and I'm not getting the panic
log message like I am in my actual setup. I've raised traefik/plugin-rewritebody#14 to see if they think it's a separate issue.)
Of the containers I've tried, these work:
portainer/portainer
plexinc/pms-docker
linuxserver/jackett
linuxserver/deluge
linuxserver/nzbhydra2
and these don't:
linuxserver/sonarr
linuxserver/radarr
linuxserver/sabnzbd
Here's a minimal example for Portainer using the Docker config provider:
version: "3"
services:
traefik:
image: traefik
ports:
- 80:80
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
command:
- --providers.docker=true
- --pilot.token=${TOKEN}
- --experimental.plugins.rewrite.modulename=github.com/traefik/plugin-rewritebody
- --experimental.plugins.rewrite.version=v0.3.1
portainer:
image: portainer/portainer
labels:
- traefik.http.routers.portainer.rule=Host(`portainer.localhost`)
- traefik.http.routers.portainer.middlewares=portainer
- traefik.http.middlewares.portainer.plugin.rewrite.rewrites.regex=</head>
- traefik.http.middlewares.portainer.plugin.rewrite.rewrites.replacement=<link rel="stylesheet" type="text/css" href="https://gilbn.github.io/theme.park/CSS/themes/portainer/${THEME}.css"></head>
from theme.park.
@IntermittentlyRupert btw there are some docker mods you can now use to apply the themes with. (Only for linuxserver) https://github.com/gilbN/theme.park/wiki/Setup#docker-mods
from theme.park.
@GilbN Oh, that's awesome! Between the Docker mods and the Traefik rewrite plugin, the only app I use that I can't inject styles for is Organizr, and that supports custom CSS.
from theme.park.
Actually I just found a better way to do it! At the top of your dynamic yaml definition you can add # {{ $theme := "nord" }}
and then replace the {{ env THEME }}
in the example with {{ $theme }}
. I'm going to update the wiki in project shortly and may have more things building on that 😁
from theme.park.
I guess we can close this now? @packruler added some instructions here too: https://docs.theme-park.dev/setup/#traefik
from theme.park.
I have not heard of any issues yet.
from theme.park.
Hi. Sorry I haven't found a way to do subfiltering with træfik yet. I would ask the dvs if they have some similar function. Or use the better web server..nginx :P
from theme.park.
@Mbarmem see if you can get this working https://pilot.traefik.io/plugins/276809785011077632/rewrite-body
from theme.park.
Note to self: Doesn't work with the current implementation of the traefik plugin.
traefik/plugin-rewritebody#12
from theme.park.
@GilbN Oh, that's awesome! Between the Docker mods and the Traefik rewrite plugin, the only app I use that I can't inject styles for is Organizr, and that supports custom CSS.
Yeah. I didnt crate any mods for apps that support custom css. And organizr has my themes in the marketplace too. 👍🏻
from theme.park.
Sorry for highjacking this. But do you have a rewrite example for Qbittorrent?
I was able to get the themes to working with Stylus + Middleware for the headers needed to hide.
I'd like to keep it all within the Middleswares
I tried this one:
middlewares:
qbittheme:
plugin:
rewritebody:
rewrites:
regex: </noscript>
replacement: <link rel='stylesheet' type='text/css' href='https://gilbn.github.io/theme.park/CSS/themes/plex/organizr-dark.css'></noscript>
But no luck. Any help would be appreciated
For anyone wondering how to hide the headers with traefik, this is what I got.
http:
middlewares:
qbitheaders:
headers:
customRequestHeaders:
X-Webkit-CSP: ""
content-security-policy: ""
X-Frame-Options: ""
customResponseHeaders:
X-Webkit-CSP: ""
content-security-policy: ""
X-Frame-Options: ""
from theme.park.
@beloso If the rest of your Traefik config is working, my guess would be that this is probably caused by one of the plugin-rewritebody bugs from my earlier comment.
Your best bet would probably be to contribute a Docker Mod for Qbittorrent and use that. They're a lot more stable and easier to work with than trying to get plugin-rewritebody to play nice.
from theme.park.
I researched a bit on doing a Mod, but I can't seem to find the default index.html
for qbittorrent
. It might be because I am not that well versed in how this is set up. If someone can point me in the right direction, I'd be happy to try my hand at this.
from theme.park.
Yeah I didn't find the correct html file either.
from theme.park.
I've opened #148 for this and added some additional notes.
from theme.park.
Awesome! Thanks for creating this!
from theme.park.
@packruler Great plugin! Can you tell me how the dynamic env var works? Thanks.
from theme.park.
Yeah if you're using docker you can add -e THEME=nord
to your docker run traefik
command. I'm not sure exactly how to set it up in other environments at the moment but here's some more info on Linux Environment Variables.
from theme.park.
Related Issues (20)
- Docker Mods Not Working with LSIO images HOT 2
- [New Theme Request] Fider
- Overseerr could not be found HOT 1
- [New Theme Request] Audiobookshelf
- Self-hosted deployments have a "None" SHA HOT 1
- Sonarr, Lidarr, & Prowlarr Theme Issues HOT 22
- Gitea baseTheme requires an update after migrating to 1.20.0 HOT 5
- Stylesheets loaded in backwards order with docker mods HOT 2
- Radarr Dark theme not working at all on Radarr V4 HOT 5
- [New Theme Request] OpenMediaVault
- Aquamarine theme for TheLounge HOT 2
- hotios plex paths changed HOT 3
- Radarr, & Prowlarr Theme Issues HOT 4
- [New Theme Request] Jellyseerr HOT 1
- unRAID Community Apps Repo should be updated HOT 1
- [New Theme Request] Homarr
- Footer Design Enhancement HOT 1
- Radarr Theme Organizr Seems Broken HOT 3
- qBittorrent scrollbars not being styled in Firefox HOT 1
- Theme not fully compatible with VueTorrent rewrite HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from theme.park.