diff --git a/README.md b/README.md index 0fe9df3..dbef65c 100644 --- a/README.md +++ b/README.md @@ -92,7 +92,6 @@ python web.py --identity-base64 "GCN6mMhVemdNIK/fw97C1zvU17qjQPFTXRBotVckeGmoOwQ ## TODO -- [ ] allow passing in a custom Reticulum config file via cli args - [ ] allow generating identity in python if rnid util is not available - [ ] send images from web ui - [ ] send file attachments from web ui diff --git a/web.py b/web.py index fe25096..6d9f7bc 100644 --- a/web.py +++ b/web.py @@ -15,7 +15,7 @@ import base64 class ReticulumWebChat: - def __init__(self, webchat_config_file, identity: RNS.Identity): + def __init__(self, webchat_config_file, reticulum_config_dir, identity: RNS.Identity): # default values before loading config self.display_name = "Anonymous Peer" @@ -25,7 +25,7 @@ class ReticulumWebChat: self.load_config() # init reticulum - self.reticulum = RNS.Reticulum(None) + self.reticulum = RNS.Reticulum(reticulum_config_dir) self.identity = identity # init lxmf router @@ -420,6 +420,7 @@ async def main(): parser.add_argument("--port", nargs='?', default="8000", type=int, help="The port the web server should listen on.") parser.add_argument("--identity-file", type=str, help="Path to a Reticulum Identity file to use as your LXMF address.") parser.add_argument("--identity-base64", type=str, help="A base64 encoded Reticulum Identity to use as your LXMF address.") + parser.add_argument("--reticulum-config-dir", type=str, help="Path to a Reticulum config directory for the RNS stack to use (e.g: ~/.reticulum)") parser.add_argument("--webchat-config-file", type=str, help="Path to a ReticulumWebChat config file for saving user preferences.") args = parser.parse_args() @@ -440,7 +441,7 @@ async def main(): print(identity) # init app - reticulum_webchat = ReticulumWebChat(args.webchat_config_file, identity) + reticulum_webchat = ReticulumWebChat(args.webchat_config_file, args.reticulum_config_dir, identity) await reticulum_webchat.run(args.host, args.port)