k8s-agent-skills 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/README.md +102 -0
  2. package/package.json +63 -0
  3. package/skills/atlas/SKILL.md +166 -0
  4. package/skills/cert-manager/SKILL.md +212 -0
  5. package/skills/cilium-gateway/SKILL.md +283 -0
  6. package/skills/cilium-network/SKILL.md +243 -0
  7. package/skills/cnpg/SKILL.md +130 -0
  8. package/skills/dragonfly/SKILL.md +194 -0
  9. package/skills/external-dns/SKILL.md +185 -0
  10. package/skills/flagger/SKILL.md +292 -0
  11. package/skills/flux/SKILL.md +36 -0
  12. package/skills/gitea/SKILL.md +32 -0
  13. package/skills/gitea-api/SKILL.md +104 -0
  14. package/skills/gitea-registry/SKILL.md +71 -0
  15. package/skills/gitea-runner/SKILL.md +126 -0
  16. package/skills/gitea-tea/SKILL.md +206 -0
  17. package/skills/gitea-webhooks/SKILL.md +93 -0
  18. package/skills/harbor/SKILL.md +32 -0
  19. package/skills/harbor-api/SKILL.md +231 -0
  20. package/skills/harbor-helm/SKILL.md +238 -0
  21. package/skills/harbor-terraform/SKILL.md +233 -0
  22. package/skills/higress/SKILL.md +27 -0
  23. package/skills/higress-helm/SKILL.md +328 -0
  24. package/skills/higress-operator/SKILL.md +435 -0
  25. package/skills/kserve/SKILL.md +28 -0
  26. package/skills/kserve-helm/SKILL.md +330 -0
  27. package/skills/kserve-operator/SKILL.md +763 -0
  28. package/skills/kubeflow/SKILL.md +33 -0
  29. package/skills/kubeflow-pipelines/SKILL.md +392 -0
  30. package/skills/kubeflow-trainer/SKILL.md +429 -0
  31. package/skills/kubeflow-training-operator/SKILL.md +176 -0
  32. package/skills/mariadb/SKILL.md +27 -0
  33. package/skills/mariadb-helm/SKILL.md +378 -0
  34. package/skills/mariadb-operator/SKILL.md +1114 -0
  35. package/skills/nvidia-device-plugin/SKILL.md +204 -0
  36. package/skills/rook-ceph/SKILL.md +22 -0
  37. package/skills/rook-ceph-operator/SKILL.md +150 -0
  38. package/skills/rook-ceph-toolbox/SKILL.md +220 -0
  39. package/skills/sealed-secrets/SKILL.md +221 -0
  40. package/skills/stakater-reloader/SKILL.md +259 -0
  41. package/skills/talos/SKILL.md +244 -0
  42. package/skills/tekton/SKILL.md +187 -0
  43. package/skills/vector/SKILL.md +24 -0
  44. package/skills/vector-helm/SKILL.md +186 -0
  45. package/skills/vector-operator/SKILL.md +455 -0
  46. package/skills/victoria-metrics/SKILL.md +35 -0
  47. package/skills/victoriametrics-operator/SKILL.md +248 -0
  48. package/skills/zitadel/SKILL.md +24 -0
  49. package/skills/zitadel-api/SKILL.md +962 -0
  50. package/skills/zitadel-helm/SKILL.md +263 -0
  51. package/skills/zitadel-terraform/SKILL.md +728 -0
