Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion docs/labs/getting-started/01-requirements.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,17 @@
sidebar_label: 'Requirements'
---

# Requirements
# πŸ“¦ 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/).
:::
81 changes: 81 additions & 0 deletions docs/labs/getting-started/02-installation.md
Original file line number Diff line number Diff line change
@@ -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.
6 changes: 4 additions & 2 deletions docs/labs/getting-started/index.md
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 0 additions & 2 deletions src/components/HomepageFeatures/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down