Skip to content

Commit

Permalink
Restructures and adds new content to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
prasadtalasila authored and Astitva committed May 19, 2024
1 parent fa39b56 commit c41e4bb
Show file tree
Hide file tree
Showing 13 changed files with 364 additions and 82 deletions.
42 changes: 6 additions & 36 deletions docs/admin/client/auth.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# OAuth for React Client

<!-- markdownlint-disable MD046 -->
<!-- prettier-ignore -->
!!! failure
Add screenshots from dtaas-digitaltwin.com demo.
<!-- markdownlint-enable MD046 -->

To enable user authorization on DTaaS React client website, you will use
the OAuth authorization protocol, specifically the PKCE authorization flow.
Here are the steps to get started:
Expand Down Expand Up @@ -75,39 +81,3 @@ Logout URL: http://localhost:4000
```

The port 4000 is the default port for running the client website.

## Multiple DTaaS applications

The DTaaS is a regular web application. It is possible to host multiple DTaaS
applications on the same server. The only requirement is to have a distinct URLs.
You can have three DTaaS applications running at the following URLs.

```txt
https://foo.com/au
https://foo.com/acme
https://foo.com/bar
```

All of these instances can use the same gitlab instance for authorization.

| DTaaS application URL | Gitlab Instance URL | Callback URL | Logout URL | Application ID |
|:----|:----|:----|:----|:----|
| <https://foo.com/au> | <https://foo.gitlab.com> | <https://foo.com/au/Library> | <https://foo.com/au> | autogenerated by gitlab |
| <https://foo.com/acme> | <https://foo.gitlab.com> | <https://foo.com/au/Library> | <https://foo.com/au> | autogenerated by gitlab |
| <https://foo.com/bar> | <https://foo.gitlab.com> | <https://foo.com/au/Library> | <https://foo.com/au> | autogenerated by gitlab |
||

If you are hosting multiple DTaaS instances on the same server,
do not install DTaaS with a null basename on the same server.
Even though it works well, the setup is confusing to setup
and may lead to maintenance issues.

If you choose to host your DTaaS application with a basename (say bar), then the
URLs in `env.js` change to:

```txt
DTaaS application URL: https://foo.com/bar
Gitlab instance URL: https://foo.gitlab.com
Callback URL: https://foo.com/bar/Library
Logout URL: https://foo.com/bar
```
119 changes: 119 additions & 0 deletions docs/admin/client/config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
# Configure Client Website

<!-- markdownlint-disable MD046 -->
<!-- prettier-ignore -->
!!! failure
Consolidate all config description here, even the instructions
from README of client/ directory.
<!-- markdownlint-enable MD046 -->

This page describes various configuration options for react website.

```js
if (typeof window !== 'undefined') {
window.env = {
REACT_APP_ENVIRONMENT: "prod | dev",
REACT_APP_URL: "URL for the gateway",
REACT_APP_URL_BASENAME: "Base URL for the client website"(optional),
REACT_APP_URL_DTLINK: "Endpoint for the Digital Twin",
REACT_APP_URL_LIBLINK: "Endpoint for the Library Assets",
REACT_APP_WORKBENCHLINK_VNCDESKTOP: "Endpoint for the VNC Desktop link",
REACT_APP_WORKBENCHLINK_VSCODE: "Endpoint for the VS Code link",
REACT_APP_WORKBENCHLINK_JUPYTERLAB: "Endpoint for the Jupyter Lab link",
REACT_APP_WORKBENCHLINK_JUPYTERNOTEBOOK:
"Endpoint for the Jupyter Notebook link",
REACT_APP_CLIENT_ID: 'AppID genereated by the gitlab OAuth provider',
REACT_APP_AUTH_AUTHORITY: 'URL of the private gitlab instance',
REACT_APP_REDIRECT_URI: 'URL of the homepage for the logged in users of the website',
REACT_APP_LOGOUT_REDIRECT_URI: 'URL of the homepage for the anonymous users of the website',
REACT_APP_GITLAB_SCOPES: 'OAuth scopes. These should match with the scopes set in gitlab OAuth provider',
};
};

