1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
# Netconf Server
This server uses sysrepo to simulate network configuration.
It is base od sysrepo-netopeer2 image.
## User guide
### starting server
In order to start server use docker-compose located in root catalog:
```shell
docker-compose up -d
```
or run image using docker:
```shell
docker run -it -p 830:830 -p 6513:6513 onap/org.onap.integration.simulators.netconf-server:latest
```
### using server
Server allows:
- installing custom configuration models on start up.
- changing configuration of that modules on runtime.
Config can be changed with use of **SSH, be default expose on port 830**
and **TLS, be default exposed on port 6513**.
- SSH works "out of the box" with a username and password *netconf*.
- **TLS is disabled be default**,
in order to enable it, set environment variable `ENABLE_TLS=true`.
More about TLS in ***TLS*** section.
### custom models
new models are loaded on the image start up from catalog `/resources/models`.
Be default this directory contains `pnf-simulator.yang` model.
In order to load custom models on start up,
volume with models, should be mounted to `/resources/models` directory.
It can be done in docker-compose, by putting
`./path/to/cusom/models:/resources/models` in *volumes* section.
### TLS
TLS in disabled be default with environment variable `ENABLE_TLS` set to false.
In order to enable TLS, that environment variable need to be set to `true`
**on container start up**.
It can be done in docker-compose,
by putting `ENABLE_TLS=true` in *environment* section.
#### Custom certificate
When TLS is enabled server will use auto generated certificates, be default.
That certificates are generated during image build and
are located in `/resources/certs` directory.
Certificates are loaded during image start up.
**In order to use custom certs**
volume with certificates needs to be mounted to `/resources/certs` directory.
In this volume following files are required, **named accordingly**:
- **ca.crt** - CA/Root certificate
- **client.crt** - client certificate
- **server.crt** - server certificate
- **server.key** - server private key
- **server_pub.key** - server public key
## Development guide
### building image
In order to build image mvn command can be run:
```shell
mvn clean install -p docker
```
### image building process
To build image, Dockerfile is used.
During an image building:
- catalog `scripts` is copied to image home directory.
That catalog contains all scripts needed for
installing initial models and configuring TLS.
- catalog `models` is copied to image directory `/resources/models`.
That catalog contains default models
that will be installed on image start up.
- default certificates and keys for TLS are generated and
stored in `/resources/certs` directory.
- set-up-netopeer script is set to be run on image start up.
### change log
This project contains `Changeloge.md` file.
Please update this file when change is made,
according to the guidelines.
|