mirror of
https://github.com/postmannen/ctrl.git
synced 2024-12-14 12:37:31 +00:00
fixed wrong handling newpki when db is missing
This commit is contained in:
parent
6f10ed9ecd
commit
731f628233
3 changed files with 16 additions and 3 deletions
|
@ -5,7 +5,6 @@ import (
|
|||
"crypto/sha256"
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"sort"
|
||||
"sync"
|
||||
|
@ -77,7 +76,7 @@ func newPKI(configuration *Configuration, errorKernel *errorKernel) *pki {
|
|||
db, err := bolt.Open(databaseFilepath, 0600, nil)
|
||||
if err != nil {
|
||||
log.Printf("error: failed to open db: %v\n", err)
|
||||
os.Exit(1)
|
||||
return &p
|
||||
}
|
||||
|
||||
p.db = db
|
||||
|
|
|
@ -3,6 +3,7 @@ package steward
|
|||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"log"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
@ -113,6 +114,11 @@ func (m methodREQCopySrc) handler(proc process, message Message, node string) ([
|
|||
func copySrcProcFunc() func(context.Context, chan Message) error {
|
||||
pf := func(ctx context.Context, procFuncCh chan Message) error {
|
||||
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
log.Printf(" * copySrcProcFunc ended\n")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
10
server.go
10
server.go
|
@ -145,8 +145,16 @@ func NewServer(configuration *Configuration, version string) (*server, error) {
|
|||
|
||||
}
|
||||
|
||||
//var nodeAuth *nodeAuth
|
||||
//if configuration.EnableSignatureCheck {
|
||||
nodeAuth := newNodeAuth(configuration, errorKernel)
|
||||
// fmt.Printf(" * DEBUG: newServer: signatures contains: %+v\n", signatures)
|
||||
//}
|
||||
|
||||
//var centralAuth *centralAuth
|
||||
//if configuration.IsCentralAuth {
|
||||
centralAuth := newCentralAuth(configuration, errorKernel)
|
||||
//}
|
||||
|
||||
s := server{
|
||||
ctx: ctx,
|
||||
|
@ -162,7 +170,7 @@ func NewServer(configuration *Configuration, version string) (*server, error) {
|
|||
errorKernel: errorKernel,
|
||||
nodeAuth: nodeAuth,
|
||||
helloRegister: newHelloRegister(),
|
||||
centralAuth: newCentralAuth(configuration, errorKernel),
|
||||
centralAuth: centralAuth,
|
||||
}
|
||||
|
||||
s.processes = newProcesses(ctx, &s)
|
||||
|
|
Loading…
Reference in a new issue