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
2k stars 803 forks source link

一个IP节点下,用一键安装后,定义config.yml. 系统只接受第一个节点。后面的节点不报错,也无法上线运行 #544

Closed WhoCaresBugs closed 9 months ago

WhoCaresBugs commented 9 months ago

Log: Level: debug # Log level: none, error, warning, info, debug AccessPath: /xrayr1/XrayR-release/logs/access.log ErrorPath: /xrayr1/XrayR-release/logs/error.log DnsConfigPath: # /etc/XrayR/dns.json # Path to dns config, check https://xtls.github.io/config/dns.html for help RouteConfigPath: # /etc/XrayR/route.json # Path to route config, check https://xtls.github.io/config/routing.html for help InboundConfigPath: # /etc/XrayR/custom_inbound.json # Path to custom inbound config, check https://xtls.github.io/config/inbound.html for help OutboundConfigPath: # /etc/XrayR/custom_outbound.json # Path to custom outbound config, check https://xtls.github.io/config/outbound.html for help ConnectionConfig: Handshake: 4 # Handshake time limit, Second ConnIdle: 30 # Connection idle time limit, Second UplinkOnly: 2 # Time limit when the connection downstream is closed, Second DownlinkOnly: 4 # Time limit when the connection is closed after the uplink is closed, Second BufferSize: 64 # The internal cache size of each connection, kB Nodes:

PanelType: "NewV2board" # Panel type: SSpanel, V2board, NewV2board, PMpanel, Proxypanel, V2RaySocks
ApiConfig:
  ApiHost: "https://www.xyz.cc"
  ApiKey: "17e1#202a612dad%9f52d58e0a^c780d9"
  NodeID: 1
  NodeType: V2ray # Node type: V2ray, Shadowsocks, Trojan, Shadowsocks-Plugin
  Timeout: 30 # Timeout for the api request
  EnableVless: false # Enable Vless for V2ray Type
  EnableXTLS: false # Enable XTLS for V2ray and Trojan
  SpeedLimit: 0 # Mbps, Local settings will replace remote settings, 0 means disable
  DeviceLimit: 0 # Local settings will replace remote settings, 0 means disable
  RuleListPath: # /etc/XrayR/rulelist Path to local rulelist file
ControllerConfig:
  ListenIP: 0.0.0.0 # IP address you want to listen
  SendIP: 0.0.0.0 # IP address you want to send pacakage
  UpdatePeriodic: 60 # Time to update the nodeinfo, how many sec.
  EnableDNS: false # Use custom DNS config, Please ensure that you set the dns.json well
  DNSType: AsIs # AsIs, UseIP, UseIPv4, UseIPv6, DNS strategy
  EnableProxyProtocol: false # Only works for WebSocket and TCP
  AutoSpeedLimitConfig:
    Limit: 0 # Warned speed. Set to 0 to disable AutoSpeedLimit (mbps)
    WarnTimes: 0 # After (WarnTimes) consecutive warnings, the user will be limited. Set to 0 to punish overspeed user immediately.
    LimitSpeed: 0 # The speedlimit of a limited user (unit: mbps)
    LimitDuration: 0 # How many minutes will the limiting last (unit: minute)
  GlobalDeviceLimitConfig:
    Enable: false # Enable the global device limit of a user
    RedisAddr: 127.0.0.1:6379 # The redis server address
    RedisPassword: YOUR PASSWORD # Redis password
    RedisDB: 0 # Redis DB
    Timeout: 5 # Timeout for redis request
    Expiry: 60 # Expiry time (second)
  EnableFallback: false # Only support for Trojan and Vless
  FallBackConfigs:  # Support multiple fallbacks
    -
      SNI: # TLS SNI(Server Name Indication), Empty for any
      Alpn: # Alpn, Empty for any
      Path: # HTTP PATH, Empty for any
      Dest: 80 # Required, Destination of fallback, check https://xtls.github.io/config/features/fallback.html for details.
      ProxyProtocolVer: 0 # Send PROXY protocol version, 0 for dsable
  CertConfig:
    CertMode: dns # Option about how to get certificate: none, file, http, tls, dns. Choose "none" will forcedly disable the tls config.
    CertDomain: "v2ray01.xyz.xyz" # Domain to cert
    CertFile: /etc/XrayR/cert/node1.test.com.cert # Provided if the CertMode is file
    KeyFile: /etc/XrayR/cert/node1.test.com.key
    Provider: cloudflare # DNS cert provider, Get the full support list here: https://go-acme.github.io/lego/dns/
    Email: test@me.com
    DNSEnv: # DNS ENV option used by DNS provider
      CLOUDFLARE_EMAIL: xyz@gmail.com 
      CLOUDFLARE_API_KEY: 9ca90ccbbbcaade09651e4c34050f5a6fc881

