Skip to content

Backend las2peer service for project management (components, users, roles) in the CAE.

License

Notifications You must be signed in to change notification settings

rwth-acis/CAE-Project-Management-Service

Repository files navigation

CAE-Project-Management-Service

This las2peer service is used by the Community Application Editor's frontend for project management. This includes creating projects and managing their components, users and roles.

How to build this service

Building the service is just building a las2peer service. The las2peer template project and its wiki contain detailed information, but basically you should be able to clone the repository and execute a build using gradle.

How to run using Docker

First build the image:

docker build . -t cae-project-management-service

Then you can run the image like this:

docker run -e MYSQL_USER=myuser -e MYSQL_PASSWORD=mypasswd -e GITHUB_PERSONAL_ACCESS_TOKEN=personal_access_token -e GITHUB_ORGANIZATION=organization_name -e GITHUB_OAUTH_CLIENTID=client_id -e GITHUB_OAUTH_CLIENTSECRET=client_secret -e REQ_BAZ_PROJECT_ID=project_id -p 8080:8080 -p 9011:9011 cae-project-management-service

Replace myuser and mypasswd with the username and password of a MySQL user with access to a database named commedit. By default the database host is mysql and the port is 3306. You can use --link option to connect the project management service with the MySQL docker container. Note, when using MYSQL_HOST env variable, it seems to be needed to also give the MYSQL_PORT even if it should be the standard one. By using the environment variables GITHUB_PERSONAL_ACCESS_TOKEN and GITHUB_ORGANIZATION you can select which GitHub organization gets used for storing the GitHub projects that correspond to CAE projects. Note, that the user (that the personal access token from GitHub belongs to) must be able to create projects inside the given organization. You can generate a new personal access token in GitHub under "Settings" -> "Developer settings" -> "Personal access tokens".

For connecting the users CAE account with the GitHub account, an OAuth GitHub app is required. You can read more on how to create a GitHub OAuth app here. Once you've created your OAuth app, you will receive a client id and a client secret. Replace the placeholders client_id and client_secret in the docker run command with these. The OAuth app is also used to get access tokens for the GitHub API, which allow to query the GitHub projects API. In order to get access to the GitHub projects, the organization where you host the GitHub projects needs to be configured. In the organization on GitHub, go to Settings, then Third Party access and grant access for your OAuth app. Otherwise access tokens generated by using your OAuth app will not have access to the GitHub projects of your organization.

Set project_id to the id of a project in the Requirements Bazaar which should be used to create categories for CAE components.

In order to customize your setup you can set further environment variables.

Node Launcher Variables

Set las2peer node launcher options with these variables. The las2peer port is fixed at 9011.

Variable Default Description
BOOTSTRAP unset Set the --bootstrap option to bootrap with existing nodes. The container will wait for any bootstrap node to be available before continuing.
SERVICE_PASSPHRASE Passphrase Set the second argument in startService('service@version', '<SERVICE_PASSPHRASE>').
SERVICE_EXTRA_ARGS unset Set additional launcher arguments. Example: --observer to enable monitoring.

Service Variables

Variable Default
MYSQL_USER mandatory
MYSQL_PASSWORD mandatory
MYSQL_HOST mysql
MYSQL_PORT 3306
GITHUB_PERSONAL_ACCESS_TOKEN mandatory
GITHUB_ORGANIZATION mandatory
GITHUB_OAUTH_CLIENTID mandatory
GITHUB_OAUTH_CLIENTSECRET mandatory
REQ_BAZ_PROJECT_ID mandatory
DISABLE_CATEGORY_CREATION false

Web Connector Variables

Set WebConnector properties with these variables. httpPort and httpsPort are fixed at 8080 and 8443.

Variable Default
START_HTTP TRUE
START_HTTPS FALSE
SSL_KEYSTORE ""
SSL_KEY_PASSWORD ""
CROSS_ORIGIN_RESOURCE_DOMAIN *
CROSS_ORIGIN_RESOURCE_MAX_AGE 60
ENABLE_CROSS_ORIGIN_RESOURCE_SHARING TRUE
OIDC_PROVIDERS https://api.learning-layers.eu/o/oauth2,https://accounts.google.com

Other Variables

Variable Default Description
DEBUG unset Set to any value to get verbose output in the container entrypoint script.

Volumes

The following places should be persisted in volumes in productive scenarios:

Path Description
/src/node-storage Pastry P2P storage.
/src/etc/startup Service agent key pair and passphrase.
/src/log Log files.

Do not forget to persist you database data

About

Backend las2peer service for project management (components, users, roles) in the CAE.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages