package lib import ( "encoding/base64" "regexp" ) const SessionDurationDays = 7 // 1 week const DatabaseCleanupMinutes = 10 // ten minutes const GitReposDir = "data/repos/" const GitBranchMaxLen = 100 const GitBranchMinLen = 2 const GitDefaultBranch = "master" const GitHashLength = 8 var GitNameRegex = regexp.MustCompile("^[a-zA-Z0-9](?:[a-zA-Z0-9]|[-_][a-zA-Z0-9])*$") var GitBranchRegex = regexp.MustCompile(`^([a-z0-9A-Z._-]+\/)*[a-z0-9A-Z._-]+$`) const MaxBlobPreviewBytes = 5 << 20 // 5 MiB - blobs larger than this are not loaded for preview. const MaxFileRawBytes = 256 << 20 // 256 MiB per file. const MaxRepoRawBytes = 1 << 30 // 1 GiB per repo. const SSHPort = 6969 const SSHHostKeyPath = "data/host_key" const IssueTitleMaxLen = 100 // characters const IssueDescriptionMaxLen = 2000 // characters const IssueCommentMaxLen = 3000 // characters const GistTitleMaxLen = 100 // characters const GistContentMaxLen = 30000 // characters const OAuthStateDurationMins = 10 var Base64Encoder = base64.URLEncoding var ValidationErrorKey = "ValidationErr-" const MessageKey = "msg" const ErrorKey = "err" const SessionKey = "session" const LoggedInKey = "loggedIn" const UserKey = "user"