Skip to content

Commit

Permalink
feat(KUI-1321): cleanup local env setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Karl Andin authored and karlandindrakryggen committed May 17, 2024
1 parent 74a2488 commit e756238
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 46 deletions.
24 changes: 5 additions & 19 deletions .env.in
Original file line number Diff line number Diff line change
@@ -1,19 +1,5 @@
KURSINFO_API_KEY=[key you specified in kursinfo-api for this service]
APPLICATIONINSIGHTS_CONNECTION_STRING=<Available at Azure key vault>
KOPPS_URI=https://api-r.referens.sys.kth.se/api/kopps/v2/?defaultTimeout=60000
KURSINFO_API_URI=<Available at Azure configuration page>
SESSION_SECRET=[something random]
SESSION_KEY=kursinfo-admin-web.sid
OIDC_APPLICATION_ID=<FROM ADFS>
OIDC_CLIENT_SECRET=<FROM ADFS>
OIDC_TOKEN_SECRET=<Random string>
OIDC_CONFIGURATION_URL=<not needed if localhost>
OIDC_CALLBACK_URL=<not needed if localhost>
OIDC_CALLBACK_SILENT_URL=<not needed if localhost>
OIDC_CALLBACK_LOGOUT_URL=<not needed if localhost>
REDIS_URI=[connection string to redis]
BLOB_SERVICE_SAS_URL=https://[common storage name].blob.core.windows.net/?[params]&spr=https&sig=[generated signature]
STORAGE_CONTAINER_NAME=kursinfo-image-container
/*If you want to start your server on another port, add the following two variables, else use default ones from serversettings.js*/
SERVER_PORT=[your port for the server]
SERVER_HOST_URL=http://localhost:[SERVER_PORT]
KURSINFO_API_KEY=[Available in Azure KeyVault]
OIDC_APPLICATION_ID=[Available in Azure KeyVault]
OIDC_CLIENT_SECRET=[Available in Azure KeyVault]
REDIS_URI=[Available in Azure KeyVault]
BLOB_SERVICE_SAS_URL=[Available in Azure KeyVault]
27 changes: 1 addition & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ localhost:3000/kursinfoadmin/kurser/kurs/:courseCode
```

- Course introduction text for course information page, which can be edited by course coordinators and examiners.
(requires only: `KURSINFO_API_KEY` kursinfo-api)

```
localhost:3000/kursinfoadmin/kurser/kurs/edit/:courseCode
Expand Down Expand Up @@ -97,31 +96,7 @@ Later you will use it as a _BLOB_SERVICE_SAS_URL_ in secrets together with a nam

### Secrets for Development

Secrets during local development are ALWAYS stored in a `.env`-file in the root of your project.

IMPORTANT: In Prod env, save URL:s in docker file but secrets in secrets.env

```
KURSINFO_API_KEY=[key you specified in kursinfo-api for this service]
KOPPS_URI=https://[kopps api]/api/kopps/v2/?defaultTimeout=60000
SESSION_SECRET=[something random]
SESSION_KEY=[f.e. kursinfo-admin-web.sid]
OIDC_APPLICATION_ID=<FROM ADFS>
OIDC_CLIENT_SECRET=<FROM ADFS>
OIDC_TOKEN_SECRET=<Random string>
OIDC_CONFIGURATION_URL=<not needed if localhost>
OIDC_CALLBACK_URL=<not needed if localhost>
OIDC_CALLBACK_SILENT_URL=<not needed if localhost>
OIDC_CALLBACK_LOGOUT_URL=<not needed if localhost>
REDIS_URI=[connection string to redis]
/*If you want to start your server on another port, add the following two variables, else use default ones from serversettings.js*/
SERVER_PORT=[your port for the server]
SERVER_HOST_URL=http://localhost:[SERVER_PORT]
BLOB_SERVICE_SAS_URL=https://[blob storage address]/?sv=[date]&ss=b&srt=o&sp=rwcx&se=[date]&st=[date]&spr=https&sig=[generated signature]
STORAGE_CONTAINER_NAME=kursinfo-image-container
```

These settings are also available in an `env.in` file.
Secrets during local development are stored in a gitignored `.env` file (`env.in` can be used as template for your `.env` file). More details about environment variable setup and secrets can be found in [confluence](https://confluence.sys.kth.se/confluence/x/OYKBDQ).

### Install

Expand Down
2 changes: 1 addition & 1 deletion config/serverSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const { safeGet } = require('safe-utils')
const devPort = devDefaults(3000)
const devSsl = devDefaults(false)
const devUrl = devDefaults('http://localhost:' + devPort)
const devKursinfoApi = devDefaults('http://localhost:3001/api/kursinfo?defaultTimeout=10000') // required=true&
const devKursinfoApi = devDefaults('https://api-r.referens.sys.kth.se/api/kursinfo?defaultTimeout=10000') // required=true&
const devKoppsApi = devDefaults('https://api-r.referens.sys.kth.se/api/kopps/v2/?defaultTimeout=60000') // required=true&
const devSessionKey = devDefaults('kursinfo-admin-web.sid')
const devSessionUseRedis = devDefaults(true)
Expand Down

0 comments on commit e756238

Please sign in to comment.