diff --git a/README.md b/README.md index 8ff779f5..61f63502 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ You can use older versions of SciCat Live by checking out specific tags using `g `v1.0` - the first stable version -Note: older versions might not contain certain functionality (e.g. archival mock in `v1.0`). Be sure to take a look at that version's `README.md` as well. +Note: older versions might not contain certain functionality (e.g. archival mock in `v1.0`). Be sure to take a look at that version's `README.md` as well. ## Steps @@ -23,7 +23,7 @@ Note: older versions might not contain certain functionality (e.g. archival mock ## Default setup -By running `docker-compose up -d` these steps take place: +By running `docker-compose up -d` these steps take place: 1. a [mongodb](./services/mongodb/) container is created with some intial data. 2. a [rabbitmq](./services/rabbitmq/) container is created. 3. the SciCat [backend v3](./services/backend/) container is created and connected to (1) and (2). @@ -33,27 +33,33 @@ By running `docker-compose up -d` these steps take place: 7. a reverse [proxy](./services/proxy) container is created and routes trafic to (2), (3), (4) and (5) through localhost subdomains, in the form: `http://${service}.localhost` (for the ones of need). The frontend is available at simply `http://localhost`. -Here below we show the dependencies (if `B` depends on `A`, then we visualize as `A --> B`): +Here below we show the dependencies (if `B` depends on `A`, then we visualize as `A --> B`): ```mermaid -graph TD; - subgraph services; - rabbitmq --> archivemock; - rabbitmq --> backend; - mongodb --> backend; - backend --> archivemock; - backend --> frontend; - backend --> searchapi; - end; - proxy -.- backend; - proxy -.- frontend; - proxy -.- searchapi; - proxy -.- rabbitmq; +graph TD + subgraph services + subgraph backends + backend + backend-next + end + + rabbitmq --> archivemock + rabbitmq --> backend + mongodb --> backends + backend --> archivemock + backend --> frontend + backend --> searchapi + end + + proxy -.- backends + proxy -.- frontend + proxy -.- searchapi + proxy -.- rabbitmq ``` ## Select the services -The user can selectively decide the containers to spin up and the dependencies will be resolved accordingly. The available services are in the [services](./services/) folder and called consistently. +The user can selectively decide the containers to spin up and the dependencies will be resolved accordingly. The available services are in the [services](./services/) folder and called consistently. For example, one could decide to only run the `backend` by running (be aware that this will not run the `proxy`, so the service will not be available at `backend.localhost`): @@ -63,26 +69,26 @@ docker-compose up -d backend (or a list of services, for example, with the proxy `docker-compose up -d backend proxy`) -This will run, from the [previous section](#default-setup), (1), (2) and (3) but skip the rest. +This will run, from the [previous section](#default-setup), (1), (2) and (3) but skip the rest. Accordingly, ```sh docker-compose up -d frontend(/searchapi) ``` -Will run, from the [previous section](#default-setup), (1), (2), (3) and (4/(5)) but skip (5/(4)), (6) and (7). +Will run, from the [previous section](#default-setup), (1), (2), (3) and (4/(5)) but skip (5/(4)), (6) and (7). ## Custom configure a service Every service folder (inside the [services](./services/) parent directory) contains its configuration and some instructions, at least for the non third-party containers. -For example, to configure the [frontend](./services/frontend/), the user can change any file in the [frontend config](./services/frontend/config/) folder, for which instructions are available in the [README](./services/frontend/README.md) file. +For example, to configure the [frontend](./services/frontend/), the user can change any file in the [frontend config](./services/frontend/config/) folder, for which instructions are available in the [README](./services/frontend/README.md) file. After any configuration change, `docker-compose up -d` must be rerun, to allow loading the changes. ## Add a new service -To add a new service: +To add a new service: 1. create a dedicated folder in the [services](./services/) one 2. call it as the service should be named 3. create the `docker-compose.yaml` file with the required dependencies (if any) diff --git a/services/backend-next/README.md b/services/backend-next/README.md index 44d2af09..a28b0ee6 100644 --- a/services/backend-next/README.md +++ b/services/backend-next/README.md @@ -6,6 +6,8 @@ The SciCat backend-next is a rewrite of the original backend, built on top of th The backend-next service is mainly configured via environment variables. For an extensive list of available options see [here](https://scicatproject.github.io/documentation/Development/v4.x/backend/configuration.html). +It can also serve the frontend theme and configuration by mounting the files in `/home/node/app/dist/config/frontend.theme.json` and `/home/node/app/dist/config/frontend.config.json`. + ### Functional Accounts There are a few functional accounts available for handling data: diff --git a/services/backend-next/config/.env b/services/backend-next/config/.env index 11e43e51..1c9f851c 100644 --- a/services/backend-next/config/.env +++ b/services/backend-next/config/.env @@ -1,5 +1,10 @@ MONGODB_URI=mongodb://mongodb:27017/dacat-next SITE=FACILITY JWT_SECRET=secret -JWT_NEVER_EXPIRES=true EXPRESS_SESSION_SECRET=secret + +ADMIN_GROUPS=admin +DELETE_GROUPS=jerk +CREATE_DATASET_GROUPS=ingestor +PROPOSAL_GROUPS=proposalingestor +SAMPLE_GROUPS=ingestor diff --git a/services/backend-next/config/functionalAccounts.json b/services/backend-next/config/functionalAccounts.json index 0b329992..51934f4b 100644 --- a/services/backend-next/config/functionalAccounts.json +++ b/services/backend-next/config/functionalAccounts.json @@ -3,15 +3,13 @@ "username": "admin", "password": "2jf0TPNZsS", "email": "scicatadmin@your.site", - "role": "admin", - "global": true + "role": "admin" }, { "username": "ingestor", "password": "aman", "email": "scicatingestor@your.site", - "role": "ingestor", - "global": true + "role": "ingestor" }, { "username": "archiveManager",