cleanup and readme updates

This commit is contained in:
William Welling
2021-12-07 11:38:48 -06:00
parent 33488ccf40
commit 46bb3e109c
4 changed files with 165 additions and 74 deletions

View File

@@ -1,26 +1,32 @@
# Configuration
Default configuration file is located in `src/environments/` folder. All configuration options should be listed in the default configuration file `src/environments/environment.common.ts`. Please do not change this file directly! To change the default configuration values, create local files that override the parameters you need to change. You can use `environment.template.ts` as a starting point.
Default configuration file is located in `config/` folder. All configuration options should be listed in the default configuration file `src/config/default-app-config.ts`. Please do not change this file directly! To change the default configuration values, create local files that override the parameters you need to change. You can use `appConfig.json` as a starting point.
- Create a new `environment.dev.ts` file in `src/environments/` for `development` environment;
- Create a new `environment.prod.ts` file in `src/environments/` for `production` environment;
- Create a new `appConfig.(dev or development).json` file in `config/` for `development` environment;
- Create a new `appConfig.(prod or production).json` file in `config/` for `production` environment;
Some few configuration options can be overridden by setting environment variables. These and the variable names are listed below.
Alternatively, create a desired app config file at an external location and set the path as environment variable `APP_CONFIG_PATH`.
e.g.
```
APP_CONFIG_PATH=/usr/local/dspace/config/appConfig.json
```
Configuration options can be overridden by setting environment variables.
## Nodejs server
When you start dspace-angular on node, it spins up an http server on which it listens for incoming connections. You can define the ip address and port the server should bind itsself to, and if ssl should be enabled not. By default it listens on `localhost:4000`. If you want it to listen on all your network connections, configure it to bind itself to `0.0.0.0`.
To change this configuration, change the options `ui.host`, `ui.port` and `ui.ssl` in the appropriate configuration file (see above):
```
export const environment = {
// Angular UI settings.
ui: {
ssl: false,
host: 'localhost',
port: 4000,
nameSpace: '/'
{
"ui": {
"ssl": false,
"host": "localhost",
"port": 4000,
"nameSpace": "/"
}
};
}
```
Alternately you can set the following environment variables. If any of these are set, it will override all configuration files:
@@ -30,21 +36,26 @@ Alternately you can set the following environment variables. If any of these are
DSPACE_PORT=4000
DSPACE_NAMESPACE=/
```
or
```
UI_SSL=true
UI_HOST=localhost
UI_PORT=4000
UI_NAMESPACE=/
```
## DSpace's REST endpoint
dspace-angular connects to your DSpace installation by using its REST endpoint. To do so, you have to define the ip address, port and if ssl should be enabled. You can do this in a configuration file (see above) by adding the following options:
```
export const environment = {
// The REST API server settings.
rest: {
ssl: true,
host: 'api7.dspace.org',
port: 443,
// NOTE: Space is capitalized because 'namespace' is a reserved string in TypeScript
nameSpace: '/server'
{
"rest": {
"ssl": true,
"host": "api7.dspace.org",
"port": 443,
"nameSpace": "/server"
}
};
}
```
Alternately you can set the following environment variables. If any of these are set, it will override all configuration files:
@@ -54,6 +65,27 @@ Alternately you can set the following environment variables. If any of these are
DSPACE_REST_PORT=443
DSPACE_REST_NAMESPACE=/server
```
or
```
REST_SSL=true
REST_HOST=api7.dspace.org
REST_PORT=443
REST_NAMESPACE=/server
```
## Environment variable naming convention
Settings can be set using the following convention for naming the environment variables:
1. replace all `.` with `_`
2. convert all characters to upper case
e.g.
```
cache.msToLive.default => CACHE_MSTOLIVE_DEFAULT
auth.ui.timeUntilIdle => AUTH_UI_TIMEUNTILIDLE
```
## Supporting analytics services other than Google Analytics
This project makes use of [Angulartics](https://angulartics.github.io/angulartics2/) to track usage events and send them to Google Analytics.