From 910d8ed8c5f14a1e2ae2c756db70fda2aa02a2ec Mon Sep 17 00:00:00 2001 From: mik-tf Date: Fri, 8 Nov 2024 12:11:03 -0500 Subject: [PATCH] added docs to deploy on any system --- README.md | 31 ++++++---- hero_docs/crystallib_hero_basic_docs.md | 81 +++++++++++++++++++++++++ 2 files changed, 101 insertions(+), 11 deletions(-) create mode 100644 hero_docs/crystallib_hero_basic_docs.md diff --git a/README.md b/README.md index 2c11076..6c90fdc 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,25 @@ -# www_threefold4 +

ThreeFold V4 Website

-new version of threefold, minimalistic +

Table of Contents

-## install +- [Introduction](#introduction) +- [Docker Installation](#docker-installation) -```bash -hero git clone -u git@git.ourworld.tf:tfgrid/www_threefold4.git -~/code/git.ourworld.tf/tfgrid/www_threefold4/install.sh -``` +--- -## to start the server for seeing the website +## Introduction -```bash -~/code/git.ourworld.tf/tfgrid/www_threefold4/start.sh -``` +We present the new version of the ThreeFold website for V4. This website has a minimalistic aesthetics. + +## Docker Installation + +- Set a [Hero Docker container](./hero_docs/crystallib_hero_basic_docs.md) as shown in the docs +- Install the website + ```bash + hero git clone -u git@git.ourworld.tf:tfgrid/www_threefold4.git + ~/code/git.ourworld.tf/tfgrid/www_threefold4/install.sh + ``` +- Start the website + ```bash + ~/code/git.ourworld.tf/tfgrid/www_threefold4/start.sh + ``` diff --git a/hero_docs/crystallib_hero_basic_docs.md b/hero_docs/crystallib_hero_basic_docs.md new file mode 100644 index 0000000..af82417 --- /dev/null +++ b/hero_docs/crystallib_hero_basic_docs.md @@ -0,0 +1,81 @@ +

Crystallib and Hero Basic Docs

+ +

Table of Contents

+ +- [Introduction](#introduction) +- [Prerequisites](#prerequisites) +- [Deploy Webserver](#deploy-webserver) +- [Clean Up](#clean-up) + +--- + +## Introduction + +We provide the steps to prepare a Docker Ubuntu container to work with Hero and Crystallib. + +## Prerequisites + +- Docker +- Make sure that you have set your SSH Public Key on both GitHub and the TFGrid Gitea (https://git.ourworld.tf) + +## Deploy Webserver + +- Run the Ubuntu container with host networking and a specific name +``` +sudo docker run -it --net=host --name=hero-container -v ~/dvol:/root/code ubuntu:latest /bin/bash +``` +- Create Directory .ssh in container +``` +mkdir -p ~/.ssh +``` + +- Copy SSH keys to container from local machine (use the proper path and key type) +``` +sudo docker cp ~/.ssh/id_ed25519 hero-container:/root/.ssh/id_ed25519 +sudo docker cp ~/.ssh/id_ed25519.pub hero-container:/root/.ssh/id_ed25519.pub +``` + +- Execute all commands directly in the container + +``` +# Install prerequisites + +apt update && apt install -y git curl nano openssh-client libsqlite3-dev python3-venv + +# Set up SSH agent and add the key + +eval $(ssh-agent) +ssh-add ~/.ssh/id_ed25519 + +# Clone the repository and set up the environment + +mkdir -p ~/code/github/freeflowuniverse +cd ~/code/github/freeflowuniverse +git clone https://github.com/freeflowuniverse/crystallib +cd crystallib + +# Download and run installation scripts for Crystallib and Hero + +curl https://raw.githubusercontent.com/freeflowuniverse/crystallib/development/scripts/install_hero.sh > /tmp/hero_install.sh + +bash /tmp/hero_install.sh + +curl https://raw.githubusercontent.com/freeflowuniverse/crystallib/development/scripts/installer.sh > /tmp/install.sh + +bash /tmp/install.sh + +echo +echo "Crystallib and Hero are set up on your Docker container." +echo + +``` + +## Clean Up + +When you're done, you can clean up your environment. + +``` +sudo docker stop hero-container +sudo docker rm hero-container +sudo find ~/dvol -mindepth 1 -delete +``` \ No newline at end of file -- 2.40.1