feat(notify): support qywx api proxy #2802
Merged
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.
如果使用 Vercel 作为服务端,企业微信应用的可信 IP 就难以稳定设置(自部署在公网服务器的则不会碰到这种情况),因此目前常见的策略是使用一台公网 IP 服务器作为企业微信 API 的反向代理,并需要将此代理服务器添加到可信 IP.
Refs: #2753 #2661
以下是新引入的两个环境变量的简明文档:
[QYWX_PROXY]
用途: 指定企业微信接口的反向代理服务器地址(可信IP),未配置则不使用代理。
示例: 123.213.132.231
说明: 当设置此变量时,所有对企业微信 API 的请求将通过该代理服务器进行转发。
[QYWX_PROXY_PORT]
用途: 指定企业微信接口的反向代理服务器端口(默认 80)
示例: 8080
说明: 如果 [QYWX_PROXY] 设置了但未指定端口号,则使用此变量指定的端口号。如果未设置此变量,则默认使用 80 端口。
If Vercel is used as the server, the trusted IP of the enterprise WeChat application will be difficult to stably set (this situation will not happen if it is self-deployed on a public network server). Therefore, the current common strategy is to use a public network IP server as Reverse proxy for Enterprise WeChat API and need to add this proxy server to the trusted IP.
Refs: #2753 #2661
The following is concise documentation of the two newly introduced environment variables:
[QYWX_PROXY]
Purpose: Specify the reverse proxy server address (trusted IP) of the enterprise WeChat interface. If not configured, the proxy will not be used.
Example: 123.213.132.231
Description: When this variable is set, all requests to the Enterprise WeChat API will be forwarded through this proxy server.
[QYWX_PROXY_PORT]
Purpose: Specify the reverse proxy server port of the enterprise WeChat interface (default 80)
Example: 8080
Description: If [QYWX_PROXY] is set but no port number is specified, the port number specified by this variable is used. If this variable is not set, port 80 is used by default.