Skip to content

Commit 78a8897

Browse files
authored
Merge pull request #515 from impresso/develop
Release v3.1.0
2 parents eb6f661 + 3fd95bf commit 78a8897

File tree

347 files changed

+18261
-10099
lines changed

Some content is hidden

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

347 files changed

+18261
-10099
lines changed

.mocharc-integration.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
{
2+
"$schema": "https://json.schemastore.org/mocharc.json",
3+
"require": "tsx",
24
"diff": true,
35
"package": "./package.json",
46
"reporter": "spec",
57
"ui": "bdd",
8+
"exit": true,
69
"recursive": true,
7-
"watch-files": ["src/**/*.js", "test/**/*.js"],
10+
"extension": ["ts", "js"],
11+
"watch-files": ["src/**/*.{js,ts}", "test/**/*.{js,ts}"],
812
"ignore": ["node_modules"]
913
}

.mocharc.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
2-
"require": "ts-node/register",
3-
"loader": "ts-node/esm",
4-
"extensions": ["ts", "tsx"],
2+
"$schema": "https://json.schemastore.org/mocharc.json",
3+
"require": "tsx",
54
"diff": true,
65
"package": "./package.json",
76
"reporter": "spec",
87
"ui": "bdd",
8+
"exit": true,
99
"recursive": true,
10-
"watch-files": ["src/**/*.js", "test/**/*.js"],
11-
"ignore": ["node_modules", "test/integration/*.js", "test/integration/services/*.js"]
10+
"extension": ["ts", "js"],
11+
"watch-files": ["src/**/*.{js,ts}", "test/**/*.{js,ts}"],
12+
"ignore": ["node_modules", "test/integration/**/*.{js,ts}"]
1213
}

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@
2222
"[json]": {
2323
"editor.formatOnSave": true
2424
},
25-
"mochaExplorer.files": "test/**/*.test.{ts,js}"
25+
"mochaExplorer.require": "tsx",
26+
"mochaExplorer.files": "test/**/*.{ts,js}"
2627
}

README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,11 @@ Getting up and running is as easy as 1, 2, 3, 4, 5.
101101
You can also create a **service** using system d.
102102

