caddyfss3

package module
v0.0.0-...-bcf51b6 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2025 License: MIT Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Caddy FS module for AWS S3

GitHub Workflow Status Caddy Version GitHub go.mod Go version OpenSSF Scorecard

Installation

Build Caddy using xcaddy:

xcaddy build --with github.com/sagikazarmark/caddy-fs-s3

Usage

{
	filesystem my-s3-fs s3 {
		bucket mybucket
		region us-east-1

		# endpoint <endpoint>
		# profile <profile>
		# use_path_style
	}
}

example.com {
    file_server {
        fs my-s3-fs
    }
}

[!NOTE] For a full parameter reference, check out the module documentation page.

Authentication

The module uses the AWS SDK default credential chain to find valid credentials.

The easiest way to try the module is setting static credentials either in your AWS credentials file or as environment variables:

export AWS_ACCESS_KEY_ID=...
export AWS_SECRET_ACCESS_KEY=...

Caddy will pick up the credentials automatically.

Development

For an optimal developer experience, it is recommended to install Nix and direnv.

Run Caddy with the following command:

just run up --ports 8080:80

When all coding and testing is done, please run the test suite:

just check

License

The project is licensed under the MIT License.

Documentation

Overview

Package caddyfss3 implements a Caddy virtual filesystem module for AWS S3 (and compatible) object store.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FS

type FS struct {
	fs.FS `json:"-"`

	// The name of the S3 bucket.
	Bucket string `json:"bucket,omitempty"`

	// The AWS region the bucket is hosted in.
	Region string `json:"region,omitempty"`

	// The AWS profile to use if multiple profiles are specified.
	Profile string `json:"profile,omitempty"`

	// Use non-standard endpoint for S3.
	Endpoint string `json:"endpoint,omitempty"`

	// Set this to `true` to enable the client to use path-style addressing.
	UsePathStyle bool `json:"use_path_style,omitempty"`

	// DEPRECATED: please use 'use_path_style' instead.
	// Set this to `true` to force the request to use path-style addressing.
	S3ForcePathStyle bool `json:"force_path_style,omitempty"`
}

FS is a Caddy virtual filesystem module for AWS S3 (and compatible) object store.

func (FS) CaddyModule

func (FS) CaddyModule() caddy.ModuleInfo

CaddyModule returns the Caddy module information.

func (*FS) Provision

func (fs *FS) Provision(ctx caddy.Context) error

Provision implements the caddy.Provisioner interface.

func (*FS) UnmarshalCaddyfile

func (fs *FS) UnmarshalCaddyfile(d *caddyfile.Dispenser) error

UnmarshalCaddyfile unmarshals a caddyfile.

Jump to

Keyboard shortcuts

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