Gitea — Dependencies#
Module info#
- Module:
code.gitea.io/gitea - Go version: 1.26.1
- Direct dependencies: 119
- Indirect dependencies: ~155 (second
requireblock in go.mod) - go.sum entries: 979 lines (~489 module versions)
Dependency categories#
Core infrastructure#
github.com/urfave/cli/v3— CLI framework for thegiteabinary; commands likeweb,admin,migrate, etc.gopkg.in/ini.v1— INI file parsing forapp.ini, Gitea’s primary configuration format; deliberate over Viper/YAML since Gitea pre-dates widespread YAML config adoption in Go appsgo.yaml.in/yaml/v4— YAML used for Actions workflow files and API payloadsgopkg.in/yaml.v3— Still used internally alongside yaml/v4 (pinned at rc.3 pending stable release)github.com/robfig/cron/v3andgithub.com/go-co-op/gocron/v2— Cron/job scheduling for background tasks (cleanup, mirrors, archiving)github.com/hashicorp/golang-lru/v2— In-process LRU caches for hot data (user info, git objects, sessions)github.com/fsnotify/fsnotify— File system watching (custom template hot-reload in development mode)github.com/google/uuid— UUID generation for tokens, uploads, etc.github.com/dustin/go-humanize— Human-readable file sizes, timestamps in templatesgithub.com/felixge/fgprofandgithub.com/google/pprof— Profiling endpoints exposed at/debug/pprof
Networking/HTTP#
github.com/go-chi/chi/v5— Primary HTTP router; Gitea forked and maintains several chi middlewares undergitea.com/go-chi/gitea.com/go-chi/binding,gitea.com/go-chi/cache,gitea.com/go-chi/captcha,gitea.com/go-chi/session— Gitea-maintained chi middleware forks; the project self-hosts its own fork chain rather than depending on upstreamgithub.com/go-chi/cors— CORS headers for the APIgithub.com/chi-middleware/proxy— Trusted reverse-proxy header handling (X-Forwarded-For, etc.)connectrpc.com/connect+google.golang.org/grpc+google.golang.org/protobuf— Used for Gitea Actions runner protocol (code.gitea.io/actions-proto-go); not for general internal RPCgithub.com/42wim/httpsig— HTTP Signature verification for ActivityPub federationgithub.com/caddyserver/certmagic— Automatic TLS certificate provisioning via ACME (Let’s Encrypt built in)github.com/markbates/goth— Social/OAuth2 login providers (GitHub, Google, GitLab, Twitter, etc.)golang.org/x/oauth2— OAuth2 client used alongside gothgithub.com/yohcop/openid-go— OpenID 2.0 SSO supportgithub.com/gliderlabs/ssh— Embedded SSH server for git-over-SSH and the SSH API shellgithub.com/go-ldap/ldap/v3— LDAP/LDAPS authenticationgithub.com/quasoft/websspi— Windows SSPI/Kerberos authentication (Windows-only build)github.com/msteinert/pam/v2— PAM authentication (Linux-only build)github.com/wneessen/go-mail— Outbound SMTP email (notifications, password resets)github.com/emersion/go-imap— IMAP client for incoming mail processinggithub.com/gorilla/feeds— RSS/Atom feed generation for repository activitygithub.com/gorilla/sessions— Session store backend (complements gitea.com/go-chi/session)strk.kbt.io/projects/go/libravatar— Federated avatar service (Gravatar-compatible)golang.org/x/net— Extended networking (HTTP/2, idna, etc.)github.com/bohde/codel— Controlled delay (CoDel) queue for request admission control under load
Data/Storage#
xorm.io/xorm+xorm.io/builder— ORM and query builder; the entiremodels/layer sits on xorm, a deliberate choice over GORM dating back to the Gogs codebasegithub.com/go-sql-driver/mysql— MySQL/MariaDB drivergithub.com/lib/pq— PostgreSQL drivergithub.com/mattn/go-sqlite3— SQLite3 driver (CGO required; default for single-user installs)github.com/microsoft/go-mssqldb— MSSQL/SQL Server driver (pinned, Azure SDK compatibility)github.com/redis/go-redis/v9— Redis client for queue, cache, and distributed session storagegithub.com/go-redsync/redsync/v4— Redis-backed distributed locks (cluster coordination)gitea.com/lunny/levelqueue+github.com/syndtr/goleveldb— LevelDB-backed task queue; the default queue backend without Redisgithub.com/minio/minio-go/v7— Object storage (MinIO, S3-compatible) for attachments and LFSgithub.com/Azure/azure-sdk-for-go/sdk/azcore+azblob— Azure Blob Storage backend (pinned below v1.21 due to CI Azurite compatibility)github.com/aws/aws-sdk-go-v2/credentials+service/codecommit— AWS S3 credentials and CodeCommit mirroringgithub.com/blevesearch/bleve/v2— Embedded full-text search index (default; no external service)github.com/olivere/elastic/v7— Elasticsearch backend for search (optional)github.com/meilisearch/meilisearch-go— Meilisearch backend for search (optional)github.com/klauspost/compress— Compression (zstd, gzip, snappy) used throughout storage and network layersgithub.com/SaveTheRbtz/zstd-seekable-format-go/pkg— Seekable zstd for compressed git pack filesgithub.com/mholt/archives— Archive extraction (zip, tar.gz, etc.) for repository downloads and uploadsgithub.com/goccy/go-json— Drop-in fast JSON encoder; selected overencoding/jsonfor performance on large API responses
Authentication & Security#
github.com/go-webauthn/webauthn— WebAuthn/FIDO2 hardware security key supportgithub.com/pquerna/otp— TOTP 2FA (authenticator app QR codes)github.com/golang-jwt/jwt/v5— JWT tokens for API auth and OAuth2 tokensgithub.com/tstranex/u2f— Legacy U2F hardware token supportgithub.com/ProtonMail/go-crypto— OpenPGP/GPG for commit signing verificationgithub.com/42wim/sshsig— SSH signature verification for signed commitscodeberg.org/gusted/mcaptcha— mCaptcha integration for bot preventiongolang.org/x/crypto— bcrypt, SSH protocol, TLS helpers
Git & VCS#
github.com/go-git/go-git/v5+go-billy/v5— Pure Go git library; used for specific operations like parsing git objects without shelling out togitgithub.com/charmbracelet/git-lfs-transfer— Git LFS pure-Go transfer protocolgithub.com/gogs/go-gogs-client— Gogs API client for Gogs→Gitea migrationgithub.com/emirpasica/gods— Generic data structures used by go-git internalsgithub.com/editorconfig/editorconfig-core-go/v2— EditorConfig file parsing for the editor UI
Code Rendering & Markup#
github.com/yuin/goldmark+goldmark-highlighting/v2+goldmark-meta— Markdown pipeline with syntax highlighting and YAML frontmattergithub.com/alecthomas/chroma/v2— Syntax highlighting engine (280+ languages) for code view and diffsgithub.com/microcosm-cc/bluemonday— HTML sanitizer for user-submitted contentgithub.com/PuerkitoBio/goquery— HTML parsing/manipulation for rendering pipelinegithub.com/sergi/go-diff— Diff computation for code review patchesgithub.com/niklasfasching/go-org— Org-mode markup renderinggithub.com/buildkite/terminal-to-html/v3— Converts ANSI terminal output to HTML for Actions logsgithub.com/go-enry/go-enry/v2— Language detection by file content/extension (GitHub Linguist port)github.com/google/licenseclassifier/v2— Open-source license detection for repository insightsgithub.com/dlclark/regexp2— .NET-compatible regex for chroma syntax highlighter rulesmvdan.cc/xurls/v2— URL autolink extraction from plain textgithub.com/jaytaylor/html2text— HTML→plaintext for email notifications (replaced with a maintained fork viareplace)
Package Registry & CI/CD#
github.com/nektos/act(replaced →gitea.com/gitea/act) — GitHub Actions workflow runner embedded in the Gitea binary; Gitea maintains its own forkcode.gitea.io/actions-proto-go— Protobuf definitions for Actions runner protocolgithub.com/blakesmith/ar— Debian.debpackage format parsing for the package registrygithub.com/sassoftware/go-rpmutils— RPM package parsing for the package registrygithub.com/opencontainers/go-digest+image-spec— OCI container image standards for Gitea’s container registrygithub.com/santhosh-tekuri/jsonschema/v6— JSON Schema validation for API request bodies
External Integrations#
github.com/google/go-github/v84— GitHub API client for GitHub→Gitea migration and repository mirroringgitlab.com/gitlab-org/api/client-go— GitLab API client for GitLab→Gitea migrationcode.gitea.io/sdk/gitea— Gitea’s own API client (used internally for CLI admin commands)gitea.com/lunny/dingtalk_webhook— DingTalk (Chinese messaging platform) webhook integrationgithub.com/ethantkoenig/rupture— Batch indexing for Bleve (wraps bleve indexing with transaction-like batching)
Testing#
github.com/stretchr/testify— The only explicit test framework (assert, require, mock); used heavily throughout*_test.gofilesgithub.com/dimero1/reply— HTTP response recording for handler tests
Observability#
github.com/prometheus/client_golang— Prometheus metrics endpoint (/metrics); production-grade observability built in
Stdlib reliance#
Gitea makes heavy use of stdlib, particularly:
net/http— All HTTP serving (chi wraps stdlib’shttp.Handler)database/sql— The DB layer; xorm builds on top of stdlib’sdatabase/sqlencoding/json— Supplemented bygoccy/go-jsonfor hot pathsos/exec— Git subprocess invocations for most git operations (the project shells out togitCLI rather than using go-git for the majority of operations, for performance/completeness reasons)crypto/*— TLS, hash functions, alongsidegolang.org/x/cryptotext/template/html/template— Server-side HTML renderingsync— Mutexes and WaitGroups throughout the codebasecontext— Pervasive context propagation through all layers
The project is stdlib-heavy for its core serving logic but relies heavily on third-party packages for the breadth of its feature set (auth, search, archives, rendering, etc.).
Shared dependencies#
Dependencies appearing across many of the 50 analyzed projects:
golang.org/x/{crypto,net,sys,text,sync}— near-universal Go extended stdlibgithub.com/stretchr/testify— de facto standard test frameworkgithub.com/prometheus/client_golang— common in any server exposing metricsgithub.com/go-chi/chi/v5— widely used in non-framework Go web apps (also seen in Consul, Vault, Nomad)github.com/redis/go-redis/v9— common Redis clientgoogle.golang.org/grpc+protobuf— common in infrastructure/service projectsgithub.com/google/uuid— ubiquitousgithub.com/hashicorp/golang-lru/v2— shared with Consul, Vault, Terraformgithub.com/klauspost/compress— common high-performance compressiongopkg.in/yaml.v3— widespread YAML parsinggithub.com/fsnotify/fsnotify— common file watchinggithub.com/minio/minio-go/v7— shared with other projects needing S3-compatible storage
Vendoring#
Gitea does not vendor dependencies. The go.mod ignore directive explicitly excludes .venv and node_modules but there is no vendor/ directory. The project uses the Go module proxy and sum database. The replace directives (7 total) serve a similar pinning purpose for specific packages where upstream is unmaintained or broken:
| Replaced module | Replacement | Reason |
|---|---|---|
github.com/jaytaylor/html2text | github.com/Necoro/html2text | Upstream unmaintained |
github.com/nektos/act | gitea.com/gitea/act | Gitea maintains own fork |
github.com/urfave/cli/v3 | pinned v3.4.1 | v3.6.2 breaks -c flag parsing |
go.yaml.in/yaml/v4 | pinned rc.3 | rc.4 changed block scalar behavior |
| Azure SDK azcore + azblob | pinned below v1.21 | Azurite CI incompatibility |
github.com/microsoft/go-mssqldb | pinned v1.9.7 | Coordinated with Azure SDK downgrade |
Notable dependency decisions#
xorm over GORM: Gitea inherited xorm from Gogs and chose to stay with it rather than migrating to the more widely adopted GORM. xorm has better support for the
Sync2schema migration pattern Gitea relies on, and the cost of migrating 2,800+ Go files was never justified.Fork chain under
gitea.com/go-chi/: Rather than contributing back to upstream chi middlewares or finding alternatives, Gitea maintains its own forks of binding, cache, captcha, and session middleware. This reflects the team’s need for tight control over session and cache behavior specific to Gitea’s architecture.Embedded Actions runner (
gitea.com/gitea/act): Bundling an entire CI workflow execution engine into the same binary is architecturally unusual. Thereplacedirective pointing to Gitea’s own fork means the project cannot simply pull in upstreamnektos/actupdates — all upstream changes must be manually ported.Three search backends: Shipping drivers for Bleve (embedded), Elasticsearch, and Meilisearch as direct dependencies means all three are compiled into every Gitea binary, not loaded dynamically. The choice of which backend to use is a runtime config decision; the binaries for all three ship regardless. This inflates binary size but simplifies deployment.
All four database drivers always compiled in: Same pattern as search — MySQL, PostgreSQL, SQLite, and MSSQL drivers are always compiled in. SQLite requires CGO, making
CGO_ENABLED=0builds impossible unlesssqliteis excluded from build tags.Minimal indirect dep hygiene: The go.mod explicitly comments that
go get -u ./...is not safe to run freely, and maintains a pinning list with TODO markers for versions that need manual review before upgrading. This signals the project acknowledges its dependency graph is large and fragile in places, and manages it with explicit human oversight rather than automation.