diff --git a/README.md b/README.md index 95e106bd84d2068ae9332915ba11dbc712f61485..0720886e69159a57684351f9f203b05da5c183b1 100644 --- a/README.md +++ b/README.md @@ -13,28 +13,6 @@ REST service for the validation of ```xml``` against a XML Schema (```xsd```). > ./server ``` -The location of the ```xsd```-file can be configured in ```config.json```. -The default location is ```../xsd-dcc/dcc.xsd```: - -```shell -├── xml-validation -│ ├── config.json -│ ├── README.md -│ ├── server -│ ├── server.py -│ ├── share -│ ├── utils.py -│ ├── xml-validation.service -│ └── xsd -└── xsd-dcc - ├── dcc.xsd - ├── documentation - ├── examples - ├── README.md - ├── schemata - └── wiki -``` - ## Installation as Daemon Do the following with root permission: @@ -56,7 +34,8 @@ systemctl start xml-validation.service # running? systemctl status xml-validation.service journalctl -f --unit xml-validation.service # run-time check # ... -# git -c http.sslVerify=false pull +sudo -u nobody git -c http.sslVerify=false pull +sudo systemctl restart xml-validation.service ``` ## Configuration @@ -72,21 +51,13 @@ File `config.json`: "dir":"." }, "xsd":{ - "mode":"inline,external,local", "filename":"dcc.xsd", - "localPath":"../xsd-dcc/", "externalBaseURL":"https://ptb.de/dcc/" } } ``` +<!-- TODO: Better "configFile: ..." with versions and paths inside --> -* `mode`: - * `inline`: Load XML schema from corresponding 'schemaLocation' attribute - inside the XML target - * `external`: Load XML schema from the URL build from - 'externalBaseURL' and 'filename' - * `local`: Load XML schema from the local file build from 'localPath' and - 'filename' * `localPath`: Must be ended with a path seperator * `externalBaseURL`: Must be ended with a path seperator @@ -101,7 +72,7 @@ File `config.json`: ``` ```shell -> curl -X POST -H "Content-Type: text/xml" -d @no_valid_xml http://localhost:5005/validate +> curl -X POST -H "Content-Type: text/xml?v=2.1.0" -d @no_valid_xml http://localhost:5005/validate > <error>unvalid xml data</error> ``` @@ -159,19 +130,3 @@ Returns the version of the validation server: > curl http://localhost:5005/version > <version>0.2.0</version> ``` - -### /version_xsd [GET] - -Returns the version of the xsd-definition. The version is given at -`xmlRoot.annotation.documentation` - -```shell -> curl http://localhost:5005/version_xsd -<version>1.9.2</version> -`` - -### /update [POST] - -Updates the server; used by webhook (no security checks so far). - - diff --git a/config.json b/config.json index 87be2988d19d04ae8476e3534df41d2f62a54c4f..31dcb880d2788222287eace06a9549a929fe0728 100644 --- a/config.json +++ b/config.json @@ -7,9 +7,7 @@ "dir":"." }, "xsd":{ - "mode":"inline,external,local", "filename":"dcc.xsd", - "localPath":"../xsd-dcc/", - "externalBaseURL":"https://www.ptb.de/dcc/" + "externalBaseURL":"https://ptb.de/dcc/" } }