- PanelType: "NewV2board" # Panel type: SSpanel, V2board, NewV2board, PMpanel, Proxypanel, V2RaySocks ApiConfig: ApiHost: "https://www.xyz.cc" ApiKey: "17e1#202a612dad%9f52d58e0a^c780d9" NodeID: 4 NodeType: V2ray # Node type: V2ray, Shadowsocks, Trojan, Shadowsocks-Plugin Timeout: 30 # Timeout for the api request EnableVless: false # Enable Vless for V2ray Type EnableXTLS: false # Enable XTLS for V2ray and Trojan SpeedLimit: 0 # Mbps, Local settings will replace remote settings, 0 means disable DeviceLimit: 0 # Local settings will replace remote settings, 0 means disable RuleListPath: # /etc/XrayR/rulelist Path to local rulelist file ControllerConfig: ListenIP: 0.0.0.0 # IP address you want to listen SendIP: 0.0.0.0 # IP address you want to send pacakage UpdatePeriodic: 60 # Time to update the nodeinfo, how many sec. EnableDNS: false # Use custom DNS config, Please ensure that you set the dns.json well DNSType: AsIs # AsIs, UseIP, UseIPv4, UseIPv6, DNS strategy EnableProxyProtocol: false # Only works for WebSocket and TCP AutoSpeedLimitConfig: Limit: 0 # Warned speed. Set to 0 to disable AutoSpeedLimit (mbps) WarnTimes: 0 # After (WarnTimes) consecutive warnings, the user will be limited. Set to 0 to punish overspeed user immediately. LimitSpeed: 0 # The speedlimit of a limited user (unit: mbps) LimitDuration: 0 # How many minutes will the limiting last (unit: minute) GlobalDeviceLimitConfig: Enable: false # Enable the global device limit of a user RedisAddr: 127.0.0.1:6379 # The redis server address RedisPassword: YOUR PASSWORD # Redis password RedisDB: 0 # Redis DB Timeout: 5 # Timeout for redis request Expiry: 60 # Expiry time (second) EnableFallback: false # Only support for Trojan and Vless FallBackConfigs: # Support multiple fallbacks

      SNI: # TLS SNI(Server Name Indication), Empty for any
      Alpn: # Alpn, Empty for any
      Path: # HTTP PATH, Empty for any
      Dest: 80 # Required, Destination of fallback, check https://xtls.github.io/config/features/fallback.html for details.
      ProxyProtocolVer: 0 # Send PROXY protocol version, 0 for dsable
  CertConfig:
    CertMode: dns # Option about how to get certificate: none, file, http, tls, dns. Choose "none" will forcedly disable the tls config.
    CertDomain: "v2ray02.xyz.xyz" # Domain to cert
    CertFile: /etc/XrayR/cert/node1.test.com.cert # Provided if the CertMode is file
    KeyFile: /etc/XrayR/cert/node1.test.com.key
    Provider: cloudflare # DNS cert provider, Get the full support list here: https://go-acme.github.io/lego/dns/
    Email: test@me.com
    DNSEnv: # DNS ENV option used by DNS provider
      CLOUDFLARE_EMAIL: xyz@gmail.com 
      CLOUDFLARE_API_KEY: 9c4c34050f5a6fc881sSSSsaSAsA

