mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-19 13:36:09 +05:00
add check for command line ip options
This commit is contained in:
@@ -142,7 +142,7 @@ func (bt *BTServer) configure() {
|
|||||||
|
|
||||||
// set public IPv4
|
// set public IPv4
|
||||||
if settings.PubIPv4 != "" {
|
if settings.PubIPv4 != "" {
|
||||||
if ip4 := net.ParseIP(settings.PubIPv4); ip4.To4 != nil {
|
if ip4 := net.ParseIP(settings.PubIPv4); ip4.To4 != nil && !isPrivateIP(ip4) {
|
||||||
bt.config.PublicIp4 = ip4
|
bt.config.PublicIp4 = ip4
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -155,7 +155,7 @@ func (bt *BTServer) configure() {
|
|||||||
|
|
||||||
// set public IPv6
|
// set public IPv6
|
||||||
if settings.PubIPv6 != "" {
|
if settings.PubIPv6 != "" {
|
||||||
if ip6 := net.ParseIP(settings.PubIPv6); ip6.To16 != nil && ip6.To4 == nil {
|
if ip6 := net.ParseIP(settings.PubIPv6); ip6.To16 != nil && ip6.To4 == nil && !isPrivateIP(ip6) {
|
||||||
bt.config.PublicIp6 = ip6
|
bt.config.PublicIp6 = ip6
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user