From 0bb32748b92a830e9f6496b3d2101da953cdd02e Mon Sep 17 00:00:00 2001 From: mik-tf Date: Thu, 22 Feb 2024 15:04:48 +0000 Subject: [PATCH 1/3] Update scripts/hero_mdbook.sh added line to properly install mdbook --- scripts/hero_mdbook.sh | 125 +++++++++++++++++++++-------------------- 1 file changed, 63 insertions(+), 62 deletions(-) diff --git a/scripts/hero_mdbook.sh b/scripts/hero_mdbook.sh index d94caa1..b9b6421 100644 --- a/scripts/hero_mdbook.sh +++ b/scripts/hero_mdbook.sh @@ -1,63 +1,64 @@ -#!/bin/bash - -# Generate opening text. -cat < /tmp/hero_install.sh -bash /tmp/hero_install.sh - -# Start the SSH agent, run hero mdbook and build the mdbook -eval $(ssh-agent) -hero mdbook -u https://git.ourworld.tf/tfgrid/info_tfgrid/src/branch/main/heroscript -cd /root/hero/var/mdbuild/duniayetu -mdbook build - -# Generate closing text after successful script. -cat < /tmp/hero_install.sh +bash /tmp/hero_install.sh + +# Start the SSH agent, run hero mdbook and build the mdbook +eval $(ssh-agent) +hero mdbook -u https://git.ourworld.tf/tfgrid/info_tfgrid/src/branch/main/heroscript +cd /root/hero/var/mdbuild/duniayetu +mdbook build + +# Generate closing text after successful script. +cat < /dev/null; exit \ No newline at end of file From dac4534d9963f05eb1f4e2356c9057ae1ed014be Mon Sep 17 00:00:00 2001 From: mik-tf Date: Thu, 22 Feb 2024 15:05:49 +0000 Subject: [PATCH 2/3] Update docs/hero_mdbook_fullvm.md added line to install cargo --- docs/hero_mdbook_fullvm.md | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/docs/hero_mdbook_fullvm.md b/docs/hero_mdbook_fullvm.md index afdbf59..bfb2d0e 100644 --- a/docs/hero_mdbook_fullvm.md +++ b/docs/hero_mdbook_fullvm.md @@ -5,7 +5,7 @@ - [Introduction](#introduction) - [Setting the Full VM](#setting-the-full-vm) - [Remote Explorer Access](#remote-explorer-access) - - [Install cargo](#install-cargo) + - [Install cargo and mdbook](#install-cargo-and-mdbook) - [Install redis](#install-redis) - [Install pkg-config, gcc and libssl](#install-pkg-config-gcc-and-libssl) - [Set Hero](#set-hero) @@ -23,13 +23,21 @@ For this guide, we show an example using the mdbook from the repository [info_tf We show the steps for a full VM deployed on the TFGrid with WireGuard. We use `10.20.4.2` as a WireGuard IP address. Adjust according to your own setup. -We will be using SSH to connect to the VM and we will access the mdbook output on a local browser. To manage the mdbook files, we will be using the remote explorer feature of either VSCodium or VSCode. +We will be using SSH to connect to the VM and to create an SSH tunnel between the local machine and the VM. This will allow the mdbook output to be displayed on a local browser. + +To manage the mdbook files, we will be using the remote explorer feature of either VSCodium or VSCode. ## Setting the Full VM -We start by deploying a full VM with WireGuard on the TFGrid. +We start by deploying a full VM with WireGuard on the TFGrid. We also set an SSH tunnel. -To connect to the VM, we will be using a remote explorer. +- Deploy a full VM with WireGuard on the TFGrid +- Set an SSH tunnel, on port 3333 for both local and VM + ``` + ssh -4 -L 3333:127.0.0.1:3333 root@10.20.4.2 + ``` + +Instead of working on the SSH tunnel terminal window, we will be using the remote explorer feature of a source-code editor. ### Remote Explorer Access @@ -49,7 +57,7 @@ You can use the remote explorer feature of both [VSCode](https://marketplace.vis apt update && apt upgrade -y ``` -### Install cargo +### Install cargo and mdbook Once you install cargo, all mdbook dependencies will be installed via the hero script. @@ -61,6 +69,10 @@ Once you install cargo, all mdbook dependencies will be installed via the hero s ``` source "$HOME/.cargo/env" ``` +- Install mdbook + ``` + cargo install mdbook + ``` ### Install redis @@ -120,7 +132,7 @@ Once you install cargo, all mdbook dependencies will be installed via the hero s - To serve on your local machine, make sure to use the same part as the one set in your SSH tunnel (here it's port 3333) ``` - mdbook serve --hostname 0.0.0.0 --port 3333 + mdbook serve --port 3333 ``` - To see the mdbook live, open a browser on the local machine and go to localhost:3333 From dbc6c5504c7b3abc7c945dcfc415aa4246a5abb9 Mon Sep 17 00:00:00 2001 From: mik-tf Date: Thu, 22 Feb 2024 15:06:28 +0000 Subject: [PATCH 3/3] Update docs/hero_mdbook_fullvm.md --- docs/hero_mdbook_fullvm.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/hero_mdbook_fullvm.md b/docs/hero_mdbook_fullvm.md index bfb2d0e..c084777 100644 --- a/docs/hero_mdbook_fullvm.md +++ b/docs/hero_mdbook_fullvm.md @@ -59,8 +59,6 @@ You can use the remote explorer feature of both [VSCode](https://marketplace.vis ### Install cargo and mdbook -Once you install cargo, all mdbook dependencies will be installed via the hero script. - - Install cargo rust for linux and mac (with default installation) ``` curl https://sh.rustup.rs -sSf | sh