diff --git a/docs/labs/getting-started/01-requirements.md b/docs/labs/getting-started/01-requirements.md index 2f821a3..ec78b59 100644 --- a/docs/labs/getting-started/01-requirements.md +++ b/docs/labs/getting-started/01-requirements.md @@ -2,4 +2,17 @@ sidebar_label: 'Requirements' --- -# Requirements \ No newline at end of file +# 📦 Requirements + +Before you deploy, make sure you have the following: + +- [Docker](https://www.docker.com/) +- [Docker compose](https://docs.docker.com/compose/) +- [Kind](https://kind.sigs.k8s.io/) (using external cluster is possible too) +- [npm](https://www.npmjs.com/) +- [nodejs](https://nodejs.org/pt) (> 18) +- Makefile + +:::info[To contribute] +For local development and testing, you also is going to need [Go](https://go.dev/). The frontend is using [Typescript](https://www.typescriptlang.org/). +::: \ No newline at end of file diff --git a/docs/labs/getting-started/02-installation.md b/docs/labs/getting-started/02-installation.md new file mode 100644 index 0000000..9db66b1 --- /dev/null +++ b/docs/labs/getting-started/02-installation.md @@ -0,0 +1,81 @@ +--- +sidebar_label: 'Install' +--- + +# ⚙️ Installation + +1. Clone the project and install the frontend dependencies: + +```bash +git clone https://github.com/opiasec/opiaseclabs.git +cd opiaseclabs/front-end +npm install +``` + +2. To simplified deployment, we are using Makefile. First, you're going to need to setup the Kubernetes cluster: + +```bash +# If you're not in the root +cd ../ + +# In the root +cd kubernetes +make install +``` + +3. Get the kubeconfig content: +```bash +cat ~/.kube/kubeconfig > kubeconfig +``` + +4. Open the 'kubeconfig' file with your prefered text editor and edit the *cluster server* value to **https://kind-control-plane:6443**, like the example below. + +```yaml +apiVersion: v1 +clusters: + - cluster: + certificate-authority-data: [...]d2RPK2NvemZXCi0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K + //highlight-next-line + server: https://kind-control-plane:6443 + name: kind-kind +contexts: + - context: + [...] +``` + +5. Encode the kubeconfig modified as base64 and insert that value in **.env** (project root), in the variable **KUBECONFIG_BASE64**. +```bash +cat kubeconfig | base64 -w0 +``` + +:::warning[External clusters] +If you already have a deployed cluster, you need to pay attention in your **kubeconfig** cluster server url and authentication methods. The docker container ***needs to be able to access the Kubernetes cluster API***. +::: + +6. Go back to the project's root and update the **.env** (you can rename the .env.example). In addition to **KUBECONFIG_BASE64**, you need to update at least: + - **GITHUB_INIT_CONTAINER_USERNAME**: with your github username + - **GITHUB_INIT_CONTAINER_PAT**: with your github personal access token, with permissions *read packages* and *read projects* (that's necessary for pulling labs repositories) + +:::note[Recommendation] +We do recommend to update all the *password* variables. Also, you can setup an auth provider if you want to, in section *'*Auth Provider Configuration*. The basic setup is using the **Auth Password Configuration**. +::: + +7. With all variables set, run the Make command to execute the *Docker compose* and connect the cluster container to the Labs network. + +```bash +# In the project's root +make install +``` + +:::tip[External cluster] +if you have used an external cluster, use the command `make docker-compose`. +::: + +8. The last step is to start the front-end. Go to *front-end* folder and start the service: + +```bash +cd front-end +npm start +``` + +9. The project now should be up and running. Navigate to `localhost:4200` and access using the credentials you've setted up in .env. \ No newline at end of file diff --git a/docs/labs/getting-started/index.md b/docs/labs/getting-started/index.md index 0e9681b..59df74a 100644 --- a/docs/labs/getting-started/index.md +++ b/docs/labs/getting-started/index.md @@ -1,7 +1,9 @@ -# Getting Started -In this section, you will find a collection of tutorials and guides to help you get started with our project. Whether you're a beginner or an experienced user, these resources will provide you with the knowledge and skills you need to make the most of our tools and features. +--- +--- +# 🚀 Getting Started +Welcome! This guide will help you get the project up and running in just a few steps. Whether you're contributing, testing, or just exploring, this is the place to start. import DocCardList from '@theme/DocCardList'; diff --git a/src/components/HomepageFeatures/index.tsx b/src/components/HomepageFeatures/index.tsx index 0d40554..1249928 100644 --- a/src/components/HomepageFeatures/index.tsx +++ b/src/components/HomepageFeatures/index.tsx @@ -2,8 +2,6 @@ import type {ReactNode} from 'react'; import clsx from 'clsx'; import Heading from '@theme/Heading'; import styles from './styles.module.css'; -import MountainSvg from '@site/static/img/undraw_docusaurus_mountain.svg'; -import TreeSvg from '@site/static/img/undraw_docusaurus_tree.svg'; import People from '@site/static/img/undraw_people.svg'; import OpenSource from '@site/static/img/undraw_open-source.svg';