mirror of
https://github.com/ClusterCockpit/cc-metric-store.git
synced 2024-12-26 16:59:07 +01:00
Support for NATS Creds
This commit is contained in:
parent
2f3f70aa9f
commit
2d510b2890
4
.gitignore
vendored
4
.gitignore
vendored
@ -18,6 +18,10 @@
|
|||||||
# Project specific ignores
|
# Project specific ignores
|
||||||
/var
|
/var
|
||||||
|
|
||||||
|
aditya.creds
|
||||||
|
test.creds
|
||||||
|
config.json
|
||||||
|
|
||||||
migrateTimestamps.pl
|
migrateTimestamps.pl
|
||||||
test_ccms_api.sh
|
test_ccms_api.sh
|
||||||
test_ccms_free_api.sh
|
test_ccms_free_api.sh
|
||||||
|
@ -166,12 +166,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"checkpoints": {
|
"checkpoints": {
|
||||||
"interval": "1h",
|
"interval": "12h",
|
||||||
"directory": "./var/checkpoints",
|
"directory": "./var/checkpoints",
|
||||||
"restore": "1h"
|
"restore": "48h"
|
||||||
},
|
},
|
||||||
"archive": {
|
"archive": {
|
||||||
"interval": "2h",
|
"interval": "50h",
|
||||||
"directory": "./var/archive"
|
"directory": "./var/archive"
|
||||||
},
|
},
|
||||||
"http-api": {
|
"http-api": {
|
||||||
@ -179,7 +179,18 @@
|
|||||||
"https-cert-file": null,
|
"https-cert-file": null,
|
||||||
"https-key-file": null
|
"https-key-file": null
|
||||||
},
|
},
|
||||||
"retention-in-memory": "1h",
|
"retention-in-memory": "48h",
|
||||||
"nats": null,
|
"nats": [
|
||||||
|
{
|
||||||
|
"address": "nats://localhost:4222",
|
||||||
|
"creds-file-path": "test.creds",
|
||||||
|
"subscriptions": [
|
||||||
|
{
|
||||||
|
"subscribe-to": "ee-hpc-nats",
|
||||||
|
"cluster-tag": "fritz2"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"jwt-public-key": "kzfYrYy+TzpanWZHJ5qSdMj5uKUWgq74BWhQG6copP0="
|
"jwt-public-key": "kzfYrYy+TzpanWZHJ5qSdMj5uKUWgq74BWhQG6copP0="
|
||||||
}
|
}
|
@ -92,6 +92,10 @@ func ReceiveNats(conf *config.NatsConfig,
|
|||||||
opts = append(opts, nats.UserInfo(conf.Username, conf.Password))
|
opts = append(opts, nats.UserInfo(conf.Username, conf.Password))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if conf.Credsfilepath != "" {
|
||||||
|
opts = append(opts, nats.UserCredentials(conf.Credsfilepath))
|
||||||
|
}
|
||||||
|
|
||||||
nc, err := nats.Connect(conf.Address, opts...)
|
nc, err := nats.Connect(conf.Address, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -65,6 +65,9 @@ type NatsConfig struct {
|
|||||||
Username string `json:"username"`
|
Username string `json:"username"`
|
||||||
Password string `json:"password"`
|
Password string `json:"password"`
|
||||||
|
|
||||||
|
//Creds file path
|
||||||
|
Credsfilepath string `json:"creds-file-path"`
|
||||||
|
|
||||||
Subscriptions []struct {
|
Subscriptions []struct {
|
||||||
// Channel name
|
// Channel name
|
||||||
SubscribeTo string `json:"subscribe-to"`
|
SubscribeTo string `json:"subscribe-to"`
|
||||||
|
Loading…
Reference in New Issue
Block a user