Merge branch 'main' of git.ourworld.tf:tfgrid/info_tfgrid

This commit is contained in:
despiegk 2024-02-20 06:39:56 +03:00
commit d2c37f5d8a
Signed by: despiegk
GPG Key ID: 99E4E1492F73BC18
19 changed files with 307 additions and 23 deletions

View File

@ -1,18 +1,21 @@
# info for our new Internet / Social network
# Info for our new Internet / Social network
> [https://info.ourworld.tf/duniayetu](https://info.ourworld.tf/duniayetu)
## First install hero:
```bash
# Download the hero installer script
curl https://raw.githubusercontent.com/freeflowuniverse/crystallib/development/scripts/installer_hero.sh > /tmp/hero_install.sh
# Run the script as root to properly complete the script (e.g. sudo bash ...)
bash /tmp/hero_install.sh
#check how to use, can also do on each of the subcommands
# Check how to use, can also do on each of the subcommands
hero -help
#if it can't find hero, do the following on osx
# If it can't find hero, do the following on osx
source ~/.zprofile
```
There is also a [quick guide](./docs/hero_mdbook_fullvm.md) and a [script](./docs/hero_mdbook_fullvm_script.md) on setting mdbook and hero on a full VM running on the TFGrid. Read the [docs](./docs) for more information.
## to run the book
@ -20,7 +23,7 @@ source ~/.zprofile
```bash
hero mdbook -u https://git.ourworld.tf/tfgrid/info_tfgrid/src/branch/main/heroscript
# in case you want to open the generated book and edit
# In case you want to open the generated book and edit
hero mdbook -u https://git.ourworld.tf/tfgrid/info_tfgrid/src/branch/main/heroscript -e
```

View File

@ -6,17 +6,30 @@
- [Social Warming](why/social_warming.md)
- [Farming](farming/farming.md)
- [3Nodes](farming/3nodes.md)
- [Vision](priciples/planet_people_first.md)
- [Proof of Authenticity](priciples/poa.md)
- [Solutions](tfgrid_structure/solutions.md)
- [Decentralized Cloud](solutions/cloud.md)
- [Content Providing](solutions/content_providers.md)
- [Vision](values/values.md)
- [Planet and People First](values/planet_people_first.md)
- [Proof of Authenticity](values/poa.md)
- [Problems](problems/problems.md)
- [painkillers and onions](problems/no_pain_killer.md)
- [clouds are complicated](problems/internet_infra/cloud_issues.md)
- [content delivery is expensive](problems/internet_infra/cdn_issues.md)
- [Clouds are C omplicated](problems/cd_issues_cloud_not_enough.md)
- [Content Delivery is Expensive](problems/cd_issues_cost.md)
- [Solutions](solutions/solutions.md)
- [Decentralized Cloud](solutions/cloud/cloud.md)
- [Content Providers](solutions/content_providers/content_providers.md)
<!-- - [Social Media Platform]() -->
- [Web4](solutions/web4.md)
- [Web4](WEB4/web4.md)
- [FreeFlow Movement](freeflow/freeflow_movement.md)
- [Community Principles](freeflow/community_principles/community_principles.md)
- [Social Media Protocols](social_media_protocols/protocols.md)
- [Nostr Protocol](social_media_protocols/nostr.md)
- [Activity Pub](social_media_protocols/activitypub.md)
- [Activity Pub 2](social_media_protocols/activitypub2.md)
- [Technology](web4/web4.md)
- [FreeFlow Self](web4/freeflowself/freeflowself.md)
- [Actor Based Development](web4/actor_based/actor_based_approach.md)
- [Vlang](web4/vlang/vlang.md)
- [Dunia Yetu](dy_intro/dunia_yetu/dunia_yetu.md)
- [About Us](dy_intro/dunia_yetu/about_us.md)
- [Our Core Values](dy_intro/dunia_yetu/our_core_values.md)
- [What We Offer](dy_intro/what_we_offer/what_we_offer.md)
@ -28,15 +41,8 @@
- [Build on top of Tanzania's decentralised Internet](dy_intro/how_you_can_participate/build.md)
- [Join Our Coding Academy](dy_intro/how_you_can_participate/coding_participate.md)
- [Join Our Community](dy_intro/how_you_can_participate/community_participate.md)
- [FreeFlow Movement](freeflow_movement/freeflow_movement.md)
- [Community Principles](freeflow_movement/community_principles/community_principles.md)
- [Social Media Protocols](social_media_protocols/protocols.md)
- [Nostr Protocol](social_media_protocols/nostr.md)
- [Activity Pub](social_media_protocols/activitypub.md)
- [Activity Pub 2](social_media_protocols/activitypub2.md)
- [Technology](ffself_specs/tech.md)
- [Actor Based Development](ffself_specs/actor_based/actor_based_approach.md)
- [Vlang](ffself_specs/vlang/vlang.md)
- [SASHA sidebar](sasha/ilovezanzibar.md)
<!-- - [FreeFlow Self](ffself_specs/freeflowself/freeflowself.md) -->

View File

View File

View File

@ -0,0 +1,9 @@
# HEEEY WHATS UP
JUSt testing.
stay awesome.
live
laugh
love

View File

View File

View File

@ -1,3 +1,5 @@
# planet_people_first.md
![](img/planet_first.png)
## Core Values
@ -15,5 +17,4 @@
## Simplicity
> TODO: values, do it in the 2 layers
> TODO: values, do it in the 2 layers

View File

View File

@ -0,0 +1 @@
# Our Values

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

View File

@ -0,0 +1 @@
# countries_no_internet

View File

@ -0,0 +1 @@
# current_cloud_too_centralized

129
docs/hero_mdbook_fullvm.md Normal file
View File

@ -0,0 +1,129 @@
<h1>Hero and mdbook on a Full VM</h1>
<h2>Table of Contents</h2>
- [Introduction](#introduction)
- [Setting the Full VM](#setting-the-full-vm)
- [Remote Explorer Access](#remote-explorer-access)
- [Install cargo](#install-cargo)
- [Install redis](#install-redis)
- [Install pkg-config, gcc and libssl](#install-pkg-config-gcc-and-libssl)
- [Set Hero](#set-hero)
- [Generate the mdbook](#generate-the-mdbook)
- [Serve and View the mdbook](#serve-and-view-the-mdbook)
- [Questions and Feedback](#questions-and-feedback)
***
## Introduction
In this tutorial, we show all the steps to deploy an mdbook with the [hero](https://github.com/freeflowuniverse/crystallib/tree/development/cli/hero) tool.
For this guide, we show an example using the mdbook from the repository [info_tfgrid](https://git.ourworld.tf/tfgrid/info_tfgrid). This setup can be done locally or on a VM. Note that it should be run as root.
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.
## Setting the Full VM
We start by deploying a full VM with WireGuard on the TFGrid.
To connect to the VM, we will be using a remote explorer.
### Remote Explorer Access
You can use the remote explorer feature of both [VSCode](https://marketplace.visualstudio.com/items?itemName=ms-vscode.remote-repositories) and [VSCodium](https://open-vsx.org/extension/jeanp413/open-remote-ssh) to manage the mdbook.
- Open the window `Remote Explorer`, click on `Add New` and write the following in the SSH config file:
```
Host 10.20.4.2
HostName 10.20.4.2
User root
```
- Click on `Connect to Host`
- Open the main `/root` directory
- Right-click on the main window of the directory and select `Open in Integrated Terminal`
- Update and upgrade the VM
```
apt update && apt upgrade -y
```
### Install cargo
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
```
- Configure the current shell
```
source "$HOME/.cargo/env"
```
### Install redis
- Install redis on the VM
```
apt install lsb-release curl gpg
curl -fsSL https://packages.redis.io/gpg | gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/redis.list
apt-get update
apt-get install redis -y
```
### Install pkg-config, gcc and libssl
- Install other packages
```
apt install pkg-config -y
apt-get install gcc -y
apt install libssl-dev
```
## Set Hero
- Download the hero installation script
```
curl https://raw.githubusercontent.com/freeflowuniverse/crystallib/development/scripts/installer_hero.sh > /tmp/hero_install.sh
```
- Run the script as root
```
bash /tmp/hero_install.sh
```
- Run hero to confirm the installation is done properly
```
hero -help
```
## Generate the mdbook
- Start the ssh-agent
```
eval $(ssh-agent)
```
- Generate the mdbook with hero
```
hero mdbook -u https://git.ourworld.tf/tfgrid/info_tfgrid/src/branch/main/heroscript
```
- Change directory to where the book is built
```
cd /root/hero/var/mdbuild/book_name
```
- You can then edit the content of the book as with any mdbook
```
mdbook build
```
## Serve and View the mdbook
- 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
```
- To see the mdbook live, open a browser on the local machine and go to localhost:3333
## Questions and Feedback
If you have any questions or feedback, please let us know by either writing a post on the [ThreeFold Forum](https://forum.threefold.io/), or by chatting with us on the [TF Grid Tester Community](https://t.me/threefoldtesting) Telegram channel.

View File

@ -0,0 +1,70 @@
<h1>Hero and mdbook on a Full VM: Script</h1>
<h2>Table of Contents</h2>
- [Introduction](#introduction)
- [Setting the Full VM](#setting-the-full-vm)
- [Remote Explorer Access](#remote-explorer-access)
- [Download and Run the Script](#download-and-run-the-script)
- [Serve and View the mdbook](#serve-and-view-the-mdbook)
- [Questions and Feedback](#questions-and-feedback)
***
## Introduction
In this tutorial, we show how to use a script to deploy an mdbook with the [hero](https://github.com/freeflowuniverse/crystallib/tree/development/cli/hero) tool.
For this guide, we show an example using the mdbook from the repository [info_tfgrid](https://git.ourworld.tf/tfgrid/info_tfgrid). This setup can be done locally or on a VM. Note that it should be run as root.
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.
## Setting the Full VM
We start by deploying a full VM with WireGuard on the TFGrid.
To connect to the VM, we will be using a remote explorer.
## Remote Explorer Access
You can use the remote explorer feature of both [VSCode](https://marketplace.visualstudio.com/items?itemName=ms-vscode.remote-repositories) and [VSCodium](https://open-vsx.org/extension/jeanp413/open-remote-ssh) to manage the mdbook.
- Open the window `Remote Explorer`, click on `Add New` and write the following in the SSH config file:
```
Host 10.20.4.2
HostName 10.20.4.2
User root
```
- Click on `Connect to Host`
- Open the main `/root` directory
- Right-click on the main window of the directory and select `Open in Integrated Terminal`
## Download and Run the Script
- Download the script
```
wget https://git.ourworld.tf/tfgrid/info_tfgrid/raw/branch/main/scripts/hero_mdbook.sh
```
- Run the script (this will take a couple of minutes)
```
source hero_mdbook.sh
```
## Serve and View the mdbook
- Serve the mdbook
```
mdbook serve --hostname 0.0.0.0 --port 3333
```
- Open your browser and use the following URL:
```
localhost:3333
```
You can now work on the mdbook and see live the changes your bring to the mdbook files on the remote VM.
## Questions and Feedback
If you have any questions or feedback, please let us know by either writing a post on the [ThreeFold Forum](https://forum.threefold.io/), or by chatting with us on the [TF Grid Tester Community](https://t.me/threefoldtesting) Telegram channel.

63
scripts/hero_mdbook.sh Normal file
View File

@ -0,0 +1,63 @@
#!/bin/bash
# Generate opening text.
cat <<EOF
* * * * *
Welcome!
The script will install hero and set the environment to work with mdbook.
This will take a couple of minutes.
* * * * *
EOF
sleep 2
# Disable "Pending kernel upgrade" and "Daemons using outdated libraries" windows
sed -i "s/#\$nrconf{kernelhints} = -1;/\$nrconf{kernelhints} = -1;/g" /etc/needrestart/needrestart.conf
sed -i "/#\$nrconf{restart} = 'i';/s/.*/\$nrconf{restart} = 'a';/" /etc/needrestart/needrestart.conf
# Update and install dependencies
apt-get update
apt-get install -y lsb-release gpg
curl https://sh.rustup.rs -sSf | sh -s -- -y
source "$HOME/.cargo/env"
export PATH=$PATH:/root/.cargo/bin
curl -fsSL https://packages.redis.io/gpg | gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/redis.list
apt-get update
apt-get install -y redis pkg-config gcc libssl-dev
# Download and run the hero installer script
curl https://raw.githubusercontent.com/freeflowuniverse/crystallib/development/scripts/installer_hero.sh > /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 <<EOF
* * * * *
The script has been successfully completed.
To see the mdbook live on your browser,
run the following command with the proper port (here we use 3333).
mdbook serve --hostname 0.0.0.0 --port 3333
Happy mdbooking!
* * * * *
EOF
# Send stderr to null and exit gracefully
return 2> /dev/null; exit