Commit Graph

20894 Commits

Author SHA1 Message Date
Jonathan Miller 0166a6d02a feat(ci): add upstream bug sync workflow
Branch Policy Check / Verify merge target (pull_request) Failing after 1s
Adds a scheduled workflow that runs daily at 08:00 UTC to automatically
detect new bug fixes merged into upstream Gitea's release/v1.26 branch
and create corresponding issues in the MokoGitea tracker.

The workflow:
- Queries GitHub Search API for recently merged fix/security PRs
- Cross-references against existing MokoGitea issues to avoid duplicates
- Creates labeled issues (type: bug, upstream, priority, security)
- Supports manual dispatch with configurable lookback period

Requires secrets: GH_TOKEN (GitHub), GITEA_TOKEN (MokoGitea)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-24 03:28:47 -05:00
jmiller 0f543903fb Merge pull request 'fix: backport upstream v1.26.2 critical fixes' (#139) from fix/upstream-v1.26.2-backports into main 2026-05-24 04:30:33 +00:00
Giteabot ec02fb9cf8 fix: treat email addresses case-insensitively (#37600) (#37611)
Branch Policy Check / Verify merge target (pull_request) Failing after 1s
2026-05-23 23:19:32 -05:00
Giteabot f639940608 Fix scheduled action panic with null event payload (#37459) (#37466)
Backport #37459 by cyphercodes

This fixes the scheduled action panic when an event payload is JSON
`null` by initializing the payload map before adding `schedule`. It also
adds regression coverage for the null-payload case.

Fixes #37447.

Co-authored-by: Rayan Salhab <r.salhab@aiyexpertsolutions.com>
Co-authored-by: cyphercodes <cyphercodes@users.noreply.github.com>
Co-authored-by: Hermes Agent (GPT-5.5) <hermes-agent@users.noreply.github.com>
Co-authored-by: Nicolas <bircni@icloud.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Claude (Opus 4.7) <noreply@anthropic.com>
2026-05-23 23:17:46 -05:00
jmiller 482ad13ff1 Merge pull request 'fix(ui): actions runs list broken row layout' (#138) from fix/136-actions-concurrency-nil-panic into main 2026-05-24 03:51:51 +00:00
Jonathan Miller 8b5abc6b1e fix(actions): align runs list template classes with refactored CSS
Branch Policy Check / Verify merge target (pull_request) Failing after 1s
The runs_list.tmpl used old class names (flex-list, flex-item,
flex-item-leading, flex-item-main, flex-item-trailing, flex-item-title,
flex-item-body) that no longer exist in the CSS. The shared flex-list
stylesheet was refactored to use flex-divided-list, items-with-main,
item, item-leading, item-main, item-trailing, item-title, item-body.

Without matching CSS, the Actions runs list lost all flex layout — items
were not displayed as proper rows.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-23 22:47:48 -05:00
jmiller 7a06e44e24 Merge pull request 'fix(actions): nil pointer dereference in concurrency during PR creation' (#137) from fix/136-actions-concurrency-nil-panic into main
fix(actions): nil pointer dereference in concurrency during PR creation (#137)

Closes #136
2026-05-24 03:26:39 +00:00
Jonathan Miller a804ebcf09 fix(actions): nil pointer dereference in concurrency during PR creation
Branch Policy Check / Verify merge target (pull_request) Failing after 1s
InsertRun passed nil for the attempt parameter to
EvaluateRunConcurrencyFillModel, which then dereferenced the nil
pointer at concurrency.go:39 when writing ConcurrencyGroup and
ConcurrencyCancel fields. This caused a server panic whenever a PR was
created via the API on a repo with workflow-level concurrency
configured.

The fix:
- Creates an ActionRunAttempt struct in InsertRun before calling
  EvaluateRunConcurrencyFillModel, and reuses it for
  PrepareToStartRunWithConcurrency
- Updates EvaluateRunConcurrencyFillModel to write concurrency fields
  to both the run (for DB persistence) and the attempt (for in-memory
  concurrency checks), with a nil guard on the attempt
- Fixes TestEvaluateRunConcurrency_RunIDFallback which had the wrong
  argument count and was not testing the attempt path

Closes #136

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-23 18:18:06 -05:00
Jonathan Miller 3ec28c7f6a fix(api): load repo before assignee update in bulk endpoint
Fixes nil pointer dereference in BulkSetIssueAssignees — the issue's
Repo field must be loaded before UpdateAssignees calls CanAssignTo.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-21 22:38:45 -05:00
Jonathan Miller 6f49a9efbe feat(api): bulk issue operations — labels, state, milestone, assignees (#21)
Add four new API endpoints under /repos/{owner}/{repo}/issues/bulk/ for
performing batch operations across multiple issues in a single request.
Each endpoint returns a partial-failure result with per-issue success/failure.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-21 21:40:25 -05:00
Jonathan Miller a2b951ea43 chore: remove docs/ directory — content lives in wiki
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-21 17:07:32 -05:00
jmiller 8b83c415cf chore: rename .gitea/ to .mokogitea/ [skip ci]
Authored-by: Moko Consulting
2026-05-21 17:14:26 +00:00
jmiller f36125926a chore: rename .gitea/ to .mokogitea/ [skip ci]
Authored-by: Moko Consulting
2026-05-21 17:14:21 +00:00
jmiller 0902e726ed chore: rename .gitea/ to .mokogitea/ [skip ci]
Authored-by: Moko Consulting
2026-05-21 17:14:16 +00:00
jmiller b4907ac75c chore: rename .gitea/ to .mokogitea/ [skip ci]
Authored-by: Moko Consulting
2026-05-21 17:14:11 +00:00
jmiller db4ab6c82e chore: rename .gitea/ to .mokogitea/ [skip ci]
Authored-by: Moko Consulting
2026-05-21 17:14:06 +00:00
jmiller 7b1f539f05 chore: rename .gitea/ to .mokogitea/ [skip ci]
Authored-by: Moko Consulting
2026-05-21 17:14:01 +00:00
jmiller 6c368f81a7 chore: rename .gitea/ to .mokogitea/ [skip ci]
Authored-by: Moko Consulting
2026-05-21 17:13:56 +00:00
jmiller 1ceecaa3de chore: rename .gitea/ to .mokogitea/ [skip ci]
Authored-by: Moko Consulting
2026-05-21 17:13:51 +00:00
jmiller 9b5ac9246b chore: rename .gitea/ to .mokogitea/ [skip ci]
Authored-by: Moko Consulting
2026-05-21 17:13:46 +00:00
jmiller 73f301102a chore: rename .gitea/ to .mokogitea/ [skip ci]
Authored-by: Moko Consulting
2026-05-21 17:13:41 +00:00
jmiller ee57494073 chore: rename .gitea/ to .mokogitea/ [skip ci]
Authored-by: Moko Consulting
2026-05-21 17:13:36 +00:00
jmiller 5fcdc7fff0 chore: rename .gitea/ to .mokogitea/ [skip ci]
Authored-by: Moko Consulting
2026-05-21 17:13:30 +00:00
jmiller b2d6ce9c34 chore: rename .gitea/ to .mokogitea/ [skip ci]
Authored-by: Moko Consulting
2026-05-21 17:13:25 +00:00
jmiller 9e78f1c367 chore: rename .gitea/ to .mokogitea/ [skip ci]
Authored-by: Moko Consulting
2026-05-21 17:13:20 +00:00
jmiller 0d702937fb chore: rename .gitea/ to .mokogitea/ [skip ci]
Authored-by: Moko Consulting
2026-05-21 17:13:15 +00:00
jmiller d891985aac chore: rename .gitea/ to .mokogitea/ [skip ci]
Authored-by: Moko Consulting
2026-05-21 17:13:10 +00:00
jmiller f372bcb998 chore: rename .gitea/ to .mokogitea/ [skip ci]
Authored-by: Moko Consulting
2026-05-21 17:13:04 +00:00
jmiller 8d942b2ebf chore: rename .gitea/ to .mokogitea/ [skip ci]
Authored-by: Moko Consulting
2026-05-21 17:12:58 +00:00
jmiller 01bb4a34ca chore: rename .gitea/ to .mokogitea/ [skip ci]
Authored-by: Moko Consulting
2026-05-21 17:12:52 +00:00
jmiller 3f97efb934 chore: rename .gitea/ to .mokogitea/ [skip ci]
Authored-by: Moko Consulting
2026-05-21 17:12:47 +00:00
jmiller a60f1b7fc8 chore: rename .gitea/ to .mokogitea/ [skip ci]
Authored-by: Moko Consulting
2026-05-21 17:12:41 +00:00
jmiller 026bbce088 chore: rename .gitea/ to .mokogitea/ [skip ci]
Authored-by: Moko Consulting
2026-05-21 17:12:35 +00:00
jmiller b6bfe109d9 chore: rename .gitea/ to .mokogitea/ [skip ci]
Authored-by: Moko Consulting
2026-05-21 17:12:29 +00:00
jmiller 69fe39374d chore: rename .gitea/ to .mokogitea/ [skip ci]
Authored-by: Moko Consulting
2026-05-21 17:12:24 +00:00
Jonathan Miller 6e3f9e2cdf fix: integrate badge presets with existing upstream badge module
Restore original modules/badge/badge.go (upstream) and adapt our
presets to use GenerateBadge() and the existing Badge type.

- Rename Generate → GenerateRepoBadge to avoid conflict
- Add FormatRepoBadgeSVG for SVG rendering
- Add RenderFlat/RenderFlatSquare methods on Badge
- Fix API handler to use new function names

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-20 20:27:03 -05:00
Jonathan Miller 22fa3d16bf fix: badge presets API compatibility
- GetLatestCommitStatus takes db.ListOptions not int
- Use GetRepoLicenses() instead of non-existent repo.License field
- Use repo.Topics instead of repo.HasWiki() (not a method)
- licenseBadge now takes ctx parameter

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-20 20:16:36 -05:00
jmiller 6d2ccb76eb Merge pull request 'feat(notify): native ntfy push notification integration (#41)' (#130) from feat/ntfy-integration into dev 2026-05-21 01:07:29 +00:00
Jonathan Miller a66f88e0bf feat(notify): native ntfy push notification integration (#41)
Add ntfy as a native notification channel via the Notifier interface.

Events notified:
- NewIssue — new issue created
- IssueChangeStatus — issue closed/reopened
- NewPullRequest — new PR opened
- MergePullRequest — PR merged
- NewRelease — new release published
- WorkflowRunStatusUpdate — CI success/failure

Implementation:
- modules/setting/ntfy.go — [ntfy] config section
- services/ntfy/ntfy.go — HTTP POST sender with 5s timeout
- services/ntfy/notifier.go — Notifier implementation (async, non-blocking)

Config:
  [ntfy]
  ENABLED = true
  SERVER_URL = https://ntfy.mokoconsulting.tech
  DEFAULT_TOPIC = mokogitea

Closes #41

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-20 20:06:50 -05:00
jmiller 58782a3920 Merge pull request 'feat(api): native SVG badge engine (#103)' (#127) from feat/badge-engine into dev 2026-05-21 01:04:47 +00:00
jmiller 53b7e378d1 Merge pull request 'feat(metrics): Prometheus app metrics (#42)' (#126) from feat/prometheus-metrics into dev 2026-05-21 01:04:41 +00:00
jmiller ad78bb7c27 Merge pull request 'feat(admin): MokoGitea update checker (#74)' (#125) from feat/update-checker into dev 2026-05-21 01:04:36 +00:00
Jonathan Miller ff016ed888 fix: restore .mokogitea support for issue/PR templates and file icons
These were lost during the src/ revert. Re-add .mokogitea as
first-priority search path for:
- Issue template directories (services/issue/template.go)
- Issue template config candidates
- Single-file issue template candidates (routers/web/repo/issue.go)
- PR template candidates (routers/web/repo/pull.go)
- File icon rules (options/fileicon/material-icon-rules.json)

Already preserved from the revert:
- Workflow dirs (modules/setting/actions.go)
- Repo template file (services/repository/generate.go)
- Vendor analysis (modules/analyze/vendor.go)
- README view (routers/web/repo/view_readme.go)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-20 19:16:20 -05:00
Jonathan Miller 33fd9c5620 test: add .mokogitea test fixtures for workflow and template discovery
Add test workflow and issue template under .mokogitea/ to verify
the dot-folder feature works end-to-end on the live server.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-20 18:27:31 -05:00
Jonathan Miller 6f1b83eb74 feat(api): native SVG badge engine (#103)
Branch Policy Check / Verify merge target (pull_request) Successful in 1s
Self-hosted badge generation at /api/v1/repos/{owner}/{repo}/badge/{type}.svg

Badge types:
- version: latest release tag
- build: commit status (passing/failing/pending)
- license: repo license
- health: composite score (wiki + license + description)

Renders shields.io-compatible flat-style SVG badges with caching.
No external dependencies — uses stdlib html/template.

Closes #103

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-20 04:43:23 -05:00
Jonathan Miller d300cde639 feat(metrics): add active users, actions queue/running to Prometheus (#42)
Branch Policy Check / Verify merge target (pull_request) Successful in 1s
Extend the existing /metrics endpoint with 3 new application metrics:
- gitea_active_users_30d: users active in last 30 days
- gitea_actions_queue_length: pending action jobs
- gitea_actions_running_jobs: currently running jobs

No new dependencies — extends existing collector and statistic model.

Closes #42

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-19 21:44:37 -05:00
Jonathan Miller 05f1ac1a12 feat(admin): add MokoGitea update checker (#74)
Branch Policy Check / Verify merge target (pull_request) Successful in 1s
Replace removed upstream Gitea update checker with MokoGitea-native
version that checks our own releases API.

- New module: modules/updatechecker/ — fetches latest release from
  git.mokoconsulting.tech, compares semver, caches result
- Cron task: runs every 24h (and at startup)
- Admin dashboard: shows green banner when update available
- Configurable via [update_checker] in app.ini

Closes #74

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-19 21:41:10 -05:00
Jonathan Miller 5d84da9ae8 feat(ci): deploy workflow pushes Docker images to container registry
Updated deploy workflow:
- Builds image, pushes to git.mokoconsulting.tech container registry
- Supports dev and production environments via input selector
- Tags: v1.26.1-moko.N (production) or v1.26.1-moko.N-dev (dev)
- Always pushes :latest alongside versioned tag
- Images pullable from any machine via docker pull

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-19 21:18:16 -05:00
Jonathan Miller a8a01ed978 Merge branch 'dev' 2026-05-19 20:32:22 -05:00
Jonathan Miller 871883ef11 fix: add FastCryptoRandomHex/Bytes used by ScriptImport CSP nonces
Add ChaCha8-based fast crypto random functions required by the
TemplateContext.CspScriptNonce() method for Content-Security-Policy
nonce generation. ~20x faster than crypto/rand for session IDs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-19 20:07:27 -05:00