Commit Graph

20952 Commits

Author SHA1 Message Date
Jonathan Miller d541a07263 fix(ui): left-align admin sidebar — fix justify-content and text-align
Branch Policy Check / Verify merge target (pull_request) Successful in 1s
PR RC Release / Build RC Release (pull_request) Successful in 2s
Changed details.toggleable-item summary from justify-content:
space-between to gap + margin-left: auto on the chevron. Added
.flex-container-nav .item rule to force left alignment on all
menu items including standalone links.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-25 23:29:52 -05:00
jmiller 4ef4aeb04a Merge pull request 'feat: admin branding page with uploadable images (#181)' (#182) from feat/181-admin-branding into dev
Branch Policy Check / Verify merge target (pull_request) Successful in 1s
PR RC Release / Build RC Release (pull_request) Successful in 20s
v1.26.1-moko.05.00.00-rc.186
2026-05-26 02:13:37 +00:00
jmiller 4ec61ec260 Merge pull request 'fix: org sidebar not listing members or teams (#183)' (#184) from fix/183-org-sidebar into dev
Branch Policy Check / Verify merge target (pull_request) Successful in 1s
PR RC Release / Build RC Release (pull_request) Successful in 21s
v1.26.1-moko.05.00.00-rc.185
2026-05-26 01:57:26 +00:00
Jonathan Miller b5defc2a4a fix: populate org home sidebar with members, teams, and public member status (#183)
Branch Policy Check / Verify merge target (pull_request) Successful in 1s
PR RC Release / Build RC Release (pull_request) Successful in 2s
The org home page template expects .Members, .NumMembers, .Teams,
.IsOrganizationMember, .IsOrganizationOwner, and .IsPublicMember
but the handler only set OrgOverviewMembers and OrgOverviewTeams
(different key names). The sidebar rendered empty because the
template variables were undefined.

Fixed by adding all required data bindings and capturing the
membersIsPublic map (previously discarded) as a callable function.

Closes #183

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-25 20:56:44 -05:00
Jonathan Miller d77713dd77 feat: admin branding page with uploadable nav icon, logo, and favicon (#181)
Branch Policy Check / Verify merge target (pull_request) Successful in 1s
PR RC Release / Build RC Release (pull_request) Successful in 2s
Add a Branding section to Site Administration where admins can upload
custom images for three separate slots:

- Nav icon (logo-small.png) — top-left corner, 30x30px
- Login logo (logo.png) — login page and homepage
- Favicon (favicon.png) — browser tab icon

Changes:
- New admin route: /-/admin/branding with upload forms
- Templates use AssetUrlPrefix instead of hardcoded external URLs
- Nav bar uses logo-small.png with fallback to logo.png
- Uploads save to custom/public/assets/img/ (persists across restarts)
- SVG overrides auto-removed when PNG is uploaded
- Added logo-small.png as default built-in asset

Closes #181

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-25 20:23:34 -05:00
jmiller a45be34139 Merge pull request 'feat(ci): auto-update updates.xml on production deploy' (#179) from feat/auto-update-xml into dev
Branch Policy Check / Verify merge target (pull_request) Successful in 2s
PR RC Release / Build RC Release (pull_request) Successful in 25s
v1.26.1-moko.05.00.00-rc.180
2026-05-26 00:56:19 +00:00
Jonathan Miller d97955394f feat(ci): auto-update updates.xml on production deploy
Branch Policy Check / Verify merge target (pull_request) Successful in 2s
PR RC Release / Build RC Release (pull_request) Successful in 2s
After a successful production deployment, the deploy workflow now
automatically updates updates.xml on main with the new version,
release URL, and docker image tag for the stable channel.

Dev deployments skip this step — only production releases update
the stable channel.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-25 19:49:04 -05:00
jmiller 592a71968f Merge pull request 'feat(ci): enable maintenance mode during deployments' (#177) from feat/deploy-maintenance-mode into dev
Branch Policy Check / Verify merge target (pull_request) Successful in 2s
PR RC Release / Build RC Release (pull_request) Successful in 23s
v1.26.1-moko.05.00.00-rc.178
2026-05-26 00:35:09 +00:00
Jonathan Miller d55b79a9ff feat(ci): enable maintenance mode during deployments
Branch Policy Check / Verify merge target (pull_request) Successful in 1s
PR RC Release / Build RC Release (pull_request) Successful in 2s
The deploy workflow now:
1. Enables maintenance mode before building (users see maintenance page)
2. Builds, pushes, and restarts the container
3. Disables maintenance mode after health check passes (if: always)

Uses Gitea's built-in maintenance mode via admin config API.
If the instance is already down, the enable step gracefully warns
instead of failing. The disable step runs even if deploy fails
to avoid leaving the instance in maintenance mode.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-25 19:33:59 -05:00
jmiller 64e1e37e20 Merge pull request 'fix: generate checksums on API asset upload' (#175) from feat/release-sha-checksums into dev
Branch Policy Check / Verify merge target (pull_request) Successful in 1s
PR RC Release / Build RC Release (pull_request) Successful in 18s
v1.26.1-moko.05.00.00-rc.176
2026-05-26 00:15:52 +00:00
Jonathan Miller a847129f9c fix: generate checksums on API asset upload, not just CreateRelease
Branch Policy Check / Verify merge target (pull_request) Successful in 1s
PR RC Release / Build RC Release (pull_request) Successful in 2s
The API endpoint POST /releases/{id}/assets bypasses CreateRelease
and UpdateRelease, so checksums were not generated for API uploads.
Added GenerateReleaseChecksums call after successful asset upload.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-25 19:15:12 -05:00
jmiller 30e16cccc1 Merge pull request 'feat: auto-generate SHA256 checksums for release attachments' (#174) from feat/release-sha-checksums into dev 2026-05-26 00:08:48 +00:00
jmiller b74cf800ef Merge pull request 'feat: update checker channels, email + ntfy notifications' (#173) from feat/update-checker-channels into dev 2026-05-26 00:08:09 +00:00
Jonathan Miller 90f612f211 feat: auto-generate SHA256 checksums for release attachments
Branch Policy Check / Verify merge target (pull_request) Successful in 1s
PR RC Release / Build RC Release (pull_request) Successful in 2s
When a release is created or updated with attachments, automatically
compute SHA256 checksums for every file and attach a checksums.sha256
manifest file. The manifest follows the standard sha256sum format:
  <hash>  <filename>

Existing checksums.sha256 files are replaced when attachments change.
Checksums are generated for both CreateRelease and UpdateRelease flows.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-25 19:05:13 -05:00
Jonathan Miller 49fe3cf6eb feat: add ntfy push notification for update checker
Branch Policy Check / Verify merge target (pull_request) Successful in 1s
PR RC Release / Build RC Release (pull_request) Successful in 2s
Update notifications now go through three channels:
- Admin dashboard banner (existing)
- Email to admin (added in previous commit)
- ntfy push notification (new)

Configure in app.ini:
  [ntfy]
  ENABLED = true
  SERVER_URL = https://ntfy.mokoconsulting.tech
  DEFAULT_TOPIC = mokogitea
  TOKEN = (optional bearer token)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-25 18:34:14 -05:00
Jonathan Miller 13352e7213 feat: email admin when MokoGitea update is detected
The update checker now emails the first admin user when a new version
is found on the configured channel. Notifications are deduplicated —
only sent once per new version, not on every cron tick.

- Added NotifyFunc callback in updatechecker module
- Wired to mailer in cron task registration
- Created mail_update.go with plain-text email including version,
  channel, release URL, and docker pull command

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-25 18:24:03 -05:00
Jonathan Miller 07827bcc2e test: bump dev channel to 06.00.00-dev to test update checker
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-25 18:19:32 -05:00
Jonathan Miller 8509932b41 feat: update channel selector dropdown on admin dashboard
Add a dropdown on the admin dashboard to switch between update streams
(stable, rc, beta, alpha, development) matching the Joomla pattern.

Changes:
- Admin dashboard shows channel selector with descriptions
- POST handler validates and applies channel change in-memory
- Triggers immediate re-check against updates.xml after switch
- updates.xml has all 5 standard channels with descriptions

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-25 17:58:39 -05:00
Jonathan Miller 8ad1b8a110 chore: align update streams to standard channels (dev/alpha/beta/rc/stable)
Matches the Joomla update server pattern used across all Moko repos.
Removed the non-standard 'security' channel. All five standard
channels now present in updates.xml.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-25 17:55:28 -05:00
Jonathan Miller be5c2d35a5 chore: bump updates.xml to v05.00.00
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-25 17:53:13 -05:00
jmiller 83244e8361 Merge pull request 'chore(core): separate MokoGitea namespace from upstream code.gitea.io' (#171) from feat/132-namespace-separation into main v1.26.1-moko.05.00.00 2026-05-25 21:36:55 +00:00
Jonathan Miller c572fcfe04 chore(core): rename Go module from code.gitea.io/gitea to MokoGitea namespace
PR RC Release / Build RC Release (pull_request) Failing after 0s
Branch Policy Check / Verify merge target (pull_request) Failing after 0s
Rename the Go module path from code.gitea.io/gitea to
git.mokoconsulting.tech/MokoConsulting/MokoGitea across the entire
codebase.

Scope:
- go.mod module declaration
- 2,235 Go source files (import paths)
- Dockerfile WORKDIR and COPY paths
- Swagger API templates
- golangci.yml linter config

External dependencies (code.gitea.io/gitea-vet, code.gitea.io/sdk/gitea,
gitea.com/gitea/act, etc.) are intentionally NOT renamed — they are
separate upstream modules.

Closes #132

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-25 00:22:38 -05:00
jmiller c233878484 feat(ci): add issue-branch.yml [skip ci] 2026-05-25 05:12:46 +00:00
jmiller 39150c6968 Merge pull request 'fix(ci): PR RC workflow YAML fix' (#170) from feat/test-rc-workflow into main 2026-05-25 05:01:00 +00:00
moko-deploy 417bda1735 chore(ci): update RC stream for PR #170 2026-05-25 04:59:38 +00:00
Jonathan Miller f09aadf60c fix(ci): use env var for API_BASE in RC release step
Branch Policy Check / Verify merge target (pull_request) Failing after 1s
PR RC Release / Build RC Release (pull_request) Successful in 19s
The Python heredoc couldn't access shell-local API variable.
Move it to step-level env so os.environ sees it.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
v1.26.1-moko.04.01.00-rc.170
2026-05-24 23:59:15 -05:00
Jonathan Miller fa54fe1ffc fix(ci): rewrite PR RC workflow — move XML generation to Python
Branch Policy Check / Verify merge target (pull_request) Failing after 1s
PR RC Release / Build RC Release (pull_request) Failing after 16s
The previous workflow had raw XML in bash heredocs that broke the
YAML parser during workflow discovery, causing Gitea to silently
skip the entire workflow.

Fix: all XML generation and API calls now use Python heredocs
(<<'PYEOF') which don't contain characters that confuse the YAML
parser. All github context values passed via env vars instead of
inline expressions in run blocks.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-24 23:54:54 -05:00
Jonathan Miller 49fb7bb9a4 test: verify PR RC workflow triggers
Branch Policy Check / Verify merge target (pull_request) Failing after 0s
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-24 23:51:31 -05:00
Jonathan Miller 5dd98c04d8 fix(ci): rewrite PR RC workflow to bypass Gitea branches filter bug
Gitea Actions doesn't reliably evaluate the branches: filter on
pull_request events, causing the workflow to never trigger. Replaced
with a step-level guard that checks github.base_ref at runtime.

Also fixed:
- XML insertion using sed 'e' command instead of shell interpolation
- RC entry removal using Python regex for reliability
- Simplified API URL construction

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-24 23:51:18 -05:00
jmiller ea3957597c Merge pull request 'rc(v04.01.00): release candidate' (#168) from rc/04.01.00 into main v1.26.1-moko.04.01.00 2026-05-25 04:27:24 +00:00
Jonathan Miller 45e08616ac fix(ci): remove draft check from PR RC workflow
Branch Policy Check / Verify merge target (pull_request) Successful in 1s
Gitea Actions may not evaluate github.event.pull_request.draft
correctly, preventing the workflow from triggering entirely.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-24 23:26:16 -05:00
Jonathan Miller 4dafcc5429 fix(ci): remove draft check from PR RC workflow
Gitea Actions may not evaluate github.event.pull_request.draft
correctly, preventing the workflow from triggering entirely.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-24 23:26:13 -05:00
Jonathan Miller 3159d53322 chore: bump version to 04.01.00 for next release cycle
Branch Policy Check / Verify merge target (pull_request) Successful in 1s
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-24 23:21:20 -05:00
Jonathan Miller fff64e6e7c fix(ci): fix RC workflow API URL, update CHANGELOG for v1.26.1-moko.04.00.00
Branch Policy Check / Verify merge target (pull_request) Successful in 1s
- Fix missing https:// protocol in pr-rc-release.yml API URL
- Update comment to remove stale fan-out reference
- Add comprehensive CHANGELOG entry for v1.26.1-moko.04.00.00 release

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-24 23:17:31 -05:00
Jonathan Miller 1d4340a142 feat(ci): auto-build RC release on PR to main
When a PR is opened or updated against main:
- Determines RC version from updates.xml base + PR number
- Creates/updates a prerelease on Gitea tagged as v1.26.1-moko.{version}-rc.{PR#}
- Updates updates.xml with RC channel entry pointing to the PR

Admins on the RC update channel will see the PR build as an available
update, matching the Joomla update server pattern.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-24 23:09:49 -05:00
Jonathan Miller 60670d066b feat: Joomla-style updates.xml with channel selection for update checker
Replace JSON API-based update checking with Joomla-style updates.xml
that supports multiple update streams (stable, dev, security).

Changes:
- Add updates.xml at repo root with stable/dev/security channels
  following the same XML structure as MokoOnyx and other Joomla repos
- Rewrite updatechecker module to parse XML with channel filtering
- Add CHANNEL setting to [update_checker] config (default: stable)
- Show channel name and docker pull command in admin dashboard banner

Config example:
  [update_checker]
  ENABLED = true
  CHANNEL = stable

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-24 22:56:04 -05:00
Jonathan Miller e8b2a485fc fix: remove unused setting import in action.go
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
v1.26.1-moko.04.00.00
2026-05-24 17:47:58 -05:00
Jonathan Miller cd496f159d fix: restore Permission field access in context middleware functions
The upstream reading permission fix (#37781) refactored Repository
to have direct IsAdmin/CanWrite/CanRead methods, but our fork's
Repository struct still uses the Permission field for these.
Keep the new CheckTokenScopes function but use ctx.Repo.Permission.*
for the middleware functions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-24 17:42:17 -05:00
Claude afbff02d81 chore: go mod tidy for security dependency updates
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-24 22:07:57 +00:00
Claude 8355b39ad4 chore: update go.sum for golang.org/x/net v0.55.0 transitive deps
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-24 19:52:16 +00:00
Jonathan Miller c2c9e053ff chore: update version format to 3-part moko semver
Update deploy workflow description to reflect new versioning scheme:
v{upstream}-moko.{major}.{minor}.{patch} (e.g. v1.26.1-moko.04.00.00)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-24 13:29:30 -05:00
jmiller 451b3022bd Merge pull request 'fix: .mod lexer panic, pnpm lockfile, branding updates' (#166) from fix/security-backports into main 2026-05-24 09:14:24 +00:00
Claude 2153d7c916 chore: regenerate pnpm-lock.yaml for mermaid v11.15.0 security update
Branch Policy Check / Verify merge target (pull_request) Failing after 1s
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-24 09:11:14 +00:00
Jonathan Miller 63c801d595 fix: remove invalid .mod lexer mapping, update upstream references to MokoGitea
- Remove .mod -> AMPL mapping from conflictingExtLangMap (AMPL lexer
  doesn't exist in chroma v2.23.1, causing a panic when viewing .mod
  files). Upstream doesn't have this mapping either.
- Update 500 error page issue link to MokoGitea repo
- Update home page install/license links to MokoGitea repo
- Update theme settings link to MokoGitea repo

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-24 04:09:42 -05:00
jmiller 0270be743f Merge pull request 'fix(security): backport 12 upstream security fixes from v1.26.2' (#165) from fix/security-backports into main 2026-05-24 08:53:19 +00:00
Lunny Xiao dbf70a7def fix(deps): update module golang.org/x/net to v0.55.0 [security] (#37813) (#37829)
Branch Policy Check / Verify merge target (pull_request) Failing after 1s
Backport #37813

Co-authored-by: Giteabot <teabot@gitea.io>
Co-authored-by: silverwind <me@silverwind.io>
2026-05-24 03:52:01 -05:00
Nicolas 43b5a54ffa fix(actions): make artifact signature payloads unambiguous (#37707) (#37795)
This PR hardens artifact URL signing by encoding signature inputs in an
unambiguous binary payload before computing the HMAC.

What it changes:

- replace direct concatenation-style signing inputs with explicit
payload builders
- encode string fields with a length prefix before appending their bytes
- encode integer fields as fixed-width binary values instead of decimal
text
- apply the same hardening to both:
  - Actions Artifact V4 signing in `routers/api/actions/artifactsv4.go`
  - artifact download signing in `routers/api/v1/repo/action.go`
- add regression tests that verify distinct field combinations produce
distinct payloads and signatures

Why:

The previous signing logic built HMAC inputs by appending multiple
fields without a strongly structured representation. That kind of
construction can create ambiguity at field boundaries, where different
parameter combinations may serialize into the same byte stream for
signing.

This change removes that ambiguity by constructing a deterministic
payload format with explicit boundaries between fields.

Backport #37707

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Claude (Opus 4.7) <noreply@anthropic.com>
2026-05-24 03:49:09 -05:00
Giteabot b182855fc5 fix(permissions): Fix reading permission (#37769) (#37781) 2026-05-24 03:39:48 -05:00
Lunny Xiao ca6c8c958c fix: Unify public-only token filtering in API queries and repo access checks (#37118) (#37773)
backport #37118 

This PR closes remaining `public-only` token gaps in the API by making
the restriction apply consistently across repository, organization,
activity, notification, and authenticated `/api/v1/user/...` routes.

Previously, `public-only` tokens were still able to:
- receive private results from some list/search/self endpoints,
- access repository data through ID-based lookups,
- and reach several authenticated self routes that should remain
unavailable for public-only access.

This change treats `public-only` as a cross-cutting visibility boundary:
- list/search endpoints now filter private resources consistently,
- repository lookups enforce the same restriction even when addressed
indirectly,
- and self routes that inherently expose or mutate private account state
now reject `public-only` tokens.

---
Generated by a coding agent with Codex 5.2

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Claude (Opus 4.7) <noreply@anthropic.com>
Co-authored-by: Nicolas <bircni@icloud.com>
2026-05-24 03:38:02 -05:00
Giteabot e9efbbc93b fix: Add missed token scope checking (#37735) (#37757)
Backport #37735 by @lunny

Follow #37698

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2026-05-24 03:37:58 -05:00