feat: Support deployment in custom subpaths by `NEXT_PUBLIC_BASE_PATH`
Summary
Support deployment in custom subpaths by NEXT_PUBLIC_BASE_PATH environment variables
Fix #11335 Fix #6076
Screenshots
| Before | After |
|---|---|
| ... | ... |
Checklist
[!IMPORTANT]
Please review the checklist below before submitting your pull request.
- [x] This change requires a documentation update, included: Dify Document
- [x] I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
- [x] I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
- [x] I've updated the documentation accordingly.
- [x] I ran
dev/reformat(backend) andcd web && npx lint-staged(frontend) to appease the lint gods
Hope to merge into the main branch as soon as possible
Looking forward to see this PR to be merged. I really need this!
Please correct the conflict and resubmit the PR @deershark , and please merge the features in a timely manner @crazywoola
The community has a lot of voices about this, so do we
web/service/base.ts. Need to deal with the signin caused by 401. line 469
const loginUrl = `${globalThis.location.origin}${process.env.NEXT_PUBLIC_BASE_PATH ? `/${process.env.NEXT_PUBLIC_BASE_PATH}` : ''}/signin`
两个多月了还没合代码吗。。。
Although my PR was not paid attention to immediately, I thought the official had no plans for this at the moment and did not resolve the conflict immediately after 1.0 version, but now that the PR of others who resolved the changes have been merged, I am also very happy as a promoter of the implementation of the update. :)