summaryrefslogtreecommitdiff
path: root/dryad
diff options
context:
space:
mode:
authorAleksander Mistewicz <a.mistewicz@samsung.com>2018-05-28 16:51:57 +0200
committerAleksander Mistewicz <a.mistewicz@samsung.com>2018-08-01 18:05:38 +0200
commit0ca27786ce5a62e0be92112c066044022a657cd3 (patch)
tree1c472d33001ddff550d50944fc9d17e39f677769 /dryad
parent25a99c9c7f7e17ab5c1f46ad05f8f43545ae00e2 (diff)
downloadboruta-0ca27786ce5a62e0be92112c066044022a657cd3.tar.gz
boruta-0ca27786ce5a62e0be92112c066044022a657cd3.tar.bz2
boruta-0ca27786ce5a62e0be92112c066044022a657cd3.zip
Inform Dryad about SSH listen address
When multiple Dryads run under the same IP address, SSH and Dryad listen ports must be different. Change-Id: Iedf8dd5aafb0c45c6d8c6c6b45bc61d47c720041 Signed-off-by: Aleksander Mistewicz <a.mistewicz@samsung.com>
Diffstat (limited to 'dryad')
-rw-r--r--dryad/conf/conf.go10
-rw-r--r--dryad/conf/conf_test.go6
2 files changed, 12 insertions, 4 deletions
diff --git a/dryad/conf/conf.go b/dryad/conf/conf.go
index 049fb7b..d8b37cd 100644
--- a/dryad/conf/conf.go
+++ b/dryad/conf/conf.go
@@ -31,11 +31,15 @@ import (
// for Dryad's RPC client and server.
const DefaultRPCPort = 7175
+// DefaultSSHPort is a default port off SSH daemon.
+const DefaultSSHPort = 22
+
// NewConf returns a new instance of General configuration with default values set.
func NewConf() *General {
return &General{
- Address: fmt.Sprintf(":%d", DefaultRPCPort),
- Caps: Capabilities(map[string]string{}),
+ Address: fmt.Sprintf(":%d", DefaultRPCPort),
+ SSHAdress: fmt.Sprintf(":%d", DefaultSSHPort),
+ Caps: Capabilities(map[string]string{}),
User: &User{
Name: "boruta-user",
Groups: []string{},
@@ -60,6 +64,8 @@ type General struct {
Address string `toml:"listen_address"`
// BorutaAddress is used to connect to Boruta server.
BorutaAddress string `toml:"boruta_address"`
+ // SSHAdress is a ssh daemon listen address.
+ SSHAdress string `toml:"ssh_address"`
// Caps are necessary information to register in Boruta.
//
// TODO(amistewicz): This field should be removed when
diff --git a/dryad/conf/conf_test.go b/dryad/conf/conf_test.go
index f8f9997..c220a5f 100644
--- a/dryad/conf/conf_test.go
+++ b/dryad/conf/conf_test.go
@@ -30,6 +30,7 @@ import (
var _ = Describe("Conf", func() {
marshaled := `listen_address = ":7175"
boruta_address = ""
+ssh_address = ":22"
sdcard = "/dev/sdX"
stm_path = "/run/stm.socket"
@@ -40,8 +41,9 @@ stm_path = "/run/stm.socket"
groups = []
`
unmarshaled := &General{
- Address: ":7175",
- Caps: boruta.Capabilities(map[string]string{}),
+ Address: ":7175",
+ SSHAdress: ":22",
+ Caps: boruta.Capabilities(map[string]string{}),
User: &User{
Name: "boruta-user",
Groups: []string{},