Skip to content

Commit

Permalink
Merge pull request #216 from romu42/relax_config_reqs
Browse files Browse the repository at this point in the history
added enabled flag for desec plugin
  • Loading branch information
romu42 authored Mar 22, 2023
2 parents 6721576 + 81d5e1a commit 3d48ba0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15 deletions.
35 changes: 20 additions & 15 deletions musicd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,24 +152,27 @@ func main() {
conf.Internal.Processes = fsml
conf.Internal.MusicDB.FSMlist = fsml

// deSEC stuff
conf.Internal.DesecFetch = make(chan music.SignerOp, 100)
conf.Internal.DesecUpdate = make(chan music.SignerOp, 100)
conf.Internal.DdnsFetch = make(chan music.SignerOp, 100)
conf.Internal.DdnsUpdate = make(chan music.SignerOp, 100)

rootcafile := viper.GetString("common.rootCA")
desecapi, err := music.DesecSetupClient(rootcafile, cliconf.Verbose, cliconf.Debug)
if err != nil {
log.Fatalf("Error from DesecSetupClient: %v\n", err)
}
desecapi.TokViper = tokvip
// deSEC stuff
if viper.GetBool("signers.desec.enabled") {
conf.Internal.DesecFetch = make(chan music.SignerOp, 100)
conf.Internal.DesecUpdate = make(chan music.SignerOp, 100)

rldu := music.Updaters["rldesec-api"]
rldu.SetChannels(conf.Internal.DesecFetch, conf.Internal.DesecUpdate)
rldu.SetApi(*desecapi)
du := music.Updaters["desec-api"]
du.SetApi(*desecapi) // it is ok to reuse the same object here
rootcafile := viper.GetString("common.rootCA")
desecapi, err := music.DesecSetupClient(rootcafile, cliconf.Verbose, cliconf.Debug)
if err != nil {
log.Fatalf("Error from DesecSetupClient: %v\n", err)
}
desecapi.TokViper = tokvip

rldu := music.Updaters["rldesec-api"]
rldu.SetChannels(conf.Internal.DesecFetch, conf.Internal.DesecUpdate)
rldu.SetApi(*desecapi)
du := music.Updaters["desec-api"]
du.SetApi(*desecapi) // it is ok to reuse the same object here
}

rlddu := music.Updaters["rlddns"]
rlddu.SetChannels(conf.Internal.DdnsFetch, conf.Internal.DdnsUpdate)
Expand All @@ -178,7 +181,9 @@ func main() {

go dbUpdater(&conf)
go APIdispatcher(&conf)
go deSECmgr(&conf, done)
if viper.GetBool("signers.desec.enabled") {
go deSECmgr(&conf, done)
}
go ddnsmgr(&conf, done)
go FSMEngine(&conf, done)

Expand Down
1 change: 1 addition & 0 deletions musicd/musicd.yaml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ signers:
fetch: 5
update: 2
desec:
enabled: true # Set to false disable desec plugin.
email: johan.stenstam@internetstiftelsen.se
password: Blurg99,123
baseurl: https://desec.io/api/v1
Expand Down

0 comments on commit 3d48ba0

Please sign in to comment.