diff --git a/CHANGELOG.md b/CHANGELOG.md index 904d79e3a02..3bb635f5536 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.md). - The mapping selection dropbown is now sorted alphabetically. [#3864](https://github.com/scalableminds/webknossos/pull/3864) - The HTML template now includes SEO tags for demo instances and hides internal instances from search engines. - A maximize-button was added to the viewports in the annotation view. Maximization can also be toggled with the `.` shortcut. [#3876](https://github.com/scalableminds/webknossos/pull/3876) +- [webknossos-connect](https://github.com/scalableminds/webknossos-connect) now starts with webKnossos on local and development instances by default. [#3913](https://github.com/scalableminds/webknossos/pull/3913) ### Changed - Improved the flight mode performance for tracings with very large trees (>80.000 nodes). [#3880](https://github.com/scalableminds/webknossos/pull/3880) diff --git a/app/controllers/InitialDataController.scala b/app/controllers/InitialDataController.scala index d835bc670bb..bc19efd576e 100644 --- a/app/controllers/InitialDataController.scala +++ b/app/controllers/InitialDataController.scala @@ -94,6 +94,7 @@ Samplecountry for { _ <- insertLocalDataStoreIfEnabled _ <- insertLocalTracingStoreIfEnabled + _ <- insertConnectDataStoreIfEnabled _ <- assertInitialDataEnabled _ <- assertNoOrganizationsPresent _ <- insertOrganization @@ -211,6 +212,16 @@ Samplecountry } } else Fox.successful(()) + def insertConnectDataStoreIfEnabled: Fox[Any] = + if (conf.Application.insertLocalConnectDatastore) { + dataStoreDAO.findOneByName("connect").futureBox.map { maybeStore => + if (maybeStore.isEmpty) { + logger.info("inserting connect datastore") + dataStoreDAO.insertOne(DataStore("connect", "http://localhost:8000", "secret-key", isConnector = true)) + } + } + } else Fox.successful(()) + def insertLocalTracingStoreIfEnabled: Fox[Any] = if (conf.Tracingstore.enabled) { tracingStoreDAO.findOneByName("localhost").futureBox.map { maybeStore => diff --git a/app/utils/WkConf.scala b/app/utils/WkConf.scala index 8da45400f06..88abe2be36c 100644 --- a/app/utils/WkConf.scala +++ b/app/utils/WkConf.scala @@ -12,6 +12,7 @@ class WkConf @Inject()(configuration: Configuration) extends ConfigReader { object Application { val insertInitialData = get[Boolean]("application.insertInitialData") + val insertLocalConnectDatastore = get[Boolean]("application.insertLocalConnectDatastore") val title = get[String]("application.title") object Authentication { @@ -125,5 +126,16 @@ class WkConf @Inject()(configuration: Configuration) extends ConfigReader { } val children = - List(Application, Http, Mail, WebKnossos, Datastore, User, Braintracing, Features, Silhouette, Airbrake, Google) + List(Application, + Http, + Mail, + WebKnossos, + Datastore, + Tracingstore, + User, + Braintracing, + Features, + Silhouette, + Airbrake, + Google) } diff --git a/conf/application.conf b/conf/application.conf index adfc452ccfa..b6897125780 100644 --- a/conf/application.conf +++ b/conf/application.conf @@ -64,6 +64,7 @@ braintracing { application { insertInitialData = true + insertLocalConnectDatastore = true authentication { enableDevAutoLogin = false enableDevAutoAdmin = false diff --git a/conf/connect/.gitignore b/conf/connect/.gitignore new file mode 100644 index 00000000000..0ca687ac137 --- /dev/null +++ b/conf/connect/.gitignore @@ -0,0 +1 @@ +datasets.json diff --git a/conf/connect/config.json b/conf/connect/config.json new file mode 100644 index 00000000000..0b758441137 --- /dev/null +++ b/conf/connect/config.json @@ -0,0 +1,7 @@ +{ + "server": {"host": "0.0.0.0", "port": 8000, "url": "http://localhost:8000"}, + "datastore": {"name": "connect", "key": "secret-key"}, + "webknossos": {"url": "http://localhost:9000"}, + "backends": {"neuroglancer": {}}, + "datasets_path": "data/datasets.json" +} diff --git a/docker-compose.yml b/docker-compose.yml index 6623d558908..cf0b0d13f3c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,11 +12,14 @@ services: - "fossildb-persisted:fossildb" - "postgres-persisted:postgres" - redis + - webknossos-connect depends_on: postgres-persisted: condition: service_healthy fossildb-persisted: condition: service_healthy + webknossos-connect: + condition: service_healthy command: - -Dconfig.file=conf/application.conf - -Djava.net.preferIPv4Stack=true @@ -122,11 +125,14 @@ services: - "fossildb-dev:fossildb" - "postgres-dev:postgres" - redis + - webknossos-connect depends_on: postgres-dev: condition: service_healthy fossildb-dev: condition: service_healthy + webknossos-connect: + condition: service_healthy environment: - POSTGRES_URL=jdbc:postgresql://postgres/webknossos command: @@ -166,11 +172,14 @@ services: - postgres - fossildb - redis + - webknossos-connect depends_on: postgres: condition: service_healthy fossildb: condition: service_healthy + webknossos-connect: + condition: service_healthy environment: - POSTGRES_URL=jdbc:postgresql://postgres/webknossos_testing command: @@ -195,6 +204,13 @@ services: - ".:/home/pptruser/webknossos" user: ${USER_UID:-1000}:${USER_GID:-1000} + # webKnossos-connect + webknossos-connect: + image: scalableminds/webknossos-connect:master__190 + volumes: + - "./conf/connect:/app/data" + network_mode: host + # Postgres postgres: image: postgres:10-alpine diff --git a/frontend/javascripts/test/snapshots/public/test-bundle/test/backend-snapshot-tests/misc.e2e.js.md b/frontend/javascripts/test/snapshots/public/test-bundle/test/backend-snapshot-tests/misc.e2e.js.md index 3ed875ad62b..1182edc01fb 100644 --- a/frontend/javascripts/test/snapshots/public/test-bundle/test/backend-snapshot-tests/misc.e2e.js.md +++ b/frontend/javascripts/test/snapshots/public/test-bundle/test/backend-snapshot-tests/misc.e2e.js.md @@ -44,6 +44,13 @@ Generated by [AVA](https://ava.li). ## misc-datastores [ + { + isConnector: true, + isForeign: false, + isScratch: false, + name: 'connect', + url: 'http://localhost:8000', + }, { isConnector: false, isForeign: false, diff --git a/frontend/javascripts/test/snapshots/public/test-bundle/test/backend-snapshot-tests/misc.e2e.js.snap b/frontend/javascripts/test/snapshots/public/test-bundle/test/backend-snapshot-tests/misc.e2e.js.snap index f166f529e96..12ad6b9d058 100644 Binary files a/frontend/javascripts/test/snapshots/public/test-bundle/test/backend-snapshot-tests/misc.e2e.js.snap and b/frontend/javascripts/test/snapshots/public/test-bundle/test/backend-snapshot-tests/misc.e2e.js.snap differ diff --git a/test/db/dataStores.csv b/test/db/dataStores.csv index b3b56bfa6d8..0d4f93383fd 100644 --- a/test/db/dataStores.csv +++ b/test/db/dataStores.csv @@ -1,2 +1,3 @@ name,url,key,isScratch,isDeleted,isForeign,isConnector 'localhost','http://localhost:9000','something-secure',f,f,f,f +'connect','http://localhost:8000','secret-key',f,f,f,t diff --git a/tools/proxy/proxy.js b/tools/proxy/proxy.js index e20ecafb9b0..7294f255c47 100644 --- a/tools/proxy/proxy.js +++ b/tools/proxy/proxy.js @@ -52,6 +52,10 @@ const processes = { shell: true, }, ), + connect: spawnIfNotSpecified("noConnect", "docker-compose run --rm webknossos-connect", [], { + cwd: ROOT, + shell: true, + }), }; function spawnIfNotSpecified(keyword, command, args, options) {