diff --git a/deploy/config/client/env.js b/deploy/config/client/env.js index baa19d645..ea8dc9b9f 100644 --- a/deploy/config/client/env.js +++ b/deploy/config/client/env.js @@ -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', diff --git a/deploy/config/client/env.local.js b/deploy/config/client/env.local.js index 3268c3f00..330364169 100644 --- a/deploy/config/client/env.local.js +++ b/deploy/config/client/env.local.js @@ -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", diff --git a/deploy/config/client/env.trial.js b/deploy/config/client/env.trial.js index baa19d645..14c3ee101 100644 --- a/deploy/config/client/env.trial.js +++ b/deploy/config/client/env.trial.js @@ -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', diff --git a/deploy/config/lib.local b/deploy/config/lib.local deleted file mode 100644 index 5b26931e4..000000000 --- a/deploy/config/lib.local +++ /dev/null @@ -1,6 +0,0 @@ -PORT='4001' -MODE='local' -LOCAL_PATH ='filepath' -LOG_LEVEL='debug' -APOLLO_PATH='/lib' -GRAPHQL_PLAYGROUND='true' \ No newline at end of file diff --git a/deploy/config/lib.trial b/deploy/config/lib.trial deleted file mode 100644 index 1acc5496d..000000000 --- a/deploy/config/lib.trial +++ /dev/null @@ -1,9 +0,0 @@ -PORT='4001' -MODE='local' or 'gitlab' -LOCAL_PATH ='filepath' -GITLAB_GROUP ='dtaas' -GITLAB_URL='https://gitlab.foo.com/api/graphql' -TOKEN='123-sample-token' -LOG_LEVEL='debug' -APOLLO_PATH='/lib' or '' -GRAPHQL_PLAYGROUND='false' or 'true' \ No newline at end of file diff --git a/deploy/single-script-install.sh b/deploy/single-script-install.sh index e1d7937fd..776c5688b 100755 --- a/deploy/single-script-install.sh +++ b/deploy/single-script-install.sh @@ -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 @@ -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 " diff --git a/docs/admin/localhost.md b/docs/admin/localhost.md index afe2ffd32..1e3e23d16 100644 --- a/docs/admin/localhost.md +++ b/docs/admin/localhost.md @@ -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 @@ -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 @@ -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 | or | +| OAuth Provider | REACT_APP_AUTH_AUTHORITY | or | | Application ID | REACT_APP_CLIENT_ID | | Callback URL | REACT_APP_REDIRECT_URI | | | Scopes | REACT_APP_GITLAB_SCOPES | openid, profile, read_user, read_repository, api | @@ -40,8 +41,6 @@ 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 @@ -49,43 +48,32 @@ Remember to create gitlab accounts for `user1`. 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 ``` - -!!! 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 , 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. diff --git a/docs/admin/trial.md b/docs/admin/trial.md index d16aaa689..142e7378f 100644 --- a/docs/admin/trial.md +++ b/docs/admin/trial.md @@ -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 @@ -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 | | +| OAuth Provider | REACT_APP_AUTH_AUTHORITY | or | | Application ID | REACT_APP_CLIENT_ID | | Callback URL | REACT_APP_REDIRECT_URI | | | Scopes | REACT_APP_GITLAB_SCOPES | openid, profile, read_user, read_repository, api | @@ -45,8 +47,6 @@ 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 @@ -54,20 +54,21 @@ Remember to create gitlab accounts for `user1`. 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 ``` +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. + !!! 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 @@ -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 , 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.