traefik_s3_proxy_plugin

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 9, 2025 License: MIT Imports: 7 Imported by: 0

README

traefik-s3-proxy-plugin

This plugin is based on craigbrogle/traefik-s3-plugin code.

Changelog

s3-proxy 1.0.0
  • The code has been improved
  • Added the ability to select the endpoint type for a bucket: https://bucket.endpoit/prefix/key or https://endpoint/bucket/prefix/key
Usage (example for Yandex Cloud)
http:
  middlewares:
    s3-get:
      plugin:
        s3-proxy:
          Service: s3
          EndpointUrl: storage.yandexcloud.net
          Region: ru-central1
          AccessKeyID: xxxxxxxxxxxxxxxx
          SecretAccessKey: xxxxxxxxxxxxxxxx
          Bucket: some.bucket.name
          LinkStyle: path
  
  routers:
    gmc:
      entryPoints:
        - websecure
      rule: Host(`example.com`)
      service: noop@internal
      middlewares:
        - s3-get
      tls: {}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(_ context.Context, next http.Handler, config *Config, name string) (http.Handler, error)

Types

type Config

type Config struct {
	TimeoutSeconds int
	Service        string

	// Local directory
	Directory string

	// S3
	AccessKeyId     string
	SecretAccessKey string
	Region          string
	EndpointUrl     string
	Bucket          string
	Prefix          string
	LinkStyle       string
}

func CreateConfig

func CreateConfig() *Config

type S3Plugin

type S3Plugin struct {
	// contains filtered or unexported fields
}

func (S3Plugin) ServeHTTP

func (plugin S3Plugin) ServeHTTP(rw http.ResponseWriter, req *http.Request)

type Service

type Service interface {
	Get(name string, rw http.ResponseWriter) ([]byte, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL