Skip to content
Snippets Groups Projects
Verified Commit fc7ff813 authored by David Beniamine's avatar David Beniamine
Browse files

Customize annotot endpoint and environment

Close #13
parent de3bb133
No related branches found
No related tags found
1 merge request!8Customize annotot endpoint and environment
...@@ -3,7 +3,7 @@ services: ...@@ -3,7 +3,7 @@ services:
annotot: annotot:
image: tetraslibre/annotot-app image: tetraslibre/annotot-app
ports: ports:
- 3000:3000 - ${ANNOTOT_PORT}:3000
environment: environment:
- IP=0.0.0.0 - IP=${ANNOTOT_LISTEN_IP}
- ENV=production - ENV=${ANNOTOT_ENV}
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"css-loader": "^3.6.0", "css-loader": "^3.6.0",
"dotenv-webpack": "^8.0.1",
"mirador": "git+https://gitlab.tetras-libre.fr/iiif/mirador-video-annotation#wip-webpack-from-git", "mirador": "git+https://gitlab.tetras-libre.fr/iiif/mirador-video-annotation#wip-webpack-from-git",
"mirador-annotations": "0.4.0", "mirador-annotations": "0.4.0",
"react": "^16.13.1", "react": "^16.13.1",
...@@ -2470,6 +2471,36 @@ ...@@ -2470,6 +2471,36 @@
"resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.4.0.tgz", "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.4.0.tgz",
"integrity": "sha512-Be9tbQMZds4a3C6xTmz68NlMfeONA//4dOavl/1rNw50E+/QO0KVpbcU0PcaW0nsQxurXls9ZocqFxk8R2mWEA==" "integrity": "sha512-Be9tbQMZds4a3C6xTmz68NlMfeONA//4dOavl/1rNw50E+/QO0KVpbcU0PcaW0nsQxurXls9ZocqFxk8R2mWEA=="
}, },
"node_modules/dotenv": {
"version": "8.6.0",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.6.0.tgz",
"integrity": "sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g==",
"engines": {
"node": ">=10"
}
},
"node_modules/dotenv-defaults": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/dotenv-defaults/-/dotenv-defaults-2.0.2.tgz",
"integrity": "sha512-iOIzovWfsUHU91L5i8bJce3NYK5JXeAwH50Jh6+ARUdLiiGlYWfGw6UkzsYqaXZH/hjE/eCd/PlfM/qqyK0AMg==",
"dependencies": {
"dotenv": "^8.2.0"
}
},
"node_modules/dotenv-webpack": {
"version": "8.0.1",
"resolved": "https://registry.npmjs.org/dotenv-webpack/-/dotenv-webpack-8.0.1.tgz",
"integrity": "sha512-CdrgfhZOnx4uB18SgaoP9XHRN2v48BbjuXQsZY5ixs5A8579NxQkmMxRtI7aTwSiSQcM2ao12Fdu+L3ZS3bG4w==",
"dependencies": {
"dotenv-defaults": "^2.0.2"
},
"engines": {
"node": ">=10"
},
"peerDependencies": {
"webpack": "^4 || ^5"
}
},
"node_modules/draft-js": { "node_modules/draft-js": {
"version": "0.11.7", "version": "0.11.7",
"resolved": "https://registry.npmjs.org/draft-js/-/draft-js-0.11.7.tgz", "resolved": "https://registry.npmjs.org/draft-js/-/draft-js-0.11.7.tgz",
...@@ -10145,6 +10176,27 @@ ...@@ -10145,6 +10176,27 @@
"resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.4.0.tgz", "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.4.0.tgz",
"integrity": "sha512-Be9tbQMZds4a3C6xTmz68NlMfeONA//4dOavl/1rNw50E+/QO0KVpbcU0PcaW0nsQxurXls9ZocqFxk8R2mWEA==" "integrity": "sha512-Be9tbQMZds4a3C6xTmz68NlMfeONA//4dOavl/1rNw50E+/QO0KVpbcU0PcaW0nsQxurXls9ZocqFxk8R2mWEA=="
}, },
"dotenv": {
"version": "8.6.0",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.6.0.tgz",
"integrity": "sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g=="
},
"dotenv-defaults": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/dotenv-defaults/-/dotenv-defaults-2.0.2.tgz",
"integrity": "sha512-iOIzovWfsUHU91L5i8bJce3NYK5JXeAwH50Jh6+ARUdLiiGlYWfGw6UkzsYqaXZH/hjE/eCd/PlfM/qqyK0AMg==",
"requires": {
"dotenv": "^8.2.0"
}
},
"dotenv-webpack": {
"version": "8.0.1",
"resolved": "https://registry.npmjs.org/dotenv-webpack/-/dotenv-webpack-8.0.1.tgz",
"integrity": "sha512-CdrgfhZOnx4uB18SgaoP9XHRN2v48BbjuXQsZY5ixs5A8579NxQkmMxRtI7aTwSiSQcM2ao12Fdu+L3ZS3bG4w==",
"requires": {
"dotenv-defaults": "^2.0.2"
}
},
"draft-js": { "draft-js": {
"version": "0.11.7", "version": "0.11.7",
"resolved": "https://registry.npmjs.org/draft-js/-/draft-js-0.11.7.tgz", "resolved": "https://registry.npmjs.org/draft-js/-/draft-js-0.11.7.tgz",
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"css-loader": "^3.6.0", "css-loader": "^3.6.0",
"dotenv-webpack": "^8.0.1",
"mirador": "git+https://gitlab.tetras-libre.fr/iiif/mirador-video-annotation#wip-webpack-from-git", "mirador": "git+https://gitlab.tetras-libre.fr/iiif/mirador-video-annotation#wip-webpack-from-git",
"mirador-annotations": "0.4.0", "mirador-annotations": "0.4.0",
"react": "^16.13.1", "react": "^16.13.1",
......
...@@ -3,7 +3,7 @@ import annotationPlugins from 'mirador-annotations/es/index'; ...@@ -3,7 +3,7 @@ import annotationPlugins from 'mirador-annotations/es/index';
import LocalStorageAdapter from 'mirador-annotations/es/LocalStorageAdapter'; import LocalStorageAdapter from 'mirador-annotations/es/LocalStorageAdapter';
import AnnototAdapter from 'mirador-annotations/es/AnnototAdapter'; import AnnototAdapter from 'mirador-annotations/es/AnnototAdapter';
const endpointUrl = 'http://localhost:3000/annotations'; const endpointUrl = `http://${process.env.ANNOTOT_HOST}:${process.env.ANNOTOT_PORT}/annotations`;
const config = { const config = {
annotation: { annotation: {
// adapter: (canvasId) => new LocalStorageAdapter(`localStorage://?canvasId=${canvasId}`), // adapter: (canvasId) => new LocalStorageAdapter(`localStorage://?canvasId=${canvasId}`),
......
const path = require('path'); const path = require('path');
const webpack = require('webpack'); const webpack = require('webpack');
const Dotenv = require('dotenv-webpack');
module.exports = { module.exports = {
mode: process.env.WEBPACK_MODE, mode: process.env.WEBPACK_MODE,
...@@ -35,6 +36,7 @@ module.exports = { ...@@ -35,6 +36,7 @@ module.exports = {
new webpack.IgnorePlugin({ new webpack.IgnorePlugin({
/* cf https://gitlab.tetras-libre.fr/iiif/mirador-video-annotation/-/blob/annotation-on-video/webpack.config.js#L42 */ /* cf https://gitlab.tetras-libre.fr/iiif/mirador-video-annotation/-/blob/annotation-on-video/webpack.config.js#L42 */
resourceRegExp: /@blueprintjs\/(core|icons)/, // ignore optional UI framework dependencies resourceRegExp: /@blueprintjs\/(core|icons)/, // ignore optional UI framework dependencies
}) }),
new Dotenv()
] ]
}; };
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment