Giter Club home page Giter Club logo

Comments (20)

packruler avatar packruler commented on May 22, 2024 2

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.

beloso avatar beloso commented on May 22, 2024 2

I found that plug-in yesterday. I’ll give it a go this week.

from theme.park.

IntermittentlyRupert avatar IntermittentlyRupert commented on May 22, 2024 1

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.

GilbN avatar GilbN commented on May 22, 2024 1

@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.

IntermittentlyRupert avatar IntermittentlyRupert commented on May 22, 2024 1

@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.

packruler avatar packruler commented on May 22, 2024 1

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.

GilbN avatar GilbN commented on May 22, 2024 1

I guess we can close this now? @packruler added some instructions here too: https://docs.theme-park.dev/setup/#traefik

from theme.park.

packruler avatar packruler commented on May 22, 2024 1

I have not heard of any issues yet.

from theme.park.

GilbN avatar GilbN commented on May 22, 2024

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.

GilbN avatar GilbN commented on May 22, 2024

@Mbarmem see if you can get this working https://pilot.traefik.io/plugins/276809785011077632/rewrite-body

from theme.park.

GilbN avatar GilbN commented on May 22, 2024

Note to self: Doesn't work with the current implementation of the traefik plugin.
traefik/plugin-rewritebody#12

from theme.park.

GilbN avatar GilbN commented on May 22, 2024

@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.

beloso avatar beloso commented on May 22, 2024

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.

IntermittentlyRupert avatar IntermittentlyRupert commented on May 22, 2024

@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.

beloso avatar beloso commented on May 22, 2024

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.

GilbN avatar GilbN commented on May 22, 2024

Yeah I didn't find the correct html file either.

from theme.park.

IntermittentlyRupert avatar IntermittentlyRupert commented on May 22, 2024

I've opened #148 for this and added some additional notes.

from theme.park.

GilbN avatar GilbN commented on May 22, 2024

Awesome! Thanks for creating this!

from theme.park.

agneevX avatar agneevX commented on May 22, 2024

@packruler Great plugin! Can you tell me how the dynamic env var works? Thanks.

from theme.park.

packruler avatar packruler commented on May 22, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.