Codeberg Provider
The Codeberg provider uses the Gitea-compatible API to fetch release information.
Usage
zig
const updater = @import("updater");
// Quick check
const result = try updater.checkCodeberg(allocator, "owner", "repo", "1.0.0");
// Full configuration
const result = try updater.checkForUpdates(allocator, .{
.provider = updater.providers.codeberg,
.owner = "owner",
.repo = "repo",
.current_version = "1.0.0",
});API Details
Endpoint
GET https://codeberg.org/api/v1/repos/{owner}/{repo}/releases/latestHeaders
| Header | Value |
|---|---|
| Accept | application/json |
| User-Agent | updater.zig/0.0.1 |
Response Format
json
{
"tag_name": "v1.0.0",
"html_url": "https://codeberg.org/owner/repo/releases/tag/v1.0.0",
"name": "Release 1.0.0",
"body": "Release notes...",
"published_at": "2024-01-15T12:00:00Z",
"prerelease": false,
"draft": false
}About Codeberg
Codeberg is a community-driven Git hosting platform running Forgejo (a Gitea fork). It provides free hosting for open source projects.
Authentication
For private repositories (Codeberg generally supports public repos):
zig
const private_codeberg = updater.providers.custom(
"codeberg-private",
buildCodebergUrl,
parseCodebergResponse,
&[_]updater.HttpHeader{
.{ .name = "Accept", .value = "application/json" },
.{ .name = "Authorization", .value = "token YOUR_TOKEN" },
},
);Rate Limits
Codeberg has rate limits to ensure fair usage for all users. Contact Codeberg for specific limits.
Features
| Feature | Supported |
|---|---|
| Latest release | Yes |
| Prereleases | Yes |
| Drafts | Filtered out |
| Assets | Not parsed |
| Release notes | Yes |
Other Gitea Instances
Codeberg uses the same API as Gitea and Forgejo. For other instances:
zig
// Any Gitea/Forgejo instance
const myGitea = updater.providers.gitea("https://git.example.com");Troubleshooting
404 Not Found
- Repository does not exist
- No releases exist (only tags)
429 Too Many Requests
- Rate limit exceeded
- Wait and retry later