Skip to content

Commit

Permalink
Updates documentation (INTO-CPS-Association#820)
Browse files Browse the repository at this point in the history
  - Completes admin docs and fixes minor mistakes in other places
  - Updates user website pages
  - Adds docker compose for starting stand alone libms
  • Loading branch information
prasadtalasila committed Jun 18, 2024
1 parent eb73b5c commit 9c739f3
Show file tree
Hide file tree
Showing 35 changed files with 374 additions and 380 deletions.
6 changes: 3 additions & 3 deletions client/DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ if (typeof window !== 'undefined') {
window.env = {
REACT_APP_ENVIRONMENT: 'test',
REACT_APP_URL: 'http://localhost:4000/',
REACT_APP_URL_BASENAME: '',
REACT_APP_URL_BASENAME: 'au',
REACT_APP_URL_DTLINK: '/lab',
REACT_APP_URL_LIBLINK: '',
REACT_APP_WORKBENCHLINK_VNCDESKTOP: '/tools/vnc/?password=vncpassword',
Expand All @@ -143,8 +143,8 @@ if (typeof window !== 'undefined') {

REACT_APP_CLIENT_ID: '1be55736756190b3ace4c2c4fb19bde386d1dcc748d20b47ea8cfb5935b8446c',
REACT_APP_AUTH_AUTHORITY: 'https://gitlab.com/',
REACT_APP_REDIRECT_URI: 'http://localhost:4000/Library',
REACT_APP_LOGOUT_REDIRECT_URI: 'http://localhost:4000/',
REACT_APP_REDIRECT_URI: 'http://localhost:4000/au/Library',
REACT_APP_LOGOUT_REDIRECT_URI: 'http://localhost:4000/au',
REACT_APP_GITLAB_SCOPES: 'openid profile read_user read_repository api',
};
};
Expand Down
1 change: 1 addition & 0 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"build": "npx react-scripts build",
"clean": "npx rimraf build/ node_modules/ coverage/ playwright-report/ *.svg",
"config:dev": "npx shx cp config/dev.js public/env.js && npx shx cp config/dev.js build/env.js",
"config:local": "npx shx cp config/local.js public/env.js && npx shx cp config/local.js build/env.js",
"config:prod": "npx shx cp config/prod.js public/env.js && npx shx cp config/prod.js build/env.js",
"config:test": "npx shx cp config/test.js public/env.js && npx shx cp config/test.js build/env.js",
"develop": "npx react-scripts start",
Expand Down
19 changes: 15 additions & 4 deletions docs/admin/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ usernames of the users to be added
add = ["username1","username2", "username3"]
```

Make sure you are in the _cli_ directory.

Then simply:

```bash
Expand Down Expand Up @@ -110,18 +112,27 @@ instance, with authorization enabled.

### Delete users

TO delete existing users, fill in the _users.delete_ list in
_dtaas_.toml_ with the Gitlab instance
usernames of the users to be deleted.
- To delete existing users, fill in the _users.delete_ list in
_dtaas.toml_ with the Gitlab instance
usernames of the users to be deleted.

Make sure you are in the _cli_ directory.
```toml
[users]
# matching user info must present in this config file
delete = ["username1","username2", "username3"]
```

- Make sure you are in the _cli_ directory.

Then simply:

```bash
dtaas admin user delete
```

- Remember to remove the rules for deleted users
in _conf.server_.

### Additional Points to Remember

- The _user add_ CLI will add and start a
Expand Down
13 changes: 3 additions & 10 deletions docs/admin/client/config.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
# 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_ENVIRONMENT: "prod | dev | local | test",
REACT_APP_URL: "URL for the gateway",
REACT_APP_URL_BASENAME: "Base URL for the client website"(optional),
REACT_APP_URL_BASENAME: "Base URL for the client website"(optional, can be null),
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",
Expand Down Expand Up @@ -113,7 +106,7 @@ URLs in `env.js` change to:

```txt
DTaaS application URL: https://foo.com/bar
Gitlab instance URL: https://foo.gitlab.com
Gitlab instance URL: https://gitlab.foo.com
Callback URL: https://foo.com/bar/Library
Logout URL: https://foo.com/bar
```
166 changes: 0 additions & 166 deletions docs/admin/client/docker.md

This file was deleted.

29 changes: 29 additions & 0 deletions docs/admin/host.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,35 @@ If there are extra routes in `deploy/docker/conf.server` file but these are not
in `deploy/docker/.env.server` file,
such routes are not served by traefik; it will give **404 server response**.

## Access Rights Over Files

<!-- markdownlint-disable MD046 -->
<!-- prettier-ignore -->
!!! warning
The default setting in docker compose file exposes
all user files at <http://foo.com/lib/files>.
All files of all the users are readable-writable by
all logged in users.
The `compose.server.yml` file needs to updated to
expose another directory like common assets directory.
<!-- markdownlint-enable MD046 -->

If you wish to reduce this scope to only **common assets**,
please change,

```yaml
libms:
image: intocps/libms:latest
restart: unless-stopped
volumes:
- ${DTAAS_DIR}/deploy/config/lib.docker:/dtaas/libms/.env
- ${DTAAS_DIR}/files/common:/dtaas/libms/files
```

The change in the last line. The `${DTAAS_DIR}/files`
got replaced by `${DTAAS_DIR}/files/common`. With this change, only
common files are readable-writable by all logged in users.

## Run

The commands to start and stop the appliation are:
Expand Down
43 changes: 18 additions & 25 deletions docs/admin/overview.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,33 @@
# Overview

## Goal

The goal is to set up the DTaaS infrastructure in order to enable
your users to use the DTaaS.

## Optional Requirements

There are three optional requirements for installing the DTaaS.
These requirements are not needed for
[**localhost**](./localhost.md) installation.
They are only required for installation of the DTaaS on a web server.
## Install

### OAuth Provider
The goal is to install and administer the DTaaS application for users.

The DTaaS software is uses OAuth for user authorization. It is
possible to use either <http:>_gitlab.com_</http:> or your own
OAuth service provider.
The DTaaS can be installed in different ways.
Each version serves a different purpose.

### Domain name
<!-- markdownlint-disable MD046 -->
<!-- prettier-ignore -->
!!! tip "Easy Setup on Localhost"

The DTaaS software is a web application and is preferably hosted
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:>.
The [localhost](localhost.md) installation is easy for
first time users. Please give it a try.
<!-- markdownlint-enable MD046 -->

## Install

The DTaaS can be installed in different ways. Each version serves a different purpose.
Follow the installation that fits your usecase.
Otherwise, use the installation setup that fits your needs.

| Installation Setup | Purpose |
|:-----|:-----|
| [localhost](./localhost.md) | Install DTaaS on your computer for a single user; does not need a web server. _This setup does not require domain name._ |
| [Server](./host.md) | Install DTaaS on server for multiple users. |
| [Server](./host.md) | Install DTaaS on server for multiple users. Please check the [requirements](requirements.md) |
| [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. |
| [Independent Packages](packages.md) | Can be used independently; do not need full installation of DTaaS. |

The [installation steps](steps.md) is a good place to start the installation process.

## Administer

There is a [CLI](cli.md) to add and delete users of a running application.
2 changes: 1 addition & 1 deletion docs/admin/packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ A brief explanation of the packages is given below.

| Package Name | Description | Documentation for | Availability |
|:----|:----|:----|:----|
| dtaas-web | React web application | [container image](client/docker.md) | [docker hub](https://hub.docker.com/r/intocps/dtaas-web) and [github](https://github.com/INTO-CPS-Association/DTaaS/pkgs/container/dtaas-web) |
| dtaas-web | React web application | Not useful as standalone package | [docker hub](https://hub.docker.com/r/intocps/dtaas-web) and [github](https://github.com/INTO-CPS-Association/DTaaS/pkgs/container/dtaas-web) |
| libms |Library microservice | [npm package](servers/lib/npm.md) | [npmjs](https://www.npmjs.com/package/@into-cps-association/libms) and [github](https://github.com/INTO-CPS-Association/DTaaS/pkgs/npm/libms) |
| | | [container image](servers/lib/docker.md) | [docker hub](https://hub.docker.com/r/intocps/libms) and [github](https://github.com/INTO-CPS-Association/DTaaS/pkgs/container/libms) |
| runner | REST API wrapper for multiple scripts/programs | [npm package](../user/servers/execution/runner/README.md) | [npmjs](https://www.npmjs.com/package/@into-cps-association/runner) and [github](https://github.com/INTO-CPS-Association/DTaaS/pkgs/npm/runner) |
Expand Down
26 changes: 26 additions & 0 deletions docs/admin/requirements.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Requirements

<!-- markdownlint-disable MD046 -->
<!-- prettier-ignore -->
!!! tip localhost

These optional requirements are not needed for
[**localhost**](./localhost.md) installation.
They are only required for installation of the DTaaS on
a production web server.
<!-- markdownlint-enable MD046 -->

There are two optional requirements for installing the DTaaS.

## OAuth Provider

The DTaaS software is uses OAuth for user authorization. It is
possible to use either <http:>_gitlab.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:>.
However, it is possible to install the software on your computer
and use access it at <http:>_localhost_</http:>.
Loading

0 comments on commit 9c739f3

Please sign in to comment.