This commit is contained in:
2025-06-16 10:27:14 +02:00
parent 52db50342a
commit ccd01c291d
61 changed files with 127 additions and 127 deletions

View File

@@ -18,7 +18,7 @@
We show how to build an mdbook using the [Hero tool](https://github.com/freeflowuniverse/crystallib/tree/development/cli/hero).
For this guide, we will show how to add an mdbook to the TFGrid repository `info_tfgrid` on `git.ourworld.tf`.
For this guide, we will show how to add an mdbook to the TFGrid repository `info_tfgrid` on `git.threefold.info`.
## Prerequisites
@@ -33,13 +33,13 @@ Let's go through all the steps to create a new mdbook. We will call our book `ne
For this guide, we will add a book to `info_tfgrid`. For this reason, we first start to clone the repository. Note that this step can be done automatically by Hero, but it might be easier to do it manually for later steps, such as pushing changes with git.
```
mkdir -p /root/code/git.ourworld.tf/tfgrid
cd /root/code/git.ourworld.tf/tfgrid
git clone https://git.ourworld.tf/tfgrid/info_tfgrid
mkdir -p /root/code/git.threefold.info/tfgrid
cd /root/code/git.threefold.info/tfgrid
git clone https://git.threefold.info/tfgrid/info_tfgrid
cd info_tfgrid
```
Once we've cloned the repository, we can make changes to the repository and then push it to `git.ourworld.tf` when we're ready.
Once we've cloned the repository, we can make changes to the repository and then push it to `git.threefold.info` when we're ready.
Before creating the new mdbook, let's have a look at how the overall directory tree will look like.
@@ -108,11 +108,11 @@ Hero uses three main directories to build an mdbook `books`, `collections` and `
- In the directory `collections` as we've seen above
```
\!!book.generate name:'new_mdbook' title:'New mdbook'
url:'https://git.ourworld.tf/tfgrid/info_tfgrid/src/branch/main/heroscript/new_mdbook'
url:'https://git.threefold.info/tfgrid/info_tfgrid/src/branch/main/heroscript/new_mdbook'
\!!doctree.add
url:'https://git.ourworld.tf/tfgrid/info_tfgrid/src/branch/main/collections/new_mdbook'
url:'https://git.threefold.info/tfgrid/info_tfgrid/src/branch/main/collections/new_mdbook'
```
@@ -138,7 +138,7 @@ pushd /root/hero/www/info/new_mdbook/; python3 -m http.server 5173; popd;
## Pushing the Changes
Once you've set the files and directories for your new mdbook and that you are satisfied with the result, you can push the changes to `git.ourworld.tf`.
Once you've set the files and directories for your new mdbook and that you are satisfied with the result, you can push the changes to `git.threefold.info`.
```
git add .
@@ -152,9 +152,9 @@ Once the changes are uploaded to the remote repository, you will be able to upda
- Update the repository
```
hero mdbook -u https://git.ourworld.tf/tfgrid/info_tfgrid/src/branch/main/heroscript/new_mdbook -gr
hero mdbook -u https://git.threefold.info/tfgrid/info_tfgrid/src/branch/main/heroscript/new_mdbook -gr
```
- Build the book
```
hero mdbook -u https://git.ourworld.tf/tfgrid/info_tfgrid/src/branch/main/heroscript/new_mdbook -o
hero mdbook -u https://git.threefold.info/tfgrid/info_tfgrid/src/branch/main/heroscript/new_mdbook -o
```

View File

@@ -34,9 +34,9 @@ Note that you will need to adjust the local path of the git repo and the docker
- On a terminal window, create the code repository on the local machine
```
mkdir -p ~/code/git.ourworld.tf/tfgrid
cd ~/code/git.ourworld.tf/tfgrid
git clone https://git.ourworld.tf/tfgrid/info_tfgrid
mkdir -p ~/code/git.threefold.info/tfgrid
cd ~/code/git.threefold.info/tfgrid
git clone https://git.threefold.info/tfgrid/info_tfgrid
```
- Start Hero docker
```
@@ -48,21 +48,21 @@ Note that you will need to adjust the local path of the git repo and the docker
```
- Change directory
```
cd ~/code/git.ourworld.tf/tfgrid/info_tfgrid
cd ~/code/git.threefold.info/tfgrid/info_tfgrid
```
- Git configuration
- Set git lobally with a safe directory
```
git config --global --add safe.directory /root/code/git.ourworld.tf/tfgrid/info_tfgrid
git config --global --add safe.directory /root/code/git.threefold.info/tfgrid/info_tfgrid
```
- You can now use Hero normally, e.g. with **tech**
- With a URL:
```
hero mdbook -u https://git.ourworld.tf/tfgrid/info_tfgrid/src/branch/main/heroscript/tech
hero mdbook -u https://git.threefold.info/tfgrid/info_tfgrid/src/branch/main/heroscript/tech
```
- With a path:
```
hero mdbook -p /root/code/git.ourworld.tf/tfgrid/info_tfgrid/heroscript/tech
hero mdbook -p /root/code/git.threefold.info/tfgrid/info_tfgrid/heroscript/tech
```
- In this case, you can modify the mdbook on the local machine's git repo that you set in the prerequisites section and the changes will be shown on the docker path
- To view the mdbook on your local browser, run the lines:
@@ -99,15 +99,15 @@ You can use [VSCodium](https://manual.grid.tf/documentation/system_administrator
- Open VSCodium
- Open the directory where the repo is located, e.g.
```
cd ~/code/git.ourworld.tf/tfgrid/info_tfgrid
cd ~/code/git.threefold.info/tfgrid/info_tfgrid
```
- Make changes and save the files
- Redeploy Hero Mdbook
- With a path:
```
hero mdbook -p /root/code/git.ourworld.tf/tfgrid/info_tfgrid/heroscript/tech
hero mdbook -p /root/code/git.threefold.info/tfgrid/info_tfgrid/heroscript/tech
```
- With a URL (make sure to pull the changes with `git pull`):
```
hero mdbook -u https://git.ourworld.tf/tfgrid/info_tfgrid/src/branch/main/heroscript/tech
hero mdbook -u https://git.threefold.info/tfgrid/info_tfgrid/src/branch/main/heroscript/tech
```

View File

@@ -19,7 +19,7 @@
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.
For this guide, we show an example using the mdbook from the repository [info_tfgrid](https://git.threefold.info/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.
@@ -70,8 +70,8 @@ ssh-keygen
```
cat /root/.ssh/books.pub
```
- Add the SSH public key on [git.ourworld.tf](https://git.ourworld.tf/user/settings/keys) and [github](https://github.com/settings/keys)
- Optional: on git.ourworld.tf, verify the key. Make sure to put the proper token.
- Add the SSH public key on [git.threefold.info](https://git.threefold.info/user/settings/keys) and [github](https://github.com/settings/keys)
- Optional: on git.threefold.info, verify the key. Make sure to put the proper token.
```
echo -n 'token' | ssh-keygen -Y sign -n gitea -f /root/.ssh/books
```
@@ -101,13 +101,13 @@ Download the git repository from a URL:
- Download the repository
```
hero mdbook -u https://git.ourworld.tf/tfgrid/info_tfgrid/src/branch/main/heroscript/bookname -gp
hero mdbook -u https://git.threefold.info/tfgrid/info_tfgrid/src/branch/main/heroscript/bookname -gp
```
- The line above will clone the repository `info_tfgrid` at the path `/root/code/git.ourworld.tf/tfgrid`. The same result can be obtained by running the following lines:
- The line above will clone the repository `info_tfgrid` at the path `/root/code/git.threefold.info/tfgrid`. The same result can be obtained by running the following lines:
```
mkdir -p /root/code/git.ourworld.tf/tfgrid
cd /root/code/git.ourworld.tf/tfgrid
git clone https://git.ourworld.tf/tfgrid/info_tfgrid
mkdir -p /root/code/git.threefold.info/tfgrid
cd /root/code/git.threefold.info/tfgrid
git clone https://git.threefold.info/tfgrid/info_tfgrid
```
For the next steps, you can either run the commands locally (with -p and the proper path) or remotely (with -u and the proper URL). Running the command locally is useful when you are doing changes to the mdbook and you want to test them before pushing the new files to the remote repository.
@@ -116,7 +116,7 @@ For the next steps, you can either run the commands locally (with -p and the pro
- Note: add the parameter `-o` at the end of the line to open the book with your local browser
- Option 1: Build the book with a URL
```
hero mdbook -u https://git.ourworld.tf/tfgrid/info_tfgrid/src/branch/main/heroscript/bookname
hero mdbook -u https://git.threefold.info/tfgrid/info_tfgrid/src/branch/main/heroscript/bookname
```
- Option 2: Build the book with a local path
@@ -135,10 +135,10 @@ pushd /root/hero/www/info/<book_name>/; python3 -m http.server 5173; popd;
### Fix the error: "cli execution error: Cannot pull repo..."
If you get the following error: "cli execution error: Cannot pull repo: /root/code/git.ourworld.tf/tfgrid/info_tfgrid because there are changes in the dir.", you can try the following as a fix:
If you get the following error: "cli execution error: Cannot pull repo: /root/code/git.threefold.info/tfgrid/info_tfgrid because there are changes in the dir.", you can try the following as a fix:
```
rm -r /root/code/git.ourworld.tf/tfgrid/info_tfgrid
rm -r /root/code/git.threefold.info/tfgrid/info_tfgrid
```
### Fix: Git hangs at "Cloning into..."
@@ -152,8 +152,8 @@ git config --global credential.provider generic
If it happens another time, you can try to download it manually:
```
mkdir -p /root/code/git.ourworld.tf/tfgrid && cd $_
git clone https://git.ourworld.tf/tfgrid/info_tfgrid
mkdir -p /root/code/git.threefold.info/tfgrid && cd $_
git clone https://git.threefold.info/tfgrid/info_tfgrid
```
## Distinctions between mdbook and hero mdbook