config

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	MaxUploadSize int64  `default:"25"` // MiB
	IDLength      int    `default:"20"`
	StorePath     string `default:"files"`
	ListenAddr    string `default:":8080"`
	TLS           struct {
		Use  bool   `default:"false"`
		Key  string `default:"/etc/ssl/private/ssl-cert-snakeoil.key"`
		Cert string `default:"/etc/ssl/certs/ssl-cert-snakeoil.pem"`
	}
	Database struct {
		Driver string `default:"sqlite3"`
		Args   string `default:"gdprshare.db"`
	}
	Mail struct {
		SmtpHost       string `default:"localhost"`
		SmtpPort       uint16 `default:"25"`
		SmtpUser       string
		SmtpPass       string
		From           string `default:"root@localhost"`
		Subject        string `default:"File has been accessed: %s"`
		SubjectReceipt string `default:"File download confirmed: %s"`
		Body           string `default:"File download with id {{.FileID}} has been attempted. {{.Denied}}"`
		DeniedMsg      string `default:"Download was denied."`
	}
	Header struct {
		TLSVersion     string `default:"X-TLS-Version"`
		TLSCipherSuite string `default:"X-TLS-CipherSuite"`
	}
	SaveClientInfo bool `default:"false"`
	GeoIPPath      string
}

func Default

func Default() *Config

func New

func New(path string) (*Config, error)

Jump to

Keyboard shortcuts

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