diff --git a/client/README.md b/client/README.md index a95ff4c69..1566627dd 100644 --- a/client/README.md +++ b/client/README.md @@ -22,6 +22,7 @@ yarn build #build the react app into build/ directory yarn develop #start the development server without building. Great for live edits. #Required: Choose one config for application (mandatory) +yarn config:local yarn config:dev yarn config:prod yarn config:test diff --git a/client/config/local.js b/client/config/local.js new file mode 100644 index 000000000..7c2fa66ce --- /dev/null +++ b/client/config/local.js @@ -0,0 +1,19 @@ +if (typeof window !== 'undefined') { + window.env = { + REACT_APP_ENVIRONMENT: 'dev', + REACT_APP_URL: 'http://localhost/', + 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.com/', + REACT_APP_REDIRECT_URI: 'http://localhost/Library', + REACT_APP_LOGOUT_REDIRECT_URI: 'http://localhost/', + REACT_APP_GITLAB_SCOPES: 'openid profile read_user read_repository api', + }; +}; diff --git a/docker/README.md b/docker/README.md index e69c0bf7f..1b7b506e1 100644 --- a/docker/README.md +++ b/docker/README.md @@ -67,11 +67,11 @@ Edit all the fields according to your specific case. Note: 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. +same convention (IP/DNS) in the `CLIENT_CONFIG` file as well. ### Website Client -- Assign the correct client config file to `CLIENT_CONFIG and +- Assign the correct client config file to `CLIENT_CONFIG` and update the values. | Deployment Scenario | client env file | @@ -101,6 +101,8 @@ and the compose file being used. ### Caveat The usernames in the `.env` file need to match those in the conf file. +The conf.local is used by compose.local.yml and +conf.server is used by compose.server.yml. Traefik routes are controlled by the `.env` file Authentication on these routes is controlled by the `conf` file. diff --git a/docker/dev/.env b/docker/dev/.env index 882796b22..80b1ec640 100644 --- a/docker/dev/.env +++ b/docker/dev/.env @@ -4,7 +4,6 @@ OAUTH_URL='https://gitlab.foo.com' CLIENT_ID='xx' CLIENT_SECRET='xx' OAUTH_SECRET='random-secret-string' -CLIENT_CONFIG='/home/Desktop/DTaaS/deploy/config/client/env.local.js' OAUTH_CONF_FILEPATH='/home/Desktop/DTaaS/docker/conf.local' username1='user1' username2='user2' diff --git a/docker/dev/README.md b/docker/dev/README.md index eeaa9bbed..450667fa7 100644 --- a/docker/dev/README.md +++ b/docker/dev/README.md @@ -70,8 +70,8 @@ This scenario is for software developers: The configuration files to be updated are: -1. client/config/dev.js -1. deploy/config/lib.docker +1. client/config/local.js +1. deploy/config/lib.docker (optional) The relevant docker commands are: diff --git a/docker/dev/compose.dev.yml b/docker/dev/compose.dev.yml index 98f2a5ec4..02f206a9f 100644 --- a/docker/dev/compose.dev.yml +++ b/docker/dev/compose.dev.yml @@ -18,7 +18,7 @@ services: context: ${DTAAS_DIR}/ dockerfile: ${DTAAS_DIR}/docker/dev/client.dockerfile volumes: - - "${DTAAS_DIR}/client/config/dev.js:/dtaas/client/build/env.js" + - "${DTAAS_DIR}/client/config/local.js:/dtaas/client/build/env.js" labels: - "traefik.enable=true" - "traefik.http.routers.client.entryPoints=web" diff --git a/docs/admin/servers/auth.md b/docs/admin/servers/auth.md index 3566f869c..a478e1695 100644 --- a/docs/admin/servers/auth.md +++ b/docs/admin/servers/auth.md @@ -42,11 +42,13 @@ Here are the steps to get started: - The callback URL informs the OAuth provider of the page where signed-in users should be redirected. It is the landing - homepage of the DTaaS applicati1on. - (either or ) + homepage of the DTaaS application. + (either or ) - The logout URL is the URL for signout of gitlab and clear authorization within traefik-forward auth. - (either or ) + (either or ). + The logout URL is to help users logout of traefik forward-auth. The logout + URL should not be entered into Gitlab OAuth application setup. **4. OAuth Application Creation:** @@ -72,7 +74,7 @@ Here are the steps to get started: |Application Secret|CLIENT_SECRET| _xx_ | |Callback URL|(to be directly entered in Gitlab OAuth registration)|| |Forward-auth secret|OAUTH_SECRET|_random-secret-string_ (password for forward-auth, can be changed to your preferred string) | -|Scopes|email|| +|Scopes| read_user || ## Development Environment