Added: - SETUP_GUIDE.md: Complete step-by-step integration guide - komodo-gitea.config.toml: Gitea provider config snippet The guide covers: - Git provider configuration - Resource import options (Sync vs Manual) - Webhook setup with examples - Troubleshooting tips
4.7 KiB
Komodo + Gitea Integration Setup Guide
This guide will help you configure Komodo to work with your Gitea server.
Summary
- Gitea Host:
gitea.straymoog.xyz - Gitea User:
komodo - Gitea Token:
18f8305e245023e8f5863991b66610854d6d9820 - Komodo Host:
komodo.internal - Repository:
stray/komodo-demo
Step 1: Configure Gitea Provider in Komodo
You need to add the Gitea git provider configuration to Komodo. There are two ways to do this:
Option A: Via Komodo Config File (Recommended)
Add this to your Komodo core.config.toml:
[[git_provider]]
domain = "gitea.straymoog.xyz"
accounts = [
{ username = "komodo", token = "18f8305e245023e8f5863991b66610854d6d9820" }
]
If running Komodo in Docker, mount the config file:
docker run -v ./core.config.toml:/config/core.config.toml \
-e KOMODO_CONFIG_PATH=/config/core.config.toml \
ghcr.io/moghtech/komodo:latest
Option B: Via Komodo UI
- Navigate to Komodo UI at
http://komodo.internal - Go to Settings → Git Providers
- Add new provider:
- Domain:
gitea.straymoog.xyz - Username:
komodo - Token:
18f8305e245023e8f5863991b66610854d6d9820
- Domain:
Step 2: Import Resources into Komodo
The repository contains Komodo resource definitions in .komodo/resources.toml. You can import them:
Option A: Using Resource Sync (Recommended - GitOps approach)
-
In Komodo UI, create a new Resource Sync:
- Name:
komodo-demo-sync - Git Provider:
gitea.straymoog.xyz - Git Account:
stray(orkomodo) - Repository:
stray/komodo-demo - Branch:
main - Resource Path:
.komodo
- Name:
-
Execute the sync to import all resources (Build, Stack, Sync)
-
Enable webhook for automatic syncing on git push
Option B: Manual Creation
Create each resource manually in the Komodo UI using the configurations from .komodo/resources.toml.
Step 3: Set Up Webhooks in Gitea
Configure webhooks to trigger Komodo actions on git push.
Webhook Secret
First, ensure Komodo has a webhook secret configured. Check your Komodo environment for:
KOMODO_WEBHOOK_SECRET=your_secret_here
Create Webhooks
For each resource, create a webhook in Gitea:
Build Webhook
- Go to
https://gitea.straymoog.xyz/stray/komodo-demo/settings/hooks - Click Add Webhook → Gitea
- Configure:
- Payload URL:
http://komodo.internal:9120/listener/github/build/komodo-demo-build/build - Content Type:
application/json - Secret: Your
KOMODO_WEBHOOK_SECRET - Trigger: Just the push event
- Active: ✓
- Payload URL:
Stack Webhook (Deploy)
- Payload URL:
http://komodo.internal:9120/listener/github/stack/komodo-demo-stack/deploy
Resource Sync Webhook
- Payload URL:
http://komodo.internal:9120/listener/github/sync/komodo-demo-sync/sync
Note: Use /listener/github/ for Gitea (it's compatible with GitHub webhook format)
Step 4: Test the Integration
- Make a small change to
app.js(e.g., update the version) - Commit and push to the
mainbranch - Watch Komodo:
- Build should trigger automatically
- Stack can be deployed with new image
- Sync updates configuration if
.komodo/resources.tomlchanges
Resource Details
Build Resource: komodo-demo-build
- Builds Docker image from Dockerfile
- Image name:
komodo-demo-app:latest - Triggers on push to
mainbranch
Stack Resource: komodo-demo-stack
- Deploys using
docker-compose.yml - Runs app on port 3000
- Depends on built image
Sync Resource: komodo-demo-sync
- Syncs Komodo configuration from
.komodo/directory - Enables GitOps workflow
- Can be configured to commit changes back to repo
Webhook URLs Reference
If using resource IDs instead of names, format:
http://komodo.internal:9120/listener/github/{resource_type}/{id_or_name}/{action}
Actions:
- Build:
/build - Stack:
/deploy,/refresh - Sync:
/sync,/refresh - Repo:
/pull,/clone,/build
Troubleshooting
Webhook not triggering
- Check webhook secret matches
KOMODO_WEBHOOK_SECRET - Verify Komodo is accessible from Gitea server
- Check branch name matches resource configuration
Build fails
- Verify git provider credentials are correct
- Check build logs in Komodo UI
- Ensure builder/server has Docker installed
Cannot clone repository
- Verify git provider configuration in Komodo
- Check token has correct permissions
- Ensure
komodouser has access to repository
Next Steps
- Configure your Komodo core with Gitea provider
- Import resources via Sync or manual creation
- Set up webhooks for automated workflows
- Test by pushing changes to the repository
For more information, see the Komodo documentation.