langgenius / langgenius/dify

The http proxy environment variable of Dify plugin_daemon only supports uppercase letters.

Open
#18,752 6 comments 2 reactions 0 assignees View on GitHub
🐞 bug good first issue
Dominant language
TypeScript
Stars
156k
Forks
24.6k
Avg merge
22h 9m
Merged PRs (30d)
610

Description

### Self Checks

- [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general).
- [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones.
- [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)).
- [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
- [x] Please do not modify this template :) and fill in all the required fields.

### Dify version

1.3.0

### Cloud or Self Hosted

Self Hosted (Docker)

### Steps to reproduce

In a self-hosted environment under an HTTP(S) proxy, set the following proxy environment variables in docker-compose.yaml .
```yaml
services:
plugin_daemon:
environment;
http(s)_proxy: http://proxy-host:port
```
The http(s)_proxy environment variables specified in lowercase are valid in sandbox and api containers, but not in plugin_daemon.

plugin_daemon supports resolving python dependencies under http(s) proxy.
https://github.com/langgenius/dify-plugin-daemon/blob/main/internal/core/plugin_manager/launcher.go#L132-L143
```golang
localPluginRuntime := local_runtime.NewLocalPluginRuntime(local_runtime.LocalPluginRuntimeConfig{
PythonInterpreterPath: p.pythonInterpreterPath,

HttpProxy: p.HttpProxy,
HttpsProxy: p.HttpsProxy,
NoProxy: p.NoProxy,

})
```

However, the plugin_daemon configuration only reads the proxy environment variable in uppercase.
https://github.com/langgenius/dify-plugin-daemon/blob/main/internal/types/app/config.go#L131-L132
```golang
HttpProxy string `envconfig:"HTTP_PROXY"`
HttpsProxy string `envconfig:"HTTPS_PROXY"`
```
If the uppercase HTTP(S)_PROXY setting is empty and the lowercase http(s)_proxy is defined, I would like it to take precedence.

### ✔️ Expected Behavior

It will be possible to install plugins on the marketplace from behind the http(s) proxy.

### ❌ Actual Behavior

plugin_daemon gives the following error.
```
runtime error: invalid memory address or nil pointer dereference
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.