├── .gitignore ├── cache └── scala-homedir │ └── .empty ├── bin └── serve-ui ├── docker ├── ui.Dockerfile ├── scala.Dockerfile ├── entrypoint-scala.sh ├── elasticsearch.Dockerfile ├── entrypoint-ui.sh ├── entrypoint-elasticsearch.sh ├── ui.env ├── application.docker.conf └── docker-compose.yml ├── .gitmodules └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | cache 2 | -------------------------------------------------------------------------------- /cache/scala-homedir/.empty: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /bin/serve-ui: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | docker-compose -f docker/docker-compose.yml up --build 4 | -------------------------------------------------------------------------------- /docker/ui.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:12 2 | WORKDIR /srv/oerworldmap-ui 3 | 4 | COPY ./docker/entrypoint-ui.sh / 5 | ENTRYPOINT [ "/entrypoint-ui.sh" ] 6 | -------------------------------------------------------------------------------- /docker/scala.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM hseeberger/scala-sbt:8u141-jdk_2.12.3_0.13.16 2 | WORKDIR /srv/oerworldmap 3 | 4 | COPY ./docker/entrypoint-scala.sh / 5 | ENTRYPOINT [ "/entrypoint-scala.sh" ] 6 | -------------------------------------------------------------------------------- /docker/entrypoint-scala.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | mkdir -p data/consents/objects 4 | touch data/consents/history 5 | mkdir -p data/commits/objects/ 6 | touch data/commits/history 7 | 8 | sbt stage && sbt run 9 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "oerworldmap-api"] 2 | path = oerworldmap-api 3 | url = git@github.com:wmde/oerworldmap.git 4 | [submodule "oerworldmap-ui"] 5 | path = oerworldmap-ui 6 | url = git@github.com:wmde/oerworldmap-ui.git 7 | -------------------------------------------------------------------------------- /docker/elasticsearch.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM elasticsearch:6.4.3 2 | COPY docker/entrypoint-elasticsearch.sh / 3 | COPY oerworldmap-api/conf/index-config.json / 4 | CMD /entrypoint-elasticsearch.sh 5 | 6 | # TODO: multi-stage build? 7 | -------------------------------------------------------------------------------- /docker/entrypoint-ui.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | yarn install 4 | # TODO: "dev" mode automatically reloads--but suffers a bug causing the load to 5 | # hang indefinitely in this docker environment. 6 | # npm run build:dev 7 | 8 | yarn run build:dev & 9 | 10 | yarn run site:dev & 11 | 12 | yarn run server:dev 13 | -------------------------------------------------------------------------------- /docker/entrypoint-elasticsearch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -euxo pipefail 4 | 5 | # TODO: could this be moved to the Dockerfile? 6 | (elasticsearch-plugin list | grep -qE '^analysis-icu$') \ 7 | || elasticsearch-plugin install analysis-icu 8 | 9 | # FIXME: use standard dir 10 | #elasticsearch -Epath.data=/tmp 11 | 12 | /usr/local/bin/docker-entrypoint.sh eswrapper 13 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Development repo for the Capacity Exchange pilot site 2 | 3 | This repo is a container for our customizations and development tooling. Set up the submodules: 4 | 5 | git submodule update -i --recursive 6 | 7 | To launch a UI-only container for development, 8 | 9 | ./bin/serve-ui 10 | 11 | Expect half an hour of downloading and compiling on the first run. The application is available at http://localhost:8080/ 12 | 13 | FIXME: Once running, the UI services should be in development mode and hot-reload whenever code is changed, however the job stays at 100% CPU so this is disabled for now. 14 | 15 | Debugging OAuth 16 | === 17 | Edit docker/ui.env to add: 18 | ``` 19 | MEDIAWIKI_OAUTH_DEBUG_OVERRIDE=1 20 | ``` 21 | -------------------------------------------------------------------------------- /docker/ui.env: -------------------------------------------------------------------------------- 1 | SERVER_HOST=0.0.0.0 2 | SERVER_PORT=3000 3 | MAPBOX_ACCESS_TOKEN= 4 | MAPBOX_STYLE=/ 5 | MAPBOX_MINIMAP_STYLE=mapbox/streets-v8 6 | API_HOST=scala 7 | API_PORT=9000 8 | API_SCHEME=http 9 | PUBLIC_API_HOST=localhost 10 | PUBLIC_API_PORT=3000 11 | PUBLIC_API_SCHEME=http 12 | PIWIK_ID= 13 | PIWIK_URL= 14 | LANG_DEFAULT=en 15 | LANG_SUPPORTED=en de pt 16 | ELASTICSEARCH_INDEX=oerworldmap 17 | ELASTICSEARCH_URL=http://localhost:3000/elastic/ 18 | ELASTICSEARCH_INTERNAL_URL=http://elasticsearch:9200 19 | PAGES_URL=http://pages:4000/oerworldmap-ui/ 20 | MEDIAWIKI_REST_URL=http://dev.wiki/w/rest.php 21 | MEDIAWIKI_OAUTH_CONSUMER_KEY= 22 | MEDIAWIKI_OAUTH_CONSUMER_SECRET= 23 | MEDIAWIKI_OAUTH_DEBUG_OVERRIDE= 24 | MEDIAWIKI_OAUTH_CALLBACK_URL=http://localhost:3000/oauth2/callback 25 | SESSION_SECRET= 26 | -------------------------------------------------------------------------------- /docker/application.docker.conf: -------------------------------------------------------------------------------- 1 | java.version=1.8 2 | es.host.server="elasticsearch" 3 | es.host.port.http="9200" 4 | es.index.name="oerworldmap" 5 | es.index.type="resource" 6 | es.cluster.name="oerwm" 7 | es.search.fuzziness="AUTO" 8 | es.request.refreshpolicy="NONE" 9 | mailman.host="" 10 | mailman.list="" 11 | mail.smtp.host="localhost" 12 | mail.smtp.port=25 13 | mail.smtp.user="" 14 | mail.smtp.password="" 15 | mail.smtp.ssl=false 16 | mail.smtp.tls=false 17 | mail.smtp.from="" 18 | mail.smtp.sender="" 19 | ht.permissions="data/permissions/" 20 | tdb.dir="data/tdb/" 21 | graph.history.dir="data/commits/objects/" 22 | graph.history.file="data/commits/history" 23 | graph.history.autoload=true 24 | play.http.parser.maxMemoryBuffer=10000024K 25 | proxy.host="http://localhost" 26 | ht.apache2ctl.restart="sudo apache2ctl graceful" 27 | index.async = false 28 | play.http.filters = "filters.Filters" 29 | jsonld.context="https://capacity-exchange.wmcloud.org/assets/json/context.json" 30 | play.filters.cors.pathPrefixes=["/label", "/resource", "/assets/json", "/country"] 31 | play.filters.cors.exposedHeaders=["Link"] 32 | json.schema="public/json/schema.json" 33 | web.crawling.allowed=true 34 | search.conf.file="conf/search.conf" 35 | reconcile.conf.file="conf/reconcile.conf" 36 | -------------------------------------------------------------------------------- /docker/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.7' 2 | services: 3 | ui: 4 | build: 5 | dockerfile: docker/ui.Dockerfile 6 | context: .. 7 | volumes: 8 | - "../oerworldmap-ui:/srv/oerworldmap-ui" 9 | - "./ui.env:/srv/oerworldmap-ui/.env" 10 | ports: 11 | - 3000:3000 12 | #extra_hosts: 13 | # Local hostnames can be aliased like so: 14 | # - dev.wiki:host-gateway 15 | 16 | pages: 17 | image: "jekyll/jekyll:4.2.0" 18 | command: jekyll serve --watch --incremental 19 | environment: 20 | - JEKYLL_ENV=production 21 | volumes: 22 | - "../oerworldmap-ui/docs:/srv/jekyll" 23 | ports: 24 | - "4000:4000" 25 | 26 | scala: 27 | build: 28 | context: .. 29 | dockerfile: docker/scala.Dockerfile 30 | volumes: 31 | - "../oerworldmap-api:/srv/oerworldmap" 32 | - "../cache/scala-homedir:/root" 33 | - "./application.docker.conf:/srv/oerworldmap/conf/application.conf" 34 | ports: 35 | - '9000:9000' 36 | depends_on: 37 | - elasticsearch 38 | # FIXME: `sbt run` dies when `< /dev/null` so we need to connect to the terminal, for now. 39 | stdin_open: true # docker run -i 40 | tty: true # docker run -t 41 | 42 | elasticsearch: 43 | build: 44 | dockerfile: docker/elasticsearch.Dockerfile 45 | context: .. 46 | ports: 47 | - "9200:9200" 48 | --------------------------------------------------------------------------------