feat(settings): add custom domain settings for share and direct links #1996
+4
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description / 描述
Add two new global settings to allow users to configure custom domains for share links and direct links:
share_url_domain: Custom domain for share linksdirect_link_url_domain: Custom domain for direct links添加两个新的全局设置,允许用户为分享链接和直链配置自定义域名:
share_url_domain:分享链接的自定义域名direct_link_url_domain:直链的自定义域名Motivation and Context / 背景
When OpenList is deployed behind a reverse proxy or accessed via different domains (internal vs external), users may want share links and direct links to use a public domain instead of the internal IP address.
For example:
http://192.168.0.107:5244https://share.example.comThis allows users to share links that work externally without exposing internal network addresses.
当 OpenList 部署在反向代理后面或通过不同域名访问时(内网 vs 外网),用户可能希望分享链接和直链使用公网域名而非内网IP。
例如:
http://192.168.0.107:5244https://share.example.com这允许用户分享可以从外部访问的链接,而无需暴露内部网络地址。
How Has This Been Tested? / 测试
share_url_domaindirect_link_url_domainlocation.origin)Checklist / 检查清单
我已阅读 CONTRIBUTING 文档。
go fmtor prettier.我已使用
go fmt或 prettier 格式化提交的代码。我已为此 PR 添加了适当的标签(如无权限或需要的标签不存在,请在描述中说明,管理员将后续处理)。
Labels needed:
enhancement,Module: Settings我已在适当情况下使用"Request review"功能请求相关代码作者进行审查。
我已相应更新了相关仓库(若适用)。