mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-08-17 00:31:00 +00:00
feat(docker): support XUI_PORT runtime override (#5240)
* feat(docker): support XUI_PORT runtime override Allow deployments to select the panel listener port without mutating the persisted webPort setting. Invalid values fall back to the database-backed port and are covered by parser boundary tests. * docs: describe XUI_PORT deployment usage Add commented local and Compose examples, explain runtime precedence, and call out matching Docker bridge port mappings.
This commit is contained in:
@@ -407,6 +407,14 @@ func (s *Server) start(restartXray bool, startTgBot bool) (err error) {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if envPort, configured, envErr := config.GetPortOverride(); configured {
|
||||
if envErr != nil {
|
||||
logger.Warning("Ignoring invalid XUI_PORT; using configured web port:", port, envErr)
|
||||
} else {
|
||||
port = envPort
|
||||
logger.Info("Using XUI_PORT override for web panel port:", port)
|
||||
}
|
||||
}
|
||||
listenAddr := net.JoinHostPort(listen, strconv.Itoa(port))
|
||||
listener, err := net.Listen("tcp", listenAddr)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user