Skip to content

Commit

Permalink
Updates docs and improves installation script
Browse files Browse the repository at this point in the history
  • Loading branch information
prasadtalasila committed Dec 21, 2023
1 parent 2905adb commit c03eaaa
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 65 deletions.
2 changes: 1 addition & 1 deletion deploy/config/client/env.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
window.env = {
REACT_APP_ENVIRONMENT: 'dev',
REACT_APP_ENVIRONMENT: 'prod',
REACT_APP_URL: 'https://foo.com/',
REACT_APP_URL_BASENAME: '',
REACT_APP_URL_DTLINK: '/lab',
Expand Down
2 changes: 1 addition & 1 deletion deploy/config/client/env.local.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
window.env = {
REACT_APP_ENVIRONMENT: "dev",
REACT_APP_ENVIRONMENT: "local",
REACT_APP_URL: "http://localhost/",
REACT_APP_URL_BASENAME: "",
REACT_APP_URL_DTLINK: "/lab",
Expand Down
2 changes: 1 addition & 1 deletion deploy/config/client/env.trial.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
window.env = {
REACT_APP_ENVIRONMENT: 'dev',
REACT_APP_ENVIRONMENT: 'trial',
REACT_APP_URL: 'https://foo.com/',
REACT_APP_URL_BASENAME: '',
REACT_APP_URL_DTLINK: '/lab',
Expand Down
6 changes: 0 additions & 6 deletions deploy/config/lib.local

This file was deleted.

9 changes: 0 additions & 9 deletions deploy/config/lib.trial

This file was deleted.

9 changes: 3 additions & 6 deletions deploy/single-script-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,6 @@ nohup serve -s build -l 4000 & disown
printf "\n\n Build, configure and run the lib microservice\n "
printf "...........\n "
cd "${TOP_DIR}/servers/lib" || exit
if [ -n "$env_variable" ] ; then
cp "${TOP_DIR}/deploy/config/lib.${env_variable}" .env
else
cp "${TOP_DIR}/deploy/config/lib" .env
fi
yarn install
yarn build

Expand Down Expand Up @@ -252,7 +247,9 @@ printf "\n\n The installation is complete.\n\n\n "
printf "Continue with the application configuration.\n "
printf ".........\n\n\n "
if [[ "$env_variable" == "local" ]]; then
:
printf "Remember to change Gitlab OAuth details to your \
local settings in the following file.\n "
printf "%s/client/build/env.js\n " "$TOP_DIR"
else
printf "Remember to change foo.com and Gitlab OAuth details to your \
local settings in the following files.\n "
Expand Down
40 changes: 14 additions & 26 deletions docs/admin/localhost.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Localhot Installation

To try out the software, you can install it on Ubuntu 22.04
Operating System. The setup requires a
Desktop Operating System. The setup requires a
machine which can spare 4GB RAM, 2 vCPUs and 15GB Hard Disk
space to a the DTaaS application.
A successful installation will create a setup
Expand All @@ -10,8 +10,8 @@ similar to the one shown in the figure.
![localhost install](./localhost.png)

A one-step installation script is provided on this page. This script sets up
the DTaaS software with a user.
You can use it to check a test installation of DTaaS software.
the DTaaS software for a single user.
You can use it to check a test installation of the DTaaS software.

## Pre-requisites

Expand All @@ -27,11 +27,12 @@ the [Authentication page](client/auth.md).
application. You can create this application
in your gitlab account.

You need the following information from the OAuth application registered on Gitlab:
You need the following information from the Gitlab OAuth application
registered on Gitlab:

| Gitlab Variable Name | Variable name in Client env.js | Default Value |
| :------------------- | :----------------------------- | :----------------------------------------------- |
| OAuth Provider | REACT_APP_AUTH_AUTHORITY | <https://gitlab.com/> or <https://gitlab.foo.com/> |
| OAuth Provider | REACT_APP_AUTH_AUTHORITY | <https://gitlab.com> or <https://gitlab.foo.com> |
| Application ID | REACT_APP_CLIENT_ID |
| Callback URL | REACT_APP_REDIRECT_URI | <http://localhost/Library> |
| Scopes | REACT_APP_GITLAB_SCOPES | openid, profile, read_user, read_repository, api |
Expand All @@ -40,52 +41,39 @@ You can also see
[Gitlab help page](https://docs.gitlab.com/ee/integration/oauth_provider.html)
for getting the Gitlab OAuth application details.

Remember to create gitlab accounts for `user1`.

## Install

<!-- prettier-ignore -->
!!! note
While installing you might encounter multiple dialogs asking,
which services should be restarted. Just click **OK** to all of those.

Run the following scripts. To setup the installation to use localhost,
the following argument is added to the script `--env local`.

Please also specify the username used in the OAuth Application,
with `--username username`.
Run the following commands.

```bash
wget https://raw.githubusercontent.com/INTO-CPS-Association/DTaaS/feature/distributed-demo/deploy/single-script-install.sh
bash single-script-install.sh --env local --username <username>
```

<!-- prettier-ignore -->
!!! warning
This test installation has default credentials and is thus highly insecure.
The `--env local` argument is added to the script specifies `localhost`
as the installation scenario. The `--username username` uses your
Gitlab username to configure the DTaaS application.

## Post install

After the install-script. Please change
After the single-install-script is successfully run. Please change
[Gitlab OAuth](#1-gitlab-oauth-application) details in

```txt
~/DTaaS/client/build/env.js
```

and change `filepath`
to your local settings in the following file.

```txt
~/DTaaS/servers/lib/.env
```

## Post-install Check

Now when you visit your domain, you should be able to login through your
OAuth Provider and be able to access the DTaas web UI.
Now when you visit <http://localhost>, you should be able to login through
Gitlab OAuth Provider and access the DTaas web UI.

If you can following all the screenshots from
If you can following along to see all the screenshots from
[user website](../user/website/index.md).
Everything is correctly setup.

Expand Down
31 changes: 16 additions & 15 deletions docs/admin/trial.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
To try out the software, you can install it on Ubuntu Server 22.04
Operating System. The setup requires a
machine which can spare 16GB RAM, 8 vCPUs and 50GB Hard Disk
space to the vagrant box.
space to the DTaaS application (or the vagrant box hosting
the DTaaS application).
A successful installation will create a setup
similar to the one shown in the figure.

![Single host install](./single-host.png)

A one-step installation script is provided on this page. This script sets up
the DTaaS software with default credentials and users.
the DTaaS software with default gateway credentials for a single user.
You can use it to check a test installation of DTaaS software.

!!! Information
Expand All @@ -32,11 +33,12 @@ The DTaaS react website requires Gitlab OAuth provider.
If you need more help with this step, please see
the [Authentication page](client/auth.md).

You need the following information from the OAuth application registered on Gitlab:
You need the following information from the Gitlab OAuth application
registered on Gitlab:

| Gitlab Variable Name | Variable name in Client env.js | Default Value |
| :------------------- | :----------------------------- | :----------------------------------------------- |
| OAuth Provider | REACT_APP_AUTH_AUTHORITY | <https://gitlab.foo.com/> |
| OAuth Provider | REACT_APP_AUTH_AUTHORITY | <https://gitlab.com> or <https://gitlab.foo.com> |
| Application ID | REACT_APP_CLIENT_ID |
| Callback URL | REACT_APP_REDIRECT_URI | <https://foo.com/Library> |
| Scopes | REACT_APP_GITLAB_SCOPES | openid, profile, read_user, read_repository, api |
Expand All @@ -45,29 +47,28 @@ You can also see
[Gitlab help page](https://docs.gitlab.com/ee/integration/oauth_provider.html)
for getting the Gitlab OAuth application details.

Remember to create gitlab accounts for `user1`.

## Install

<!-- prettier-ignore -->
!!! note
While installing you might encounter multiple dialogs asking,
which services should be restarted. Just click **OK** to all of those.

Run the following scripts. To setup the installation to use trial,
the following argument is added to the script `--env trial`.

Please also specify the username used in the OAuth Application,
with `--username username`.
Run the following commands.

```bash
wget https://raw.githubusercontent.com/INTO-CPS-Association/DTaaS/feature/distributed-demo/deploy/single-script-install.sh
bash single-script-install.sh --env trial --username <username>
```

The `--env trial` argument is added to the script specifies `trial`
as the installation scenario. The `--username username` uses your
Gitlab username to configure the DTaaS application.

<!-- prettier-ignore -->
!!! warning
This test installation has default credentials and is thus highly insecure.
This test installation has default gateway credentials and is
thus highly insecure.

## Post install

Expand All @@ -82,10 +83,10 @@ to your local settings in the following files.

## Post-install Check

Now when you visit your domain, you should be able to login through your
OAuth Provider and be able to access the DTaas web UI.
Now when you visit <https://foo.com>, you should be able to login through
Gitlab OAuth Provider and access the DTaas web UI.

If you can following all the screenshots from
If you can following along to see all the screenshots from
[user website](../user/website/index.md).
Everything is correctly setup.

Expand Down

0 comments on commit c03eaaa

Please sign in to comment.