|
|
# Description
|
|
|
The asset-manager manages all asset-store-specific data (repository)
|
|
|
|
|
|
> *Requirements*
|
|
|
* [git](https://git-scm.com)
|
|
|
* [Node.js](https://nodejs.org)
|
|
|
* [MongoDB](https://www.mongodb.com)
|
|
|
|
|
|
# Check if tools are available
|
|
|
```
|
|
|
> npm -v
|
|
|
```
|
|
|
|
|
|
# Checkout process
|
|
|
```
|
|
|
> git clone git@gitlab.beuth-hochschule.de:smart-learning/managers.git
|
|
|
> git checkout asset-manager-release
|
|
|
> npm install
|
|
|
```
|
|
|
|
|
|
# Installation
|
|
|
* [GitLab](https://gitlab.beuth-hochschule.de/smart-learning/managers/tags) browse to `Tags` and download `asset-manager-v*` as archive
|
|
|
* Unzip the archive
|
|
|
* cd into unarchived directory
|
|
|
|
|
|
```
|
|
|
> npm install
|
|
|
```
|
|
|
|
|
|
# Configuration
|
|
|
In order to configure the asset-manager open and edit the
|
|
|
*.env* file in the root directory.
|
|
|
|
|
|
* `APP_PORT` - port of the asset-manager
|
|
|
* `SWAGGER_DOC_USE` - flag whether Swagger Doc is available via http://localhost:3132/doc/swagger
|
|
|
* `SWAGGER_UI_USE` - flag whether Swagger UI is available via http://localhost:3132
|
|
|
* `REVERSE_PROXY_USE` - flag whether the authentication-manager is available via reverse-proxy (e.g. the verification url send by e-mail)
|
|
|
* `REVERSE_PROXY_PROT` - protocol of the reverse-proxy
|
|
|
* `REVERSE_PROXY_HOST` - host of the reverse-proxy
|
|
|
* `REVERSE_PROXY_PORT` - port of the reverse-proxy
|
|
|
* `REVERSE_PROXY_BASE` - base url of the reverse-proxy
|
|
|
* `AUTH_USER_ENUM_ROLES` - list of all enumerated roles for the user accounts
|
|
|
* `API_REST_DEPRECATED_USE` - flag whether use asset model 'resources' or 'items' (deprecated)
|
|
|
* `AUTH_{{API}}_USE` - flag whether each POST, PUT and DELETE request needs authentication (for each data model / API)
|
|
|
* `AUTH_{{API}}_PROT` - protocol of the authentication api
|
|
|
* `AUTH_{{API}}_HOST` - host of the authentication api
|
|
|
* `AUTH_{{API}}_PORT` - port of the authentication api
|
|
|
* `AUTH_{{API}}_BASE` - base url of the authentication api
|
|
|
* `AUTH_{{API}}_TTL` - time to live of the token (in seconds)
|
|
|
* `AUTH_{{API}}_MIN_ROLE` - minimal role for authorized access (need to match one of the enumerated role in `AUTH_USER_ENUM_ROLES`)
|
|
|
* `DB_SINGLE_USE` - flag whether a single database is used for the asset-manager (all data models can be stored in a single database in different collections)
|
|
|
* `DB_SINGLE_HOST` - host of the database
|
|
|
* `DB_SINGLE_PORT` - port of the database
|
|
|
* `DB_SINGLE_NAME` - name of the database
|
|
|
* `DB_SINGLE_USER` - username to authenticate
|
|
|
* `DB_SINGLE_PASS` - password to authenticate
|
|
|
* `DB_{{data model}}_HOST` - host of the database (for each data model if no single database in use)
|
|
|
* `DB_{{data model}}_PORT` - port of the database (for each data model if no single database in use)
|
|
|
* `DB_{{data model}}_NAME` - name of the database (for each data model if no single database in use)
|
|
|
* `DB_{{data model}}_USER` - username to authenticate (for each data model if no single database in use)
|
|
|
* `DB_{{data model}}_PASS` - password to authenticate (for each data model if no single database in use)
|
|
|
|
|
|
```
|
|
|
NODE_ENV=false
|
|
|
|
|
|
APP_PORT=3132
|
|
|
|
|
|
# Swagger
|
|
|
SWAGGER_DOC_USE=true
|
|
|
SWAGGER_DOC_PATH=../../swagger/api-doc/swagger
|
|
|
SWAGGER_DOC_DEPRECATED_PATH=../../swagger/api-doc/deprecated
|
|
|
SWAGGER_UI_USE=true
|
|
|
|
|
|
# Reverse proxy
|
|
|
REVERSE_PROXY_USE=false
|
|
|
REVERSE_PROXY_PROT=https
|
|
|
REVERSE_PROXY_HOST=subdomain.domain.tld
|
|
|
REVERSE_PROXY_PORT=443
|
|
|
REVERSE_PROXY_BASE=/path/to
|
|
|
|
|
|
# Default user role
|
|
|
AUTH_USER_ENUM_ROLES=Public,Learner,Editor,Teacher,Manager,Administrator
|
|
|
|
|
|
# /rest - use asset model 'resources' or 'items' (deprecated)
|
|
|
API_REST_DEPRECATED_USE=false
|
|
|
|
|
|
# /rest - intercept express requests, check min user role by authorization header
|
|
|
AUTH_REST_USE=true
|
|
|
AUTH_REST_PROT=http
|
|
|
AUTH_REST_HOST=localhost
|
|
|
AUTH_REST_PORT=3131
|
|
|
AUTH_REST_BASE=/user/authentication/info
|
|
|
AUTH_REST_TTL=86400
|
|
|
AUTH_REST_MIN_ROLE=Manager
|
|
|
|
|
|
# DB credentials, if use single db instance
|
|
|
DB_SINGLE_USE=true
|
|
|
DB_SINGLE_HOST=localhost
|
|
|
DB_SINGLE_PORT=27017
|
|
|
DB_SINGLE_NAME=assets
|
|
|
DB_SINGLE_USER=asset
|
|
|
DB_SINGLE_PASS=manager
|
|
|
|
|
|
# DB credentials
|
|
|
DB_CONTENTRESOURCES_HOST=localhost
|
|
|
DB_CONTENTRESOURCES_PORT=27017
|
|
|
DB_CONTENTRESOURCES_NAME=assets
|
|
|
DB_CONTENTRESOURCES_USER=asset
|
|
|
DB_CONTENTRESOURCES_PASS=manager
|
|
|
|
|
|
# DB credentials
|
|
|
DB_COURSES_HOST=localhost
|
|
|
DB_COURSES_PORT=27017
|
|
|
DB_COURSES_NAME=assets
|
|
|
DB_COURSES_USER=asset
|
|
|
DB_COURSES_PASS=manager
|
|
|
|
|
|
# DB credentials
|
|
|
DB_INTERACTIONS_HOST=localhost
|
|
|
DB_INTERACTIONS_PORT=27017
|
|
|
DB_INTERACTIONS_NAME=assets
|
|
|
DB_INTERACTIONS_USER=asset
|
|
|
DB_INTERACTIONS_PASS=manager
|
|
|
|
|
|
# DB credentials
|
|
|
DB_LEARNINGOBJECTIVES_HOST=localhost
|
|
|
DB_LEARNINGOBJECTIVES_PORT=27017
|
|
|
DB_LEARNINGOBJECTIVES_NAME=assets
|
|
|
DB_LEARNINGOBJECTIVES_USER=asset
|
|
|
DB_LEARNINGOBJECTIVES_PASS=manager
|
|
|
|
|
|
# DB credentials
|
|
|
DB_LESSONS_HOST=localhost
|
|
|
DB_LESSONS_PORT=27017
|
|
|
DB_LESSONS_NAME=assets
|
|
|
DB_LESSONS_USER=asset
|
|
|
DB_LESSONS_PASS=manager
|
|
|
|
|
|
# DB credentials
|
|
|
DB_MODULES_HOST=localhost
|
|
|
DB_MODULES_PORT=27017
|
|
|
DB_MODULES_NAME=assets
|
|
|
DB_MODULES_USER=asset
|
|
|
DB_MODULES_PASS=manager
|
|
|
|
|
|
# DB credentials
|
|
|
DB_QUESTIONS_HOST=localhost
|
|
|
DB_QUESTIONS_PORT=27017
|
|
|
DB_QUESTIONS_NAME=assets
|
|
|
DB_QUESTIONS_USER=asset
|
|
|
DB_QUESTIONS_PASS=manager
|
|
|
|
|
|
# DB credentials
|
|
|
DB_RESOURCES_HOST=localhost
|
|
|
DB_RESOURCES_PORT=27017
|
|
|
DB_RESOURCES_NAME=assets
|
|
|
DB_RESOURCES_USER=asset
|
|
|
DB_RESOURCES_PASS=manager
|
|
|
|
|
|
# DB credentials
|
|
|
DB_SECTIONS_HOST=localhost
|
|
|
DB_SECTIONS_PORT=27017
|
|
|
DB_SECTIONS_NAME=assets
|
|
|
DB_SECTIONS_USER=asset
|
|
|
DB_SECTIONS_PASS=manager
|
|
|
|
|
|
# DB credentials
|
|
|
DB_TAXONS_HOST=localhost
|
|
|
DB_TAXONS_PORT=27017
|
|
|
DB_TAXONS_NAME=assets
|
|
|
DB_TAXONS_USER=asset
|
|
|
DB_TAXONS_PASS=manager
|
|
|
|
|
|
# DB credentials
|
|
|
DB_ITEMS_HOST=localhost
|
|
|
DB_ITEMS_PORT=27017
|
|
|
DB_ITEMS_NAME=assets
|
|
|
DB_ITEMS_USER=asset
|
|
|
DB_ITEMS_PASS=manager
|
|
|
```
|
|
|
|
|
|
# Run manager with:
|
|
|
```
|
|
|
> node server.js
|
|
|
```
|
|
|
|
|
|
# See also:
|
|
|
* [Documentation](https://gitlab.beuth-hochschule.de/smart-learning/managers/blob/asset-manager-release/docs/index.html) [JSDoc] or within unarchived folder in directory *docs*
|
|
|
* [Swagger-UI](http://localhost:3132/) [localhost]
|
|
|
* [Swagger-DOC](http://localhost:3132/doc/swagger) [localhost]
|
|
|
|
|
|
# Licence:
|
|
|
<a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-sa/4.0/88x31.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">Creative Commons Attribution-ShareAlike 4.0 International License</a>. |
|
|
\ No newline at end of file |