mirror of
https://github.com/go-vikunja/vikunja.git
synced 2026-05-21 10:41:50 -05:00
Open
opened 2026-03-22 15:04:34 -05:00 by GiteaMirror
·
0 comments
No Branch/Tag Specified
main
claude/analyze-beans-project-9VxoS
renovate/dev-dependencies
fix-list-sort-resets
feat-huma-api-v2-migration
feat-v2-foundation
spike-huma-openapi3
claude/investigate-swagger3-support-nyyUa
feat-list-view-buckets
ci-mysql-8-test
codex/analyze-codebase-for-email-task-feature
feat-project-templates
csv-import-feature
claude/email-reply-comments-wpdcQ
fix-oidc-pkce-support
fix/overview-subtasks-expand
feat/bucket-select-task-detail
feat-soft-delete-projects
claude/review-bot-design-plan-cf5C3
claude/project-scoped-api-tokens-KTqR3
claude/explore-openclaw-integration-KQEzg
claude/project-scoped-api-tokens-yv5KS
fix-duplicate-close-button
feat-list-view-sorting
feat/official-vite-sentry-plugin
feat/highlight-overdue-tasks
feat/add-enter-key-form-submission-handling
feat/TipTap-nits
feat/update-caldavtimetotimestamp-parsing
feat-phosphor-icons
wip-plans
claude/investigate-issue-2173-llKme
fix-description-text-drag
feat-custom-keyboard-shortcuts
pr-1845-ci
codex/fix-drag-and-drop-behavior-inconsistency
copilot/add-clickable-labels-for-filtering
copilot/fix-issue-1786
playwright-migration
fix-kanban-repeating-wip
copilot/fix-1498
feature/replace-axios
codex/upgrade-to-tailwind-4.1.8-using-pnpm
codex/add-cypress-test-for-avatar-types
feature/biome
feature/oxc
codex/update-flexsearch-to-0.8.205
4r6ni9-codex/fix-deprecated-sass-@import-usage
codex/fix-deprecated-sass-@import-usage
codex/add-cypress-test-for-task-list-refresh-fix
codex/fix-quick-add-magic-not-adding-tasks
codex/fix-all-type-errors
codex/fix-mimetype-for-docs.json
feature/caldav-from-scratch
feature/gh-actions-hetzner
fix-ci
feat/new-logger
jyte-better-dev-config
feat/add-team-member-with-enter
fix/button-and-icon-types
fix/notifications-component-name-collision
feature/null-time
renovate/tailwindcss-4.x
feature/unplugin-vue-router
fix/deprecated-import
feature/zod-schema
renovate/golangci-golangci-lint-1.x
fix/tiptap-editor-reactive-destructuring
release/0.24
feat/improve-add-task
fix/saved-filter-search
feat/webp-and-avif-attachment-previews
feature/migrate-back-to-bulma
fix/sass-add-missing-list-import
feature/sticky-demo-bar
fix/gantt-view-switch
feature/typesense-position-join
feature/focus-visible
dependencies/golangci-lint
feature/better-filter-syntax
fix/tiptap-task-list
renovate/github.com-golang-jwt-jwt-v4-5.x
feature/hide-forbidden-related-tasks
renovate/golang-1.x
release/0.20
release/0.17
release/0.16
release/0.15
release/0.14
v2.3.0
v2.2.2
v2.2.1
v2.2.0
v2.1.0
v2.0.0
v1.1.0
v1.0.0
v1.0.0-rc4
v1.0.0-rc3
v1.0.0-rc2
v1.0.0-rc1
v1.0.0-rc0
v0.24.6
v0.24.5
v0.24.4
v0.24.3
v0.24.2
v0.24.1
v0.24.0
v0.23.0
v0.22.1
v0.22.0
0.21.0
v0.21.0
v0.20.4
v0.20.5
v0.20.3
v0.20.2
v0.20.1
v0.20.0
v0.19.2
v0.19.1
v0.19.0
vue3
v0.18.1
v0.18.0
v0.17.1
v0.17.0
v0.16.1
v0.16.0
v0.15.1
v0.15.0
v0.14.1
v0.14.0
v0.13.1
v0.13
v0.12
v0.11
v0.10
v0.9
v0.8
v0.7
v0.6
v0.5
v0.4
v0.3
v0.2
v0.1
Labels
Clear labels
area/api
area/attachments
area/auth
area/avatars
area/backup-restore
area/caldav
area/calendar-view
area/comments
area/config
area/database
area/desktop
area/docker
area/email
area/favorites
area/filters
area/frontend
area/gantt
area/i18n
area/import-export
area/internal-code
area/kanban
area/labels
area/list-view
area/mobile
area/notifications
area/permissions
area/projects
area/pwa
area/recurring-tasks
area/reminders
area/search
area/shortcuts
area/subtasks
area/sync
area/table-view
area/task-editor
area/task-metadata
area/task-relations
area/teams
area/theming
area/time-tracking
area/typesense
area/views
area/webhooks
bug
changes requested
concern/accessibility
concern/performance
concern/regression
concern/ux
confirmed
db/mysql
dependencies
enhancement
good first issue
help wanted
integration/inbound
integration/outbound
kind/bug
kind/feature
needs reproduction
pull-request
question
security
support
upstream issue
waiting for reply
wontfix
Mirrored from GitHub Pull Request
No Label
pull-request
Milestone
No items
No Milestone
Projects
Clear projects
No project
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/vikunja#4141
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/go-vikunja/vikunja/pull/2436
Author: @mdrkrg
Created: 3/22/2026
Status: 🔄 Open
Base:
main← Head:feat/path-based-serving📝 Commits (10+)
7f549b8fix(frontend): Make sw.ts respect to frontend base URLb544feafix(frontend): Fix hard-coded API base in checkAndSetApiUrl.tsf52d9d1fix(frontend/tests): Fix hard-coded API base in tests3466082fix(static): Use VIKUNJA_API_URL placeholder in index.html2f71492fix(frontend/vite): Configure vite dev proxy to handle frontend pathea14fdafix(frontend/oidc): Prefix frontend base to redirect URL6d662d9chore: Rename BUILD_STANDALONE to VIKUNJA_BUILD_STANDALONE153929dfeat(frontend): Add VIKUNJA_API_URL to explicitly set window.API_URLdf58e9dfix(auth): Make refresh token path respect to public URL88fad75fix(api/docs): Make redoc load docs.json from public URL📊 Changes
18 files changed (+142 additions, -44 deletions)
View changed files
📝
.github/workflows/test.yml(+2 -0)📝
frontend/.env.local.example(+2 -0)📝
frontend/index.html(+6 -2)📝
frontend/src/components/tasks/partials/Comments.vue(+3 -1)📝
frontend/src/helpers/checkAndSetApiUrl.ts(+27 -18)📝
frontend/src/helpers/redirectToProvider.ts(+3 -1)📝
frontend/src/sw.ts(+3 -1)📝
frontend/tests/support/authenticateUser.ts(+2 -3)📝
frontend/tests/support/constants.ts(+5 -0)📝
frontend/tests/support/fixtures.ts(+2 -1)📝
frontend/tests/support/seed.ts(+2 -1)📝
frontend/tests/support/updateUserSettings.ts(+2 -1)📝
frontend/vite.config.ts(+38 -8)📝
magefile.go(+4 -0)📝
pkg/modules/auth/auth.go(+19 -3)📝
pkg/routes/api/v1/docs.go(+17 -2)📝
pkg/routes/api/v1/redoc/redoc.html(+1 -1)📝
pkg/routes/static.go(+4 -1)📄 Description
Make the frontend work correctly when served at a subpath (e.g.
/vikunja/instead of/). Previously, API URLs, OIDC redirects, CalDAV URLs, and the service worker all had paths hardcoded relative to the domain root, which broke any deployment behind a reverse proxy with a path prefix.This PR is based on the fix in #2440 .
What changed
index.html/static.go: Replaced the hardcodedwindow.API_URLvalue with a__VIKUNJA_API_URL__marker. Vite replaces it at build time (for standalone nginx deploys) ifVIKUNJA_BUILD_STANDALONE=trueis set in.env.local. Otherwise the Go backend replaces it at serve time usingservice.publicurl.I'm unsure about this change. The original
static.gotargets'http://localhost:3456/api/v1'to replace, but in actualindex.htmlit is'/api/v1', so this is already broken?Current implementation would work for this case: Serving frontend and backend on the same server under a subpath (e.g.,
example.com/vikunja), in which it does not matter whether Vite does theAPI_BASEreplacement or the go backend.However, it is not feasible to serve frontend at subpath but backend at subdomain (e.g.,Fixed in 2e134cec1. See this comment.example.com/vikunjaserved by nginx, and backend atapi.example.com). Might need some refactoring.checkAndSetApiUrl.ts: ExtractedAPI_DEFAULT_PATHconstant andjoinPath/hasApiPathhelpers.config.ts(apiBasecomputed): See !2435. Usespathnameand strips/api/v1to derive the deployment base. This fixes CalDAV URL construction inCaldav.vue.redirectToProvider.ts: OIDC redirect URL now includes the base path viagetFullBaseUrl(), so the callback lands on a route the Vue router handles.sw.ts: Service worker API route regex is anchored to the configured base path instead of matchingapi/v1/anywhere in the URL.auth/auth.go: Compute refresh token cookie base path fromservice.publicurlrather than hard coding the base as/api/v1.api/v1/docs.go: BuildRedocUITemplateas template, and replace withapiBase + api/v1/docs.json.Test files: Centralized
TEST_API_URLconstant so the API base URL for tests is defined in one place.vite.config.ts: Added atransformIndexHtmlplugin for the marker replacement. Made the dev proxy path and rewrite dynamic based onVIKUNJA_FRONTEND_BASEso local development works with a subpath.How to deploy at a subpath
Set
VIKUNJA_FRONTEND_BASEto the desired path (e.g./vikunja/) before building the frontend. This sets Vite'sbaseand bakes the correct API URL into the built HTML.Configure the reverse proxy to forward requests from the subpath to Vikunja. The Go backend still expects
/api/v1at its root — the proxy should strip the prefix before forwarding.Example Caddyfile:
Set
service.publicurlinconfig.ymlto the full public URL including the subpath (e.g.https://example.com/vikunja). When the Go backend serves the frontend, it will replace thewindow.API_BASEplaceholder.For OIDC: no extra configuration needed — the redirect URL is now built dynamically from the frontend's base path.
For migration services (Trello, Todoist, Microsoft To Do): the redirect URLs in
config.ymlare absolute URLs set by the admin, so include the subpath there if applicable.Docs changes needed
The following should be mentioned in the deployment documentation:
VIKUNJA_FRONTEND_BASE: (Already there).VIKUNJA_API_URL: The full URL to the Vikunja API. Only required when building the standalone frontend (see belowVIKUNJA_BUILD_STANDALONE). If unset when building a standalone frontend, it would be automatically derived asVIKUNJA_FRONTEND_BASE + /api/v1. Only set this when the backend is at a different origin or path than the frontend.VIKUNJA_BUILD_STANDALONE: If building a frontend that is intended to be served at a subpath by a reverse proxy, set this totrueso that Vite replaces__VIKUNJA_API_URL__withVIKUNJA_API_URLat build time.Otherwise go backend will handle the replacement using
service.publicurl.Reverse proxy subpath configuration: Document that when deploying at a subpath, the reverse proxy should strip the prefix before forwarding to the backend.
Include example configs for common web servers.
Include the subpath in
service.publicurl: If the Go backend serves the frontend and the deployment uses a subpath,service.publicurlmust reflect that (e.g.https://example.com/vikunja).Migration redirect URLs: Admins must include the subpath in
migration.*.redirecturlvalues inconfig.ymlif deploying at a subpath. These are not auto-detected.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.