Giter Club home page Giter Club logo

traefik-themepark's Introduction

theme.park Traefik Plugin

Apply themes from theme.park to supported applications.

All credit for design and styling to the various contributors to https://github.com/GilbN/theme.park!

Features

Here is a list of features: (current [x], planned [ ], and potential ?)

  • Support for all supported themes and apps in theme.park
  • Supports service side compression:
    • gzip - gzip
    • deflate - zlib
    • ? br - brotli (currently unsupported in Yaegi for Traefik plugins)
  • Limits the HTTP queries which are touched by plugin to improve performance
  • Updates requests to limit requests' Accept-Encoding to include only supported systems

Configuration

Static

experimental:
    plugins:
        themepark:
            moduleName: "github.com/packruler/traefik-themepark"
            version: "v1.2.2"

Dynamic

To configure the theme.park plugin you should create a middleware in your dynamic configuration as explained here. The following example creates and uses the themepark middleware plugin to replace all foo occurences by bar in the HTTP response body.

The app and theme values passed to the plugin should match the <style> tag provided in the Installation section. The example below would match Installation section having the following <style> tag.

<link rel="stylesheet" type="text/css" href="https://theme-park.dev/css/base/sonarr/dark.css">

http:
  routers:
    my-router:
      rule: "Host(`localhost`)"
      middlewares:
        - "sonarr-dark"
      service: "my-service"

  middlewares:
    sonarr-dark:
      plugin:
        themepark:
          # The name of the supported application listed on https://docs.theme-park.dev/themes.
          app: sonarr

          # The name of the supported theme listed on https://docs.theme-park.dev/theme-options/ or https://docs.theme-park.dev/community-themes/
          theme: dark

          # baseUrl is optional if you want to use a self-hosted version of theme.park
          baseUrl: https://theme-park.domain.tld

          # This currently only supports '4k-logo' and 'darker' addons. Future addons that follow a similar syntax will work as well.
          # For refernce: https://docs.theme-park.dev/themes/addons/
          addons:
            - 4k-logo
    radarr-theme:
      plugin:
        themepark:
          # The name of the supported application listed on https://docs.theme-park.dev/themes.
          app: radarr

          # If using the 'darker' addon the theme MUST be excluded or set to 'base'
          theme: base

          # Multiple addons can be included at the same time
          addons:
            - darker
            - 4k-logo

  services:
    my-service:
      loadBalancer:
        servers:
          - url: "http://127.0.0.1"

How Does This Work?

This is an extension of the rewrite-body plugin I created based on Traefik's plugin-rewritebody to add support for compressed content.

That said, this plugin is more focused on theme.park support and allows more targetted middleware logic. This means the overhead added by the plugin's logic is very limited. You can read more about that in the process section.

Process

Supported Requests

For any updates to be attempted the following conditions must be met by the incoming request:

  • Accept header must include text/html
  • HTTP Method must be GET

These conditions are intended to drastically limit the HTTP queries that are touched by this plugin. At this time these conditions properly cover all tested applications.

Supported Responses

Assuming Supported Request conditions have been met, the following conditions must be met by the resulting response:

  • Content-Type must be text/html
  • Content-Encoding must be a support compression (gzip, deflate, or identity)

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.