forked from emersion/yojo
A CI bridge from Forgejo/Gitea to SourceHut
- Go 87.4%
- HTML 8.6%
- CSS 4%
|
Jerry Lundström
6131d4ec4c
repository list
- Show `Owner.UserName` in repository list, as in repository template, to help people with same name repository in, for example, organizations |
||
|---|---|---|
| buildssrht | Add support for secrets | |
| static | Add checkbox to enable secrets | |
| templates | repository list | |
| .build.yml | ci: add .build.yml | |
| .gitignore | Initial commit | |
| config.go | all: prettify | |
| db.go | Stop de-duplicating installations per token IDs | |
| gitea.go | Set build job visibility | |
| go.mod | Upgrade dependencies | |
| go.sum | Upgrade dependencies | |
| job.go | Always unset oauth field in manifest | |
| LICENSE | Initial commit | |
| main.go | Add detailed instructions for custom Gitea instance | |
| README.md | readme: add section for local development | |
| schema.sql | schema: fix dropped username columns | |
| session.go | Add checkbox to enable secrets | |
yojo
A CI bridge from Forgejo/Gitea to SourceHut.
A public instance is available.
Configuration
yojo can be configured via an scfg file by running yojo -config <path>.
Only the OAuth client ID and secrets are required.
- For sr.ht, register an sr.ht OAuth client with the redirect URL set to
https://<origin>/authorize-srht. - For Codeberg, register a Codeberg OAuth client with the redirect URL set to
https://<origin>/authorize-gitea.
# HTTP server listen address
listen localhost:8080
# SQLite database path
db yojo.db
# SourceHut configuration
srht {
# OAuth client ID and secret
client-id "..."
client-secret "..."
# Endpoint URLs for builds.sr.ht and meta.sr.ht
builds-endpoint "https://builds.sr.ht"
meta-endpoint "https://meta.sr.ht"
}
# Gitea/Forgejo configuration
gitea {
# OAuth client ID and secret
client-id "..."
client-secret "..."
# Endpoint URL
endpoint "https://codeberg.org"
}
Local development
For local development, smee.io can be used to forward Web hooks. Install go-smee (or their offical client), then run:
smee -target "http://localhost:8080/webhook"
Grab the channel URL and start yojo like so:
yojo -config <config> -webhook-endpoint "https://smee.io/<token>"
To restart the smee client with the same channel, -proxy can be used:
smee -target "http://localhost:8080/webhook" -proxy "https://smee.io/<token>"
License
AGPLv3, see LICENSE.
Copyright (C) 2023 Simon Ser