diff --git a/config/authorization/delta.ex b/config/authorization/delta.ex new file mode 100644 index 0000000..0c0e26c --- /dev/null +++ b/config/authorization/delta.ex @@ -0,0 +1,5 @@ +defmodule Delta.Config do + def targets do + [ "http://deltanotifier" ] + end +end \ No newline at end of file diff --git a/config/delta/rules.js b/config/delta/rules.js new file mode 100644 index 0000000..6b2fe67 --- /dev/null +++ b/config/delta/rules.js @@ -0,0 +1,16 @@ +export default [ + { + match: { + subject: { + } + }, + callback: { + url: "http://kalliope-api/delta", method: "POST" + }, + options: { + resourceFormat: "v0.0.1", + gracePeriod: 1000, + ignoreFromSelf: true + } + } + ] \ No newline at end of file diff --git a/config/dispatcher/dispatcher.ex b/config/dispatcher/dispatcher.ex index e3b1b50..f44e5f7 100644 --- a/config/dispatcher/dispatcher.ex +++ b/config/dispatcher/dispatcher.ex @@ -8,7 +8,7 @@ defmodule Dispatcher do any: [ "*/*" ], ] - define_layers [ :api, :frontend, :not_found ] + define_layers [ :api_services, :api, :frontend, :not_found ] ############################################################### # sparql endpoint @@ -17,6 +17,26 @@ defmodule Dispatcher do forward conn, path, "http://db:8890/sparql/" end + ############### + # API SERVICES + ############### + match "/v3/api-docs/*path", %{ layer: :api_services, accept: %{ json: true } } do + forward conn, path, "http://kalliope-api/v3/api-docs/" + end + + match "/delta/*path", %{ layer: :api_services, accept: %{ json: true } } do + forward conn, path, "http://kalliope-api/delta/" + end + + match "/changes/*path", %{ layer: :api_services, accept: %{ json: true } } do + forward conn, path, "http://kalliope-api/changes/" + end + + match "/consolidated/*path", %{ layer: :api_services, accept: %{ json: true } } do + forward conn, path, "http://kalliope-api/consolidated/" + end + + ############################################################### # ember metis ############################################################### diff --git a/config/proxy/nginx.htpasswd b/config/proxy/nginx.htpasswd index 850d460..5315068 100644 --- a/config/proxy/nginx.htpasswd +++ b/config/proxy/nginx.htpasswd @@ -1,2 +1,3 @@ root:$apr1$x9yMUyVV$w2FZk76C0mbKOlDHdLDV30 -contacthub:$apr1$X8vLzV8z$Xsb.0lLoyasxfvwxQGQUp/ \ No newline at end of file +contacthub:$apr1$X8vLzV8z$Xsb.0lLoyasxfvwxQGQUp/ +kalliope:$apr1$1HrKMwbi$Uqc18XpIohhrabnM49ete1 \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 1ec8738..e18e154 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,7 +12,7 @@ services: image: semtech/mu-identifier:1.9.1 environment: DEFAULT_ACCESS_CONTROL_ALLOW_ORIGIN_HEADER: "*" - DEFAULT_MU_AUTH_ALLOWED_GROUPS_HEADER: "[{\"variables\":[],\"name\":\"public\"}]" + DEFAULT_MU_AUTH_ALLOWED_GROUPS_HEADER: "[{\"variables\":[],\"name\":\"public\"}, {\"variables\":[],\"name\":\"clean\"}]" labels: - "logging=true" restart: always @@ -92,7 +92,20 @@ services: logging: *default-logging labels: - "logging=true" - + kalliope-api: + image: lblod/app-kalliope-api + volumes: + - ./config/kalliope:/config + - ./data/files:/share + environment: + SERVER_PORT: "80" + LOGGING_LEVEL: "INFO" + SPARQL_ENDPOINT: "http://db:8890/sparql" + restart: always + deltanotifier: + image: semtech/mu-delta-notifier:0.1.0 + volumes: + - ./config/delta:/config frontend: image: lblod/frontend-contact-hub labels: