Update documentation

more-debug
Simon Stürz 2018-08-15 20:26:15 +02:00
parent 10c4ec2302
commit 84b964f501
1 changed files with 81 additions and 53 deletions

130
README.md
View File

@ -9,68 +9,71 @@ In order to build the proxy server you need to install the qt default package.
apt install qt5-default apt install qt5-default
## Build from source
Change into the source directory and run following commands Change into the source directory and run following commands
cd nymea-remoteproxy $ cd nymea-remoteproxy
mkdir build $ mkdir build
cd build $ cd build
qmake ../ $ qmake ../
make -j$(nproc) $ make -j$(nproc)
In the build directory you can find the resulting library and binary files. In the build directory you can find the resulting library and binary files.
If you want to start the proxy server from the build directory, you need to export the library path before starting the application: If you want to start the proxy server from the build directory, you need to export the library path before starting the application:
$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd)/libnymea-remoteproxy:$(pwd)/libnymea-remoteproxyclient $ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd)/libnymea-remoteproxy:$(pwd)/libnymea-remoteproxyclient
$ ./server/nymea-remoteproxy -c ../nymea-remoteproxy/tests/test-certificate.crt -k ../nymea-remoteproxy/tests/test-certificate.key $ ./server/nymea-remoteproxy -c ../nymea-remoteproxy/nymea-remoteproxy.conf
## AWS SDK ## Build debian package
Get the latest source code and build dependecies
$ apt update
$ apt install git build-essential cmake libcurl4-openssl-dev libssl-dev uuid-dev zlib1g-dev libpulse-dev
$ git clone https://github.com/aws/aws-sdk-cpp.git
Create the build and install folder
$ cd aws-sdk-cpp
$ mkdir -p build/install
$ cd build
$ cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_ONLY="lambda" -DCMAKE_INSTALL_PREFIX=$(pwd)/install ../
$ make -j$(nproc)
Install build output into install directory
$ make install
#### Building debian package
$ git clone https://github.com/aws/aws-sdk-cpp.git
$ cd aws-sdk-cpp
$ git clone git@gitlab.guh.io:cloud/aws-sdk-cpp-debian.git debian
$ apt install crossbuilder
$ cd nymea-remoteproxy
$ crossbuilder $ crossbuilder
# Install # Install
## From repository
There is a public version available in the nymea repository.
$ apt install nymea-remoteproxy nymea-remoteproxy-client
This will install a systemd service called `nymea-remoteproxy.service` and the client application for testing.
## From build directory
Simply run following command in the build dir:
$ sudo make install
# Configure # Configure
The package will deliver a default configuration file with following content:
name=nymea-remoteproxy
writeLogs=false
logFile=/var/log/nymea-remoteproxy.log
certificate=/etc/ssl/certs/ssl-cert-snakeoil.pem
certificateKey=/etc/ssl/private/ssl-cert-snakeoil.key
[WebSocketServer]
host=0.0.0.0
port=443
[TcpServer]
host=0.0.0.0
port=80
# Test # Test
In order to run the test, you can call `make check` in the build directory or run the resulting executable: In order to run the test, you can call `make check` in the build directory or run the resulting executable:
$ nymea-remoteproxy-tests $ nymea-remoteproxy-tests-offline
$ nymea-remoteproxy-tests-online
## Test coverage report ## Test coverage report
@ -83,7 +86,7 @@ If you want to create a line coverage report from the tests simply run following
The resulting coverage report will be place in the `coverage-html` directory. The resulting coverage report will be place in the `coverage-html` directory.
# Usage # Server usage
In order to get information about the server you can start the command with the `--help` parameter. In order to get information about the server you can start the command with the `--help` parameter.
@ -100,19 +103,19 @@ In order to get information about the server you can start the command with the
Options: Options:
-h, --help Displays this help. -h, --help Displays this help.
-v, --version Displays version information. -v, --version Displays version information.
-l, --logging <logfile> Write log file to the given logfile. -l, --logging <logfile> Write log file to the given logfile.
-s, --server <hostaddress> The server address this proxy will -d, --development Enable the development mode. This
listen on. Default is 127.0.0.1 enabled the server assumes there are
-p, --port <port> The proxy server port. Default is static AWS credentials provided to
1212 aws-cli.
-c, --certificate <certificate> The path to the SSL certificate used -m, --mock-authenticator Start the server using a mock
for this proxy server. authenticator which returns always true.
-k, --certificate-key <certificate-key> The path to the SSL certificate key -c, --configuration <configuration> The path to the proxy server
used for this proxy server. configuration file. The default is
-a, --authentication-server <url> The server url of the AWS ~/.config/nymea/nymea-remoteproxy.conf
authentication server. --verbose Print more verbose.
# Server API # Server API
@ -301,6 +304,31 @@ Once the other client is here and ready, the server will send a notification to
"status": "success" "status": "success"
} }
# Client usage
The client allowes you to test the proxy server and create a dummy client for testing the connection.
nymea-remoteproxy-client --help
Usage: nymea-remoteproxy-client [options]
The nymea remote proxy server client application. This client allowes to test a server application as client perspective.
Server version: 0.0.1
API version: 0.1
Copyright © 2018 Simon Stürz <simon.stuerz@guh.io>
Options:
-h, --help Displays this help.
-v, --version Displays version information.
-t, --token <token> The AWS token for authentication.
-a, --address <address> The proxy server host address. Default 127.0.0.1
-p, --port <port> The proxy server port. Default 1212
# License # License