Skip to content

Conversation

@Suyunmeng
Copy link
Contributor

Resolve the path and content issues of manifest.json when deploying in sub-directories to ensure that the PWA function works properly in all deployment scenarios while maintaining compatibility with existing CDN mechanisms.

Copy link
Member

@xrgzs xrgzs left a comment

Choose a reason for hiding this comment

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

存在问题,直接panic,貌似是路由冲突

Microsoft Windows [版本 10.0.19045.2006]
(c) Microsoft Corporation。保留所有权利。

C:\Users\Admin\Desktop\openlist_a4646d8_windows-amd64>openlist.exe server
INFO[2025-08-06 17:36:42] reading config file: C:\Users\Admin\Desktop\openlist_a4646d8_windows-amd64\data\config.json
INFO[2025-08-06 17:36:42] max buffer limit: 213909504
INFO[2025-08-06 17:36:42] load config from env with prefix: OPENLIST_
INFO[2025-08-06 17:36:42] init logrus...
panic: catch-all wildcard '*filepath' in new path '/static/*filepath' conflicts with existing path segment 'manifest.json' in existing prefix 'atic/manifest.json'

goroutine 1 [running]:
github.com/gin-gonic/gin.(*node).insertChild(0xc0007d20e0?, {0xc000845280?, 0xc0004974c0?}, {0xc000845278, 0x11}, {0xc0008ce210, 0x6, 0x6})
        /go/pkg/mod/github.com/gin-gonic/gin@v1.10.1/tree.go:358 +0xbc5
github.com/gin-gonic/gin.(*node).addRoute(0x2cad864?, {0xc000845278, 0x11}, {0xc0008ce210, 0x6, 0x6})
        /go/pkg/mod/github.com/gin-gonic/gin@v1.10.1/tree.go:254 +0x9bf
github.com/gin-gonic/gin.(*Engine).addRoute(0xc0004d1860, {0x2cad864, 0x3}, {0xc000845278, 0x11}, {0xc0008ce210, 0x6, 0x6})
        /go/pkg/mod/github.com/gin-gonic/gin@v1.10.1/gin.go:352 +0x252
github.com/gin-gonic/gin.(*RouterGroup).handle(0xc00083a040, {0x2cad864, 0x3}, {0xc000845218?, 0xc0008412d0?}, {0xc000584da8, 0x1, 0xc0000ccdc0?})
        /go/pkg/mod/github.com/gin-gonic/gin@v1.10.1/routergroup.go:89 +0x13e
github.com/gin-gonic/gin.(*RouterGroup).GET(...)
        /go/pkg/mod/github.com/gin-gonic/gin@v1.10.1/routergroup.go:117
github.com/gin-gonic/gin.(*RouterGroup).StaticFS(0xc00083a040, {0xc000925670, 0x8}, {0x6ff0100, 0xc0008412d0})
        /go/pkg/mod/github.com/gin-gonic/gin@v1.10.1/routergroup.go:211 +0x16d
github.com/OpenListTeam/OpenList/v4/server/static.Static(0xc00083a040, 0xc0004979b0)
        /source/server/static/static.go:134 +0x3b1
github.com/OpenListTeam/OpenList/v4/server.Init(0xc0004d1860)
        /source/server/router.go:101 +0x1439
github.com/OpenListTeam/OpenList/v4/cmd.init.func10(0xc000786e00?, {0x2cae9ad?, 0x4?, 0x2cae971?})
        /source/cmd/server.go:60 +0x272
github.com/spf13/cobra.(*Command).execute(0x25a5a80, {0x85e64a0, 0x0, 0x0})
        /go/pkg/mod/github.com/spf13/cobra@v1.9.1/command.go:1019 +0xa7b
github.com/spf13/cobra.(*Command).ExecuteC(0x25a57c0)
        /go/pkg/mod/github.com/spf13/cobra@v1.9.1/command.go:1148 +0x40c
github.com/spf13/cobra.(*Command).Execute(...)
        /go/pkg/mod/github.com/spf13/cobra@v1.9.1/command.go:1071
github.com/OpenListTeam/OpenList/v4/cmd.Execute()
        /source/cmd/root.go:23 +0x1a
main.main()
        /source/main.go:6 +0xf

C:\Users\Admin\Desktop\openlist_a4646d8_windows-amd64>openlist.exe version
Built At: 8/6/2025, 9:05:54 AM
Go Version: go1.24.1 windows/amd64
Author: The OpenList Projects Contributors <noreply@openlist.team>
Commit ID: a4646d8d39073abe8c4c8671cec445865b381478
Version: refs/pull/990/merge
WebVersion: rolling

@Suyunmeng Suyunmeng requested a review from xrgzs August 6, 2025 10:25
@Suyunmeng
Copy link
Contributor Author

还有新变更,暂不合并

- Remove CDN-specific logic for PWA manifest scope and start_url
- Always use base path for PWA scope regardless of CDN configuration
- Replace manual file serving logic with http.FileServer for static assets
@Suyunmeng
Copy link
Contributor Author

已无新变更。@xrgzs 再看一下有没有问题

@xrgzs xrgzs marked this pull request as draft August 6, 2025 22:03
@Suyunmeng Suyunmeng marked this pull request as ready for review August 8, 2025 08:59
@Suyunmeng Suyunmeng requested a review from xrgzs August 8, 2025 09:48
Copy link
Member

@xrgzs xrgzs left a comment

Choose a reason for hiding this comment

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

还是得去前端改掉路径,不然这个manifest 的 link 被 vite-plugin-dynamic-base 给一起处理了,应该让它跟 logo 一样

试了下,删了 /public/static/manifest.json 再打包,就不会被 vite-plugin-dynamic-base 处理

路由还是恢复成之前那样注册到 /manifest.json,不要动 /static/

image

Copy link
Member

@xrgzs xrgzs left a comment

Choose a reason for hiding this comment

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

LGTM

image

@xrgzs xrgzs merged commit ab747d9 into main Aug 8, 2025
19 checks passed
@xrgzs xrgzs deleted the feat/manifest branch August 8, 2025 12:07
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.

3 participants