From a5cf7f0ad72fe51a857bb5cadf00478102457fce Mon Sep 17 00:00:00 2001
From: Niko Ehrenfeuchter <nikolaus.ehrenfeuchter@unibas.ch>
Date: Tue, 6 Mar 2018 16:19:42 +0100
Subject: [PATCH] Update instructions for AutoTx-Updater.

- config validation
- reporting
- log file upload
- update-source folder structure
- permissions

Fixes #33
---
 Updater/README.md | 39 +++++++++++++++++++++++++++++++--------
 1 file changed, 31 insertions(+), 8 deletions(-)

diff --git a/Updater/README.md b/Updater/README.md
index c3ef1d3..e679f06 100644
--- a/Updater/README.md
+++ b/Updater/README.md
@@ -5,9 +5,16 @@ The service can automatically be updated by running the `Update-Service.ps1`
 script. It will check a remote location (configurable via a config file) and do
 the following tasks:
 
-- check for new service binaries and update the local ones if applicable
-- check for a new configuration file for this host and update the local one
-- try to restart the service if one of the previous tasks was done
+- check if new service binaries should be installed on the system
+- check if new configuration files are available for the given machine
+- validate if configuration and service are compatible (in all possible
+  combinations, i.e. new binaries with existing config, new config with existing
+  binaries and finally new binaries with new config files)
+- update those components that were detected to require updating before
+- restart the service if applicable
+- report to the Windows Event Log as well as via email
+- upload the local service log file to the storage location that is also used
+  to retrieve updates
 
 Config File Options
 -------------------
@@ -21,6 +28,8 @@ just a few comments here:
 - `$UpdateSourcePath` points to the base directory on a storage location (most
   likely some UNC path) where the service update files are provided. See the
   next section for details on the structure therein.
+- `$Pattern` is a regular expression that will be used to locate possible
+  update packages in the given path matching this expression.
 
 Folder Structure
 ----------------
@@ -29,10 +38,14 @@ The `$UpdateSourcePath` folder structure is expected to be like this:
 
 ```
 ├─── Configs
-│   ├─── _COMMON_
-│   │   └─── common_config.xml
-│   └─── <HOSTNAME>
-│       └─── configuration.xml
+│   ├─── config.common.xml
+│   ├─── <HOSTNAME1>.xml
+│   └─── <HOSTNAME2>.xml
+├─── Logs
+│   ├─── <HOSTNAME1>
+│   │   └─── AutoTx.log
+│   └─── <HOSTNAME2>
+│       └─── AutoTx.log
 └─── Service
     ├─── Binaries
     │   ├─── build_2018-01-21_17-18-19
@@ -40,9 +53,19 @@ The `$UpdateSourcePath` folder structure is expected to be like this:
     │   └─── build_2018-01-23_11-22-33
     │       └─── AutoTx
     └─── UpdateMarkers
-        └─── <HOSTNAME>
+        ├─── <HOSTNAME1>
+        └─── <HOSTNAME2>
 ```
 
+Permissions
+-----------
+
+The updater script needs to be run with an account that has applicable
+permissions to start and stop the service, has write permissions to the local
+service installation directory and the `$UpdateSourcePath` location (the latter
+one only requires write-permissions for the `Logs` folder for uploading the log
+files).
+
 Automatic Updates
 -----------------
 
-- 
GitLab