Skip to content

Migrate to subdomain, fix vulnerabilities, and update deploy for Hetzner - #62

Merged
Cwooper merged 2 commits into
mainfrom
feat/subdomain-migration
Jun 4, 2026
Merged

Migrate to subdomain, fix vulnerabilities, and update deploy for Hetzner#62
Cwooper merged 2 commits into
mainfrom
feat/subdomain-migration

Conversation

@Cwooper

@Cwooper Cwooper commented Jun 4, 2026

Copy link
Copy Markdown
Owner

Summary

Three related pieces of work for the infra rework:

1. Subdomain migration (cwooper.me/schedule-optimizerschedule-optimizer.cwooper.me)

The app now serves from root instead of a subpath, simplifying nginx/DNS.

  • Frontend: vite base: '/', API calls hit /api, dropped the proxy rewrite; updated canonical/og:url.
  • Backend: static handler no longer strips a /schedule-optimizer prefix (serves from root).
  • Updated CORS_ALLOWED_ORIGINS example and the README "Try it live" link.

nginx for the subdomain should proxy schedule-optimizer.cwooper.me/localhost:48920/ with no path rewrite.

2. Vulnerability fixes (resolves the dependabot alerts on main)

  • Backend: bumped golang.org/x/net 0.47→0.55, golang.org/x/crypto, quic-go 0.57→0.59.1. govulncheck is clean. The go directive moved to 1.25 (required by quic-go 0.59.1).
  • Frontend: bumped vite & vitest (clears the critical vitest advisory) and added pnpm overrides for transitive dev-tooling advisories (minimatch, picomatch, flatted, rollup, ajv, brace-expansion, postcss). pnpm audit is clean; production audit was clean throughout.
  • Approved esbuild's build script in committed pnpm config so pnpm install --frozen-lockfile exits 0 (it was erroring under set -e).

3. Deploy workflow for the new Hetzner box

  • PATH points at the new layout (~/.local/bin, ~/.local/share/pnpm/bin, ~/go/bin).
  • Go build and test run with CGO_ENABLED=1 (mattn/go-sqlite3 needs cgo).

⚠️ Requires on the server

  • Go 1.25+ (the new box has 1.25.4 ✓)
  • gcc for cgo, and a pnpm that understands allowBuilds (latest pnpm ✓)

Verification

  • Backend: go build ./... + go test ./... pass; govulncheck clean.
  • Frontend: pnpm install --frozen-lockfile exits 0, vite build (root base path), 118/118 tests pass, pnpm audit clean.

Cwooper added 2 commits June 4, 2026 04:46
Move from the cwooper.me/schedule-optimizer subpath to the
schedule-optimizer.cwooper.me subdomain, and patch known advisories.

Subdomain migration:
- Frontend serves from root: vite base '/', API at /api, drop the proxy
  rewrite; update canonical/og URLs.
- Backend static handler no longer strips a /schedule-optimizer prefix.
- Update CORS example and README live link to the subdomain.

Vulnerabilities:
- Bump golang.org/x/net (0.47->0.55), x/crypto, quic-go (0.57->0.59.1);
  go directive -> 1.25 (required by quic-go). govulncheck clean.
- Bump vite and vitest; add pnpm overrides for transitive dev-tooling
  advisories (minimatch, picomatch, flatted, rollup, ajv,
  brace-expansion, postcss). pnpm audit clean.
- Approve esbuild's build script in pnpm config so frozen installs exit 0.
- Bump documented Go prerequisite to 1.25.
- Point PATH at the new server layout (~/.local/bin,
  ~/.local/share/pnpm/bin, ~/go/bin).
- Build and test the Go server with CGO_ENABLED=1; mattn/go-sqlite3
  needs cgo, and the new box has gcc. Without it the binary compiles to
  a stub that fails at runtime with "requires cgo to work."
Copilot AI review requested due to automatic review settings June 4, 2026 11:47
@Cwooper
Cwooper merged commit aed804f into main Jun 4, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the app’s hosting/deploy setup to serve from a dedicated subdomain root path, while also addressing dependency security advisories across the Go backend and Vite/Vitest frontend toolchain, and updating the production deploy workflow for a new Hetzner host environment.

Changes:

  • Migrate from /schedule-optimizer subpath hosting to serving from / (frontend Vite base/proxy, backend static handler, and public metadata URLs).
  • Apply dependency upgrades/overrides to resolve known vulnerability advisories (Go modules + frontend dev tooling).
  • Update the production deploy workflow (PATH changes; build/test with CGO_ENABLED=1 for sqlite3).

Reviewed changes

Copilot reviewed 12 out of 14 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
README.md Updates public “Try it live” URL and Go version prerequisites.
CLAUDE.md Updates server setup docs to require Go 1.25+.
backend/README.md Updates backend prerequisite docs to Go 1.25+.
backend/.env.example Updates example CORS origin for the new subdomain.
backend/go.mod Bumps Go/tooling deps (x/*, quic-go) and adjusts module requirements.
backend/go.sum Updates module checksums consistent with dependency bumps.
backend/internal/static/handler.go Removes subpath-stripping behavior to serve static assets from root.
backend/internal/static/handler_test.go Updates static handler tests to match root hosting paths.
frontend/vite.config.ts Switches Vite base path to / and proxies /api to the backend.
frontend/index.html Updates canonical and OG URLs to the new subdomain root.
frontend/package.json Bumps vite/vitest and adds pnpm overrides / build-script allow-list config.
frontend/pnpm-workspace.yaml Adds pnpm config intended to allow esbuild and enforce patched transitive versions.
frontend/pnpm-lock.yaml Updates lockfile for new tool versions and override constraints.
.github/workflows/deploy.yml Updates deploy PATH and runs Go build/test with CGO_ENABLED=1.
Files not reviewed (1)
  • frontend/pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -0,0 +1,26 @@
# esbuild runs a postinstall script to fetch its platform binary. pnpm 10+
Comment on lines 35 to 39
// Determine the logical file path (for gzip lookup)
filePath := strings.TrimPrefix(urlPath, "/")
filePath := strings.TrimPrefix(r.URL.Path, "/")
if filePath == "" {
filePath = "index.html"
}
Cwooper added a commit that referenced this pull request Jun 13, 2026
…ner (#62)

* Migrate to subdomain and fix backend/frontend vulnerabilities

Move from the cwooper.me/schedule-optimizer subpath to the
schedule-optimizer.cwooper.me subdomain, and patch known advisories.

Subdomain migration:
- Frontend serves from root: vite base '/', API at /api, drop the proxy
  rewrite; update canonical/og URLs.
- Backend static handler no longer strips a /schedule-optimizer prefix.
- Update CORS example and README live link to the subdomain.

Vulnerabilities:
- Bump golang.org/x/net (0.47->0.55), x/crypto, quic-go (0.57->0.59.1);
  go directive -> 1.25 (required by quic-go). govulncheck clean.
- Bump vite and vitest; add pnpm overrides for transitive dev-tooling
  advisories (minimatch, picomatch, flatted, rollup, ajv,
  brace-expansion, postcss). pnpm audit clean.
- Approve esbuild's build script in pnpm config so frozen installs exit 0.
- Bump documented Go prerequisite to 1.25.

* Update deploy workflow for new Hetzner server

- Point PATH at the new server layout (~/.local/bin,
  ~/.local/share/pnpm/bin, ~/go/bin).
- Build and test the Go server with CGO_ENABLED=1; mattn/go-sqlite3
  needs cgo, and the new box has gcc. Without it the binary compiles to
  a stub that fails at runtime with "requires cgo to work."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants