Skip to content
Snippets Groups Projects
Commit 320749b5 authored by Rolf Niepraschk's avatar Rolf Niepraschk
Browse files

clean up

parent d3898e0b
No related branches found
No related tags found
No related merge requests found
...@@ -13,28 +13,6 @@ REST service for the validation of ```xml``` against a XML Schema (```xsd```). ...@@ -13,28 +13,6 @@ REST service for the validation of ```xml``` against a XML Schema (```xsd```).
> ./server > ./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 ## Installation as Daemon
Do the following with root permission: Do the following with root permission:
...@@ -56,7 +34,8 @@ systemctl start xml-validation.service # running? ...@@ -56,7 +34,8 @@ systemctl start xml-validation.service # running?
systemctl status xml-validation.service systemctl status xml-validation.service
journalctl -f --unit xml-validation.service # run-time check 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 ## Configuration
...@@ -72,21 +51,13 @@ File `config.json`: ...@@ -72,21 +51,13 @@ File `config.json`:
"dir":"." "dir":"."
}, },
"xsd":{ "xsd":{
"mode":"inline,external,local",
"filename":"dcc.xsd", "filename":"dcc.xsd",
"localPath":"../xsd-dcc/",
"externalBaseURL":"https://ptb.de/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 * `localPath`: Must be ended with a path seperator
* `externalBaseURL`: Must be ended with a path seperator * `externalBaseURL`: Must be ended with a path seperator
...@@ -101,7 +72,7 @@ File `config.json`: ...@@ -101,7 +72,7 @@ File `config.json`:
``` ```
```shell ```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> > <error>unvalid xml data</error>
``` ```
...@@ -159,19 +130,3 @@ Returns the version of the validation server: ...@@ -159,19 +130,3 @@ Returns the version of the validation server:
> curl http://localhost:5005/version > curl http://localhost:5005/version
> <version>0.2.0</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).
...@@ -7,9 +7,7 @@ ...@@ -7,9 +7,7 @@
"dir":"." "dir":"."
}, },
"xsd":{ "xsd":{
"mode":"inline,external,local",
"filename":"dcc.xsd", "filename":"dcc.xsd",
"localPath":"../xsd-dcc/", "externalBaseURL":"https://ptb.de/dcc/"
"externalBaseURL":"https://www.ptb.de/dcc/"
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment