Code Monkey home page Code Monkey logo

darkweak / souin Goto Github PK

View Code? Open in Web Editor NEW
618.0 618.0 49.0 25.85 MB

An HTTP cache system, RFC compliant, compatible with @tyktechnologies, @traefik, @caddyserver, @go-chi, @bnkamalesh, @beego, @devfeel, @labstack, @gofiber, @go-goyave, @go-kratos, @gin-gonic, @roadrunner-server, @zalando, @zeromicro, @nginx and @apache

Home Page: https://docs.souin.io

License: MIT License

Makefile 2.44% Go 97.22% Scala 0.16% PHP 0.10% Dockerfile 0.08%
cache caddy caddy-module caddy-plugin caddy-server caddyserver echo-framework gin-gonic gin-middleware http-cache labstack-echo middleware skipper souin-instance traefik traefik-plugin traefik-v2 tyk tyk-gateway varnish

souin's People

Contributors

agneevx avatar aluki avatar choelzl avatar darkweak avatar eidenschink avatar frederichoule avatar fredliang44 avatar jacquesdurand avatar jenaye avatar jonasengelmann avatar kevinpollet avatar kkroo avatar kresike avatar maxcanna avatar menci avatar mohammed90 avatar oxodao avatar p0358 avatar rustatian avatar sata51 avatar szepeviktor avatar vejipe avatar vladimiroff avatar yongzhang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

souin's Issues

[Traefik Pilot] Traefik Plugin Analyzer has detected a problem.

The plugin was not imported into Traefik Pilot.

Cause:

failed to run with Yaegi: plugin: failed to import plugin code: 1:21: import "github.com/darkweak/souin/plugins/traefik" error: /tmp/pilot-gop904576526/src/github.com/darkweak/souin/plugins/traefik/main.go:6:2: import "github.com/darkweak/souin/configuration" error: /tmp/pilot-gop904576526/src/github.com/darkweak/souin/configuration/configuration.go:6:2: import "gopkg.in/yaml.v3" error: unable to find source related to: "gopkg.in/yaml.v3"

Traefik Plugin Analyzer will restart when you will close this issue.

If you believe there is a problem with the Analyzer or this issue is the result of a false positive, please contact us.

[Traefik Pilot] Traefik Plugin Analyzer has detected a problem.

The plugin was not imported into Traefik Pilot.

Cause:

failed to run with Yaegi: plugin: failed to import plugin code: context deadline exceeded

Traefik Plugin Analyzer will restart when you will close this issue.

If you believe there is a problem with the Analyzer or this issue is the result of a false positive, please contact us.

[Traefik Pilot] Traefik Plugin Analyzer has detected a problem.

The plugin was not imported into Traefik Pilot.

Cause:

failed to run with Yaegi: plugin: failed to import plugin code: 1:21: import "github.com/darkweak/souin/plugins/traefik" error: /tmp/pilot-gop903668899/src/github.com/darkweak/souin/plugins/traefik/main.go:6:2: import "github.com/darkweak/souin/configuration" error: /tmp/pilot-gop903668899/src/github.com/darkweak/souin/configuration/configuration.go:6:2: import "gopkg.in/yaml.v3" error: unable to find source related to: "gopkg.in/yaml.v3"

Traefik Plugin Analyzer will restart when you will close this issue.

If you believe there is a problem with the Analyzer or this issue is the result of a false positive, please contact us.

[Traefik Pilot] Traefik Plugin Analyzer has detected a problem.

The plugin was not imported into Traefik Pilot.

Cause:

missing manifest: GET https://api.github.com/repos/Darkweak/Souin/contents/.traefik.yml?ref=v1.3.0: 404 Not Found []

Traefik Plugin Analyzer will restart when you will close this issue.

If you believe there is a problem with the Analyzer or this issue is the result of a false positive, please contact us.

[Traefik Pilot] Traefik Plugin Analyzer has detected a problem.

The plugin was not imported into Traefik Pilot.

Cause:

failed to run with Yaegi: plugin: failed to import plugin code: 1:21: import "github.com/darkweak/souin/plugins/traefik" error: /tmp/pilot-gop408112472/src/github.com/darkweak/souin/plugins/traefik/main.go:6:2: import "github.com/darkweak/souin/configuration" error: /tmp/pilot-gop408112472/src/github.com/darkweak/souin/configuration/configuration.go:6:2: import "gopkg.in/yaml.v3" error: unable to find source related to: "gopkg.in/yaml.v3"

Traefik Plugin Analyzer will restart when you will close this issue.

If you believe there is a problem with the Analyzer or this issue is the result of a false positive, please contact us.

Support Nginx dynamic SSL

Support Nginx dynamic SSL like Træfik implementation.
Maybe create an external script to aggregate different certificates passing an array of string containing string path (real path or relative?)

[Traefik Pilot] Traefik Plugin Analyzer has detected a problem.

The plugin was not imported into Traefik Pilot.

Cause:

failed to run with Yaegi: plugin: failed to import plugin code: context deadline exceeded

Traefik Plugin Analyzer will restart when you will close this issue.

If you believe there is a problem with the Analyzer or this issue is the result of a false positive, please contact us.

Feature Request - CDN for static assets

Hi @darkweak ,

Hope you are all well !

I was wondering if it would be an interesting feature to use Souin as an acme CDN (Content Delivery Network) for static assets like js/css and medias.

Use case:

  • Dropin media server for Prestashop websites (1M installs)

Thanks for any insights or inputs about that.

Cheers,
Luc Michalski

[Traefik Pilot] Traefik Plugin Analyzer has detected a problem.

The plugin was not imported into Traefik Pilot.

Cause:

failed to run with Yaegi: plugin: failed to import plugin code: 1:21: import "github.com/darkweak/souin/plugins/traefik" error: /tmp/pilot-gop114162016/src/github.com/darkweak/souin/plugins/traefik/configuration.go:4:2: import "github.com/darkweak/souin/configurationtypes" error: /tmp/pilot-gop114162016/src/github.com/darkweak/souin/configurationtypes/types.go:3:8: import "go.uber.org/zap" error: /tmp/pilot-gop114162016/src/github.com/darkweak/souin/vendor/go.uber.org/zap/array.go:26:2: import "go.uber.org/zap/zapcore" error: /tmp/pilot-gop114162016/src/github.com/darkweak/souin/vendor/go.uber.org/zap/zapcore/entry.go:31:2: import "go.uber.org/zap/internal/exit" error: /tmp/pilot-gop114162016/src/github.com/darkweak/souin/vendor/go.uber.org/zap/internal/exit/exit.go:32:2: not enough arguments in call to real

Traefik Plugin Analyzer will restart when you will close this issue.

If you believe there is a problem with the Analyzer or this issue is the result of a false positive, please contact us.

[Traefik Pilot] Traefik Plugin Analyzer has detected a problem.

The plugin was not imported into Traefik Pilot.

Cause:

failed to run with Yaegi: plugin: failed to import plugin code: 1:21: import "github.com/darkweak/souin/plugins/traefik" error: /tmp/pilot-gop749975276/src/github.com/darkweak/souin/plugins/traefik/configuration.go:4:2: import "github.com/darkweak/souin/configurationtypes" error: /tmp/pilot-gop749975276/src/github.com/darkweak/souin/configurationtypes/types.go:3:8: import "go.uber.org/zap" error: /tmp/pilot-gop749975276/src/github.com/darkweak/souin/vendor/go.uber.org/zap/array.go:26:2: import "go.uber.org/zap/zapcore" error: /tmp/pilot-gop749975276/src/github.com/darkweak/souin/vendor/go.uber.org/zap/zapcore/entry.go:31:2: import "go.uber.org/zap/internal/exit" error: /tmp/pilot-gop749975276/src/github.com/darkweak/souin/vendor/go.uber.org/zap/internal/exit/exit.go:32:2: not enough arguments in call to real

Traefik Plugin Analyzer will restart when you will close this issue.

If you believe there is a problem with the Analyzer or this issue is the result of a false positive, please contact us.

[Traefik Pilot] Traefik Plugin Analyzer has detected a problem.

The plugin was not imported into Traefik Pilot.

Cause:

failed to run with Yaegi: plugin: failed to import plugin code: 1:21: import "github.com/darkweak/souin/plugins/traefik" error: /tmp/pilot-gop246905978/src/github.com/darkweak/souin/plugins/traefik/main.go:6:2: import "github.com/darkweak/souin/configuration" error: /tmp/pilot-gop246905978/src/github.com/darkweak/souin/configuration/configuration.go:6:2: import "gopkg.in/yaml.v3" error: unable to find source related to: "gopkg.in/yaml.v3"

