ソースを参照

Fix csp and cors issues

Arkadiusz Ryś 2 年 前
コミット
7dda0a56ec

+ 0 - 3
.gitignore

@@ -2,12 +2,9 @@ __pycache__/
 venv/
 build/
 dist/
-fuseki/
-fuseki-extra/
 *.egg-info
 *.log
 .fuseki
 .gradle
 .idea
-
 data/backend/ontology

+ 1 - 7
README.md

@@ -3,14 +3,8 @@
 Four services are made available:
 
 - [wee](http://localhost:8081): The workflow enactment engine. End user interface.
-- [drawio](http://localhost:8700/?p=ftgpm;dtdesign&dev=1&stealth=1&splash=0&nosplash=1): Drawio with all plugins loaded. End user interface.
-
-
-
+- [drawio](http://localhost:8445/?p=ftgpm;dtdesign&dev=1&stealth=1&splash=0&nosplash=1): Drawio with all plugins loaded. End user interface.
 - [fuseki](http://localhost:3030): Fuseki debug interface.
 - [backend](http://localhost:5000): Backend debug interface.
-
-Two additional services are also accessible if you use the custom SPARQL containers.
-
 - [spendpoint](http://localhost:8000): SPARQL bind interceptor.
 - [outliers](http://localhost:9090): Service to detect outliers in CSV files.

+ 3 - 3
data/drawio/dtdesign.js

@@ -1,11 +1,11 @@
 Draw.loadPlugin(function(ui) {
 
-const WEE = "http://wee:8081";
+const WEE = "http://localhost:8081";
 
-const BACKEND = "https://backend:5000";
+const BACKEND = "http://localhost:5000";
 const EXPECTED_BACKEND_VERSION = 6; // expected backend version
 
-const SPARQL_SERVER   = "https://fuseki:3030"
+const SPARQL_SERVER   = "http://localhost:3030"
 const SPARQL_ENDPOINT = "/SystemDesignOntology2Layers/"
 
 const dropVocabularyPrefix = str => str.substring(41);

+ 28 - 0
data/fuseki/config.ttl

@@ -0,0 +1,28 @@
+@prefix fuseki:  <http://jena.apache.org/fuseki#> .
+@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix tdb:     <http://jena.hpl.hp.com/2008/tdb#> .
+@prefix tdb2:    <http://jena.apache.org/2016/tdb#> .
+@prefix ja:      <http://jena.hpl.hp.com/2005/11/Assembler#> .
+@prefix :        <#> .
+
+[] rdf:type fuseki:Server .
+
+<#service> rdf:type fuseki:Service ;
+    rdfs:label          "SystemDesignOntology2Layers" ;                             # Human readable label for dataset
+    fuseki:name         "SystemDesignOntology2Layers" ;                             # Name of the dataset in the endpoint url
+    fuseki:serviceReadWriteGraphStore "SystemDesignOntology2Layers" ;               # SPARQL Graph store protocol (read and write)
+    fuseki:endpoint     [ fuseki:operation fuseki:query ; fuseki:name "sparql"  ] ; # SPARQL query service
+    fuseki:endpoint     [ fuseki:operation fuseki:shacl ; fuseki:name "shacl" ] ;   # SHACL query service
+    
+    # Joeri: I added these, because the enactment service expects a single endpoint for query and update:
+    fuseki:endpoint     [ fuseki:operation fuseki:update ];
+    fuseki:endpoint     [ fuseki:operation fuseki:query ];
+    
+    fuseki:dataset      <#dataset> .
+
+<#dataset> rdf:type tdb2:DatasetTDB2 ;
+    tdb2:location "run/databases/DB2" ;
+    ja:context [ ja:cxtName "arq:queryTimeout" ; ja:cxtValue "30000" ] ;
+    # Make the default graph be the union of all named graphs.
+    tdb2:unionDefaultGraph true ;

+ 57 - 0
data/fuseki/shiro.ini

@@ -0,0 +1,57 @@
+#   Licensed to the Apache Software Foundation (ASF) under one or more
+#   contributor license agreements.  See the NOTICE file distributed with
+#   this work for additional information regarding copyright ownership.
+#   The ASF licenses this file to You under the Apache License, Version 2.0
+#   (the "License"); you may not use this file except in compliance with
+#   the License.  You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing, software
+#   distributed under the License is distributed on an "AS IS" BASIS,
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#   See the License for the specific language governing permissions and
+#   limitations under the License.
+
+[main]
+# Development
+ssl.enabled = false
+
+plainMatcher=org.apache.shiro.authc.credential.SimpleCredentialsMatcher
+#iniRealm=org.apache.shiro.realm.text.IniRealm
+iniRealm.credentialsMatcher = $plainMatcher
+
+#localhost=org.apache.jena.fuseki.authz.LocalhostFilter
+
+[users]
+# Implicitly adds "iniRealm =  org.apache.shiro.realm.text.IniRealm"
+# The admin password will be replaced by value of ADMIN_PASSWORD
+# variable by docker-entrypoint.sh on FIRST start up.
+admin=ChangeThisFusekiPasswordBeforeDeployment
+
+[roles]
+
+[urls]
+## Control functions open to anyone
+/$/status = anon
+/$/ping   = anon
+
+## and the rest are restricted
+/$/** = authcBasic,user[admin]
+
+## Sparql update is restricted
+/*/update/** = authcBasic,user[admin]
+
+
+## If you want simple, basic authentication user/password
+## on the operations,
+##    1 - set a password in [users]
+##    2 - change the line above to:
+## /$/** = authcBasic,user[admin]
+## and set a better
+
+## or to allow any access.
+##/$/** = anon
+
+# Everything else
+/**=anon

+ 1 - 1
data/mocka/configuration.toml

@@ -2,4 +2,4 @@
 host = "0.0.0.0"
 port = 7999
 [octiva]
-storage_base_uri = "http://localhost:5000"
+storage_base_uri = "http://backend:5000"

+ 1 - 1
data/wee/application.properties

@@ -1,5 +1,5 @@
 server.port=8081
-base_url=http://wee:8081/
+base_url=http://localhost:8081/
 spring.application.name=wee
 endpoint=http://fuseki:3030/SystemDesignOntology2Layers
 storageURL=http://backend:5000

+ 2 - 2
docker-compose.yml

@@ -81,5 +81,5 @@ services:
       - "./data/backend/ontology/SystemDesignOntology2Layers:/app/ontology:Z"
       - "./data/backend/shape_lib:/app/shape_lib:z"
     environment:
-      - WEE_ENDPOINT=wee:8081
-      - FUSEKI_ENDPOINT=fuseki:3030
+      - WEE_ENDPOINT=http://wee:8081
+      - FUSEKI_ENDPOINT=http://fuseki:3030