103103
1. Configure the `config/development.json` and `config/production.json` according to your system settings
104-
1. Preload the list of Newspaper and of the Topics.
104+
2. Preload the list of the Topics.
105105
```
106-
NODE_ENV=development DEBUG=impresso* npm run update-newspapers
107106
NODE_ENV=development DEBUG=impresso* npm run update-topics
108107
```
109-
1. Start the app! Use the env variable `NODE_ENV` to switch between your development or production configuration file.
108+
3. Start the app! Use the env variable `NODE_ENV` to switch between your development or production configuration file.
110109
```
111110
NODE_ENV=development DEBUG=impresso* npm run dev
112111
```
@@ -205,6 +204,16 @@ When a schema is updated, the typescript types should be regenerated. This can b
205204
npm run generate-types
206205
```
207206

207+
## Projecting new indexed Solr field
208+
209+
A new indexed Solr field should be added to four places:
210+
211+
1. The protobuf definition in the `impresso-jscommons`. A new filter name should be added with its unique ID.
212+
1. The `SolrMappings` structure in `src/data/constants.ts`. It defines a mapping between the new filter name and the Solr faceting configuration for this filter.
213+
1. The `solfFilters.yml` file. It defines a mapping between the new filter name and the Solr filter statement builder function.
214+
1. Optionally: the `stats.yml` file. It defines the statistics datapoint name and the field it maps to. Used to provide faceted data to various graphs and charts.
215+
216+
208217
## Configuration
209218

210219
### Public API

config/default.example.json

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"$schema": "../src/schema/common/config.json",
23
"callbackUrls": {
34
"passwordReset": "http://localhost:8080/password-reset"
45
},
@@ -10,7 +11,7 @@
1011
"max": 50
1112
},
1213
"redis": {
13-
"enable": false
14+
"host": "localhost"
1415
},
1516
"rateLimiter": {
1617
"enabled": false,
@@ -47,14 +48,6 @@
4748
"secure": false
4849
}
4950
},
50-
"neo4j": {
51-
"host": "bolt://localhost:7687",
52-
"project": "projectname",
53-
"auth": {
54-
"user": "neo4j",
55-
"pass": "neo4j"
56-
}
57-
},
5851
"proxy": {
5952
"host": "http://localhost:3030",
6053
"iiif": {
@@ -90,23 +83,29 @@
9083
"users": "auth_user"
9184
}
9285
},
93-
"solr": {
94-
"host": "localhost",
95-
"port": 8984,
96-
"auth": {
97-
"user": "",
98-
"pass": "*****"
99-
},
100-
"search": {
101-
"endpoint": "https://.../select"
102-
},
103-
"mentions": {
104-
"endpoint": "https://.../select",
105-
"suggest": "https://.../suggest"
106-
},
107-
"topics": {
108-
"endpoint": "https://.../select",
109-
"suggest": "https://.../suggest"
110-
}
86+
"solrConfiguration": {
87+
"servers": [
88+
{
89+
"id": "default",
90+
"baseUrl": "https://localhost:8983/solr",
91+
"auth": {
92+
"read": { "username": "reader", "password": "..." },
93+
"write": { "username": "writer", "password": "..." }
94+
}
95+
}
96+
],
97+
"namespaces": [
98+
{ "namespaceId": "search", "serverId": "default", "index": "search_index" },
99+
{ "namespaceId": "mentions", "serverId": "default", "index": "mentions_index" },
100+
{ "namespaceId": "topics", "serverId": "default", "index": "topics_index" },
101+
{ "namespaceId": "entities", "serverId": "default", "index": "entities_index" },
102+
{ "namespaceId": "images", "serverId": "default", "index": "images_index" },
103+
{ "namespaceId": "tr_passages", "serverId": "default", "index": "tr_passages_index" },
104+
{ "namespaceId": "tr_clusters", "serverId": "default", "index": "tr_clusters_index" },
105+
{ "namespaceId": "embeddings_de", "serverId": "default", "index": "index_embeddings_de" },
106+
{ "namespaceId": "embeddings_fr", "serverId": "default", "index": "index_embeddings_fr" },
107+
{ "namespaceId": "embeddings_lb", "serverId": "default", "index": "index_embeddings_lb" },
108+
{ "namespaceId": "entities_mentions", "serverId": "default", "index": "mentions_entities_index" }
109+
]
111110
}
112111
}

config/default.json

Lines changed: 27 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
2+
"$schema": "../src/schema/common/config.json",
23
"isPublicApi": true,
4+
"availablePlans": ["plan-basic", "plan-educational", "plan-researcher"],
35
"allowedCorsOrigins": [
46
"http://localhost:8080",
57
"https://impresso-project.ch/app",
@@ -26,7 +28,7 @@
2628
"textReuse": { "enabled": true }
2729
},
2830
"redis": {
29-
"enable": true
31+
"host": "localhost"
3032
},
3133
"cache": {
3234
"enabled": true,
@@ -67,14 +69,6 @@
6769
"secure": true
6870
}
6971
},
70-
"neo4j": {
71-
"host": "bolt://localhost:7687",
72-
"project": "impresso",
73-
"auth": {
74-
"user": "neo4j",
75-
"pass": "neo4j"
76-
}
77-
},
7872
"media": {
7973
"host": "http://localhost:3030",
8074
"path": "/media",
@@ -132,63 +126,30 @@
132126
"users": "auth_user"
133127
}
134128
},
135-
"solr": {
136-
"host": "localhost",
137-
"port": 8984,
138-
"auth": {
139-
"user": "",
140-
"pass": "*****"
141-
},
142-
"queries": {
143-
"hasTextContents": "content_length_i:[1 TO *]"
144-
},
145-
"search": {
146-
"alias": "",
147-
"endpoint": "https://.../select"
148-
},
149-
"mentions": {
150-
"alias": "",
151-
"endpoint": "https://.../select",
152-
"suggest": "https://.../suggest"
153-
},
154-
"topics": {
155-
"alias": "",
156-
"endpoint": "https://.../select",
157-
"suggest": "https://.../suggest"
158-
},
159-
"images": {
160-
"alias": "",
161-
"endpoint": "https://.../select"
162-
},
163-
"entities": {
164-
"alias": "",
165-
"endpoint": "https://.../select"
166-
},
167-
"embeddings_de": {
168-
"alias": "",
169-
"endpoint": "https://.../select"
170-
},
171-
"embeddings_fr": {
172-
"alias": "",
173-
"endpoint": "https://.../select"
174-
},
175-
"embeddings_en": {
176-
"alias": "",
177-
"endpoint": "https://.../select"
178-
},
179-
"embeddings_lb": {
180-
"alias": "",
181-
"endpoint": "https://.../select"
182-
},
183-
"tr_passages": {
184-
"endpoint": "https://.../select"
185-
},
186-
"tr_clusters": {
187-
"endpoint": "https://.../select"
188-
},
189-
"entities_mentions": {
190-
"endpoint": "https://.../select"
191-
}
129+
"solrConfiguration": {
130+
"servers": [
131+
{
132+
"id": "default",
133+
"baseUrl": "https://localhost:8983/solr",
134+
"auth": {
135+
"read": { "username": "reader", "password": "..." },
136+
"write": { "username": "writer", "password": "..." }
137+
}
138+
}
139+
],
140+
"namespaces": [
141+
{ "namespaceId": "search", "serverId": "default", "index": "search_index" },
142+
{ "namespaceId": "mentions", "serverId": "default", "index": "mentions_index" },
143+
{ "namespaceId": "topics", "serverId": "default", "index": "topics_index" },
144+
{ "namespaceId": "entities", "serverId": "default", "index": "entities_index" },
145+
{ "namespaceId": "images", "serverId": "default", "index": "images_index" },
146+
{ "namespaceId": "tr_passages", "serverId": "default", "index": "tr_passages_index" },
147+
{ "namespaceId": "tr_clusters", "serverId": "default", "index": "tr_clusters_index" },
148+
{ "namespaceId": "embeddings_de", "serverId": "default", "index": "index_embeddings_de" },
149+
{ "namespaceId": "embeddings_fr", "serverId": "default", "index": "index_embeddings_fr" },
150+
{ "namespaceId": "embeddings_lb", "serverId": "default", "index": "index_embeddings_lb" },
151+
{ "namespaceId": "entities_mentions", "serverId": "default", "index": "mentions_entities_index" }
152+
]
192153
},
193154
"recommender": {
194155
"byTopics": {

docker-compose.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ services:
1616
ports:
1717
- 3306:3306
1818
command: ssh -N cli-mysql-tunnel
19+
new-mysql-tunnel:
20+
image: kroniak/ssh-client
21+
restart: always
22+
volumes:
23+
- ./docker/config/ssh:/root/.ssh
24+
ports:
25+
- 3307:3307
26+
command: ssh -N cli-new-mysql-tunnel
1927
# uncomment to run impresso middle layer in docker
2028
# iml:
2129
# image: impresso_middle_layer

0 commit comments

Comments
 (0)