Documentation ¶
Index ¶
Constants ¶
View Source
const ( // AppName represents the app name AppName = "sigma" // APIVersion represents the API version APIVersion = "v2" // APIVersionKey represents the API version key APIVersionKey = "Docker-Distribution-API-Version" // APIVersionValue represents the API version value APIVersionValue = "registry/2.0" // UploadUUID represents the upload uuid in header UploadUUID = "Docker-Upload-UUID" // ContentDigest represents the content digest in header ContentDigest = "Docker-Content-Digest" // Blobs represents a blobs // file always represent like: blobs/{algo}/xx/xx/{digest} Blobs = "blobs" // BlobUploads represent blob uploads // file always represent like: blob_uploads/{upload_id} BlobUploads = "blob_uploads" // DirCache for the image build cache // file always represent like: caches/{builder_id}/{runner_id} DirCache = "caches" // BlobUploadParts represent blob upload parts BlobUploadParts = "blob_upload_parts" // BuilderLogs represent builder logs BuilderLogs = "builder_logs" // DefaultTimePattern time pattern DefaultTimePattern = "2006-01-02 15:04:05" // ContextJti represents jti in context ContextJti = "jti" // ContextUser represents user in context ContextUser = "user" // HotNamespace top hot namespaces HotNamespace = 3 // WebhookSecretHeader ... WebhookSecretHeader = "X-Sigma-Signature-256" // nolint: gosec // InsertBatchSize ... InsertBatchSize = 10 // MaxNamespaceMember ... MaxNamespaceMember = 10 // MaxWebhooks ... MaxWebhooks = 5 // ObsPresignMaxTtl ObsPresignMaxTtl = time.Minute * 30 // PprofPath ... PprofPath = "/__debug/pprof" )
View Source
const ( // UserInternal used for build and push image to sigma UserInternal = "sigma-internal" // UserAnonymous used for anonymous login, just have read permission UserAnonymous = "sigma-anonymous" )
View Source
const ( // CacherBlob ... CacherBlob = "blob" // CacherManifest ... CacherManifest = "manifest" )
View Source
const ( // ServerPort server port ServerPort = "0.0.0.0:3000" // WorkerPort worker port WorkerPort = "0.0.0.0:3001" )
View Source
const ( // LockerMigration ... LockerMigration = "locker-migration" // LockerCronjobBuilder ... LockerCronjobBuilder = "locker-cronjob-builder" // LockerBaseimage ... LockerBaseimage = "locker-baseimage" )
View Source
const ( // LockerRetryDelay ... LockerRetryDelay = time.Second * 1 // LockerRetryMaxTimes ... LockerRetryMaxTimes = 6 )
View Source
const ( // SettingSignPrivateKey is the private key for signing SettingSignPrivateKey = "signing.private_key" // SettingSignPublicKey is the public key for signing SettingSignPublicKey = "signing.public_key" // SettingBaseimageDockerfileKey ... SettingBaseimageDockerfileKey = "baseimage.dockerfile" // SettingBaseimageBuilderKey ... SettingBaseimageBuilderKey = "baseimage.builder" )
View Source
const (
// APIV1 api v1 for api router
APIV1 = "/api/v1"
)
View Source
const ( // AuthModel represents the auth model // policy_effect: it means at least one matched policy rule of allow, and there is no matched policy rule of deny. So in this way, both the allow and deny authorizations are supported, and the deny overrides. AuthModel = `` /* 473-byte string literal not displayed */ )
View Source
const (
// RedisPid ...
RedisPid = "/var/run/redis.pid"
)
Variables ¶
View Source
var ( // PwdStrength represents the password strength PwdStrength = pwdvalidate.GetEntropy("Admin@123") // Alphanum alphabet num Alphanum = "abcdefghijklmnopqrstuvwxyz0123456789" )
View Source
var ( // RegexUsername ... RegexUsername = regexp.MustCompile(`^[a-zA-Z0-9_@#$%-]+$`) // RegexEmail ... RegexEmail = regexp.MustCompile(`^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$`) )
View Source
var ( // KeepNamespaces namespace keep name, any name expect these names KeepNamespaces = []string{"api", "v2"} )
View Source
var ( // TagRegexp matches valid tag names. From [docker/docker:graph/tags.go]. // // [docker/docker:graph/tags.go]: https://github.com/moby/moby/blob/v1.6.0/graph/tags.go#L26-L28 TagRegexp = regexp.MustCompile(`^[\w][\w.-]{0,127}$`) )
View Source
var UserAgent = fmt.Sprintf("sigma/%s (https://github.com/go-sigma/sigma)", version.Version)
UserAgent represents the user agent
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.