@@ -0,0 +1,36 @@
1
+ ---
2
+ name: flux
3
+ description: Use when working with Flux CD — debugging live clusters, writing/auditing Flux resources, or asking Flux CD questions. Routes to 3 sub-skills depending on the task.
4
+ ---
5
+
6
+ # Flux CD
7
+
8
+ Skill router. Pick the right sub-skill based on what user is doing.
9
+
10
+ ## Which Sub-Skill?
11
+
12
+ | User wants to... | Load skill | What it does |
13
+ |---|---|---|
14
+ | Debug a failing HelmRelease/Kustomization on a live cluster | `gitops-cluster-debug` | Inspects Flux resource status, controller logs, traces dependency chains on live K8s |
15
+ | Write/understand Flux CRDs, generate YAML, ask what a concept means | `gitops-knowledge` | CRD schemas, YAML patterns, API versions, Flux concepts, FluxInstance/ResourceSet |
16
+ | Audit a GitOps repo for best practices, deprecated APIs, security | `gitops-repo-audit` | Scans repo files, validates schemas, flags deprecated APIs, checks RBAC/secrets |
17
+
18
+ ## Two Domains
19
+
20
+ **Cluster (live):** HelmRelease stuck, Kustomization failing, FluxInstance broken → `gitops-cluster-debug`
21
+
22
+ **Repo (static):** Write new Flux YAML, understand CRD fields, audit existing repo → `gitops-knowledge` for reference, `gitops-repo-audit` for validation
23
+
24
+ ## Common Task Map
25
+
26
+ | Task | Sub-skill |
27
+ |---|---|
28
+ | "Why is my HelmRelease failing?" | `gitops-cluster-debug` |
29
+ | "Show me how to write a ResourceSet" | `gitops-knowledge` |
30
+ | "Audit my GitOps repo" | `gitops-repo-audit` |
31
+ | "What API version for Flux CRDs?" | `gitops-knowledge` |
32
+ | "Check if my repo has deprecated APIs" | `gitops-repo-audit` |
33
+ | "FluxInstance not ready" | `gitops-cluster-debug` |
34
+ | "Explain OCI-based GitOps" | `gitops-knowledge` |
35
+ | "Check HelmRelease valuesFrom refs" | `gitops-repo-audit` |
36
+ | "Monitor reconciliation, set up alerts" | `gitops-knowledge` |
@@ -0,0 +1,32 @@
1
+ ---
2
+ name: gitea
3
+ description: Use when working with Gitea — route to the correct sub-skill based on what the user needs: API automation, runner management, container registry, webhooks, or tea CLI.
4
+ ---
5
+
6
+ # Gitea (v1.26) — Skill Router
7
+
8
+ Pick the right sub-skill.
9
+
10
+ ## Which Sub-Skill?
11
+
12
+ | User wants to... | Load skill |
13
+ |---|---|
14
+ | Hit REST API endpoints, manage tokens, automate via curl | `gitea-api` |
15
+ | Configure gitea-runner, register/deploy runners, manage Actions | `gitea-runner` |
16
+ | Push/pull OCI images, manage container registry, configure packages | `gitea-registry` |
17
+ | Create/manage webhooks, verify payloads, handle events | `gitea-webhooks` |
18
+ | Use `tea` CLI for issues/PRs/repos/releases | `gitea-tea` |
19
+
20
+ ## Quick Map
21
+
22
+ | Task | Skill |
23
+ |---|---|
24
+ | "Create a token via API" | `gitea-api` |
25
+ | "Deploy a runner on Kubernetes" | `gitea-runner` |
26
+ | "Push a Docker image" | `gitea-registry` |
27
+ | "Set up a webhook for CI" | `gitea-webhooks` |
28
+ | "List my repos with tea" | `gitea-tea` |
29
+ | "Delete a package version" | `gitea-api` |
30
+ | "Register an ephemeral runner" | `gitea-runner` |
31
+ | "Multi-arch build and push" | `gitea-registry` |
32
+ | "Verify webhook HMAC signature" | `gitea-webhooks` |
@@ -0,0 +1,104 @@
1
+ ---
2
+ name: gitea-api
3
+ description: Use when working with the Gitea REST API — authentication, token management, repository/issue/PR CRUD, package management, admin operations, and general API automation with curl.
4
+ ---
5
+
6
+ # Gitea REST API (v1.26)
7
+
8
+ Base: `https://gitea.example.com/api/v1`. Swagger: `https://gitea.example.com/api/swagger`. OpenAPI spec: `https://gitea.example.com/swagger.v1.json`.
9
+
10
+ ## Authentication
11
+
12
+ | Method | Header / Param | Use Case |
13
+ |--------|---------------|----------|
14
+ | Token | `Authorization: token <token>` | API tokens from Settings > Applications |
15
+ | Basic Auth | `-u username:password` | Creating tokens (`POST /users/:name/tokens`) |
16
+ | OAuth2 Bearer | `Authorization: bearer <token>` | OAuth2 access tokens |
17
+ | URL param | `?token=<token>` | Simple scripts |
18
+ | SSH signatures | `Signature` header with SSH key | mTLS-style auth via SSH |
19
+
20
+ 2FA: add header `X-Gitea-OTP: 123456` with Basic Auth.
21
+
22
+ ## Token Scopes
23
+
24
+ `"scopes": ["all"]` or fine-grained: `["repo", "write:repository", "read:user", "read:organization"]`. Create via UI or `POST /api/v1/users/{username}/tokens`.
25
+
26
+ ## Key Endpoints
27
+
28
+ ### Users & Auth
29
+
30
+ | Method | Endpoint | Purpose |
31
+ |--------|----------|---------|
32
+ | GET | `/user` | Current user info |
33
+ | GET | `/users/{username}` | Get user |
34
+ | POST | `/users/{username}/tokens` | Create API token (Basic Auth required) |
35
+
36
+ ### Repositories
37
+
38
+ | Method | Endpoint | Purpose |
39
+ |--------|----------|---------|
40
+ | GET | `/repos/{owner}/{repo}` | Get repository |
41
+ | POST | `/repos/{owner}/{repo}` | Create repository |
42
+ | POST | `/repos/{owner}/{repo}/mirrors` | Sync mirror |
43
+
44
+ ### Issues & Pull Requests
45
+
46
+ | Method | Endpoint | Purpose |
47
+ |--------|----------|---------|
48
+ | POST | `/repos/{owner}/{repo}/issues` | Create issue |
49
+ | GET | `/repos/{owner}/{repo}/issues` | List issues (filters: state, labels, created_by) |
50
+ | POST | `/repos/{owner}/{repo}/pulls` | Create pull request |
51
+ | GET | `/repos/{owner}/{repo}/pulls` | List PRs |
52
+
53
+ ### Organizations
54
+
55
+ | Method | Endpoint | Purpose |
56
+ |--------|----------|---------|
57
+ | GET | `/orgs/{org}` | Get organization |
58
+ | POST | `/orgs/{org}/teams` | Create team |
59
+
60
+ ### Admin
61
+
62
+ | Method | Endpoint | Purpose |
63
+ |--------|----------|---------|
64
+ | GET | `/admin/users` | List users (supports sorting/filtering) |
65
+ | POST | `/admin/users` | Create user |
66
+ | POST | `/admin/hooks` | Create system/default webhook |
67
+ | GET | `/admin/hooks?type=system\|default` | List admin webhooks |
68
+
69
+ ### Packages
70
+
71
+ | Method | Endpoint | Purpose |
72
+ |--------|----------|---------|
73
+ | GET | `/packages/{owner}` | List packages |
74
+ | DELETE | `/packages/{owner}/{type}/{name}/{version}` | Delete package version |
75
+
76
+ ## Examples
77
+
78
+ ```bash
79
+ # Create an issue
80
+ curl -X POST https://git.example.com/api/v1/repos/myorg/myrepo/issues \
81
+ -H "Authorization: token <token>" \
82
+ -H "Content-Type: application/json" \
83
+ -d '{"title": "Bug", "body": "Description", "labels": [1, 2]}'
84
+
85
+ # List PRs with filters
86
+ curl "https://git.example.com/api/v1/repos/myorg/myrepo/pulls?state=open&sort=recentupdate" \
87
+ -H "Authorization: token <token>"
88
+
89
+ # Create API token (Basic Auth required)
90
+ curl -X POST https://git.example.com/api/v1/users/myuser/tokens \
91
+ -u myuser:mypassword \
92
+ -H "Content-Type: application/json" \
93
+ -d '{"name": "ci-token", "scopes": ["repo", "write:repository"]}'
94
+
95
+ # Delete a package version
96
+ curl -X DELETE "https://git.example.com/api/v1/packages/myorg/container/myapp/1.0.0" \
97
+ -H "Authorization: token <token>"
98
+ ```
99
+
100
+ ## Common Mistakes
101
+
102
+ - **2FA users** — must pass `X-Gitea-OTP` header with Basic Auth when creating tokens
103
+ - **Token as query param** — `?token=...` works but logs expose it. Prefer header.
104
+ - **Package delete needs all segments** — owner, type, name, version. Missing one = 404.
@@ -0,0 +1,71 @@
1
+ ---
2
+ name: gitea-registry
3
+ description: Use when working with the Gitea container registry — OCI/Docker v2 API, push/pull images, multi-arch builds, package management via API, and configuration for supported package types.
4
+ ---
5
+
6
+ # Gitea Container Registry (v1.26)
7
+
8
+ OCI-compatible registry using Docker Registry API v2. Supports Docker images, Helm charts, and all OCI artifacts.
9
+
10
+ ## Auth
11
+
12
+ ```bash
13
+ docker login git.example.com
14
+ # Username: gitea username
15
+ # Password: personal access token (NOT account password for 2FA users)
16
+ ```
17
+
18
+ ## Image Naming
19
+
20
+ ```
21
+ {registry}/{owner}/{image}:{tag}
22
+ ```
23
+
24
+ Examples: `git.example.com/testuser/myapp:latest`, `git.example.com/myorg/backend:v1.2.3`
25
+
26
+ ## Push / Pull
27
+
28
+ ```bash
29
+ docker tag myapp:latest git.example.com/testuser/myapp:latest
30
+ docker push git.example.com/testuser/myapp:latest
31
+
32
+ docker pull git.example.com/testuser/myapp:latest
33
+ ```
34
+
35
+ ## Multi-Arch
36
+
37
+ ```bash
38
+ docker buildx build --platform linux/amd64,linux/arm64 \
39
+ -t git.example.com/testuser/myapp:latest --push .
40
+ ```
41
+
42
+ ## API
43
+
44
+ ```bash
45
+ # List packages for owner
46
+ curl -H "Authorization: token <token>" \
47
+ https://git.example.com/api/v1/packages/testuser
48
+
49
+ # Delete package version
50
+ curl -X DELETE -H "Authorization: token <token>" \
51
+ https://git.example.com/api/v1/packages/testuser/container/myapp/1.0.0
52
+ ```
53
+
54
+ ## Supported Package Types
55
+
56
+ alpine, cargo, chef, composer, conan, conda, container, cran, debian, generic, go, helm, maven, npm, nuget, pub, pypi, rpm, rubygems, swift, vagrant, **terraform** (v1.26+).
57
+
58
+ ## Config
59
+
60
+ ```ini
61
+ [packages]
62
+ ENABLED = true
63
+ LIMIT_SIZE_CONTAINER = -1 # No size limit for container images
64
+ ```
65
+
66
+ ## Common Mistakes
67
+
68
+ - **Tag case** — Tags are case-insensitive. `image:Tag` and `image:tag` are the same image.
69
+ - **Auth for 2FA users** — Always use a personal access token as password, not account password.
70
+ - **Delete needs all segments** — REST delete endpoint requires owner, type, name, and version.
71
+ - **Helm chart push** — Use `helm push` with OCI format: `helm push mychart-1.0.0.tgz oci://git.example.com/myorg`.
@@ -0,0 +1,126 @@
1
+ ---
2
+ name: gitea-runner
3
+ description: Use when configuring Gitea Actions runners — registration, deployment modes, Docker vs host mode, Talos/Kubernetes host-mode, ephemeral runners, and v1.26 Actions features.
4
+ ---
5
+
6
+ # Gitea Runner (v1.0.6)
7
+
8
+ Formerly `act_runner`. Renamed in v1.0.0 (May 2026). Binary: `gitea-runner`. Image: `gitea/runner`. Latest: **v1.0.6**.
9
+
10
+ ## Registration
11
+
12
+ Tokens at instance/admin, org, or repo level in Settings > Actions > Runners.
13
+
14
+ ```bash
15
+ # Interactive
16
+ gitea-runner register
17
+
18
+ # Non-interactive
19
+ gitea-runner register --no-interactive \
20
+ --instance https://git.example.com \
21
+ --token <token> \
22
+ --name my-runner \
23
+ --labels ubuntu-latest:docker://node:20-bookworm
24
+
25
+ # Ephemeral (single-job runner, then exits)
26
+ gitea-runner register --no-interactive --ephemeral \
27
+ --instance https://git.example.com \
28
+ --token <token>
29
+ ```
30
+
31
+ Token also via CLI: `gitea --config /etc/gitea/app.ini actions generate-runner-token`.
32
+
33
+ ## Running
34
+
35
+ ```bash
36
+ gitea-runner daemon --config config.yaml
37
+ ```
38
+
39
+ Generate default config: `gitea-runner generate-config > config.yaml`.
40
+
41
+ ## Labels Format
42
+
43
+ ```
44
+ <label>:<scheme>://<image>
45
+ ```
46
+
47
+ - `:host` suffix — runs step on host (no Docker required)
48
+ - `:docker://image` — runs step in container
49
+ - `ubuntu-latest:docker://node:20-bookworm` — label `ubuntu-latest` runs in `node:20-bookworm` container
50
+
51
+ ## Deployment Modes
52
+
53
+ | Mode | Description | Docker Required |
54
+ |------|-------------|----------------|
55
+ | **Host** | Steps run directly on host process | No |
56
+ | **Docker** | Steps in sibling containers via socket | Yes (`/var/run/docker.sock`) |
57
+ | **DinD** | Rootless, own Docker daemon in container | Yes (privileged container) |
58
+
59
+ ### Kubernetes / Talos (Host Mode)
60
+
61
+ Talos has no Docker socket. Must use host mode with `:host` labels:
62
+
63
+ ```yaml
64
+ apiVersion: apps/v1
65
+ kind: Deployment
66
+ metadata:
67
+ name: gitea-runner
68
+ namespace: gitea
69
+ spec:
70
+ replicas: 1
71
+ selector:
72
+ matchLabels:
73
+ app: gitea-runner
74
+ template:
75
+ metadata:
76
+ labels:
77
+ app: gitea-runner
78
+ spec:
79
+ containers:
80
+ - name: runner
81
+ image: gitea/runner:latest
82
+ env:
83
+ - name: GITEA_INSTANCE_URL
84
+ value: https://git.example.com
85
+ - name: GITEA_RUNNER_REGISTRATION_TOKEN
86
+ valueFrom:
87
+ secretKeyRef:
88
+ name: runner-token
89
+ key: token
90
+ - name: GITEA_RUNNER_LABELS
91
+ value: "ubuntu-latest:host"
92
+ ```
93
+
94
+ Runner container must include tools its workflows need (curl, git, node, etc.).
95
+
96
+ ### Docker Mode
97
+
98
+ ```bash
99
+ docker run -d \
100
+ -e GITEA_INSTANCE_URL=https://git.example.com \
101
+ -e GITEA_RUNNER_REGISTRATION_TOKEN=<token> \
102
+ -e GITEA_RUNNER_NAME=runner-1 \
103
+ -v /var/run/docker.sock:/var/run/docker.sock \
104
+ gitea/runner:latest
105
+ ```
106
+
107
+ ## Ephemeral Runners
108
+
109
+ Set `GITEA_RUNNER_EPHEMERAL=1`. Runner runs exactly one job then exits. Use `workflow_job` webhook to autoscale (spin up new runner per job).
110
+
111
+ ## v1.26 Actions Features
112
+
113
+ - **Concurrency groups** — GitHub-style `concurrency:` in workflows
114
+ - **Per-runner disable/pause** — toggle via UI, no unregister needed
115
+ - **Rerun failed jobs** — button in UI
116
+ - **Configurable token permissions** — `permissions:` block in workflows
117
+ - **Non-zipped artifacts** — action v7 format
118
+ - **Private repo workflows** — reusable workflows from private repos
119
+ - **Workflow dependencies graph** — visual dependency tree in UI
120
+
121
+ ## Common Mistakes
122
+
123
+ - **Stale image** — `gitea/act_runner` is deprecated. Use `gitea/runner`.
124
+ - **No `:host` on Talos** — Without Docker socket, labels must use `:host` suffix. Runner will fail trying to spawn containers.
125
+ - **Registration token via GET removed** — v1.26 removed `GET /api/v1/admin/runners/registration-token`. Use UI or `gitea actions generate-runner-token`.
126
+ - **Cache config** — `cache.external_server` now requires `cache.external_secret` (v1.0.0+). Set both or cache fails.
@@ -0,0 +1,206 @@
1
+ ---
2
+ name: gitea-tea
3
+ description: Work with Gitea using tea CLI for auth, repo, issue, pull request, release, actions, webhook, and notification workflows. Use when user references Gitea, self-hosted git forges, or asks for tea commands.
4
+ ---
5
+
6
+ # Gitea + tea CLI
7
+
8
+ Use this skill when tasks target Gitea and the `tea` CLI, especially if the user would normally use `gh` on GitHub.
9
+
10
+ ## When To Use
11
+
12
+ - User mentions Gitea, self-hosted git, forgejo-compatible flows, or `tea`
13
+ - You need CLI automation for issues, pull requests, repos, comments, or releases
14
+ - You need host-specific auth profiles (multiple Gitea instances)
15
+ - Managing Gitea Actions (secrets, variables, runners, workflow runs)
16
+ - Managing webhooks, notifications, or admin tasks
17
+
18
+ ## Core Rules
19
+
20
+ 1. Prefer `tea` over `gh` for Gitea targets.
21
+ 2. Always scope commands to target explicitly when ambiguity exists:
22
+ - `--repo owner/name`
23
+ - `--login <profile>`
24
+ - `--remote <remote-name>`
25
+ 3. If command flags differ by tea version, run `tea <cmd> --help` first and follow local help text.
26
+ 4. For PR/review actions, ensure local branches are pushed before create/merge operations.
27
+
28
+ ## Auth Workflow
29
+
30
+ ### Create login profile (token)
31
+
32
+ ```bash
33
+ tea logins add --name <profile> --url https://git.kubexa.tech --token <token>
34
+ ```
35
+
36
+ ### Verify logins / switch default
37
+
38
+ ```bash
39
+ tea logins ls
40
+ tea logins default <profile>
41
+ ```
42
+
43
+ ### Quick auth check
44
+
45
+ ```bash
46
+ tea whoami # Show current user
47
+ ```
48
+
49
+ ### Optional env-based auth (automation)
50
+
51
+ - `GITEA_SERVER_URL`
52
+ - `GITEA_SERVER_TOKEN`
53
+ - `GITEA_SERVER_USER`
54
+ - `GITEA_SERVER_PASSWORD`
55
+
56
+ ## Command Mapping (gh -> tea)
57
+
58
+ - Repo list: `gh repo list` -> `tea repos ls`
59
+ - Issue list: `gh issue list` -> `tea issues ls`
60
+ - Issue create: `gh issue create` -> `tea issues create`
61
+ - PR list: `gh pr list` -> `tea pulls ls` or `tea pr ls`
62
+ - PR create: `gh pr create` -> `tea pulls create`
63
+ - PR checkout: `gh pr checkout <n>` -> `tea pulls checkout <n>`
64
+ - Comment on PR/issue: `gh pr comment` / `gh issue comment` -> `tea comment <index> [body]`
65
+ - Release list/create: `gh release list/create` -> `tea releases ls` / `tea releases create`
66
+
67
+ ## Practical Patterns
68
+
69
+ ### Work on a specific repo
70
+
71
+ ```bash
72
+ tea issues ls --repo owner/name --login <profile>
73
+ tea pulls ls --repo owner/name --login <profile>
74
+ ```
75
+
76
+ ### Create issue / PR
77
+
78
+ ```bash
79
+ tea issues create --repo owner/name --title "Title" --description "Details"
80
+ tea pulls create --repo owner/name --head <branch> --title "Title" --description "Details"
81
+ ```
82
+
83
+ ### Review / merge PR
84
+
85
+ ```bash
86
+ tea pulls review <index>
87
+ tea pulls approve <index>
88
+ tea pulls merge <index>
89
+ ```
90
+
91
+ ### Release workflow
92
+
93
+ ```bash
94
+ tea releases create --repo owner/name --tag vX.Y.Z --title "vX.Y.Z"
95
+ tea releases assets --help
96
+ ```
97
+
98
+ ### Clone repo
99
+
100
+ ```bash
101
+ tea clone <repo-slug> [target-dir]
102
+ tea clone gitea/tea # Short form
103
+ tea clone https://git.kubexa.tech/owner/repo.git # Full URL
104
+ ```
105
+
106
+ Supports various slug formats: `owner/repo`, `host/owner/repo`, full URLs. Overrides login when host specified.
107
+
108
+ ## Gitea Actions
109
+
110
+ ### Repository actions (secrets, variables, runs, workflows)
111
+
112
+ ```bash
113
+ tea actions secrets ls --repo owner/name
114
+ tea actions secrets create --repo owner/name <name> <value>
115
+
116
+ tea actions variables ls --repo owner/name
117
+ tea actions variables set --repo owner/name <key> <value>
118
+
119
+ tea actions runs ls --repo owner/name
120
+ tea actions runs view <run-id> --repo owner/name
121
+ tea actions runs logs <run-id> --repo owner/name
122
+
123
+ tea actions workflows ls --repo owner/name
124
+ tea actions workflows dispatch <workflow-id> --repo owner/name
125
+ tea actions workflows enable <workflow-id> --repo owner/name
126
+ tea actions workflows disable <workflow-id> --repo owner/name
127
+ ```
128
+
129
+ ### Host-mode runner on Talos
130
+
131
+ Talos has no Docker socket, so standard dind runners won't work. Use host-mode runner:
132
+
133
+ ```yaml
134
+ apiVersion: apps/v1
135
+ kind: Deployment
136
+ metadata:
137
+ name: gitea-runner
138
+ spec:
139
+ template:
140
+ spec:
141
+ containers:
142
+ - name: runner
143
+ image: gitea/runner:latest
144
+ env:
145
+ - name: GITEA_INSTANCE_URL
146
+ value: https://git.kubexa.tech
147
+ - name: GITEA_RUNNER_REGISTRATION_TOKEN
148
+ valueFrom:
149
+ secretKeyRef:
150
+ name: gitea-runner-token
151
+ key: token
152
+ - name: GITEA_RUNNER_LABELS
153
+ value: "ubuntu-latest:host" # Host mode = no Docker
154
+ ```
155
+
156
+ - Label must include `:host` suffix for host-mode execution
157
+ - Job steps run as processes inside the runner container
158
+ - Runner container needs tools that workflows require (curl, git, etc.)
159
+ - For Kubernetes-specific workflows, mount kubeconfig or use SA token
160
+
161
+ ## Notifications
162
+
163
+ ```bash
164
+ tea notifications ls # List unread + pinned (default)
165
+ tea notifications ls --types issue,pull # Filter by type
166
+ tea notifications read <id> # Mark as read
167
+ tea notifications unread <id> # Mark as unread
168
+ ```
169
+
170
+ Defaults to current repo only. Use `--mine` for cross-repo notifications.
171
+
172
+ ## Webhooks
173
+
174
+ ```bash
175
+ tea webhooks ls --repo owner/name
176
+ tea webhooks create https://hook.example.com/endpoint --repo owner/name --type gitea --events push
177
+ tea webhooks create --org my-org --type slack --events issues --secret <secret>
178
+ tea webhooks delete <id> --repo owner/name
179
+ ```
180
+
181
+ `--type` options: `gitea`, `gogs`, `slack`, `discord`, `dingtalk`, `telegram`, `msteams`, `feishu`, `wechatwork`, `packagist`. Default events: `push`. Supports `--org` (org-level hooks) and `--global` (instance-wide).
182
+
183
+ ## Admin
184
+
185
+ ```bash
186
+ tea admin users ls # List registered users
187
+ tea admin users list --login admin # Requires admin token
188
+ ```
189
+
190
+ Only `users` subcommand currently. Requires login with admin privileges.
191
+
192
+ ## Safety + Verification
193
+
194
+ - Run read-only commands first (`ls`, `list`, `view`) before mutating operations.
195
+ - If repo context unclear, require explicit `--repo` and `--login`.
196
+ - Before destructive actions (`delete`, `close`, `merge`), confirm target index and repository.
197
+ - For actions: check workflow runs with `ls` before `cancel`/`delete`.
198
+ - If command fails, capture `tea <subcommand> --help` output and adapt flags to installed version.
199
+
200
+ ## Troubleshooting
201
+
202
+ - Auth failures: re-check login profile URL/token; verify `tea logins ls`.
203
+ - Wrong target host/repo: pass both `--login` and `--repo` explicitly.
204
+ - PR creation errors: ensure branch is pushed and upstream is configured.
205
+ - TLS issues on internal hosts: prefer proper CA trust; use insecure flags only when user explicitly accepts risk.
206
+ - Actions runner registration: pre-create the runner token in Gitea UI (Settings > Actions > Runners) or use API.
@@ -0,0 +1,93 @@
1
+ ---
2
+ name: gitea-webhooks
3
+ description: Use when managing Gitea webhooks — creating webhooks via API, understanding event types, system vs repo vs org webhooks, payload verification with HMAC-SHA256, and supported webhook formats.
4
+ ---
5
+
6
+ # Gitea Webhooks (v1.26)
7
+
8
+ ## Events
9
+
10
+ | Event | Trigger |
11
+ |-------|---------|
12
+ | `push` | Git push |
13
+ | `create` / `delete` | Branch/tag created or deleted |
14
+ | `fork` | Repo forked |
15
+ | `issues` | Issue opened/closed/reopened/edited/deleted |
16
+ | `issue_assign` | Issue assigned/unassigned |
17
+ | `issue_label` | Issue labels updated |
18
+ | `issue_comment` | Comment on issue |
19
+ | `pull_request` | PR opened/closed/reopened/edited/synced |
20
+ | `pull_request_review_approved` | PR approved |
21
+ | `pull_request_review_rejected` | PR rejected |
22
+ | `pull_request_review_comment` | PR review comment |
23
+ | `pull_request_review_request` | Review requested |
24
+ | `wiki` | Wiki edited |
25
+ | `repository` | Repo created/deleted |
26
+ | `release` | Release published/updated/deleted |
27
+ | `package` | Package published |
28
+ | `status` | Commit status updated |
29
+ | `workflow_run` | Actions workflow run completed |
30
+ | `workflow_job` | Actions workflow job ready (autoscaling trigger) |
31
+
32
+ ## API
33
+
34
+ ```bash
35
+ # Create repo webhook
36
+ curl -X POST https://git.example.com/api/v1/repos/{owner}/{repo}/hooks \
37
+ -H "Authorization: token <token>" \
38
+ -H "Content-Type: application/json" \
39
+ -d '{
40
+ "type": "gitea",
41
+ "config": {
42
+ "url": "https://example.com/webhook",
43
+ "content_type": "json",
44
+ "secret": "my-secret"
45
+ },
46
+ "events": ["push", "pull_request"],
47
+ "active": true
48
+ }'
49
+
50
+ # List webhooks
51
+ curl https://git.example.com/api/v1/repos/{owner}/{repo}/hooks \
52
+ -H "Authorization: token <token>"
53
+
54
+ # Delete webhook
55
+ curl -X DELETE https://git.example.com/api/v1/repos/{owner}/{repo}/hooks/{id} \
56
+ -H "Authorization: token <token>"
57
+ ```
58
+
59
+ ## System vs Repo Webhooks
60
+
61
+ | Type | Scope | API Endpoint |
62
+ |------|-------|-------------|
63
+ | Repository | Single repo | `POST /api/v1/repos/{owner}/{repo}/hooks` |
64
+ | Organization | All repos in org | `POST /api/v1/orgs/{org}/hooks` |
65
+ | System | All repos instance-wide | `POST /api/v1/admin/hooks` (`config.is_system_webhook: true`) |
66
+ | Default | Template for new repos | `POST /api/v1/admin/hooks` (`config.is_system_webhook: false`) |
67
+
68
+ ## Payload Verification
69
+
70
+ Gitea signs the raw request body with HMAC-SHA256 using the configured secret.
71
+
72
+ **Header:** `X-Gitea-Signature`
73
+
74
+ **Verify server-side:**
75
+ ```python
76
+ import hmac, hashlib
77
+
78
+ signature = request.headers.get("X-Gitea-Signature")
79
+ expected = hmac.new(secret.encode(), request.body, hashlib.sha256).hexdigest()
80
+ if not hmac.compare_digest(signature, expected):
81
+ abort(401)
82
+ ```
83
+
84
+ ## Webhook Types (format)
85
+
86
+ `gitea` (generic JSON), `gogs`, `slack`, `discord`, `dingtalk`, `telegram`, `msteams`, `feishu`, `wechatwork`, `packagist`.
87
+
88
+ ## Common Mistakes
89
+
90
+ - **HMAC algorithm** — Gitea uses SHA256, not SHA1. Check `X-Gitea-Signature` header.
91
+ - **System webhook flag** — Must set `config.is_system_webhook` to `true` for instance-wide webhooks. Defaults to false (template webhook).
92
+ - **Event names** — Use snake_case in API: `pull_request`, `issue_comment`. Verify against docs.
93
+ - **workflow_job for autoscaling** — Use `workflow_job` event (not `workflow_run`) to trigger ephemeral runner spin-up.