Skip to content

Commit

Permalink
rename web.py to meshchat.py
Browse files Browse the repository at this point in the history
  • Loading branch information
liamcottle committed Jul 9, 2024
1 parent dad956a commit 879632a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,32 +120,32 @@ Remember, in order to connect with other peers or nodes, they must announce on t
## How does it work?

- A python script ([web.py](./web.py)) runs a Reticulum instance and a WebSocket server.
- A python script ([meshchat.py](./meshchat.py)) runs a Reticulum instance and a WebSocket server.
- The web page sends and receives LXMF packets encoded in json via the WebSocket.
- Web Browser -> WebSocket -> Python Reticulum -> (configured interfaces) -> (destination)
- LXMF messages sent and received are saved to a local SQLite database.

## How to use it?

If you don't want to, or can't [download](#download) a standalone application, you will need to install [Python 3](https://www.python.org/downloads/), clone the source code from this repo, install dependencies and then run `web.py`.
If you don't want to, or can't [download](#download) a standalone application, you will need to install [Python 3](https://www.python.org/downloads/), clone the source code from this repo, install dependencies and then run `meshchat.py`.

```
git clone https://github.com/liamcottle/reticulum-meshchat
cd reticulum-meshchat
pip install -r requirements.txt
python web.py
python meshchat.py
```

> NOTE: You should now be able to access the web interface at http://localhost:8000
For a full list of command line options, you can run;

```
python web.py --help
python meshchat.py --help
```

```
usage: web.py [-h] [--host [HOST]] [--port [PORT]] [--headless] [--identity-file IDENTITY_FILE] [--identity-base64 IDENTITY_BASE64] [--generate-identity-file GENERATE_IDENTITY_FILE] [--generate-identity-base64]
usage: meshchat.py [-h] [--host [HOST]] [--port [PORT]] [--headless] [--identity-file IDENTITY_FILE] [--identity-base64 IDENTITY_BASE64] [--generate-identity-file GENERATE_IDENTITY_FILE] [--generate-identity-base64]
[--reticulum-config-dir RETICULUM_CONFIG_DIR] [--storage-dir STORAGE_DIR]
ReticulumMeshChat
Expand Down Expand Up @@ -181,7 +181,7 @@ If you want to use an existing identity;
To use a custom identity file, provide the `--identity-file` argument followed by the path to your custom identity file.

```
python web.py --identity-file ./custom_identity_file
python meshchat.py --identity-file ./custom_identity_file
```

If you would like to generate a new identity, you can use the [rnid](https://reticulum.network/manual/using.html#the-rnid-utility) utility provided by Reticulum.
Expand All @@ -193,13 +193,13 @@ rnid --generate ./new_identity_file
If you don't have access to the `rnid` command, you can use the following:

```
python web.py --generate-identity-file ./new_identity_file
python meshchat.py --generate-identity-file ./new_identity_file
```

Alternatively, you can provide a base64 encoded private key, like so;

```
python web.py --identity-base64 "GCN6mMhVemdNIK/fw97C1zvU17qjQPFTXRBotVckeGmoOwQIF8VOjXwNNem3CUOJZCQQpJuc/4U94VSsC39Phw=="
python meshchat.py --identity-base64 "GCN6mMhVemdNIK/fw97C1zvU17qjQPFTXRBotVckeGmoOwQIF8VOjXwNNem3CUOJZCQQpJuc/4U94VSsC39Phw=="
```

> NOTE: this is a randomly generated identity for example purposes. Do not use it, it has been leaked!
Expand Down
2 changes: 1 addition & 1 deletion database.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from playhouse.migrate import migrate as migrate_database, SqliteMigrator

latest_version = 2 # increment each time new database migrations are added
database = DatabaseProxy() # use a proxy object, as we will init real db client inside web.py
database = DatabaseProxy() # use a proxy object, as we will init real db client inside meshchat.py
migrator = SqliteMigrator(database)


Expand Down
2 changes: 1 addition & 1 deletion web.py → meshchat.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@


# NOTE: this is required to be able to pack our app with cxfreeze as an exe, otherwise it can't access bundled assets
# this returns a file path based on if we are running web.py directly, or if we have packed it as an exe with cxfreeze
# this returns a file path based on if we are running meshchat.py directly, or if we have packed it as an exe with cxfreeze
# https://cx-freeze.readthedocs.io/en/latest/faq.html#using-data-files
def get_file_path(filename):
if getattr(sys, "frozen", False):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
description='A simple mesh network communications app powered by the Reticulum Network Stack',
executables=[
Executable(
script='web.py', # this script to run
script='meshchat.py', # this script to run
base=None, # we are running a console application, not a gui
target_name='ReticulumMeshChat', # creates ReticulumMeshChat.exe
shortcut_name='ReticulumMeshChat', # name shown in shortcut
Expand Down

0 comments on commit 879632a

Please sign in to comment.