Personal Git forge.
package libimport ( "encoding/base64" "regexp")const SessionDurationDays = 7 // 1 weekconst DatabaseCleanupMinutes = 10 // ten minutesconst GitReposDir = "data/repos/"const GitBranchMaxLen = 100const GitBranchMinLen = 2const GitDefaultBranch = "master"const GitHashLength = 8var 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 = 6969const SSHHostKeyPath = "data/host_key"const IssueTitleMaxLen = 100 // charactersconst IssueDescriptionMaxLen = 2000 // charactersconst IssueCommentMaxLen = 3000 // charactersconst GistTitleMaxLen = 100 // charactersconst GistContentMaxLen = 30000 // charactersconst OAuthStateDurationMins = 10var Base64Encoder = base64.URLEncodingvar ValidationErrorKey = "ValidationErr-"const MessageKey = "msg"const ErrorKey = "err"const SessionKey = "session"const LoggedInKey = "loggedIn"const UserKey = "user"