Skip to content

Commit

Permalink
Merge 5a6fdfc into 8dc0012
Browse files Browse the repository at this point in the history
  • Loading branch information
bifurcation committed Mar 22, 2015
2 parents 8dc0012 + 5a6fdfc commit 038311e
Show file tree
Hide file tree
Showing 10 changed files with 458 additions and 409 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ _cgo_export.*

_testmain.go

*.swp
*.exe
*.test
*.prof
Expand Down
34 changes: 34 additions & 0 deletions cmd/boulder-ca/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// Copyright 2014 ISRG. All rights reserved
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

package main

import (
"github.com/letsencrypt/boulder/ca"
"github.com/letsencrypt/boulder/cmd"
"github.com/letsencrypt/boulder/rpc"
)

func main() {
app := cmd.NewAppShell("boulder-ca")
app.Action = func(c cmd.Config) {
ch := cmd.AmqpChannel(c.AMQP.Server)

sac, err := rpc.NewStorageAuthorityClient(c.AMQP.SA.Client, c.AMQP.SA.Client, ch)
cmd.FailOnError(err, "Failed to create SA client")

cai, err := ca.NewCertificateAuthorityImpl(c.CA.Server, c.CA.AuthKey, c.CA.Profile)
cmd.FailOnError(err, "Failed to create CA impl")

cai.SA = &sac

cas, err := rpc.NewCertificateAuthorityServer(c.AMQP.CA.Server, ch, cai)
cmd.FailOnError(err, "Unable to create CA server")

cmd.RunForever(cas)
}

app.Run()
}
39 changes: 39 additions & 0 deletions cmd/boulder-ra/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// Copyright 2014 ISRG. All rights reserved
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

package main

import (
"github.com/letsencrypt/boulder/cmd"
"github.com/letsencrypt/boulder/ra"
"github.com/letsencrypt/boulder/rpc"
)

func main() {
app := cmd.NewAppShell("boulder-sa")
app.Action = func(c cmd.Config) {
ch := cmd.AmqpChannel(c.AMQP.Server)

vac, err := rpc.NewValidationAuthorityClient(c.AMQP.VA.Client, c.AMQP.VA.Server, ch)
cmd.FailOnError(err, "Unable to create VA client")

cac, err := rpc.NewCertificateAuthorityClient(c.AMQP.CA.Client, c.AMQP.CA.Server, ch)
cmd.FailOnError(err, "Unable to create CA client")

sac, err := rpc.NewStorageAuthorityClient(c.AMQP.SA.Client, c.AMQP.SA.Server, ch)
cmd.FailOnError(err, "Unable to create SA client")

rai := ra.NewRegistrationAuthorityImpl()
rai.VA = &vac
rai.CA = &cac
rai.SA = &sac

ras, err := rpc.NewRegistrationAuthorityServer(c.AMQP.RA.Server, ch, &rai)
cmd.FailOnError(err, "Unable to create RA server")
cmd.RunForever(ras)
}

app.Run()
}
31 changes: 31 additions & 0 deletions cmd/boulder-sa/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Copyright 2014 ISRG. All rights reserved
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

package main

import (
// Load both drivers to allow configuring either
_ "github.com/go-sql-driver/mysql"
_ "github.com/mattn/go-sqlite3"

"github.com/letsencrypt/boulder/cmd"
"github.com/letsencrypt/boulder/rpc"
"github.com/letsencrypt/boulder/sa"
)

func main() {
app := cmd.NewAppShell("boulder-sa")
app.Action = func(c cmd.Config) {
ch := cmd.AmqpChannel(c.AMQP.Server)

sai, err := sa.NewSQLStorageAuthority(c.SA.DBDriver, c.SA.DBName)
cmd.FailOnError(err, "Failed to create SA impl")

sas := rpc.NewStorageAuthorityServer(c.AMQP.SA.Server, ch, sai)
cmd.RunForever(sas)
}

app.Run()
}
Loading

0 comments on commit 038311e

Please sign in to comment.