// Example values with no base URL. Trailing and ending slashes are optional.
if (typeof window !== 'undefined') {
window.env = {
REACT_APP_ENVIRONMENT: 'prod',
REACT_APP_URL: 'https://foo.com/',
REACT_APP_URL_BASENAME: '',
REACT_APP_URL_DTLINK: '/lab',
REACT_APP_URL_LIBLINK: '',
REACT_APP_WORKBENCHLINK_VNCDESKTOP: '/tools/vnc/?password=vncpassword',
REACT_APP_WORKBENCHLINK_VSCODE: '/tools/vscode/',
REACT_APP_WORKBENCHLINK_JUPYTERLAB: '/lab',
REACT_APP_WORKBENCHLINK_JUPYTERNOTEBOOK: '',
REACT_APP_CLIENT_ID: '934b98f03f1b6f743832b2840bf7cccaed93c3bfe579093dd0942a433691ccc0',
REACT_APP_AUTH_AUTHORITY: 'https://gitlab.foo.com/',
REACT_APP_REDIRECT_URI: 'https://foo.com/Library',
REACT_APP_LOGOUT_REDIRECT_URI: 'https://foo.com/',
REACT_APP_GITLAB_SCOPES: 'openid profile read_user read_repository api',
};
};


// Example values with "bar" as basename URL.
//Trailing and ending slashes are optional.
if (typeof window !== 'undefined') {
window.env = {
REACT_APP_ENVIRONMENT: "dev",
REACT_APP_URL: 'https://foo.com/',
REACT_APP_URL_BASENAME: 'bar',
REACT_APP_URL_DTLINK: '/lab',
REACT_APP_URL_LIBLINK: '',
REACT_APP_WORKBENCHLINK_VNCDESKTOP: '/tools/vnc/?password=vncpassword',
REACT_APP_WORKBENCHLINK_VSCODE: '/tools/vscode/',
REACT_APP_WORKBENCHLINK_JUPYTERLAB: '/lab',
REACT_APP_WORKBENCHLINK_JUPYTERNOTEBOOK: '',
REACT_APP_CLIENT_ID: '934b98f03f1b6f743832b2840bf7cccaed93c3bfe579093dd0942a433691ccc0',
REACT_APP_AUTH_AUTHORITY: 'https://gitlab.foo.com/',
REACT_APP_REDIRECT_URI: 'https://foo.com/bar/Library',
REACT_APP_LOGOUT_REDIRECT_URI: 'https://foo.com/bar',
REACT_APP_GITLAB_SCOPES: 'openid profile read_user read_repository api',
};
};
```

## Multiple DTaaS applications

<!-- markdownlint-disable MD046 -->
<!-- prettier-ignore -->
!!! warning
This is not a regular installation scenario and is only
recommended for experts.
This installation setup requires significant modifications
to the docker compose files.
<!-- markdownlint-enable MD046 -->

The DTaaS is a regular web application. It is possible to host multiple DTaaS
applications on the same server. The only requirement is to have a distinct URLs.
You can have three DTaaS applications running at the following URLs.

```txt
https://foo.com/au
https://foo.com/acme
https://foo.com/bar
```

All of these instances can use the same gitlab instance for authorization.

| DTaaS application URL | Gitlab Instance URL | Callback URL | Logout URL | Application ID |
|:----|:----|:----|:----|:----|
| <https://foo.com/au> | <https://foo.gitlab.com> | <https://foo.com/au/Library> | <https://foo.com/au> | autogenerated by gitlab |
| <https://foo.com/acme> | <https://foo.gitlab.com> | <https://foo.com/au/Library> | <https://foo.com/au> | autogenerated by gitlab |
| <https://foo.com/bar> | <https://foo.gitlab.com> | <https://foo.com/au/Library> | <https://foo.com/au> | autogenerated by gitlab |
||

If you are hosting multiple DTaaS instances on the same server,
do not install DTaaS with a null basename on the same server.
Even though it works well, the setup is confusing to setup
and may lead to maintenance issues.

If you choose to host your DTaaS application with a basename (say bar), then the
URLs in `env.js` change to:

```txt
DTaaS application URL: https://foo.com/bar
Gitlab instance URL: https://foo.gitlab.com
Callback URL: https://foo.com/bar/Library
Logout URL: https://foo.com/bar
```
7 changes: 6 additions & 1 deletion docs/admin/client/CLIENT.md → docs/admin/client/docker.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
# Host the DTaaS Client Website

<!-- markdownlint-disable MD046 -->
<!-- prettier-ignore -->
!!! failure
Replace zip file with docker container
<!-- markdownlint-enable MD046 -->

<!-- markdownlint-disable MD046 -->
<!-- prettier-ignore -->
!!! tip
The [Localhost](../localhost.md) installation setup is a faster
way to use the DTaaS software. You might want to consider the localhost
option before using only the **DTaaS-client.zip** package.

<!-- markdownlint-enable MD046 -->

To host DTaaS client website on your server, follow these steps:
Expand Down
8 changes: 7 additions & 1 deletion docs/admin/guides/update_basepath.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Update basepath/route for the application

<!-- markdownlint-disable MD046 -->
<!-- prettier-ignore -->
:clipboard:
Update the instructions for client docker container.
<!-- markdownlint-enable MD046 -->

The updates required to make the application
work with basepath (say bar):

Expand Down Expand Up @@ -53,7 +59,7 @@ http:
**3. Update deploy/config/client/env.js:**
See the [client documentation](../client/CLIENT.md) for an example.
See the [client documentation](../client/config.md) for an example.
**4. Update install scripts:**
Expand Down
20 changes: 12 additions & 8 deletions docs/admin/host.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,17 @@ Edit all the fields according to your specific case.
| username2 | 'user2' | The gitlab instance username of a user of DTaaS |
| CLIENT_CONFIG | '/home/dtaas/Desktop/DTaaS/deploy/config/client/env.js' | Full path to env.js file for client |

:clipboard: Important points to note:

1. The path examples given here are for Linux OS.
These paths can be Windows OS compatible paths as well.
1. The Server DNS can also be an IP address.
However, for proper working it is neccessary to use the
same convention (IP/DNS) in the `CLIENT_CONFIG` file as well.
<!-- markdownlint-disable MD046 -->
<!-- prettier-ignore -->
!!! tip
Important points to note:

1. The path examples given here are for Linux OS.
These paths can be Windows OS compatible paths as well.
1. The Server DNS can also be an IP address.
However, for proper working it is neccessary to use the
same convention (IP/DNS) in the `CLIENT_CONFIG` file as well.
<!-- markdownlint-enable MD046 -->

### Website Client

Expand All @@ -97,7 +101,7 @@ The `CLIENT_CONFIG` file is in relative directory of
_deploy/config/client/env.trial.js_.

Further explanation on the client configuration is available in
[client config](client/CLIENT.md).
[client config](client/docker.md).

### Create User Workspace

Expand Down
23 changes: 15 additions & 8 deletions docs/admin/localhost.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@ The installation requirements to run this docker version of the DTaaS are:
- docker desktop / docker CLI with compose plugin
- User account on _gitlab.com_

:clipboard: The frontend website requires authorization.
The default authorization configuration works for _gitlab.com_.
If you desire to use locally hosted gitlab instance, please see
the [client docs](client/auth.md).

<!-- markdownlint-disable MD046 -->
<!-- prettier-ignore -->
!!! tip
The frontend website requires authorization.
The default authorization configuration works for _gitlab.com_.
If you desire to use locally hosted gitlab instance, please see
the [client docs](client/auth.md).
<!-- markdownlint-enable MD046 -->

## Configuration

Expand All @@ -42,8 +45,12 @@ Edit all the fields according to your specific case.
| username1 | 'user1' | Your gitlab username |
| CLIENT_CONFIG | '/home/Desktop/DTaaS/deploy/config/client/env.local.js' | Full path to env.js file for client |

:clipboard: The path examples given here are for Linux OS.
These paths can be Windows OS compatible paths as well.
<!-- markdownlint-disable MD046 -->
<!-- prettier-ignore -->
!!! tip
The path examples given here are for Linux OS.
These paths can be Windows OS compatible paths as well.
<!-- markdownlint-enable MD046 -->

### Create User Workspace

Expand Down Expand Up @@ -85,7 +92,7 @@ through the single page client now.

## Limitations

The [library microservice](servers/lib/LIB-MS.md) is not
The [library microservice](servers/lib/docker.md) is not
included in the localhost installation scenario.

## References
Expand Down
31 changes: 15 additions & 16 deletions docs/admin/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,30 @@ The goal is to set up the DTaaS infrastructure in order to enable
your users to use the DTaaS.
As an admin you will administrate the users and the servers of the system.

## Requirements
## Optional Requirements

### OAuth Provider (Mandatory)
There are three optional requirements for installing the DTaaS.
These requirements are not needed for **localhost** installation.
They are only required for installation of the DTaaS on a web server.

You need to have an OAuth Provider running, which the DTaaS can use for
authorization. This is described further in
the [authorization section](./client/auth.md).
### OAuth Provider

### Domain name (Optional)
The DTaaS software is uses OAuth for user authorization. It is
possible to use either <http:>_foo.com_</http:> or your own
OAuth service provider.

### Domain name

The DTaaS software is a web application and is preferably hosted
on a server with a domain name like <http:>_foo.com_</http:>.
on a server with a domain name like <http:>_foo.com_</http:>.
However, it is possible to install the software on your computer
and use access it at <http:>_localhost_</http:>.

### Reverse Proxy (Optional)
### Reverse Proxy

The installation setup assumes that the foo.com server is behind a reverse
The installation setup recommends that the _foo.com_ server is behind a reverse
proxy / load balancer that provides https termination. You can still use
the DTaaS software even if you do not have this reverse proxy. If you do
not have a reverse proxy, please replace <https://foo.com>
with <http://foo.com> in
[client env.js file](./client/CLIENT.md) and in
[OAuth registration](./client/auth.md). Other installation configuration
remains the same.
the DTaaS software even if you do not have this reverse proxy.

## Install

Expand All @@ -44,4 +43,4 @@ Follow the installation that fits your usecase.
| [One vagrant machine](vagrant/single-machine.md) | Install DTaaS on a virtual machine; can be used for single or multiple users. |
| [Two vagrant machines](vagrant/two-machines.md) | Install DTaaS on two virtual machines; can be used for single or multiple users. |
| | The core DTaaS application is installed on the first virtual machine and all the services (RabbitMQ, MQTT, InfluxDB, Grafana and MongoDB) are installed on second virtual machine. |
| Seperater Packages: [client website](client/CLIENT.md) and [lib microservice](servers/lib/LIB-MS.md) | Can be used independently; do not need full installation of DTaaS. |
| Seperater Packages: [client website](client/docker.md) and [lib microservice](servers/lib/npm.md) | Can be used independently; do not need full installation of DTaaS. |
6 changes: 6 additions & 0 deletions docs/admin/servers/auth.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# OAuth for Traefik Gateway

<!-- markdownlint-disable MD046 -->
<!-- prettier-ignore -->
!!! failure
Add screenshots from dtaas-digitaltwin.com demo.
<!-- markdownlint-enable MD046 -->

The traefik gateway is used to serve the DTaaS. All the services
provided as part of the application are secured at the traefik gateway.
The security is based on [Traefik forward-auth](https://github.com/thomseddon/traefik-forward-auth).
Expand Down
File renamed without changes.
Loading

0 comments on commit c41e4bb

Please sign in to comment.