2
0

2 Commits

Author SHA1 Message Date
04bdf641c7 ci(pages): optimize vault dependency download in build workflow
Some checks failed
Build and Release / Create Release (push) Successful in 0s
Build and Release / Unit Tests (push) Successful in 3m41s
Build and Release / Integration Tests (PostgreSQL) (push) Successful in 9m44s
Build and Release / Lint (push) Successful in 10m57s
Build and Release / Build Binary (linux/arm64) (push) Failing after 4m53s
Build and Release / Build Binaries (amd64, linux, linux-latest) (push) Successful in 5m15s
Build and Release / Build Binaries (amd64, darwin, macos) (push) Successful in 5m44s
Build and Release / Build Binaries (amd64, windows, windows-latest) (push) Successful in 9h4m52s
Build and Release / Build Binaries (arm64, darwin, macos) (push) Successful in 8m14s
Replace GOPRIVATE with GOSUMDB=off and download only the specific gitcaddy-vault module instead of all dependencies. This speeds up the build process and avoids unnecessary downloads.
2026-04-26 08:23:22 -04:00
fbf5e968d9 fix(pages): prioritize social preview route over static routes
Some checks failed
Build and Release / Integration Tests (PostgreSQL) (push) Successful in 7m13s
Build and Release / Create Release (push) Successful in 0s
Build and Release / Unit Tests (push) Successful in 7m29s
Build and Release / Lint (push) Successful in 8m33s
Build and Release / Build Binaries (amd64, linux, linux-latest) (push) Failing after 2m33s
Build and Release / Build Binaries (arm64, darwin, macos) (push) Failing after 2m34s
Build and Release / Build Binaries (amd64, darwin, macos) (push) Failing after 2m52s
Build and Release / Build Binary (linux/arm64) (push) Failing after 5m21s
Build and Release / Build Binaries (amd64, windows, windows-latest) (push) Failing after 9h4m18s
Move social preview image handling before static route checking to prevent catch-all patterns like /*.png from shadowing the auto-generated OG card endpoint.

Also bumps gitcaddy-vault from v1.0.60 to v1.0.61.
2026-04-26 07:51:12 -04:00
3 changed files with 12 additions and 11 deletions

View File

@@ -347,8 +347,8 @@ jobs:
- name: Update vault dependency (Unix)
if: matrix.goos != 'windows'
env:
GOPRIVATE: ""
GOPROXY: direct
GOSUMDB: off
run: |
set -x
VAULT_VERSION="${{ steps.vault.outputs.version }}"
@@ -360,14 +360,14 @@ jobs:
sed -i "s|replace git.marketally.com/gitcaddy/gitcaddy-vault => ../gitcaddy-vault|replace git.marketally.com/gitcaddy/gitcaddy-vault => git.marketally.com/gitcaddy/gitcaddy-vault $VAULT_VERSION|" go.mod
fi
cat go.mod | grep -A2 "gitcaddy-vault" || true
go mod download
go mod download git.marketally.com/gitcaddy/gitcaddy-vault
- name: Update vault dependency (Windows)
if: matrix.goos == 'windows'
shell: pwsh
env:
GOPRIVATE: ""
GOPROXY: direct
GOSUMDB: off
run: |
$vaultVersion = "${{ steps.vault-win.outputs.version }}"
Write-Host "Building with vault $vaultVersion"
@@ -375,7 +375,7 @@ jobs:
$content = $content -replace 'replace git.marketally.com/gitcaddy/gitcaddy-vault => ../gitcaddy-vault', "replace git.marketally.com/gitcaddy/gitcaddy-vault => git.marketally.com/gitcaddy/gitcaddy-vault $vaultVersion"
Set-Content go.mod $content -NoNewline
Get-Content go.mod | Select-String "gitcaddy/vault" -Context 0,2
go mod download
go mod download git.marketally.com/gitcaddy/gitcaddy-vault
- name: Setup Node.js
uses: actions/setup-node@v4

2
go.mod
View File

@@ -16,7 +16,7 @@ require (
connectrpc.com/connect v1.18.1
// GitCaddy Vault plugin (compiled-in)
git.marketally.com/gitcaddy/gitcaddy-vault v1.0.60
git.marketally.com/gitcaddy/gitcaddy-vault v1.0.61
gitea.com/go-chi/binding v0.0.0-20240430071103-39a851e106ed
gitea.com/go-chi/cache v0.2.1
gitea.com/go-chi/captcha v0.0.0-20240315150714-fb487f629098

View File

@@ -76,6 +76,13 @@ func ServeLandingPage(ctx *context.Context) {
}
}
// Handle social preview image before static routes so a catch-all
// like /*.png cannot shadow the auto-generated OG card.
if requestPath == "/social-preview.png" || requestPath == "/social-preview" {
serveSocialPreview(ctx, repo)
return
}
// Check for static route file serving
if len(config.Advanced.StaticRoutes) > 0 {
cleanPath := path.Clean(requestPath)
@@ -91,12 +98,6 @@ func ServeLandingPage(ctx *context.Context) {
return
}
// Handle social preview image
if requestPath == "/social-preview.png" || requestPath == "/social-preview" {
serveSocialPreview(ctx, repo)
return
}
// Handle asset requests (gallery images, custom assets)
// Uses /pages/assets/ to avoid conflict with Gitea's static /assets/ route
if assetPath, found := strings.CutPrefix(requestPath, "/pages/assets/"); found && assetPath != "" {