Traefik Plugin Analyzer will restart when you will close this issue.

If you believe there is a problem with the Analyzer or this issue is the result of a false positive, please contact us.

[Traefik Pilot] Traefik Plugin Analyzer has detected a problem.

The plugin was not imported into Traefik Pilot.

Cause:

failed to run with Yaegi: plugin: failed to import plugin code: 1:21: import "github.com/darkweak/souin/plugins/traefik" error: /tmp/pilot-gop775071282/src/github.com/darkweak/souin/plugins/traefik/main.go:9:2: import "github.com/darkweak/souin/cache/providers" error: /tmp/pilot-gop775071282/src/github.com/darkweak/souin/cache/providers/ristrettoProvider.go:6:2: import "github.com/dgraph-io/ristretto" error: /tmp/pilot-gop775071282/src/github.com/darkweak/souin/vendor/github.com/dgraph-io/ristretto/cache.go:29:2: import "github.com/dgraph-io/ristretto/z" error: /tmp/pilot-gop775071282/src/github.com/darkweak/souin/vendor/github.com/dgraph-io/ristretto/z/bbloom.go:28:2: import "unsafe" error: unable to find source related to: "unsafe"

Traefik Plugin Analyzer will restart when you will close this issue.

If you believe there is a problem with the Analyzer or this issue is the result of a false positive, please contact us.

[Traefik Pilot] Traefik Plugin Analyzer has detected a problem.

The plugin was not imported into Traefik Pilot.

Cause:

failed to run with Yaegi: plugin: failed to import plugin code: context deadline exceeded

Traefik Plugin Analyzer will restart when you will close this issue.

If you believe there is a problem with the Analyzer or this issue is the result of a false positive, please contact us.

[Traefik Pilot] Traefik Plugin Analyzer has detected a problem.

The plugin was not imported into Traefik Pilot.

Cause:

failed to run with Yaegi: plugin: failed to import plugin code: 1:21: import "github.com/darkweak/souin/plugins/traefik" error: /tmp/pilot-gop544729338/src/github.com/darkweak/souin/plugins/traefik/main.go:9:2: import "github.com/darkweak/souin/cache/providers" error: /tmp/pilot-gop544729338/src/github.com/darkweak/souin/cache/providers/ristrettoProvider.go:6:2: import "github.com/dgraph-io/ristretto" error: /tmp/pilot-gop544729338/src/github.com/darkweak/souin/vendor/github.com/dgraph-io/ristretto/cache.go:29:2: import "github.com/dgraph-io/ristretto/z" error: /tmp/pilot-gop544729338/src/github.com/darkweak/souin/vendor/github.com/dgraph-io/ristretto/z/bbloom.go:28:2: import "unsafe" error: unable to find source related to: "unsafe"

Traefik Plugin Analyzer will restart when you will close this issue.

If you believe there is a problem with the Analyzer or this issue is the result of a false positive, please contact us.

Traefik & Souin: TLS handshake error

Issue

Hey ! Sorry to create an issue but I'm having problems configuring Souin with Traefik.

First of all, thanks for the awesome project ! It's a great tool to now go fully Traefik with caching features (instead of using Haproxy).

Here goes the error. When I disable Souin, everything works fine and I can access my homeassistant remotely with correct certs generated by Lets encrypt etc. However, as soon as I configure Souin, I keep getting the errors below. My configuration is available below too.

reverse-proxy-http-cache    | {"level":"DEBUG","time":"2021-07-18T08:59:42.764Z","caller":"plugins/base.go:105","message":"Provider initialized"}
reverse-proxy-http-cache    | {"level":"DEBUG","time":"2021-07-18T08:59:42.781Z","caller":"plugins/base.go:109","message":"Transport initialized"}
reverse-proxy-http-cache    | {"level":"DEBUG","time":"2021-07-18T08:59:42.781Z","caller":"plugins/base.go:122","message":"Souin configuration is now loaded"}
reverse-proxy-http-cache    | {"level":"DEBUG","time":"2021-07-18T08:59:42.782Z","caller":"souin/main.go:102","message":"Waiting for an incoming request..."}
reverse-proxy-http-cache    | 2021/07/18 08:59:55 http: TLS handshake error from XXX:58720: remote error: tls: bad certificate
reverse-proxy-http-cache    | 2021/07/18 08:59:56 http: TLS handshake error from XXX:58728: remote error: tls: bad certificate

