Clarified and Split Apart Environment Variables that alter port binding behaviour. #47
|
@ -274,6 +274,10 @@ func (tp *torProvider) Listen(identity connectivity.PrivateKey, port int) (conne
|
|||
if _, ferr := os.Stat("/usr/share/anon-ws-base-files/workstation"); !os.IsNotExist(ferr) {
|
||||
dan marked this conversation as resolved
|
||||
localListener, err = net.Listen("tcp", "0.0.0.0:"+strconv.Itoa(localport))
|
||||
}
|
||||
// for whonix like systems we tightly restrict possible listen...
|
||||
dan marked this conversation as resolved
dan
commented
dont understand this line dont understand this line
sarah
commented
I had to pick a subrange of ports (technically we could allow these to be configurable, but the additional complexity does not seem worth it atm), and this how I arrived at the top range. I had to pick a subrange of ports (technically we could allow these to be configurable, but the additional complexity does not seem worth it atm), and this how I arrived at the top range.
|
||||
// pick a random port between 15300 and 15378
|
||||
dan marked this conversation as resolved
dan
commented
since its not a specified range, why not call it WHONIX_PORTS since thats what it is since its not a specified range, why not call it WHONIX_PORTS since thats what it is
sarah
commented
there are other possible usecases for this flag e.g. any containerized OS, not just whonix. there are other possible usecases for this flag e.g. any containerized OS, not just whonix.
|
||||
// cwtch = 63 *77 *74* 63* 68 = 1537844616
|
||||
localport = 15300 + ((localport - 1024) % 78)
|
||||
} else {
|
||||
localListener, err = net.Listen("tcp", "127.0.0.1:"+strconv.Itoa(localport))
|
||||
}
|
||||
|
@ -298,6 +302,7 @@ func (tp *torProvider) Listen(identity connectivity.PrivateKey, port int) (conne
|
|||
return nil, err
|
||||
}
|
||||
|
||||
os.ID = onion
|
||||
os.CloseLocalListenerOnClose = true
|
||||
|
||||
ols := &onionListenService{os: os, tp: tp}
|
||||
|
|
Loading…
Reference in New Issue
from the docs i thought i could specify the range on the cmd line. can't we just change this to an
.exists()
check as a flag? any value means it was set?I'd rather be explicit. Someone setting this to "false" should not be surprised.