Merge pull request #42 from letsencrypt/jcj-hackathon
Customizable URLs, Listen Addresses, and Spec-Compliance w/ Challenges
This commit is contained in:
commit
3ca689caf7
|
|
@ -13,7 +13,6 @@ RUN go-wrapper download github.com/bifurcation/gose && \
|
|||
go-wrapper download github.com/cloudflare/cfssl/auth && \
|
||||
go-wrapper download github.com/cloudflare/cfssl/config && \
|
||||
go-wrapper download github.com/cloudflare/cfssl/signer
|
||||
#go-wrapper download github.com/cloudflare/cfssl/signer/remote && \
|
||||
|
||||
# Copy in the Boulder sources
|
||||
RUN mkdir -p /go/src/github.com/letsencrypt/boulder
|
||||
|
|
|
|||
|
|
@ -94,6 +94,20 @@ func main() {
|
|||
{
|
||||
Name: "monolithic",
|
||||
Usage: "Start the CA in monolithic mode, without using AMQP",
|
||||
Flags: []cli.Flag {
|
||||
cli.StringFlag{
|
||||
Name: "baseUrl",
|
||||
EnvVar: "BASE_URL",
|
||||
Value: "http://localhost:4000",
|
||||
Usage: "Base URL",
|
||||
},
|
||||
cli.StringFlag{
|
||||
Name: "listenAddress",
|
||||
EnvVar: "LISTEN_ADDRESS",
|
||||
Value: "0.0.0.0:4000",
|
||||
Usage: "interface and port to listen on",
|
||||
},
|
||||
},
|
||||
Action: func(c *cli.Context) {
|
||||
|
||||
// Grab parameters
|
||||
|
|
@ -122,8 +136,7 @@ func main() {
|
|||
ca.SA = sa
|
||||
|
||||
// Go!
|
||||
authority := "0.0.0.0:4000"
|
||||
urlBase := "http://" + authority
|
||||
urlBase := c.String("baseUrl")
|
||||
newRegPath := "/acme/new-reg"
|
||||
regPath := "/acme/reg/"
|
||||
newAuthzPath := "/acme/new-authz"
|
||||
|
|
@ -154,14 +167,28 @@ func main() {
|
|||
// XXX: Better way to do this? Part of improved configuration
|
||||
ra.AuthzBase = wfe.AuthzBase
|
||||
|
||||
fmt.Fprintf(os.Stderr, "Server running...\n")
|
||||
err = http.ListenAndServe(authority, nil)
|
||||
fmt.Fprintf(os.Stderr, "Server running, listening on %s...\n", c.String("listenAddress"))
|
||||
err = http.ListenAndServe(c.String("listenAddress"), nil)
|
||||
failOnError(err, "Error starting HTTP server")
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "monolithic-amqp",
|
||||
Usage: "Start the CA in monolithic mode, using AMQP",
|
||||
Flags: []cli.Flag {
|
||||
cli.StringFlag{
|
||||
Name: "baseUrl",
|
||||
EnvVar: "BASE_URL",
|
||||
Value: "http://localhost:4000",
|
||||
Usage: "Base URL",
|
||||
},
|
||||
cli.StringFlag{
|
||||
Name: "listenAddress",
|
||||
EnvVar: "LISTEN_ADDRESS",
|
||||
Value: "0.0.0.0:4000",
|
||||
Usage: "interface and port to listen on",
|
||||
},
|
||||
},
|
||||
Action: func(c *cli.Context) {
|
||||
// Grab parameters
|
||||
cfsslServer := c.GlobalString("cfssl")
|
||||
|
|
@ -218,8 +245,7 @@ func main() {
|
|||
wfe.SA = &sac
|
||||
|
||||
// Go!
|
||||
authority := "0.0.0.0:4000"
|
||||
urlBase := "http://" + authority
|
||||
urlBase := c.String("baseUrl")
|
||||
newRegPath := "/acme/new-reg"
|
||||
regPath := "/acme/reg/"
|
||||
newAuthzPath := "/acme/new-authz"
|
||||
|
|
@ -239,14 +265,28 @@ func main() {
|
|||
http.HandleFunc(authzPath, wfe.Authorization)
|
||||
http.HandleFunc(certPath, wfe.Certificate)
|
||||
|
||||
fmt.Fprintf(os.Stderr, "Server running...\n")
|
||||
err = http.ListenAndServe(authority, nil)
|
||||
fmt.Fprintf(os.Stderr, "Server running, listening on %s...\n", c.String("listenAddress"))
|
||||
err = http.ListenAndServe(c.String("listenAddress"), nil)
|
||||
failOnError(err, "Error starting HTTP server")
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "wfe",
|
||||
Usage: "Start the WebFrontEnd",
|
||||
Flags: []cli.Flag {
|
||||
cli.StringFlag{
|
||||
Name: "baseUrl",
|
||||
EnvVar: "BASE_URL",
|
||||
Value: "http://localhost:4000",
|
||||
Usage: "Base URL",
|
||||
},
|
||||
cli.StringFlag{
|
||||
Name: "listenAddress",
|
||||
EnvVar: "LISTEN_ADDRESS",
|
||||
Value: "0.0.0.0:4000",
|
||||
Usage: "interface and port to listen on",
|
||||
},
|
||||
},
|
||||
Action: func(c *cli.Context) {
|
||||
// Create necessary clients
|
||||
ch := amqpChannel(c.GlobalString("amqp"))
|
||||
|
|
@ -263,8 +303,7 @@ func main() {
|
|||
wfe.SA = &sac
|
||||
|
||||
// Connect the front end to HTTP
|
||||
authority := "0.0.0.0:4000"
|
||||
urlBase := "http://" + authority
|
||||
urlBase := c.String("baseUrl")
|
||||
newRegPath := "/acme/new-reg"
|
||||
regPath := "/acme/reg/"
|
||||
newAuthzPath := "/acme/new-authz"
|
||||
|
|
@ -284,8 +323,8 @@ func main() {
|
|||
http.HandleFunc(authzPath, wfe.Authorization)
|
||||
http.HandleFunc(certPath, wfe.Certificate)
|
||||
|
||||
fmt.Fprintf(os.Stderr, "Server running...\n")
|
||||
http.ListenAndServe(authority, nil)
|
||||
fmt.Fprintf(os.Stderr, "Server running, listening on %s...\n", c.String("listenAddress"))
|
||||
http.ListenAndServe(c.String("listenAddress"), nil)
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ func TestMergeChallenge(t *testing.T) {
|
|||
t2 := time.Now().Add(-5 * time.Hour)
|
||||
challenge := Challenge{
|
||||
Status: StatusPending,
|
||||
Completed: t1,
|
||||
Validated: &t1,
|
||||
Token: "asdf",
|
||||
Path: "",
|
||||
R: "asdf",
|
||||
|
|
@ -97,7 +97,7 @@ func TestMergeChallenge(t *testing.T) {
|
|||
}
|
||||
response := Challenge{
|
||||
Status: StatusValid,
|
||||
Completed: t2,
|
||||
Validated: &t2,
|
||||
Token: "qwer",
|
||||
Path: "qwer",
|
||||
R: "qwer",
|
||||
|
|
@ -106,7 +106,7 @@ func TestMergeChallenge(t *testing.T) {
|
|||
}
|
||||
merged := Challenge{
|
||||
Status: StatusPending,
|
||||
Completed: t1,
|
||||
Validated: &t1,
|
||||
Token: "asdf",
|
||||
Path: "qwer",
|
||||
R: "asdf",
|
||||
|
|
@ -118,7 +118,7 @@ func TestMergeChallenge(t *testing.T) {
|
|||
if probe.Status != merged.Status {
|
||||
t.Errorf("MergeChallenge allowed response to overwrite status")
|
||||
}
|
||||
if probe.Completed != merged.Completed {
|
||||
if probe.Validated != merged.Validated {
|
||||
t.Errorf("MergeChallenge allowed response to overwrite completed time")
|
||||
}
|
||||
if probe.Token != merged.Token {
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ type Challenge struct {
|
|||
|
||||
// If successful, the time at which this challenge
|
||||
// was completed by the server.
|
||||
Completed time.Time `json:"completed,omitempty"`
|
||||
Validated *time.Time `json:"validated,omitempty"`
|
||||
|
||||
// A URI to which a response can be POSTed
|
||||
URI AcmeURL `json:"uri"`
|
||||
|
|
|
|||
Loading…
Reference in New Issue