mirror of
https://github.com/liamcottle/reticulum-meshchat.git
synced 2026-04-28 00:20:48 +00:00
support setting host and port via cli args
This commit is contained in:
parent
1429ba50a8
commit
254177e630
2 changed files with 12 additions and 2 deletions
|
|
@ -29,7 +29,7 @@ python web.py
|
|||
|
||||
## TODO
|
||||
|
||||
- [ ] allow passing in a custom port to serve on via cli args
|
||||
- [ ] don't start Reticulum before cli args have been parsed
|
||||
- [ ] allow passing in a custom Reticulum config file via cli args
|
||||
- [ ] conversations/contacts list ui with unread indicators
|
||||
- [ ] create/import/export identities in the web ui
|
||||
|
|
|
|||
12
web.py
12
web.py
|
|
@ -1,5 +1,6 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import argparse
|
||||
import json
|
||||
|
||||
import RNS
|
||||
|
|
@ -32,8 +33,17 @@ websocket_clients = []
|
|||
|
||||
async def main():
|
||||
|
||||
# parse command line args
|
||||
parser = argparse.ArgumentParser(description="ReticulumWebChat")
|
||||
parser.add_argument("--host", nargs='?', default="0.0.0.0", type=str)
|
||||
parser.add_argument("--port", nargs='?', default="8000", type=int)
|
||||
args = parser.parse_args()
|
||||
|
||||
# run sanic app
|
||||
app.run()
|
||||
app.run(
|
||||
host=args.host,
|
||||
port=args.port,
|
||||
)
|
||||
|
||||
# set a callback for when an lxmf message is received
|
||||
message_router.register_delivery_callback(lxmf_delivery)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue