bulbistry

package module
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2023 License: MIT Imports: 14 Imported by: 1

README

Bulbistry

Go Report Card License X (formerly Twitter) URL

The name comes from Thomomys bulbivorus, the scientific name for the Camas pocket gopher, and the fact that this implements an OCI-compliant container registry.

The intention is to write a registry for (semi-)private small-scale use to be wrapped in a container. ONE container. Not 10, like Harbor does. Because of that, these requirements are set:

  1. There is no requirement to use external services.
  2. If you want HTTPS security, wrap a reverse proxy around this server.
  3. The attached database is in SQLite format - no other databases will be supported until it DOES pass the spec.
  4. Local storage only - if you want to hook up S3 or some other storage service, do it outside of this container.
  5. This is implemented to the spec at https://github.com/opencontainers/distribution-spec/blob/main/spec.md, not to any specific program.
  6. This is not a mirror. However, once it DOES pass the spec, we can talk about mirroring.
  7. No support for vulnerability scanning will be entertained until it DOES pass the spec.

This is also my attempt to learn how to program in Go, as I've found that the best way for myself to learn is to read, and then try. I've been programming in Perl for years, but I'm willing to try other languages.

Because of that, this is a work-in-progress, and is woefully incomplete even as yet.

Documentation

Index

Constants

View Source
const (
	ConfigKey contextKey = iota
)

Variables

This section is empty.

Functions

func ConfigError

func ConfigError(w http.ResponseWriter, err error)

func GenerateBlobUUID

func GenerateBlobUUID(manifestName string, reference string) (string, error)

func GenerateManifestUUID

func GenerateManifestUUID(mt database.ManifestTag) (string, error)

func GetManifest

func GetManifest(w http.ResponseWriter, _ *http.Request)

func GetNamespacedManifest

func GetNamespacedManifest(w http.ResponseWriter, _ *http.Request)

func GetNamespacedTags

func GetNamespacedTags(w http.ResponseWriter, r *http.Request)

func GetRedirectManifest

func GetRedirectManifest(w http.ResponseWriter, r *http.Request)

func GetRedirectNamespacedManifest

func GetRedirectNamespacedManifest(w http.ResponseWriter, r *http.Request)

func GetTags

func GetTags(w http.ResponseWriter, r *http.Request)

func GetV2Check

func GetV2Check(w http.ResponseWriter, _ *http.Request)

func HeadRedirectManifest

func HeadRedirectManifest(w http.ResponseWriter, r *http.Request)

func HeadRedirectNamespacedManifest

func HeadRedirectNamespacedManifest(w http.ResponseWriter, r *http.Request)

func InvalidLogin

func InvalidLogin(w http.ResponseWriter)

func NoLogin

func NoLogin(w http.ResponseWriter)

func PostNamespacedBlobUpload

func PostNamespacedBlobUpload(w http.ResponseWriter, r *http.Request)

func RepositoryNotFound

func RepositoryNotFound(w http.ResponseWriter, name string)

func StoreInProgressUpload

func StoreInProgressUpload(namespace *string, name string, nano string)

func UploadLocation

func UploadLocation(namespace *string, name string, uuid uuid.UUID) string

Types

type BasicAuth

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

func NewBasicAuthMiddleware

func NewBasicAuthMiddleware(authRequired bool, authorizer *htpasswd.File) BasicAuth

func (*BasicAuth) Middleware

func (ba *BasicAuth) Middleware(next http.Handler) http.Handler

type ErrorInfo

type ErrorInfo struct {
	Code    string       `json:"code"`
	Message string       `json:"message"`
	Details *interface{} `json:"details,omitempty"`
}

type Logger

type Logger struct {
	*log.Logger
	// contains filtered or unexported fields
}

Bulbistry's extension of log.Logger to include the UUID in the logs.

func NewLogger

func NewLogger(w io.Writer, logUUID *uuid.UUID) *Logger

type ResponseText

type ResponseText struct {
	Errors []ErrorInfo `json:"errors"`
}

type UnauthorizedDetails

type UnauthorizedDetails struct {
	Attempted string `json:"username_attempted"`
	Allowed   string `json:"username_allowed"`
}

Directories

Path Synopsis
cmd
bulbistry Module
internal
cmd Module

Jump to

Keyboard shortcuts

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