Needs super user rights using install-agl-sdks.sh
[src/xds/xds-server.git] / README.md
index a976e15..95bd565 100644 (file)
--- a/README.md
+++ b/README.md
@@ -74,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
 ```
 
@@ -86,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
@@ -94,66 +94,25 @@ 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
-{
-    "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"
-    }
-}
 ```
 
 ### 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
@@ -165,18 +124,20 @@ Use provided `install-agl-sdks` script, for example to install SDK for ARM64 and
 
 ```bash
 # Install ARM64 SDK (automatic download)
-/usr/local/bin/xds-utils/install-agl-sdks.sh --arch aarch64
+sudo /usr/local/bin/xds-utils/install-agl-sdks.sh --arch aarch64
 
 # Install Intel corei7-64 SDK (using an SDK tarball that has been built or downloaded manually)
-/usr/local/bin/xds-utils/install-agl-sdks.sh --arch corei7-64 --file /tmp/poky-agl-glibc-x86_64-agl-demo-platform-crosssdk-corei7-64-toolchain-
+sudo /usr/local/bin/xds-utils/install-agl-sdks.sh --arch corei7-64 --file /tmp/poky-agl-glibc-x86_64-agl-demo-platform-crosssdk-corei7-64-toolchain-
 3.99.1+snapshot.sh
 
 ```
 
 ### XDS Dashboard
 
-`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**.
+`xds-server` serves a web-application at [http://localhost:8000](http://localhost:8000) when XDS server is running on your host. Just replace `localhost` by the host name or ip when XDS server is running on another host. So you can now connect your browser to this url and use what we call the **XDS dashboard**.
+```bash
+xdg-open http://localhost:8000
+```
 
 Then follow instructions provided by this dashboard, knowing that the first time
 you need to download and start `xds-agent` on your local machine. 
@@ -265,7 +226,7 @@ Here is the logic to determine which `config.json` file will be used:
 Supported fields in configuration file are (all fields are optional and listed values are the default values):
 ```
 {
-    "HTTPPort": 8000,
+    "httpPort": 8000,                               # HTTP port of client webapp / dashboard
     "webAppDir": "webapp/dist",                     # location of client dashboard (default: webapp/dist)
     "shareRootDir": "${HOME}/.xds/projects",        # root directory where projects will be copied
     "logsDir": "/tmp/logs",                         # directory to store logs (eg. syncthing output)