Skip to content
This repository was archived by the owner on Oct 11, 2024. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ source scripts/configure_trillian.sh && createLog && createMap
```

3. Run Key Transparency
- `docker-compose build kt-signer`
- `docker-compose up -d`
- `docker-compose logs --tail=0 --follow`
- [https://localhost:8080/v1/users/foo@bar.com?app_id=app1](https://localhost:8080/v1/users/foo@bar.com?app_id=app1)
Expand Down
26 changes: 7 additions & 19 deletions cmd/keytransparency-signer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,9 @@ import (
"net/http"
"time"

"github.com/google/keytransparency/core/admin"
"github.com/google/keytransparency/core/appender"
"github.com/google/keytransparency/core/mutator/entry"
"github.com/google/keytransparency/core/signer"

"github.com/google/keytransparency/impl/config"
"github.com/google/keytransparency/impl/sql/engine"
"github.com/google/keytransparency/impl/sql/mutations"
"github.com/google/keytransparency/impl/transaction"
Expand All @@ -41,18 +38,14 @@ import (
var (
metricsAddr = flag.String("metrics-addr", ":8081", "The ip:port to publish metrics on")
serverDBPath = flag.String("db", "db", "Database connection string")
domain = flag.String("domain", "example.com", "Distinguished name for this key server")
minEpochDuration = flag.Duration("min-period", time.Second*60, "Minimum time between epoch creation (create epochs only if there where mutations). Expected to be smaller than max-period.")
maxEpochDuration = flag.Duration("max-period", time.Hour*12, "Maximum time between epoch creation (independent from mutations). This value should about half the time guaranteed by the policy.")

// Info to connect to sparse merkle tree database.
// Info to connect to the trillian map and log.
mapID = flag.Int64("map-id", 0, "ID for backend map")
mapURL = flag.String("map-url", "", "URL of Trilian Map Server")

// Info to send Signed Map Heads to a Trillian Log.
logID = flag.Int64("log-id", 0, "Trillian Log ID")
logURL = flag.String("log-url", "", "URL of Trillian Log Server for Signed Map Heads")
logPubKey = flag.String("log-key", "", "File path to public key of the Trillian Log")
logID = flag.Int64("log-id", 0, "Trillian Log ID")
logURL = flag.String("log-url", "", "URL of Trillian Log Server for Signed Map Heads")
)

func openDB() *sql.DB {
Expand Down Expand Up @@ -86,17 +79,12 @@ func main() {
tmap := trillian.NewTrillianMapClient(mconn)

// Connection to append only log
tlog, err := config.LogClient(*logID, *logURL, *logPubKey)
lconn, err := grpc.Dial(*logURL, grpc.WithInsecure())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this on the same machine? If yes, will it always be on the same machine? If not, why did we switch to an insecure connection?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The trillian log and map are not always on the same machine.

Using grpc.WithInsecure() is not a change. It was previously hidden behind config. This makes it a bit more obvious and consistent.

if err != nil {
glog.Exitf("LogClient(%v, %v, %v): %v", *logID, *logURL, *logPubKey, err)
glog.Exitf("Failed to connect to %v: %v", *logURL, err)
}
tlog := trillian.NewTrillianLogClient(lconn)

// Create signer helper objects.
static := admin.NewStatic()
if err := static.AddLog(*logID, tlog); err != nil {
glog.Exitf("static.AddLog(%v): %v", *mapID, err)
}
sths := appender.NewTrillian(static)
// TODO: add mutations and mutator to admin.
mutations, err := mutations.New(sqldb, *mapID)
if err != nil {
Expand All @@ -112,7 +100,7 @@ func main() {
}
}()

signer := signer.New(*domain, *mapID, tmap, *logID, sths, mutator, mutations, factory)
signer := signer.New(*mapID, tmap, *logID, tlog, mutator, mutations, factory)
glog.Infof("Signer starting")
signer.StartSigning(context.Background(), *minEpochDuration, *maxEpochDuration)
glog.Errorf("Signer exiting")
Expand Down
23 changes: 0 additions & 23 deletions core/admin/interface.go

This file was deleted.

56 changes: 0 additions & 56 deletions core/admin/static.go

This file was deleted.

44 changes: 0 additions & 44 deletions core/admin/static_test.go

This file was deleted.

59 changes: 0 additions & 59 deletions core/appender/appender.go

This file was deleted.

98 changes: 0 additions & 98 deletions core/appender/trillian.go

This file was deleted.

Loading