From 832ee413bac29ca376001859080a1ba4edff9913 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Fri, 13 Jan 2023 01:43:47 +0100 Subject: [PATCH] Updated console site --- Console/Makefile | 2 ++ Console/build.py | 70 ++++++++++++++++++++++++++++++++-------- Console/source/index.md | 2 +- Console/source/s_lxmf.md | 4 +-- Console/source/s_nn.md | 4 +-- Console/source/s_rns.md | 4 +-- 6 files changed, 66 insertions(+), 20 deletions(-) diff --git a/Console/Makefile b/Console/Makefile index 21b31ec..2e517c5 100644 --- a/Console/Makefile +++ b/Console/Makefile @@ -7,6 +7,8 @@ clean: dirs: @mkdir -p ./build + @mkdir -p ./build/3d + @mkdir -p ./build/pkg @mkdir -p ./build/css @mkdir -p ./build/gfx @mkdir -p ./build/images diff --git a/Console/build.py b/Console/build.py index 107bf77..ebba35a 100644 --- a/Console/build.py +++ b/Console/build.py @@ -153,7 +153,8 @@ def generate_html(f, root_path): 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_"+pkg_name+"}", "pkg/"+pkg_name+".zip") + page_html = page_html.replace("{PKG_BASE_"+pkg_name+"}", pkg_name+".zip") page_html = page_html.replace("{PKG_NAME_"+pkg_name+"}", packages[pkg_name]) page_date = get_prop(md, "date") @@ -172,18 +173,30 @@ mf.write(help_redirect) mf.close() def optimise_manual(path): + pm = 176 scale_imgs = [ - ("_images/board_rnodev2.png", 256), - ("_images/board_rnode.png", 256), - ("_images/board_heltec32.png", 256), - ("_images/board_t3v21.png", 256), - ("_images/board_t3v20.png", 256), - ("_images/sideband_devices.webp", 380), - ("_images/board_tbeam.png", 256), - ("_images/nomadnet_3.png", 380), - ("_images/radio_is5ac.png", 256), - ("_images/radio_rblhg5.png", 256), - ("_static/rns_logo_512.png", 256), + # ("_images/board_rnodev2.png", 256), + # ("_images/board_rnode.png", 256), + # ("_images/board_heltec32.png", 256), + # ("_images/board_t3v21.png", 256), + # ("_images/board_t3v20.png", 256), + # ("_images/sideband_devices.webp", 380), + # ("_images/board_tbeam.png", 256), + # ("_images/nomadnet_3.png", 380), + # ("_images/radio_is5ac.png", 256), + # ("_images/radio_rblhg5.png", 256), + # ("_static/rns_logo_512.png", 256), + ("_images/board_rnodev2.png", pm), + ("_images/board_rnode.png", pm), + ("_images/board_heltec32.png", pm), + ("_images/board_t3v21.png", pm), + ("_images/board_t3v20.png", pm), + ("_images/sideband_devices.webp", pm), + ("_images/board_tbeam.png", pm), + ("_images/nomadnet_3.png", pm), + ("_images/radio_is5ac.png", pm), + ("_images/radio_rblhg5.png", pm), + ("_static/rns_logo_512.png", pm), ] import subprocess @@ -236,6 +249,37 @@ def fetch_reticulum_site(): shutil.copytree(PACKAGES_PATH+"/reticulum.network", r_site_path) if os.path.isdir(r_site_path+"/manual"): optimise_manual(r_site_path+"/manual") + remove_files = [ + "gfx/reticulum_logo_512.png", + ] + for file in remove_files: + fp = r_site_path+"/"+file + print("Removing file: "+str(fp)) + os.unlink(fp) + replace_paths() + +def replace_paths(): + repls = [ + ("gfx/reticulum_logo_512.png", "/m/_static/rns_logo_512.png") + ] + for root, dirs, files in os.walk(BUILD_PATH): + for file in files: + fpath = root+"/"+file + if fpath.endswith(".html"): + print("Performing replacements in "+fpath+"") + f = open(fpath, "rb") + html = f.read().decode("utf-8") + f.close() + for s,r in repls: + html = html.replace(s,r) + f = open(fpath, "wb") + f.write(html.encode("utf-8")) + f.close() + + # if not os.path.isdir(BUILD_PATH+"/d"): + # os.makedirs(BUILD_PATH+"/d") + # shutil.move(fpath, BUILD_PATH+"/d/") + def remap_names(): for root, dirs, files in os.walk(BUILD_PATH): @@ -269,7 +313,7 @@ for pkg_name in packages: 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 = ZipFile(BUILD_PATH+"/pkg/"+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) diff --git a/Console/source/index.md b/Console/source/index.md index ddab22c..80fc5bc 100644 --- a/Console/source/index.md +++ b/Console/source/index.md @@ -7,7 +7,7 @@ You have connected to the RNode Bootstrap Console.

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

-This repository also contains tools, software and information necessary to bootstrap networks and communications systems based on Reticulum and RNodes. +This repository also contains tools, software and information necessary to bootstrap networks and communications systems based on RNodes and Reticulum. diff --git a/Console/source/s_lxmf.md b/Console/source/s_lxmf.md index 0138cca..2c15660 100644 --- a/Console/source/s_lxmf.md +++ b/Console/source/s_lxmf.md @@ -10,8 +10,8 @@ Installing this LXMF library allows other programs on your system, like Nomad Ne 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}` +- Download the [{PKG_BASE_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` If you do not have an Internet connection while installing make sure to install the [Reticulum](./s_rns.html) package first. diff --git a/Console/source/s_nn.md b/Console/source/s_nn.md index 040d01e..8522156 100644 --- a/Console/source/s_nn.md +++ b/Console/source/s_nn.md @@ -14,8 +14,8 @@ Nomad Network does not need any connections to the public internet to work. In f 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}` +- Download the [{PKG_BASE_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` If you do not have an Internet connection while installing make sure to install the [Reticulum](./s_rns.html) and [LXMF](./s_lxmf.html) packages first. diff --git a/Console/source/s_rns.md b/Console/source/s_rns.md index 0eb6aa3..72541e2 100644 --- a/Console/source/s_rns.md +++ b/Console/source/s_rns.md @@ -5,8 +5,8 @@ The cryptographic networking stack for building resilient networks anywhere. Thi ### 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}` +- Download the [{PKG_BASE_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