I tried disabling the redirection from http to https in Traefik but it didn't change anything. I'm using network_mode: host as I have some requirements for the homeassistant for that. In case you are wondering, I'm copying the configuration.yml using Dockerfile.

Any idea why this fails ? Maybe it doesn't resolve to localhost:81 ? I've checked using netstat and Traefik is available on port 81 & 444 in the host network. I've also checked the acme.json file and its filled & it's available in the souin container at the specified path.

Thanks for your time !

Configuration

docker-compose:

version: '2.4'

################################################################################
### SERVICES
################################################################################
services:
  https-proxy:
    build:
      context: ./traefik
      dockerfile: Dockerfile
    container_name: https-proxy
    restart: unless-stopped
    network_mode: host
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /opt/homeassistant/traefik/acme:/etc/traefik/acme
    labels:
      - "traefik.enable=false"
    healthcheck:
      test: traefik healthcheck --ping
      start_period: 500s
      interval: 1800s
      timeout: 3s
      retries: 10

  reverse-proxy-http-cache:
    build:
      context: ./proxy-http-cache
      dockerfile: Dockerfile
    container_name: reverse-proxy-http-cache
    network_mode: host
    environment:
      GOPATH: /app
    volumes:
      - /opt/homeassistant/traefik/acme/acme.json:/ssl/traefik.json
      - /opt/homeassistant/proxy-http-cache/:/configuration
   
  hass: 
    ...

Souin configuration:

log_level: DEBUG
default_cache: # Required
  port: # Ports on which Souin will be exposed
    web: 80
    tls: 443
  ttl: 10s # Default TTL
reverse_proxy_url: 'http://localhost:81' # If it's in the same network you can use http://your-service, otherwise just use https://yourdomain.com
ssl_providers:
  - traefik

Traefik configuration (short extract):

entryPoints: 
  web:
    address: :81
    http:
      redirections:
        entryPoint:
          to: websecure
          scheme: https
  websecure:
    address: :444

Setup Souin as Tyk plugin

Refer to the TykTechnologies/tyk#3583

Current enhancement below:

  • Write the Tyk adapter
  • Build .so extension file using the Tyk container
  • Testing before merge
  • Update the release CI to ensure everything works fine for this plugin

404 response cached as 200

While testing this, I noticed that a 404 response comes back as 404 before being cached and then after being cached is being presented as 200. Shouldn't it present the 404 response status code instead?

A question following from this : is it possible to only cache results with 200 response status codes?

Performance update

  • Better cache speed
  • Hot reload config
  • Config by reference instead of copy
  • Less heavy binary removing unused deps

Prepare 1.4

Lightweight Souin instance for

  • Træfik plugins

Implementation

  • RFC compliant 100%

Support Vary stored with a L2 storage

We have to use a second storage layer to be able to map varied headers with the following pattern
{baseKey}-[{header1};{header2};{...}]

Then we'll be able to store varied requests without poisoning it with another varied requests

Support Apache SSL

Support Apache dynamic SSL like Træfik implementation.
Maybe create an external script to aggregate different certificates passing an array of string containing string path (real path or relative?)

Prepare 1.3

  • Setup docker image build
  • Add golang code coverage over 50%
  • Add gatling tests
  • Update documentation to use docker image
  • Add examples

[Traefik Pilot] Traefik Plugin Analyzer has detected a problem.

The plugin was not imported into Traefik Pilot.

Cause:

failed to run with Yaegi: plugin: failed to import plugin code: 1:21: import "github.com/darkweak/souin/plugins/traefik" error: /tmp/pilot-gop631695605/src/github.com/darkweak/souin/plugins/traefik/main.go:6:2: import "github.com/darkweak/souin/configuration" error: /tmp/pilot-gop631695605/src/github.com/darkweak/souin/configuration/configuration.go:6:2: import "gopkg.in/yaml.v3" error: unable to find source related to: "gopkg.in/yaml.v3"