- PanelType: "NewV2board" # Panel type: SSpanel, V2board, NewV2board, PMpanel, Proxypanel, V2RaySocks ApiConfig: ApiHost: "https://www.xyz.cc" ApiKey: "17e1#202a612dad%9f52d58e0a^c780d9" NodeID: 5 NodeType: V2ray # Node type: V2ray, Shadowsocks, Trojan, Shadowsocks-Plugin Timeout: 30 # Timeout for the api request EnableVless: false # Enable Vless for V2ray Type EnableXTLS: false # Enable XTLS for V2ray and Trojan SpeedLimit: 0 # Mbps, Local settings will replace remote settings, 0 means disable DeviceLimit: 0 # Local settings will replace remote settings, 0 means disable RuleListPath: # /etc/XrayR/rulelist Path to local rulelist file ControllerConfig: ListenIP: 0.0.0.0 # IP address you want to listen SendIP: 0.0.0.0 # IP address you want to send pacakage UpdatePeriodic: 60 # Time to update the nodeinfo, how many sec. EnableDNS: false # Use custom DNS config, Please ensure that you set the dns.json well DNSType: AsIs # AsIs, UseIP, UseIPv4, UseIPv6, DNS strategy EnableProxyProtocol: false # Only works for WebSocket and TCP AutoSpeedLimitConfig: Limit: 0 # Warned speed. Set to 0 to disable AutoSpeedLimit (mbps) WarnTimes: 0 # After (WarnTimes) consecutive warnings, the user will be limited. Set to 0 to punish overspeed user immediately. LimitSpeed: 0 # The speedlimit of a limited user (unit: mbps) LimitDuration: 0 # How many minutes will the limiting last (unit: minute) GlobalDeviceLimitConfig: Enable: false # Enable the global device limit of a user RedisAddr: 127.0.0.1:6379 # The redis server address RedisPassword: YOUR PASSWORD # Redis password RedisDB: 0 # Redis DB Timeout: 5 # Timeout for redis request Expiry: 60 # Expiry time (second) EnableFallback: false # Only support for Trojan and Vless FallBackConfigs: # Support multiple fallbacks

      SNI: # TLS SNI(Server Name Indication), Empty for any
      Alpn: # Alpn, Empty for any
      Path: # HTTP PATH, Empty for any
      Dest: 80 # Required, Destination of fallback, check https://xtls.github.io/config/features/fallback.html for details.
      ProxyProtocolVer: 0 # Send PROXY protocol version, 0 for dsable
  CertConfig:
    CertMode: dns # Option about how to get certificate: none, file, http, tls, dns. Choose "none" will forcedly disable the tls config.
    CertDomain: "v2ray03.xyz.xyz" # Domain to cert
    CertFile: /etc/XrayR/cert/node1.test.com.cert # Provided if the CertMode is file
    KeyFile: /etc/XrayR/cert/node1.test.com.key
    Provider: cloudflare # DNS cert provider, Get the full support list here: https://go-acme.github.io/lego/dns/
    Email: test@me.com
    DNSEnv: # DNS ENV option used by DNS provider
      CLOUDFLARE_EMAIL: xyz@gmail.com 
      CLOUDFLARE_API_KEY: 9ca90ccbbbcaade09651e4c34050f5a6fc881
WhoCaresBugs commented 9 months ago

Xray Core Version: 1.8.4

Septrum101 commented 9 months ago

no logs?

WhoCaresBugs commented 9 months ago

no logs?

There was no error message in the XrayR log. It seems that node ID 4 and node ID 5 did not exist. Based on my understanding, XrayR code did not take the configuration after the first node section. It skips the rest of config.yml. The config.yml is provided as above. It is a pure V2ray VPS. No other protocol is configured

WhoCaresBugs commented 9 months ago

I am sure this is a bug. I did the following test by twisting the config.yml file. The logic is like decribed below.

Nodes:

Then on v2board, the node1 turned yellow, the rest were red

If I switch the sequence of the configlet, like example below:

Nodes:

Then node3 turned yellow on v2board and node1/2 were RED.

So my question is: for one XrayR instance, how many v2ray nodes it allows to run? Am I supposed to configure multiple v2ray nodes on one VPS server?

Thanks

WhoCaresBugs commented 9 months ago

I think I found the reason. It is because I was using RESTART. If I stopped XrayR and START it, then suddenly everything works.

I think we can close this ticket and work on something more important.

Thanks guys.

Use Stop - Start. Not Restart。