Skip to content

Commit bfd5ba2

Browse files
authored
Release 3.37.0
2 parents 35ec4e6 + b9df607 commit bfd5ba2

File tree

68 files changed

+5463
-2619
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+5463
-2619
lines changed

.github/workflows/pull-request-update.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,25 +44,31 @@ jobs:
4444
deploy-prod-image:
4545
runs-on: ubuntu-latest
4646
steps:
47-
- uses: actions/checkout@v3
47+
- uses: actions/checkout@v4
48+
4849
- name: Login to DockerHub
49-
uses: docker/login-action@v2
50+
uses: docker/login-action@v3
5051
with:
5152
username: ${{ secrets.DOCKER_USERNAME }}
5253
password: ${{ secrets.DOCKER_PASSWORD }}
54+
55+
- name: Set up QEMU
56+
uses: docker/setup-qemu-action@v3
57+
5358
- name: Set up Docker Buildx
54-
id: buildx
55-
uses: docker/setup-buildx-action@v2
59+
uses: docker/setup-buildx-action@v3
60+
5661
- name: Build and push PR image
57-
uses: docker/build-push-action@v3
62+
uses: docker/build-push-action@v5
5863
with:
5964
context: ./
6065
file: ./build/Dockerfile
61-
builder: ${{ steps.buildx.outputs.name }}
66+
platforms: linux/amd64,linux/arm64
6267
push: true
6368
tags: aamdigital/ndb-server:pr-${{ github.event.number }}
6469
cache-from: type=gha
6570
cache-to: type=gha,mode=max
71+
6672
- name: Deploy updated image
6773
uses: appleboy/ssh-action@master
6874
with:

build/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ RUN if [ "$SENTRY_AUTH_TOKEN" != "" ] ; then \
7070

7171
### PROD image
7272

73-
FROM nginx:1.25.5-alpine
73+
FROM nginx:1.26.1-alpine
7474
COPY ./build/default.conf /etc/nginx/templates/default.conf
7575
COPY --from=builder /app/dist/ /usr/share/nginx/html
7676
# The port on which the app will run in the Docker container

doc/compodoc_sources/concepts/permissions.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,30 @@ The `admin_app` role simpy allows user with this role to do everything, without
111111
To learn more about how to define rules, have a look at
112112
the [CASL documentation](https://casl.js.org/v5/en/guide/define-rules#rules).
113113

114+
It is also possible to access information of the user sending the request. E.g.:
115+
116+
```json
117+
{
118+
"subject": "org.couchdb.user",
119+
"action": "update",
120+
"fields": [
121+
"password"
122+
],
123+
"conditions": {
124+
"name": "${user.name}",
125+
"projects": {
126+
"$in": "${user.projects}"
127+
}
128+
}
129+
}
130+
```
131+
132+
This allows users to update the `password` property of their *own* document in the `_users` database.
133+
Placeholders can currently access properties that the _replication-backend_ explicitly adds to the auth user object.
134+
Other available values are `${user.roles}` (array of roles of the user) and `${user.projects}` (the "projects" attribute of the user's entity that is linked to the account through the "exact_username" in Keycloak).
135+
136+
For more information on how to write rules have a look at the [CASL documentation](https://casl.js.org/v5/en/guide/intro).
137+
114138
### Implementing components with permissions
115139

116140
This section is about code using permissions to read and edit **entities**.

doc/compodoc_sources/how-to-guides/reports.md

Lines changed: 53 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,65 @@
33
The reporting module allows organizations to automatically create reports of aggregated data for a given timespan.
44
This can be used to track indicators and export anonymous data.
55

6+
There are currently two systems available to generate reports, both using the same config documents (`ReportConfig:*`):
7+
- SQL-based queries executed server-side using the SQS server
8+
- (legacy) client-side generator using the aggregation & query syntax below
9+
10+
# SQL Reports
11+
12+
For this feature, we have integrated the (optional) [structured-query-service (SQS)](https://neighbourhood.ie/products-and-services/structured-query-server)
13+
(this creates a read-only copy of the data in the CouchDB and allows to run Sqlite queries against it).
14+
SQS enables the possibility to create SQL based queries in reports.
15+
16+
The SQS image is not available as open source and needs a licence. It is pulled from a private container registry.
17+
18+
## Deployment
19+
20+
To activate it for an application, simply activate "aam-backend-service" profile (`COMPOSE_PROFILES=aam-backend-service`) in the applications `.env` file and run `docker compose up -d`.
21+
622
## Configuration
723

8-
The reports can be defined through the config of the reporting component.
24+
The reports can be defined as `ReportConfig:*` entities.
25+
26+
There are different modes for `ReportConfig`:
27+
28+
### sql
29+
Requirements: SQS
30+
31+
#### Simple SQL Report
932

1033
```json
11-
"view:report": {
12-
"component": "Reporting",
13-
"config": {
14-
"reports": [
15-
{
16-
"title": "Basic Report",
17-
"aggregationDefinitions": [...],
18-
},
19-
{
20-
"title": "Event Report",
21-
"aggregationDefinitions": [...]
22-
}
23-
]
24-
}
34+
// app/ReportConfig:test-report
35+
{
36+
"_id": "ReportConfig:test-report",
37+
"title": "Test Report",
38+
"mode": "sql",
39+
"aggregationDefinition": "SELECT c.name as name, c.dateOfBirth as dateOfBirth FROM Child c",
40+
"neededArgs": []
2541
}
2642
```
2743

28-
## Aggregation structure
44+
45+
#### SQL Report With Arguments
46+
Additional arguments for the query (like a from and to date parameter) can be used in the SQL query directly using "?". The "neededArgs" array defines what arguments are filled for the "?" placeholders in the given order.
47+
48+
```json
49+
// app/ReportConfig:test-report
50+
{
51+
"_id": "ReportConfig:test-report",
52+
"title": "Test Report",
53+
"mode": "sql",
54+
"aggregationDefinition": "SELECT c.name as name, c.dateOfBirth as dateOfBirth FROM Child c WHERE created_at BETWEEN ? AND ?",
55+
"neededArgs": [
56+
"from",
57+
"to"
58+
]
59+
}
60+
```
61+
62+
# JSON-Query Reports (legacy)
63+
64+
#### Aggregation structure
2965

3066
Inside the `aggregationDefinitions` an array of aggregations can be added.
3167
The following example shows the structure of an aggregation.
@@ -52,7 +88,7 @@ The following example shows the structure of an aggregation.
5288
- The `aggregations` array can be filled with further aggregations with the same structure.
5389
They will be executed on the result of the `query` as well as on each `groupBy` result.
5490

55-
## `query` syntax
91+
#### `query` syntax
5692

5793
A full documentation can be found [here](https://github.com/auditassistant/json-query#queries).
5894
The most top-level aggregation has to start with the entity which should be queried.

0 commit comments

Comments
 (0)