Update README.md
[src/xds/xds-server.git] / README.md
index 3c119db..2fc2301 100644 (file)
--- a/README.md
+++ b/README.md
@@ -41,20 +41,7 @@ Load the pre-build AGL SDK docker image including `xds-server`:
 wget -O - http://iot.bzh/download/public/2017/XDS/docker/docker_agl_worker-xds-latest.tar.xz | docker load
 ```
 
-### Build the container
-As an alternative to a pre-build image, you can rebuild the container from scratch. 
-`xds-server` has been integrated as a flavour of AGL SDK docker image. 
-So to rebuild docker image just execute following commands:
-
-```bash
-# Clone docker-worker-generator git repo
-git clone https://git.automotivelinux.org/AGL/docker-worker-generator
-# Start build that will create a docker image
-cd docker-worker-generator
-make build FLAVOUR=xds
-```
-
-### List  container
+### List container
 You should get `docker.automotivelinux.org/agl/worker-xds:X.Y` image
  
 ```bash
@@ -87,10 +74,10 @@ This container (ID=0) exposes following ports:
   - 69   : TFTP
   - 2222 : ssh
 
-`xds-server` is automatically started as a service on container startup.
+**`xds-server` is automatically started** as a service on container startup.
 
+If the container is running on your localhost, you can access the web interface (what we call the "Dashboard"):
 ```bash
-#On your localhost you can access the web insterface:
 xdg-open http://localhost:8000
 ```
 
@@ -99,7 +86,7 @@ If needed you can status / stop / start  it manually using following commands:
 # Log into docker container
 ssh -p 2222 devel@localhost
 
-#Status XDS server:
+# Status XDS server:
 sudo systemctl status xds-server.service
 
 # Stop XDS server
@@ -107,66 +94,43 @@ sudo systemctl stop xds-server.service
 
 # Start XDS server
 sudo systemctl start xds-server.service
-```
 
-### Configuration in config.json:
-On `xds-server` startup, you should get the following output:
-
-```bash
+# Get XDS server logs
 sudo journalctl --unit=xds-server.service --output=cat
+Starting XDS Server...
+### Configuration in config.json:
 {
-    "HTTPPort": 8000,
-    "webAppDir": "/usr/local/bin/www-xds-server",
-    "shareRootDir": "/home/devel/.xds/share",
-    "logsDir": "/tmp/xds-server/logs",
-    "sdkRootDir": "/xdt/sdk",
-    "syncthing": {
-        "binDir": "/usr/local/bin",
-        "home": "/home/devel/.xds/syncthing-config",
-        "gui-address": "http://localhost:8384",
-        "gui-apikey": "1234abcezam"
-    }
+"webAppDir": "/var/www/xds-server",
+"shareRootDir": "/home/devel/.xds/projects",
+"sdkRootDir": "/xdt/sdk",
+"syncthing": {
+"home": "/home/devel/.xds/syncthing-config",
+"gui-address": "http://localhost:8384"
 }
+}
+Downloading xds-agent_darwin-amd64-v0.1.0_59b0682.zip... OK
+Downloading xds-agent_linux-amd64-v0.1.0_59b0682.zip... OK
+Downloading xds-agent_windows-amd64-v0.1.0_59b0682.zip... OK
+### Start XDS server
+nohup /usr/local/bin/xds-server --config /home/devel/.xds/config.json -log info > /tmp/xds-server/logs/xds-server.lo
+pid=140
+Started XDS Server.
 ```
 
 ### Manually Start XDS server
-Systemd use a service to start the XDS server:
 
+XDS server is started as a service by Systemd.
 ```bash
 /lib/systemd/system/xds-server.service
 ```
+This Systemd service starts a bash script `/usr/local/bin/xds-server-start.sh`
 
-Systemd service start a bash script `xds-server-start.sh` script to start all requested tools:
-
-```bash
-/usr/local/bin/xds-server-start.sh
-```
-
-Command line:
-
+If you needed you can change default setting by defining specific environment variables in `/etc/default/xds-server`.
+For example to control log level, just set LOGLEVEL env variable knowing that supported *level* are: panic, fatal, error, warn, info, debug.
 ```bash
-nohup $BINDIR/xds-server --config $XDS_CONFFILE -log $LOGLEVEL > $LOG_XDS
-```
-
-Default value :
-```bash
-BINDIR=/usr/local/bin
-#xds-server install directory
-
-XDS_CONFFILE=$HOME/.xds/config.json
-#Conf file create at the first boot
-
-LOGLEVEL=info
-#You can set LOGLEVEL env variable to increase log level if you need it. 
-#Supported *level* are: panic, fatal, error, warn, info, debug.
-
-LOG_XDS=/tmp/xds-server/logs/xds-server.log
-```
-
-#For example, to set log level to "debug" mode :
-
-```bash
-LOGLEVEL=debug /usr/local/bin/xds-server-start.sh
+echo 'LOGLEVEL=debug' | sudo tee --append /etc/default/xds-server > /dev/null
+sudo systemctl restart xds-server.service
+tail -f /tmp/xds-server/logs/xds-server.log
 ```
 
 ### Install SDK cross-toolchain
@@ -188,7 +152,7 @@ Use provided `install-agl-sdks` script, for example to install SDK for ARM64 and
 
 ### XDS Dashboard
 
-`xds-server` serves a web-application (default port 8000:
+`xds-server` serves a web-application (default port 8000). :
 [http://localhost:8000](http://localhost:8000) ). So you can now connect your browser to this url and use what we call the **XDS dashboard**.
 
 Then follow instructions provided by this dashboard, knowing that the first time
@@ -225,6 +189,8 @@ Don't forget to open new user session after installing the packages.
 
 ### Building
 
+#### Native build
+
 Create a GOPATH variable(must be a full path):
 ```bash
  export GOPATH=$(realpath ~/workspace_go)
@@ -249,6 +215,20 @@ And to install `xds-server` (by default in `/usr/local/bin`):
 >make install DESTDIR=$HOME/opt/xds-server
 >```
 
+#### XDS docker image
+
+As an alternative to a pre-build image, you can rebuild the container from scratch. 
+`xds-server` has been integrated as a flavour of AGL SDK docker image. 
+So to rebuild docker image just execute following commands:
+
+```bash
+# Clone docker-worker-generator git repo
+git clone https://git.automotivelinux.org/AGL/docker-worker-generator
+# Start build that will create a docker image
+cd docker-worker-generator
+make build FLAVOUR=xds
+```
+
 ### Configuration
 
 `xds-server` configuration is driven by a JSON config file (`config.json`).
@@ -278,6 +258,7 @@ Supported fields in configuration file are (all fields are optional and listed v
 
 >**NOTE:** environment variables are supported by using `${MY_VAR}` syntax.
 
+
 ## Debugging
 
 ### XDS server architecture