Skip to content

Commit

Permalink
Merge pull request #526 from threefoldtech/development_dashboard_domain
Browse files Browse the repository at this point in the history
updated dashboard guide
  • Loading branch information
khaledyoussef24 committed Apr 27, 2024
2 parents 4eaa274 + 6eda80a commit 5d7fda2
Showing 1 changed file with 43 additions and 5 deletions.
48 changes: 43 additions & 5 deletions src/documentation/developers/grid_deployment/deploy_dashboard.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,31 @@
<h1>Deploy the Dashboard Locally</h1>
<h1>Deploy the Dashboard</h1>

<h2>Table of Contents</h2>

- [Introduction](#introduction)
- [Prerequisites](#prerequisites)
- [Create an SSH Tunnel](#create-an-ssh-tunnel)
- [VSCode SSH Remote Connection](#vscode-ssh-remote-connection)
- [Editor SSH Remote Connection](#editor-ssh-remote-connection)
- [Set the VM](#set-the-vm)
- [Build the Dashboard](#build-the-dashboard)
- [Dashboard Public Access](#dashboard-public-access)
- [Questions and Feedback](#questions-and-feedback)

***

## Introduction

We show how to deploy the Dashboard (devnet) on a full VM. To do so, we set an SSH tunnel and use the VSCodium Remote Explorer function. We will then be able to use a source-code editor to explore the code and see changes on a local browser.

We also show how to provide a public access to the Dashboard by setting a gateway domain to your full VM deployment. Note that this method is not production-ready and should only be used to test the Dashboard.

## Prerequisites

- TFChain account with TFT
- [Deploy full VM with WireGuard connection](../../system_administrators/getstarted/ssh_guide/ssh_wireguard.md)
- [Make sure you can connect via SSH on the terminal](../../system_administrators/getstarted/ssh_guide/ssh_openssh.md)

In this guide, we use WireGuard, but you can use other connection methods, such as [Mycelium](../../system_administrators/mycelium/mycelium_toc.md).

## Create an SSH Tunnel

Expand All @@ -30,11 +36,13 @@ We show how to deploy the Dashboard (devnet) on a full VM. To do so, we set an S

Simply leave this window open and follow the next steps.

## VSCode SSH Remote Connection
If you use an IPv6 address, e.g. with Mycelium, set `-6` in the line above instead of `-4`.

## Editor SSH Remote Connection

You can connect via SSH through the source-code editor to a VM on the grid. In this example, WireGuard is set.

- Add the SSH Remote extension to VSCodium
- Add the SSH Remote extension to [VSCodium](https://vscodium.com/)
- Add a new SSH remote connection
- Set the following (adjust with your own username and host)
```
Expand Down Expand Up @@ -86,4 +94,34 @@ make run project=playground
```

You can then access the dev net Dashboard on your local browser.
You can then access the dev net Dashboard on your local browser.

To stop running the Dashboard, simply enter ̀`Ctrl-C` on the terminal window.


## Dashboard Public Access

> Note: This method is not production-ready. Use only for testing purposes.
Once you've tested the Dashboard with the SSH tunnel, you can explore how to access it from the public Internet. For this, we will create a gateway domain and bind the host to `0.0.0.0`.

On the Full VM page, [add a domain](../../dashboard/solutions/add_domain.md) to access your deployment from the public Internet.

- Under `Actions`, click on `Manage Domains`
- Go to `Add New Domain`
- Choose a gateway domain under `Select domain`
- Set the port 5173
- Click on `Add`

To run the Dashboard from the added domain, use this instead of the previous `make run` line:

```
cd packages/playground
yarn dev --host 0.0.0.0
```

You can then access the Dashboard from the domain you just created.

## 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.

0 comments on commit 5d7fda2

Please sign in to comment.