Traefik Plugin Analyzer will restart when you will close this issue.

If you believe there is a problem with the Analyzer or this issue is the result of a false positive, please contact us.

[Traefik Pilot] Traefik Plugin Analyzer has detected a problem.

The plugin was not imported into Traefik Pilot.

Cause:

failed to run with Yaegi: plugin: failed to import plugin code: context deadline exceeded

Traefik Plugin Analyzer will restart when you will close this issue.

If you believe there is a problem with the Analyzer or this issue is the result of a false positive, please contact us.

[Traefik Pilot] Traefik Plugin Analyzer has detected a problem.

The plugin was not imported into Traefik Pilot.

Cause:

failed to run with Yaegi: plugin: failed to import plugin code: 1:21: import "github.com/darkweak/souin/plugins/traefik" error: /tmp/pilot-gop142536781/src/github.com/darkweak/souin/plugins/traefik/main.go:9:2: import "github.com/darkweak/souin/cache/providers" error: /tmp/pilot-gop142536781/src/github.com/darkweak/souin/cache/providers/ristrettoProvider.go:6:2: import "github.com/dgraph-io/ristretto" error: /tmp/pilot-gop142536781/src/github.com/darkweak/souin/vendor/github.com/dgraph-io/ristretto/cache.go:29:2: import "github.com/dgraph-io/ristretto/z" error: /tmp/pilot-gop142536781/src/github.com/darkweak/souin/vendor/github.com/dgraph-io/ristretto/z/bbloom.go:28:2: import "unsafe" error: unable to find source related to: "unsafe"

Traefik Plugin Analyzer will restart when you will close this issue.

If you believe there is a problem with the Analyzer or this issue is the result of a false positive, please contact us.

[Traefik Pilot] Traefik Plugin Analyzer has detected a problem.

The plugin was not imported into Traefik Pilot.

Cause:

failed to run with Yaegi: plugin: failed to import plugin code: 1:21: import "github.com/darkweak/souin/plugins/traefik" error: /tmp/pilot-gop354641438/src/github.com/darkweak/souin/plugins/traefik/configuration.go:4:2: import "github.com/darkweak/souin/configurationtypes" error: /tmp/pilot-gop354641438/src/github.com/darkweak/souin/configurationtypes/types.go:3:8: import "go.uber.org/zap" error: /tmp/pilot-gop354641438/src/github.com/darkweak/souin/vendor/go.uber.org/zap/array.go:26:2: import "go.uber.org/zap/zapcore" error: /tmp/pilot-gop354641438/src/github.com/darkweak/souin/vendor/go.uber.org/zap/zapcore/entry.go:31:2: import "go.uber.org/zap/internal/exit" error: /tmp/pilot-gop354641438/src/github.com/darkweak/souin/vendor/go.uber.org/zap/internal/exit/exit.go:32:2: not enough arguments in call to real

Traefik Plugin Analyzer will restart when you will close this issue.

If you believe there is a problem with the Analyzer or this issue is the result of a false positive, please contact us.

Feature Request - Cache per devicetype/url

Hi @darkweak ,

Hope you are all well !

It would be awesome to create a filter on the user-agent to cache page per device types (desktop/tablet and mobile) like varnish plugin https://github.com/varnishcache/varnish-devicedetect.

It is just a collection of regexrules for setting up a prefix to cache key.

What do you think about that ? Does it inspire you an easy way to implement this layer ?

Ref. https://github.com/varnishcache/varnish-devicedetect/blob/master/devicedetect.vcl#L33-L110

Cheers,
Luc Michalski

[Traefik Pilot] Traefik Plugin Analyzer has detected a problem.

The plugin was not imported into Traefik Pilot.

Cause:

failed to run with Yaegi: plugin: failed to import plugin code: 1:21: import "github.com/darkweak/souin/plugins/traefik" error: /tmp/pilot-gop174550246/src/github.com/darkweak/souin/plugins/traefik/main.go:6:2: import "github.com/darkweak/souin/configuration" error: /tmp/pilot-gop174550246/src/github.com/darkweak/souin/configuration/configuration.go:6:2: import "gopkg.in/yaml.v3" error: unable to find source related to: "gopkg.in/yaml.v3"

Traefik Plugin Analyzer will restart when you will close this issue.

If you believe there is a problem with the Analyzer or this issue is the result of a false positive, please contact us.

[Traefik Pilot] Traefik Plugin Analyzer has detected a problem.

The plugin was not imported into Traefik Pilot.

Cause:

failed to run with Yaegi: plugin: failed to import plugin code: 1:21: import "github.com/darkweak/souin/plugins/traefik" error: /tmp/pilot-gop185111417/src/github.com/darkweak/souin/plugins/traefik/main.go:6:2: import "github.com/darkweak/souin/configuration" error: /tmp/pilot-gop185111417/src/github.com/darkweak/souin/configuration/configuration.go:6:2: import "gopkg.in/yaml.v3" error: unable to find source related to: "gopkg.in/yaml.v3"

Traefik Plugin Analyzer will restart when you will close this issue.

If you believe there is a problem with the Analyzer or this issue is the result of a false positive, please contact us.

Feature Request - Add ability to set TTL depending URL/Headers/Cookies

We want to be able to define the cache TTL depending either one of URL, Headers or Cookies or every ones at the same time.
We could replace the MatchedURL object to another one, like CacheKey with the following structure

type CacheKey struct {
    type  string (eg."headers"|"cookies")
    regex string
}

Or another one with a priority field

type CacheKey struct {
    url      string (eg."/^.+$/")
    cookies  string (eg."/^.+$/")
    priority int
}

Then the YAML could be one of

cache_keys:
  - type: headers
    regex: '/^.+$/'
  - type: cookies
    regex: '/^.+$/'
  - type: headers
    regex: '/^[A-z]+$/'
cache_keys:
  - cookies: '/^.+$/'
    priority: 1
  - url: '/^.+$/'
    priority: 40
  - url: '/nothing$/'
    cookies: '/^Auth.+$/'
    priority: 999

[Traefik Pilot] Traefik Plugin Analyzer has detected a problem.

The plugin was not imported into Traefik Pilot.

Cause:

missing manifest: GET https://api.github.com/repos/Darkweak/Souin/contents/.traefik.yml?ref=v1.3.0: 404 Not Found []

Traefik Plugin Analyzer will restart when you will close this issue.

If you believe there is a problem with the Analyzer or this issue is the result of a false positive, please contact us.

REST API

Provide a REST API to be able to :

  • Get cache keys
  • Get cache value from key
  • Use BAN/PURGE HTTP methods
  • Clear keys by regexp

API will be accessible with or without JWT depending your configuration

[Traefik Pilot] Traefik Plugin Analyzer has detected a problem.

The plugin was not imported into Traefik Pilot.

Cause:

failed to run with Yaegi: plugin: failed to import plugin code: 1:21: import "github.com/darkweak/souin/plugins/traefik" error: /tmp/pilot-gop131394980/src/github.com/darkweak/souin/plugins/traefik/configuration.go:4:2: import "github.com/darkweak/souin/configurationtypes" error: /tmp/pilot-gop131394980/src/github.com/darkweak/souin/configurationtypes/types.go:3:8: import "go.uber.org/zap" error: /tmp/pilot-gop131394980/src/github.com/darkweak/souin/vendor/go.uber.org/zap/array.go:26:2: import "go.uber.org/zap/zapcore" error: /tmp/pilot-gop131394980/src/github.com/darkweak/souin/vendor/go.uber.org/zap/zapcore/entry.go:31:2: import "go.uber.org/zap/internal/exit" error: /tmp/pilot-gop131394980/src/github.com/darkweak/souin/vendor/go.uber.org/zap/internal/exit/exit.go:32:2: not enough arguments in call to real

Traefik Plugin Analyzer will restart when you will close this issue.

If you believe there is a problem with the Analyzer or this issue is the result of a false positive, please contact us.

[Traefik Pilot] Traefik Plugin Analyzer has detected a problem.

The plugin was not imported into Traefik Pilot.

Cause:

failed to run with Yaegi: plugin: failed to import plugin code: 1:21: import "github.com/darkweak/souin/plugins/traefik" error: /tmp/pilot-gop397129733/src/github.com/darkweak/souin/plugins/traefik/main.go:6:2: import "github.com/darkweak/souin/configuration" error: /tmp/pilot-gop397129733/src/github.com/darkweak/souin/configuration/configuration.go:6:2: import "gopkg.in/yaml.v3" error: unable to find source related to: "gopkg.in/yaml.v3"

