XrayR-project / XrayR

A Xray backend framework that can easily support many panels. 一个基于Xray的后端框架,支持V2ay,Trojan,Shadowsocks协议,极易扩展,支持多面板对接
https://xrayr-project.github.io/XrayR-doc/
Mozilla Public License 2.0
2.02k stars 813 forks source link

using environment variables or .env files in config.yml #687

Open zerodwide opened 2 weeks ago

zerodwide commented 2 weeks ago

Hi

can we use environment variables or .env files in config.yml?

for example in .env:

MY_IP=0.0.0.0

or

export MY_IP=0.0.0.0

config.yml:

    ControllerConfig:
      ListenIP: $MY_IP

then run server?

Thanks in advance

zerodwide commented 2 weeks ago

you may ask why i need this?

i want to run 10 XrayR custom containers with 10 ips, but if i set docker network_mode: bridge (default) it will be freezes and nothing will work on heavy load! because packets should first come to host, then to bridge then to host then to internet, and when the open tcp connections strike it has trouble to handle it.

so i want to set network_mode:host in docker compose and set each containers ip via environment variable in docker compose. and i guess it will solve the network issue.

also i can map each container its config file, but just i was curious is it possible or not? or add this feature.