diff --git a/.gitignore b/.gitignore index 49ecd06..c585a06 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ TODO Release/*.hex Release/*.zip Release/*.json +Console/build build/* diff --git a/Console.h b/Console.h index e51b5bb..6505cdd 100644 --- a/Console.h +++ b/Console.h @@ -15,10 +15,6 @@ #error Target CONFIG_IDF_TARGET is not supported #endif -// Replace with your network credentials -const char* ssid = "RNode Test"; -const char* password = "somepass"; - WebServer server(80); void console_dbg(String msg) { @@ -63,6 +59,8 @@ String console_get_content_type(String filename) { return "application/x-zip"; } else if (filename.endsWith(".gz")) { return "application/x-gzip"; + } else if (filename.endsWith(".whl")) { + return "application/octet-stream"; } return "text/plain"; } @@ -83,6 +81,7 @@ bool console_serve_file(String path) { File file = SPIFFS.open(path, "r"); console_dbg("Serving file to client"); server.streamFile(file, content_type); + console_dbg("Closing file"); file.close(); console_dbg("File serving done"); @@ -104,8 +103,7 @@ void console_register_pages() { void console_start() { Serial.println(""); console_dbg("Starting Access Point..."); - // WiFi.softAP(ssid, password); - WiFi.softAP(bt_devname, password); + WiFi.softAP(bt_devname); delay(150); IPAddress ip(10, 0, 0, 1); IPAddress nm(255, 255, 255, 0); @@ -125,10 +123,9 @@ void console_start() { void console_loop(){ server.handleClient(); - // Internally, this yields the thread and allows // other tasks to run. - delay(5); + delay(2); } // void listDir(fs::FS &fs, const char * dirname, uint8_t levels){ diff --git a/Console/Makefile b/Console/Makefile index 457b10e..3ebb1e5 100644 --- a/Console/Makefile +++ b/Console/Makefile @@ -1,16 +1,17 @@ clean: - @echo Cleaning... - @-rm -rf ./build + @echo Cleaning... + @-rm -rf ./build site: - @mkdir -p ./build - @mkdir -p ./build/css - @mkdir -p ./build/gfx - @mkdir -p ./build/images - python ./build.py - cp assets/css/* build/css/ - cp assets/gfx/* build/gfx/ - cp assets/images/* build/images/ - cp assets/scripts/* build/scripts/ - # @cp -r ../../Reticulum/docs/manual/* build/reticulum_manual/ - # @cp -r ../../Reticulum/docs/Reticulum\ Manual.pdf build/reticulum_manual/ + @mkdir -p ./build + @mkdir -p ./build/css + @mkdir -p ./build/gfx + @mkdir -p ./build/images + # @mkdir -p ./build/pkgs + python ./build.py + @cp assets/css/* build/css/ + @cp assets/gfx/* build/gfx/ + # @cp assets/images/* build/images/ + # @cp assets/scripts/* build/scripts/ + # @cp -r ../../Reticulum/docs/manual/* build/reticulum_manual/ + # @cp -r ../../Reticulum/docs/Reticulum\ Manual.pdf build/reticulum_manual/ diff --git a/Console/assets/water.css b/Console/assets/css/water.css similarity index 100% rename from Console/assets/water.css rename to Console/assets/css/water.css diff --git a/Console/assets/yond.woff2 b/Console/assets/css/yond.woff2 similarity index 100% rename from Console/assets/yond.woff2 rename to Console/assets/css/yond.woff2 diff --git a/Console/assets/gfx/icon.png b/Console/assets/gfx/icon.png new file mode 100644 index 0000000..9549c1f Binary files /dev/null and b/Console/assets/gfx/icon.png differ diff --git a/Console/assets/gfx/nn.webp b/Console/assets/gfx/nn.webp new file mode 100644 index 0000000..5186c21 Binary files /dev/null and b/Console/assets/gfx/nn.webp differ diff --git a/Console/assets/test.png b/Console/assets/gfx/rnode_iso.png similarity index 100% rename from Console/assets/test.png rename to Console/assets/gfx/rnode_iso.png diff --git a/Console/assets/gfx/sideband.webp b/Console/assets/gfx/sideband.webp new file mode 100644 index 0000000..a90154b Binary files /dev/null and b/Console/assets/gfx/sideband.webp differ diff --git a/Console/build.py b/Console/build.py index b3b71d5..e1cd33a 100644 --- a/Console/build.py +++ b/Console/build.py @@ -1,9 +1,17 @@ import markdown import os +import shutil + +packages = { + "rns": "rns-0.4.6-py3-none-any.whl", + "nomadnet": "nomadnet-0.3.1-py3-none-any.whl", + "lxmf": "lxmf-0.2.8-py3-none-any.whl", +} DEFAULT_TITLE = "RNode Bootstrap Console" SOURCES_PATH="./source" BUILD_PATH="./build" +PACKAGES_PATH = "../../dist_archive" INPUT_ENCODING="utf-8" OUTPUT_ENCODING="utf-8" @@ -13,7 +21,7 @@ document_start = """ - + {PAGE_TITLE} @@ -26,7 +34,7 @@ document_start = """ document_end = """""" -menu_md = """
[Start]({CONTENT_PATH}index.html) | [Replicate]({CONTENT_PATH}replicate.html) | [Guides]({CONTENT_PATH}guides.html) | [Software]({CONTENT_PATH}software/index.html)| [Help](help.html) | [Contribute]({CONTENT_PATH}contribute.html)
""" +menu_md = """
[Start]({CONTENT_PATH}index.html) | [Replicate]({CONTENT_PATH}replicate.html) | [Guides]({CONTENT_PATH}guides.html) | [Software]({CONTENT_PATH}software.html) | [Help](help.html) | [Contribute]({CONTENT_PATH}contribute.html)
""" url_maps = [ # { "path": "", "target": "/.md"}, @@ -125,6 +133,10 @@ def generate_html(f, root_path): menu_html = markdown.markdown(menu_md.replace("{CONTENT_PATH}", root_path), extensions=["markdown.extensions.fenced_code"]).replace("

", "") page_html = markdown.markdown(md, extensions=["markdown.extensions.fenced_code"]).replace("{ASSET_PATH}", root_path) page_html = page_html.replace("{LXMF_ADDRESS}", LXMF_ADDRESS) + for pkg_name in packages: + page_html = page_html.replace("{PKG_"+pkg_name+"}", pkg_name+".zip") + page_html = page_html.replace("{PKG_NAME_"+pkg_name+"}", packages[pkg_name]) + page_date = get_prop(md, "date") if page_date != None: page_html = page_html.replace("{DATE}", page_date) @@ -133,6 +145,39 @@ def generate_html(f, root_path): source_files = scan_pages(SOURCES_PATH) +def fetch_reticulum_site(): + r_site_path = BUILD_PATH+"/r" + shutil.copytree(PACKAGES_PATH+"/reticulum.network", r_site_path) + shutil.rmtree(r_site_path+"/manual") + +def gz_all(): + import gzip + for root, dirs, files in os.walk(BUILD_PATH): + for file in files: + fpath = root+"/"+file + print("Gzipping "+fpath+"...") + f = open(fpath, "rb") + g = gzip.open(fpath+".gz", "wb") + g.writelines(f) + g.close() + f.close() + os.unlink(fpath) + +from zipfile import ZipFile +for pkg_name in packages: + pkg_file = packages[pkg_name] + pkg_full_path = PACKAGES_PATH+"/"+pkg_file + if os.path.isfile(pkg_full_path): + print("Including "+pkg_file) + z = ZipFile(BUILD_PATH+"/"+pkg_name+".zip", "w") + z.write(pkg_full_path, pkg_full_path[len(PACKAGES_PATH+"/"):]) + z.close() + # shutil.copy(pkg_full_path, BUILD_PATH+"/"+pkg_name) + + else: + print("Could not find "+pkg_full_path) + exit(1) + for um in url_maps: with open(SOURCES_PATH+"/"+um["target"], "rb") as f: of = BUILD_PATH+um["target"].replace(SOURCES_PATH, "").replace(".md", ".html") @@ -160,3 +205,6 @@ for mdf in source_files: with open(of, "wb") as wf: wf.write(html.encode(OUTPUT_ENCODING)) + +fetch_reticulum_site() +gz_all() \ No newline at end of file diff --git a/Console/donate.html b/Console/donate.html deleted file mode 100644 index f26454c..0000000 --- a/Console/donate.html +++ /dev/null @@ -1,18 +0,0 @@ - -
- -

Home | Guides | Software | Hardware | Discussions | Shop | Contact Me | Donate


Support My Work

-

You can help support the continued development of open, free and private communications systems by donating via one of the following channels:

- \ No newline at end of file diff --git a/Console/index.html b/Console/index.html deleted file mode 100644 index b4f64ec..0000000 --- a/Console/index.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - -RNode Bootstrap Console - - - -
- -
-
Start | Replicate | Guides | Software | Help & Support | Donate
-
-
-

Welcome to the RNode Bootstrap Console. This repository contains all the tools, software and information necessary to bootstrap networks and communications systems based on Reticulum.

- -

The tools and information contained in this RNode will also allow you to replicate the design, build more RNodes and grow your communications ecosystems.

-
-
-
-
-
-

What would you like to do?

-

This repository contains resources for a variety of different tasks. You can browse this repository freely, or jump straight into a task-oriented workflow by selecting one of the starting points below.

-
- - - - - - - -
- \ No newline at end of file diff --git a/Console/source/contribute.md b/Console/source/contribute.md new file mode 100644 index 0000000..1045cb6 --- /dev/null +++ b/Console/source/contribute.md @@ -0,0 +1,37 @@ +[title]: <> (Donate) +## Keep Communications Free and Open +Please take part in keeping the continued development, maintenance and distribution of the RNode ecosystem possible by donating via one of the following channels: + +Donating to the project directly helps improve the entire system. + +- Monero
+ ``` + 84FpY1QbxHcgdseePYNmhTHcrgMX4nFfBYtz2GKYToqHVVhJp8Eaw1Z1EedRnKD19b3B8NiLCGVxzKV17UMmmeEsCrPyA5w + ``` +

+- Ethereum
+ ``` + 0x81F7B979fEa6134bA9FD5c701b3501A2e61E897a + ``` +

+- Bitcoin
+ ``` + 3CPmacGm34qYvR6XWLVEJmi2aNe3PZqUuq + ``` +

+- Ko-Fi
+ `https://ko-fi.com/markqvist` + +## Spread Knowledge and Awareness +Another great way to contribute, is to spread awareness about the RNode project. Here's some ideas: + +- Introduce the concepts of Free & Open Communications Systems to your community +- Teach others to build and use RNodes, and how to set up resilient and private communications systems +- Learn about using Reticulum to set up resilient communications networks, and teach these skills to people in your area that need them + +## Contribute Code & Ideas +If you like to build and design, there is plenty of oppertunities to take part in the community around RNode, and the wider Reticulum community as well. There's always plenty of work to do, from writing code, to translating guides and information, to designing parts, devices and integrations. You can find us the following places: + +- The [Reticulum Matrix Channel](element://room/!TRaVWNnQhAbvuiSnEK%3Amatrix.org?via=matrix.org) at `#reticulum:matrix.org` +- The [discussion forum](https://github.com/markqvist/Reticulum/discussions) on GitHub +- The [Reticulum subreddit](https://reddit.com/r/reticulum) \ No newline at end of file diff --git a/Console/source/help.md b/Console/source/help.md new file mode 100644 index 0000000..037b8a9 --- /dev/null +++ b/Console/source/help.md @@ -0,0 +1,14 @@ +[title]: <> (Get Help) +## Get Help +If you are having trouble, or if something is not working, these resources may be useful: + +- The [Questions & Answers](qa.html) section +- The [No-Grid Communications Handbook](nghb.html) +- The [Reticulum Manual](manual/index.html) + +## Community & Support +If things still aren't working as expected here are some great places to ask for help: + +- The [discussion forum](https://github.com/markqvist/Reticulum/discussions) on GitHub +- The [Reticulum Matrix Channel](element://room/!TRaVWNnQhAbvuiSnEK%3Amatrix.org?via=matrix.org) at `#reticulum:matrix.org` +- The [Reticulum subreddit](https://reddit.com/r/reticulum) \ No newline at end of file diff --git a/Console/source/index.md b/Console/source/index.md new file mode 100644 index 0000000..d3f8a90 --- /dev/null +++ b/Console/source/index.md @@ -0,0 +1,21 @@ +**Hello!** You have connected to the **RNode Bootstrap Console**. + +This repository contains all the tools, software and information necessary to bootstrap networks and communications systems based on Reticulum. The tools and information contained in this RNode will also allow you to replicate the design, build more RNodes and grow your communications ecosystems. + +
+
+
+
+ +### What would you like to do? +This repository contains resources for a variety of different tasks. You can browse this repository freely, or jump straight into a task-oriented workflow by selecting one of the starting points below. +
+
+ + + + + + + +
\ No newline at end of file diff --git a/Console/source/qa.md b/Console/source/qa.md new file mode 100644 index 0000000..e6b1b0e --- /dev/null +++ b/Console/source/qa.md @@ -0,0 +1,3 @@ +[title]: <> (Get Help) +## Questions & Answers +This section contains a list of common questions, and associated answers. \ No newline at end of file diff --git a/Console/source/replicate.md b/Console/source/replicate.md new file mode 100644 index 0000000..119d550 --- /dev/null +++ b/Console/source/replicate.md @@ -0,0 +1,3 @@ +[title]: <> (Replicate) +# Create RNodes +This section contains the tools and guides necessary to create more RNodes. \ No newline at end of file diff --git a/Console/source/software.md b/Console/source/software.md new file mode 100644 index 0000000..0d53f46 --- /dev/null +++ b/Console/source/software.md @@ -0,0 +1,92 @@ +[title]: <> (Software) +# Software +This RNode contains a repository of downloadable software and utilities, that are useful for bootstrapping communications networks, and for replicating RNodes. + +**Please Note!** Whenever you install software onto your computer, there is a risk that someone modified this software to include malicious code. Be extra careful installing anything from this RNode, if you did not get it from a source you trust, or if there is a risk it was modified in transit. + +If possible, you can check that the `SHA-256` hashes of any downloaded files correspond to the list of release hashes published on the [Reticulum Release page](https://github.com/markqvist/Reticulum/releases). + +**You Have The Source!** Due to the size limitations of shipping all this software within an RNode, we don't include separate source-code archives for the below programs, but *all the source code is included within the Python .whl files*! You can simply unzip any of them with any program that understands `zip` files, and you will find the source code inside the unzipped directory (for some zip programs, you may need to change the file ending to `.zip`). + +## Reticulum +------------- +The cryptographic networking stack for building resilient networks anywhere. This packages requires you have `python` and `pip` installed on your computer. This should come as standard on most operating systems released since 2020. + +**Local Installation** + +If you do not have access to the Internet, or would prefer to install Reticulum directly from this RNode, you can use the following instructions. + +- Download the [{PKG_rns}]({ASSET_PATH}{PKG_rns}) package from this RNode and unzip it +- Install it with the command `pip install {PKG_NAME_rns}` +- Verify the installed Reticulum version by running `rnstatus --version` + +**Online Installation** + +If you are connected to the Internet, you can try to install the latest version of Reticulum via the `pip` package manager. + +- Install Reticulum by running the command `pip install rns` +- Verify the installed Reticulum version by running `rnstatus --version` + +If the installation has problems resolving dependencies, you can try to install the `python-cryptography`, `python-netifaces` and `python-pyserial` packages from your systems package manager, if they are locally available. If this is not possible, you please read the [Getting Started section of the Reticulum Manual]({ASSET_PATH}manual/gettingstartedfast.html) for more detailed information. + +## LXMF +------------- +LXMF is a simple and flexible messaging format and delivery protocol that allows a wide variety of implementations, while using as little bandwidth as possible. It is built on top of [Reticulum](https://reticulum.network) and offers zero-conf message routing, end-to-end encryption and Forward Secrecy, and can be transported over any kind of medium that Reticulum supports. + +LXMF is efficient enough that it can deliver messages over extremely low-bandwidth systems such as packet radio or LoRa. Encrypted LXMF messages can also be encoded as QR-codes or text-based URIs, allowing completely analog *paper message* transport. + +Installing this LXMF library allows other programs on your system, like Nomad Network, to use the LXMF messaging system. It also includes the `lxmd` program that you can use to run LXMF propagation nodes on your network. + +**Local Installation** + +If you do not have access to the Internet, or would prefer to install LXMF directly from this RNode, you can use the following instructions. + +- Download the [{PKG_lxmf}]({ASSET_PATH}{PKG_lxmf}) package from this RNode and unzip it +- Install it with the command `pip install {PKG_NAME_lxmf}` +- Verify the installed Reticulum version by running `lxmd --version` + +**Online Installation** + +If you are connected to the Internet, you can try to install the latest version of LXMF via the `pip` package manager. + +- Install Nomad Network by running the command `pip install lxmf` +- Verify the installed Reticulum version by running `lxmd --version` + +## Nomad Network +------------- +Off-grid, resilient mesh communication with strong encryption, forward secrecy and extreme privacy. + +Nomad Network Allows you to build private and resilient communications platforms that are in complete control and ownership of the people that use them. No signups, no agreements, no handover of any data, no permissions and gatekeepers. + +![Screenshot]({ASSET_PATH}gfx/nn.webp) + +Nomad Network is build on [LXMF](lxmf.html) and [Reticulum]({ASSET_PATH}r/), which together provides the cryptographic mesh functionality and peer-to-peer message routing that Nomad Network relies on. This foundation also makes it possible to use the program over a very wide variety of communication mediums, from packet radio to fiber optics. + +Nomad Network does not need any connections to the public internet to work. In fact, it doesn't even need an IP or Ethernet network. You can use it entirely over packet radio, LoRa or even serial lines. But if you wish, you can bridge islanded networks over the Internet or private ethernet networks, or you can build networks running completely over the Internet. The choice is yours. + +**Local Installation** + +If you do not have access to the Internet, or would prefer to install Nomad Network directly from this RNode, you can use the following instructions. + +- Download the [{PKG_nomadnet}]({ASSET_PATH}{PKG_nomadnet}) package from this RNode and unzip it +- Install it with the command `pip install {PKG_NAME_nomadnet}` +- Verify the installed Reticulum version by running `nomadnet --version` + +**Online Installation** + +If you are connected to the Internet, you can try to install the latest version of Nomad Network via the `pip` package manager. + +- Install Nomad Network by running the command `pip install nomadnet` +- Verify the installed Reticulum version by running `nomadnet --version` + +## Sideband +------------- +Sideband is an LXMF client for Android, Linux and macOS. It allows you to communicate with other people or LXMF-compatible systems over Reticulum networks using LoRa, Packet Radio, WiFi, I2P, or anything else Reticulum supports. Sideband also supports exchanging messages through encrypted QR-codes on paper, or through messages embedded directly in lxm:// links. + +![Screenshot]({ASSET_PATH}gfx/sideband.webp) + +The Sideband program is to large to be included on this RNode, but downloads for Linux, Android and macOS can be obtained from following sources: + +- The [Sideband page](https://unsigned.io/sideband/) on [unsigned.io](https://unsigned.io/) +- The [GitHub release page for Sideband](https://github.com/markqvist/Sideband/releases/latest) +- The [IzzyOnDroid repository for F-Droid](https://android.izzysoft.de/repo/apk/io.unsigned.sideband) \ No newline at end of file diff --git a/Makefile b/Makefile index 2bfd807..93f0d13 100644 --- a/Makefile +++ b/Makefile @@ -22,10 +22,16 @@ prep-samd: arduino-cli core update-index --config-file arduino-cli.yaml arduino-cli core install adafruit:samd -spiffs-image: - python Release/esptool/spiffsgen.py 2031616 ./Console Release/spiffs.bin +console-site: + make -C Console clean site -spiffs-deploy: +spiffs: console-site spiffs-image + +spiffs-image: + python Release/esptool/spiffsgen.py 2031616 ./Console/build Release/spiffs.bin +# python Release/esptool/spiffsgen.py --obj-name-len 64 2031616 ./Console/build Release/spiffs.bin + +upload-spiffs: @echo Deploying SPIFFS image... python ./Release/esptool/esptool.py --chip esp32 --port /dev/ttyACM1 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x210000 ./Release/spiffs.bin diff --git a/Release/spiffs.bin b/Release/spiffs.bin index 95fea1e..b38f490 100644 Binary files a/Release/spiffs.bin and b/Release/spiffs.bin differ