Traefik Plugin Analyzer will restart when you will close this issue.

If you believe there is a problem with the Analyzer or this issue is the result of a false positive, please contact us.

stupide question ^^ but important

Hi @darkweak ,

Hope you are all well !

So, I am looking for an alternative to varnish for caching content of some prestashop websites.

What is the state of souin vs varnish ? Do you plan to have an advanced config file for parsing cookies or headers for custom caching ?

Thanks for any insights or inputs on that.

Cheers,
Luc Michalski

Feature Request - Grafana/Prometheus dashboard

Hi @darkweak ,

Hope you are all well !

I wanted also tyo suggest the creation of grafana dashboard with a prometheus exporter.

For my part, I am using a gin-gonic/prometheus middleware for feeding a grafana dahsboard. It also use a geoip2 middleware for a world map panel.

Screenshot 2021-04-09 at 06 36 52

Ref.

Cheers,
Luc Michalski

Combine Vary with the base cache

We want to be able to detect the vary requests with only one request to the storage system.
Obviously it will change the key generation.

The base generated key won't be affected. If the response doesn't contain the vary header with the varied list then the key will be like {request.method}-{request.host}-{request.uri}.
If the response contains the vary header with the varied headers list it will be like this one {request.method}-{request.host}-{request.uri}{-VARY-}{first varied header key}:{first varied header value};{second varied header key}:{second varied header value}.

With that, we will be able to request the storage and retrieve the associated (varied or not) responses, thanks to the prefix query.

One simple, working example

Hi, Currently trying to get a simple working example. I've read the (quite sparse) doc, saw this post and went through following slides.

I am using following configuration (the simplest one up to the doc):

default_cache: # Required part
  port: # Ports to expose Souin
    web: 80
  ttl: 10 # Default TTL
reverse_proxy_url: 'http://localhost'

I am running following Docker Compose configuration:

version: '3.7'

services:

  traefik:
    image: traefik:latest
    command:
      - "--api.insecure=true"
      - "--providers.docker=true"
      - "--providers.docker.exposedbydefault=false"
      - "--entrypoints.web.address=:80"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    ports:
      - "8080:8080"
      - "81:80"

  whoami:
    image: "traefik/whoami"
    container_name: "simple-service"
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.whoami.rule=Host(`localhost`)"
      - "traefik.http.routers.whoami.entrypoints=web"

  souin:
    image: darkweak/souin:latest
    ports:
      - 80:80
    depends_on:
      - redis
    environment:
      GOPATH: /app
    volumes:
      - ./configuration.yml:/configuration/configuration.yml

  redis:
    image: redis:alpine

Getting following output:

Attaching to souin_redis_1, simple-service, souin_traefik_1, souin_souin_1
redis_1    | 1:C 21 Mar 2021 03:36:40.289 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
redis_1    | 1:C 21 Mar 2021 03:36:40.290 # Redis version=6.2.1, bits=64, commit=00000000, modified=0, pid=1, just started
redis_1    | 1:C 21 Mar 2021 03:36:40.290 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
redis_1    | 1:M 21 Mar 2021 03:36:40.290 * monotonic clock: POSIX clock_gettime
souin_1    | standard_init_linux.go:219: exec user process caused: exec format error
simple-service | Starting up on port 80
traefik_1  | time="2021-03-21T03:36:40Z" level=info msg="Configuration loaded from flags."
redis_1    | 1:M 21 Mar 2021 03:36:40.291 * Running mode=standalone, port=6379.
redis_1    | 1:M 21 Mar 2021 03:36:40.291 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
redis_1    | 1:M 21 Mar 2021 03:36:40.291 # Server initialized
redis_1    | 1:M 21 Mar 2021 03:36:40.291 * Ready to accept connections
souin_souin_1 exited with code 1

So what am I doing wrong? Is this project used at all (googling for souin and traefik does not return that much help/matches)?

Thanks and have a beautiful day.

Support caddy 2 plugin

We want to support Souin as Caddy 2 plugin to be able to use this inside Caddy instance instead of on top of this reverse-proxy

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.