20847 Commits

Author SHA1 Message Date
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
jmiller b441b0a350 chore: add issue templates [skip ci] 2026-05-20 00:37:37 +00:00
jmiller fcbc28735e chore: add issue templates [skip ci] 2026-05-20 00:37:31 +00:00
jmiller 5c3a36a225 chore: add issue templates [skip ci] 2026-05-20 00:37:25 +00:00
jmiller 8936883a40 chore: add issue templates [skip ci] 2026-05-20 00:37:19 +00:00
jmiller c3af273401 chore: add issue templates [skip ci] 2026-05-20 00:37:14 +00:00
jmiller 77f3a522eb chore: add issue templates [skip ci] 2026-05-20 00:37:08 +00:00
jmiller de2a2c9013 chore: add issue templates [skip ci] 2026-05-20 00:37:03 +00:00
jmiller a78e610040 chore: add issue templates [skip ci] 2026-05-20 00:36:58 +00:00
jmiller 707eec0098 chore: add issue templates [skip ci] 2026-05-20 00:36:53 +00:00
jmiller 8c89a33ecf Merge pull request 'feat(branding): replace all Gitea logos with Moko Consulting branding' (#124) from feat/custom-logo into main 2026-05-20 00:36:17 +00:00
Jonathan Miller 6f82c6af7f feat(branding): replace all Gitea logos with Moko Consulting branding
Branch Policy Check / Verify merge target (pull_request) Failing after 1s
Replace default Gitea logo.svg/logo.png with Moko Consulting logo:
- Home/login page (large logo)
- Navbar (top-left icon)
- OpenID sign-in page
- OpenGraph meta image
- 500 error page

Logo URL: https://mokoconsulting.tech/images/branding/logo.png

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-19 19:32:37 -05:00
Jonathan Miller c74a0d27e4 fix: restore full TemplateContext with ScriptImport, CspNonce methods
Restore context_template.go from commit 82bfde2a37 which added:
- ScriptImport() — generates script tags with CSP nonces
- CspScriptNonce() — generates per-request nonces
- HeadMetaContentSecurityPolicy() — CSP meta header
- CurrentWebBanner() — web banner support
- globalVars — cached script import configuration

These methods were missing from our manual TemplateContext definition,
causing "ScriptImport is not a method" runtime template errors.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-19 15:44:51 -05:00
Jonathan Miller 906682aa14 fix: add sqlite + kin-openapi deps via go get (no tidy)
Minimal dep additions using targeted go get, NOT go mod tidy.
Only adds modernc.org/sqlite v1.20.4 and github.com/getkin/kin-openapi
v0.138.0 with their transitive deps. No existing deps modified.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-19 13:10:09 -05:00
Jonathan Miller 54fe7b82c9 fix: comment out unimplemented Projects API routes
The project API endpoints (ListProjects, CreateProject, etc.) were
added to the router but their handler implementations don't exist.
Comment out until implementations are available.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-19 00:24:18 -05:00
Jonathan Miller 3d0e2971cb fix: remaining CurrentRefSubURL → CurrentRefPath + unused var
- Fix all 9 remaining files with CurrentRefSubURL field name
- Fix unused 'attempt' variable in action.go

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-18 23:02:12 -05:00
Jonathan Miller eaa9a07085 fix: LastRunStartedAt → LastRun, CurrentRefSubURL → CurrentRefPath
- gocron v2.19.1 uses LastRun() not LastRunStartedAt()
- renderhelper.RepoFileOptions uses CurrentRefPath not CurrentRefSubURL

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-18 18:43:50 -05:00
Jonathan Miller 3566874dae fix: revert go.mod/go.sum to pre-tidy state + only add sqlite
The full go mod tidy upgraded gocron, renderhelper, and other deps
to incompatible versions. Revert to the original go.mod and add
ONLY modernc.org/sqlite v1.20.4 via targeted go get.

Verified: go build -tags 'bindata timetzdata' ./... compiles clean.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-18 04:38:57 -05:00
Jonathan Miller a0949e03c1 fix: resolve all services/actions compilation errors
- Rename duplicate NotifyWorkflowRunStatusUpdateWithReload in
  job_emitter.go to notifyWorkflowRunStatusUpdateFromJob (private)
- Fix GenerateGiteaContext call: add ctx and nil attempt/job args
- Fix EvaluateRunConcurrencyFillModel: add nil attempt arg
- Fix EvaluateJobConcurrencyFillModel: add nil attempt arg (2 callers)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-17 19:31:59 -05:00
Jonathan Miller 615867b796 fix: update go.mod/go.sum with resolved transitive dependencies
Run go mod tidy on server (golang:1.26-alpine) to properly resolve
all transitive deps for modernc.org/sqlite and other indirect
requirements. This ensures go generate and go build work without
needing go mod tidy in the Dockerfile.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-17 18:14:09 -05:00
Jonathan Miller be58ffc631 fix: remove go mod tidy from Dockerfile — code compiles without it
Verified: go build ./... succeeds on the server with current go.mod.
The go mod tidy was upgrading dependencies to incompatible versions,
causing all the TemplateContext/convert/concurrency errors. The
go.mod is now correct as-is.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-17 13:57:58 -05:00
Jonathan Miller d8b702169b fix: more concurrency + ToActionWorkflowRun signature mismatches
- Fix ToActionWorkflowRun calls in routers and services/actions
- Fix PrepareToStartRunWithConcurrency 3-value return + type mismatch
- Fix PrepareToStartJobWithConcurrency 3-value return in run.go

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-17 13:28:23 -05:00
Jonathan Miller 5a692ad9cb fix: add ConcurrencyGroup field and GetConcurrentRunsAndJobs
- Add ConcurrencyGroup and ConcurrencyCancel fields to ActionRun
- Add GetConcurrentRunsAndJobs query function
- Fix PrepareToStartJobWithConcurrency 3-value return

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-17 00:02:11 -05:00
Jonathan Miller d68ae34834 fix: remaining runner/act imports + webhook notifier arg order
- Replace 9 more files still using gitea.com/gitea/runner/act/model
  with github.com/nektos/act/pkg/model (resolved via replace directive)
- Fix ToActionWorkflowRun call: args were (ctx, run, nil) but
  signature is (ctx, repo, run)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-16 22:23:08 -05:00
Jonathan Miller 2b9a9b118d fix: use api alias (not structs), fix remaining t.Message
- structs is imported as 'api' — use api.UserVisibility, api.AccessLevelName
- Fix remaining t.Message on line 731 (sed missed non-parenthesized usage)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-16 18:44:11 -05:00
Jonathan Miller 27950bf5a7 fix: resolve services/convert compilation errors
- Tag.Message → Tag.MessageRaw (field renamed in upstream)
- org.Visibility.String() → structs.UserVisibility(...) (typed string)
- t.AccessMode.ToString() → structs.AccessLevelName(...) (typed string)
- GetPossibleUserByID now returns (int64, *User, error)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-16 18:22:26 -05:00
Jonathan Miller 8e2e65f74a fix: add missing TemplateContext type definition
The type was used throughout services/context but never defined —
likely lost during upstream merge. It's a map[string]any that
implements context.Context.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-16 17:56:31 -05:00
Jonathan Miller f707415bfa fix: correct act package paths — use pkg/ prefix
gitea.com/gitea/act organizes packages under pkg/:
- exprparser → pkg/exprparser
- model → pkg/model
- workflowpattern → pkg/workflowpattern

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-16 17:49:47 -05:00
Jonathan Miller 54b28dbde7 fix: add go mod tidy before make backend in Dockerfile
The go generate step needs all deps resolved including indirect ones
(modernc.org/sqlite). Running go mod tidy after COPY resolves them.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-16 17:37:57 -05:00
Jonathan Miller eb55ffc0ed fix: use nektos/act (→ gitea/act) instead of gitea/runner for workflow parsing
The gitea.com/gitea/runner module path doesn't match its actual module
declaration (gitea.com/gitea/act_runner) and has version compatibility
issues. Switch imports to github.com/nektos/act which is already
replaced by gitea.com/gitea/act v0.261.10 in go.mod — same packages,
proven compatible.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-16 17:35:08 -05:00
Jonathan Miller 70ee382ef0 fix: add replace directive for gitea/runner → gitea/act_runner
The module at gitea.com/gitea/runner declares itself as
gitea.com/gitea/act_runner. Add replace to map the import path.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-16 17:31:43 -05:00
Jonathan Miller 6b31e9b619 fix: add gitea/runner and sqlite to go.mod, remove go mod tidy from Docker
Add missing dependencies directly to go.mod instead of relying on
go mod tidy (which pulls incompatible transitive dep upgrades):
- gitea.com/gitea/runner v0.4.1 (for act/workflowpattern imports)
- modernc.org/sqlite v1.20.4 (implicit import from models/auth)

Remove go mod tidy from Dockerfile to prevent version drift.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-16 17:28:40 -05:00
Jonathan Miller fd82cee452 fix: resolve all compilation errors from upstream merge
- Fix CryptoRandomString/CryptoRandomBytes callers (now return error)
- Add missing DiffSlice[T] generic implementation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-16 17:21:35 -05:00
Jonathan Miller de8094d77f feat: deploy workflow, custom logo, Dockerfile OOM fix
- Add .gitea/workflows/deploy-mokogitea.yml (SSH to server, docker build)
- Custom Moko Consulting logo on home/login page
- Dockerfile: add go mod tidy for missing deps, GOFLAGS=-p 1 for OOM

Reverts the src/ reorganization — Go code stays at root per standard
Go module conventions. All .mokogitea dot-folder support retained.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-16 14:34:27 -05:00
Jonathan Miller 96eb394a17 feat: add .mokogitea directory support alongside .gitea and .github
MokoGitea now recognizes .mokogitea/ as a first-class directory for:
- Workflow files (.mokogitea/workflows/) with highest priority
- README rendering from .mokogitea/ directory
- Repository template files (.mokogitea/template)
- Vendor path exclusion

The .gitea and .github directories remain supported for compatibility.

Authored-by: Moko Consulting
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-15 20:19:43 -05:00
Jonathan Miller ddbd592c2f fix: restore dropzone imports from upstream v1.26.1
The merge conflict resolution incorrectly kept @deltablot/dropzone
imports instead of upstream's dropzone package, causing vite build
failure on unresolved import.

Authored-by: Moko Consulting
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-15 20:08:59 -05:00
Jonathan Miller 869586c582 fix: export initRepoPullRequestUpdate for upstream compatibility
Another merge conflict artifact — function existed but wasn't exported,
causing the vite build to fail on missing export.

Authored-by: Moko Consulting
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-12 20:25:51 -05:00
Jonathan Miller 02ac392fba fix: resolve upstream merge build errors
Fix duplicated isGiteaError export in errors.ts and add missing
refissue.ts from v1.26.1 merge.

Authored-by: Moko Consulting
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-12 20:23:20 -05:00
jmiller a26d0bff90 Merge pull request 'feat(actions): show inherited org secrets/variables in repo settings' (#81) from feature/inherited-org-secrets into main 2026-05-13 01:17:18 +00:00
Jonathan Miller c0fccaa759 feat(actions): show inherited org secrets/variables in repo settings
Branch Policy Check / Verify merge target (pull_request) Failing after 10m5s
When viewing repo-level Actions secrets or variables, also display
inherited org-level entries as read-only with an "overridden by
repository" badge when a repo entry shadows an org entry. Includes
a link to org settings for management.

Closes #78

Authored-by: Moko Consulting
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-12 20:03:19 -05:00
jmiller fabcc7ca03 Merge pull request 'merge: upstream Gitea v1.26.1 into MokoGitea' (#80) from merge/v1.26.1 into main 2026-05-13 00:56:32 +00:00
Jonathan Miller 31945210a0 merge: upstream Gitea v1.26.1 into MokoGitea
Branch Policy Check / Verify merge target (pull_request) Successful in 2s
Merges 356 commits from upstream Gitea v1.26.1 (bugfix release).
Resolved conflicts in templates by keeping our HelpURL changes,
all other conflicts resolved by taking upstream.

Closes #70

Authored-by: Moko Consulting
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-12 19:52:45 -05:00
Jonathan Miller d2958254a0 feat(fork): complete MokoGitea fork separation from upstream Gitea
Remove upstream Gitea update checker, replace all docs.gitea.com references
with configurable HelpURL, rebrand default APP_NAME to MokoGitea, enforce
dot-prefixed repo privacy at creation time (create, fork, push-create), and
add system repo explanation in settings UI.

Closes #75, closes #76

Authored-by: Moko Consulting
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-12 19:27:12 -05:00
jmiller ef6a7dcfcf Merge pull request 'feat(repo): enforce dot-prefixed repos as always-private system repos' (#77) from feature/system-repo-private into main 2026-05-13 00:16:12 +00:00
Jonathan Miller c5eb8df8a2 feat(repo): enforce dot-prefixed repos as always-private system repos
compliance / files-changed (pull_request) Successful in 2m48s
pr-title / lint-pr-title (pull_request) Successful in 5s
db-tests / files-changed (pull_request) Successful in 2m53s
docker-dryrun / files-changed (pull_request) Successful in 3m7s
e2e-tests / files-changed (pull_request) Successful in 3m8s
compliance / lint-on-demand (pull_request) Successful in 1m23s
compliance / lint-backend (pull_request) Failing after 4m50s
compliance / frontend (pull_request) Has been skipped
compliance / checks-backend (pull_request) Failing after 5m20s
compliance / backend (pull_request) Failing after 4m15s
db-tests / test-pgsql (pull_request) Failing after 4m7s
db-tests / test-sqlite (pull_request) Failing after 4m29s
db-tests / test-unit (pull_request) Failing after 5m53s
db-tests / test-mysql (pull_request) Failing after 5m21s
docker-dryrun / container-amd64 (pull_request) Has been skipped
docker-dryrun / container-arm64 (pull_request) Has been skipped
docker-dryrun / container-riscv64 (pull_request) Has been skipped
db-tests / test-mssql (pull_request) Failing after 6m30s
e2e-tests / test-e2e (pull_request) Failing after 4m53s
compliance / lint-go-gogit (pull_request) Failing after 33m59s
compliance / lint-go-windows (pull_request) Failing after 33m59s
Repositories with names starting with "." are now treated as system
repositories that are always private and cannot be made public. This is
enforced at every code path: API create, web create, migrate, template
create, push-to-create, API edit, web settings, and public access
settings. On creation paths, privacy is silently forced. On edit paths,
a clear error is returned.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-12 19:12:00 -05:00
jmiller 32955397f0 Merge pull request 'release: promote dev to main — org branch protection & help URLs' (#73) from dev into main 2026-05-12 20:26:19 +00:00
jmiller 71105345ff Merge pull request 'feat(org): add org-level branch protection rulesets & configurable help URLs' (#72) from feature/org-branch-protection into dev
compliance / files-changed (pull_request) Failing after 17m47s
compliance / lint-on-demand (pull_request) Has been skipped
docker-dryrun / files-changed (pull_request) Failing after 27m34s
db-tests / files-changed (pull_request) Failing after 27m41s
e2e-tests / files-changed (pull_request) Successful in 10s
pr-title / lint-pr-title (pull_request) Failing after 13s
compliance / lint-backend (pull_request) Has been skipped
compliance / lint-go-windows (pull_request) Has been skipped
compliance / lint-go-gogit (pull_request) Has been skipped
compliance / checks-backend (pull_request) Has been skipped
compliance / frontend (pull_request) Has been skipped
compliance / backend (pull_request) Has been skipped
e2e-tests / test-e2e (pull_request) Failing after 2m17s
db-tests / test-pgsql (pull_request) Has been cancelled
db-tests / test-sqlite (pull_request) Has been cancelled
db-tests / test-unit (pull_request) Has been cancelled
db-tests / test-mysql (pull_request) Has been cancelled
db-tests / test-mssql (pull_request) Has been cancelled
docker-dryrun / container-amd64 (pull_request) Has been cancelled
docker-dryrun / container-arm64 (pull_request) Has been cancelled
docker-dryrun / container-riscv64 (pull_request) Has been cancelled
2026-05-12 20:24:14 +00:00
Jonathan Miller e50e8ed851 feat(admin): add configurable Help/Support URLs and version convention
db-tests / files-changed (pull_request) Successful in 6s
docker-dryrun / files-changed (pull_request) Successful in 7s
labeler / labeler (pull_request_target) Successful in 11s
pr-title / lint-pr-title (pull_request) Successful in 3m9s
compliance / files-changed (pull_request) Successful in 3m57s
e2e-tests / files-changed (pull_request) Successful in 3m9s
db-tests / test-pgsql (pull_request) Failing after 3m26s
db-tests / test-sqlite (pull_request) Failing after 3m39s
db-tests / test-mysql (pull_request) Failing after 8m16s
docker-dryrun / container-amd64 (pull_request) Has been skipped
docker-dryrun / container-arm64 (pull_request) Has been skipped
docker-dryrun / container-riscv64 (pull_request) Has been skipped
db-tests / test-mssql (pull_request) Failing after 7m59s
compliance / lint-on-demand (pull_request) Successful in 2m33s
compliance / lint-go-windows (pull_request) Failing after 3m9s
compliance / lint-go-gogit (pull_request) Failing after 3m12s
compliance / frontend (pull_request) Has been skipped
compliance / checks-backend (pull_request) Failing after 3m5s
compliance / backend (pull_request) Failing after 2m55s
e2e-tests / test-e2e (pull_request) Failing after 3m3s
db-tests / test-unit (pull_request) Failing after 28m41s
compliance / lint-backend (pull_request) Failing after 55m37s
- Add HELP_URL and SUPPORT_URL settings to app.ini (defaults to docs.gitea.com)
- Replace hardcoded docs.gitea.com in navbar with configurable HelpURL
- Expose HelpURL/SupportURL template functions
- Show Help URL and Support URL in Site Admin > Configuration
- Add locale strings for new admin config entries
- Create VERSION file (gitignored) for local builds with 1261.0.0 convention

The 1261.xx.xx version convention marks the fork starting point from
upstream Gitea. Set via VERSION file locally or GITEA_VERSION env in CI.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-12 15:11:49 -05:00