mirror of
https://github.com/markqvist/Reticulum.git
synced 2025-04-19 07:06:17 -04:00
Merge 95cea245275a2a497fd877f39c28afa0bab828fb into 98d4f1c69e8e31dc0af5f19c0aae9c1f88cb0e14
This commit is contained in:
commit
192be831f8
@ -91,7 +91,25 @@ def listen(configdir, identitypath = None, verbosity = 0, quietness = 0, allowed
|
||||
except Exception as e:
|
||||
print(str(e))
|
||||
exit(1)
|
||||
|
||||
try:
|
||||
allowed_file_name = "allowed_identities"
|
||||
allowed_file = None
|
||||
if os.path.isfile(os.path.expanduser("/etc/rnx/"+allowed_file_name)):
|
||||
allowed_file = os.path.expanduser("/etc/rnx/"+allowed_file_name)
|
||||
elif os.path.isfile(os.path.expanduser("~/.config/rnx/"+allowed_file_name)):
|
||||
allowed_file = os.path.expanduser("~/.config/rnx/"+allowed_file_name)
|
||||
elif os.path.isfile(os.path.expanduser("~/.rnx/"+allowed_file_name)):
|
||||
allowed_file = os.path.expanduser("~/.rnx/"+allowed_file_name)
|
||||
if allowed_file != None:
|
||||
with open(allowed_file, "r") as af_handle:
|
||||
allowed_by_file = af_handle.read().replace("\r", "").split("\n")
|
||||
for allowed_ID in allowed_by_file:
|
||||
if len(allowed_ID) == (RNS.Reticulum.TRUNCATED_HASHLENGTH//8)*2:
|
||||
allowed_identity_hashes.append(bytes.fromhex(allowed_ID))
|
||||
except Exception as e:
|
||||
print(str(e))
|
||||
exit(1)
|
||||
|
||||
if len(allowed_identity_hashes) < 1 and not disable_auth:
|
||||
print("Warning: No allowed identities configured, rncx will not accept any commands!")
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user