Skip to content

Commit 08a77c9

Browse files
author
Alexander Ben Nasrallah
committed
add INSTALLATION.md
1 parent 39ad1e4 commit 08a77c9

File tree

2 files changed

+83
-45
lines changed

2 files changed

+83
-45
lines changed

README.md

Lines changed: 12 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,9 @@ for a verinice database. The verinice REST service is a [Spring
66
Boot](http://projects.spring.io/spring-boot/) application build with
77
[Maven](https://maven.apache.org/).
88

9-
## Run
10-
11-
call e.g.
12-
13-
mvn spring-boot:run -Dlogging.level.org.springframework=TRACE -Drun.arguments="--server.port=8081"
14-
159
## Modules
1610

17-
The project consist of several modules to seperate concerns. This section
11+
The project consist of several modules to separate concerns. This section
1812
describes the modules of the project.
1913

2014
### verinice-interface
@@ -41,7 +35,9 @@ To build the application run
4135

4236
mvn install
4337

44-
If want to start SpringBoot you can then run
38+
you can then install the *./verinice-rest/target/verinice-rest-xxx.jar*.
39+
40+
If want to start SpringBoot in development you can then run
4541

4642
mvn -pl verinice-rest spring-boot:run
4743

@@ -51,21 +47,22 @@ assuming you have proper database setup up, see [application.properties](verinic
5147
Integration tests are written in python using [Requests][]
5248
and standard python [unittest][py-unittest].
5349

54-
Since no maven plugin has been found wich could start spring-boot and run the
50+
Since no maven plugin has been found which could start spring-boot and run the
5551
test against a custom database a shell script has been written to batch several
5652
steps. To run the integration tests execute
5753

5854
./integration-test
5955

6056
The script uses the following variables
6157

62-
- `VERINICEDB` The database name to connect to at localhost.
63-
- `VERINICEUSER` The user which spring should use for the database. Has to exists.
64-
- `VERINICEPASSWORD` The password for the database `$VERINICEUSER`.
65-
- `VERINICEDUMP` The location to a database dumb which shall be used to recreate the `$VERINICEDB`.
66-
- `SPRINGDELAY` Time to sleep before running the tests to give spring time to boot.
58+
- `VERINICEDBSERVER` the database server URL
59+
- `VERINICEDB` the database name to connect to at $VERINICEDBSERVER
60+
- `VERINICEUSER` the user which spring should use for the database (has to exists)
61+
- `VERINICEPASSWORD` the password for the database `$VERINICEUSER`
62+
- `VERINICEDUMP` the location to a database dumb which shall be used to recreate the `$VERINICEDB`
63+
- `SPRINGDELAY` time to sleep before running the tests to give spring time to boot
6764

68-
i.e. to run the test against a custom database with a special user run
65+
i.e. to run the test against a custom database with a special user run
6966

7067
VERINICEDB=databasename VERINICEUSER=user VERINICEPASSWORD=password ./integration-test
7168

@@ -135,25 +132,7 @@ To release a new version (here 0.1 is assumed) of the project, you should
135132
git merge --no-ff release/0.1
136133
git push origin develop
137134

138-
## Logging
139-
Logging can be change and start time by setting the environment variable family
140-
`logging.level.*`
141-
142-
### Received Requests
143-
144-
-Dlogging.level.org.springframework.web.servlet=DEBUG
145-
146-
### verinice specific logging
147-
148-
-Dlogging.level.org.verinice=TRACE
149-
150-
## Misc
151-
To run the created jar with customizations run, e. g.
152-
153-
java -jar verinice-rest-0.1.0.jar --spring.datasource.url=jdbc:postgresql://127.0.0.1:5432/verinicedb --server.port=8888
154-
155135
## Troubleshooting
156-
157136
### Could not resolve dependencies
158137
If you get an error like this
159138

USERGUIDE.md

Lines changed: 71 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,71 @@
1-
# verinice.REST Userguide
2-
3-
## REST
4-
Die verinice.REST-Schnittstelle kann Daten in der verinice-Datenbank lesen
5-
und schreiben. Dabei wird das Rechtesystem von verinice berücksichtigt.
6-
Es wird empfohlen einen technischen Nutzer für die REST-Aufrufe in
7-
verinice anzulegen.
8-
9-
## verinice
10-
Damit Daten von externen Tools über die REST-Schnittstelle bearbeiten
11-
werden können, ist es wichtig darauf zu achten, dass dem technischen
12-
Nutzer Lese- und Schreibrechte auf den entsprechenden Scopes geben werden.
1+
# verinice.REST-Userguide
2+
This document describes how to customize and run the verinice.REST.
3+
See [README.md](README.md) for how to build the verinice.REST. You can
4+
also retrieve the complete JAR from the [release page](https://github.com/SerNet/verinice.REST/releases)
5+
6+
## Run the verinice.REST
7+
verinice.REST comes as a self-contained jar, i. e. no further
8+
dependencies are required except a JRE-8 or later and a running
9+
[verinice](https://verinice.com/) installation.
10+
11+
You can run verinice.REST by calling
12+
13+
java -jar verinice-rest-XXX.jar
14+
15+
Replace XXX with the proper version string.
16+
17+
## Configuration
18+
The default configuration for verinice.REST is stored in
19+
[application.properties](verinice-rest/src/main/resources/application.properties)
20+
21+
Every property can be overwritten by passing it as a option to the Java call,
22+
e. g.
23+
24+
java -jar verinice-rest-XXX.jar \
25+
--server.port=8888 \
26+
--spring.datasource.url=jdbc:postgresql://verinicedb.local.example:5432/customdb \
27+
--spring.datasource.username=verinice-rest \
28+
--spring.datasource.password=********
29+
--veriniceserver.url=https://verinice.local.example:84577 \
30+
31+
tells verinice.REST to listen to port *8888*. It then open a database
32+
connection to *verinicedb.local.example:5432/customdb* authenticating as
33+
*verinice-rest* using the given password.
34+
35+
*veriniceserver.url=https://verinice.local.example:84577* is the URL to your
36+
verinice intallation and is only needed if you intend to create links.
37+
verinice.REST uses this address to retrieve information (SNCA.xml) from
38+
verinice to validate data. Creating links requires a verinice 1.20 or later.
39+
40+
**NOTE** It is highly recommended to create a technical user, e. g.
41+
*verinice-rest*, which has to be configured, s. a. This user has to be given
42+
reas and write access to scopes within verinice, in order to change them via
43+
verinice.REST.
44+
45+
## Logging
46+
Logging can be change and start time by setting the environment variable family
47+
`logging.level.*`. For example you can set the logging level for every
48+
component to `DEBUG` by running verinice.REST with the following
49+
argument:
50+
51+
java -jar verinice-rest-XXX.jar -Dlogging.level=DEBUG
52+
53+
Possible levels include
54+
55+
- `DEBUG`
56+
- `INFO`
57+
- `WARN`
58+
- `ERROR`
59+
- `FATAL`
60+
- `TRACE`
61+
62+
The next sections give some examples of logging components.
63+
64+
### Received Requests
65+
66+
-Dlogging.level.org.springframework.web.servlet=DEBUG
67+
68+
### verinice specific logging
69+
70+
-Dlogging.level.org.verinice=TRACE
71+

0 commit comments

Comments
 (0)