proxy

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 29 Imported by: 0

README

Chorus proxy

Serves s3 proxy on port :9669. Routes s3 requests to main s3 storage from config and creates replication tasks for worker based on replication policy.

Usage

Set s3 storage and redis credentials to config and run.

[!IMPORTANT]
Both Proxy and worker should have the same Redis and s3 storages in config.

Manage replication policies with CLI

[!NOTE]
Worker is required to use CLI. Deploy worker and provide worker GRPC api address to CLI.

With CLI:

  • check current replication state dashboard
    chorctl dash
    
  • list buckets available for replication (remove < and > and use values from Proxy s3 storages config)
    chorctl repl buckets -f <from storage> -t <to storage> -u <user>
    
  • create replciation for bucket:
    chorctl repl add -f <from storage> -t <to storage> -u <user> -b <bucket name>
    
  • go to dashboard to check created replication progress
    chorctl dash
    
Auth config

Proxy supports only s3 signature v4 Credentials. V2 credentials can also be enabled in config.

Possible configurations:

  • use credentials from other storages from config
    ...
    auth:
      useStorage: storageOne
    
  • use custom from config.
    ...
    auth:
      custom: 
        user1:
          accessKeyID: <user1 v4 accessKey credential>
          secretAccessKey: <user1 v4 secretKey credential>
        user2:
          accessKeyID: <user2 v4 accessKey credential>
          secretAccessKey: <user2 v4 secretKey credential>
    

[!IMPORTANT]
Custom credentials user keys (user1 and user2 in example above) should match user keys in storage config.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start(ctx context.Context, app dom.AppInfo, conf *Config) error

Types

type Config

type Config struct {
	config.Common `yaml:",inline,omitempty" mapstructure:",squash"`

	Storage *s3.StorageConfig `yaml:"storage,omitempty"`
	Auth    *auth.Config      `yaml:"auth,omitempty"`
	Port    int               `yaml:"port"`
	Address string            `yaml:"address"`
	Cors    *cors.Config      `yaml:"cors"`
}

func GetConfig

func GetConfig(src ...config.Src) (*Config, error)

func (*Config) Validate

func (c *Config) Validate() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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