Commit Graph

20 Commits

Author SHA1 Message Date
Samantha 6fe464bbb2
Export a metric with labels containing build metadata (#6422)
Emit a metric (`version`) with a constant value of '1' labeled by the short
commit-id (`buildId`), build timestamp in RFC3339 format (`buildTime`), and Go
release tag like 'go1.3' (`goVersion`)  from which the Boulder binary was built.

Resolves #6405
2022-10-03 13:54:02 -07:00
Aaron Gable 217be59a3b
Clean up gRPC log adapter (#5902)
Make the `grpcLogger`'s `Warning` methods call the underlying
`Warning` methods on our own logger, rather than upgrading the
severity to `Error`. Move our two filters from the error methods to
the warning methods, since they are warning-level messages in
gRPC. Improve code organization and documentation to make
this struct easier to read next time.
2022-01-25 12:50:40 -08:00
Aaron Gable e0c3e2c1df
Reject unrecognized config keys (#5649)
Instead of using the default `json.Unmarshal`, explicitly
construct and use a `json.Decoder` so that we can set the
`DisallowUnknownFields` flag on the decoder. This causes
any unrecognized config keys to result in errors at boulder
startup time.

Fixes #5643
2021-09-24 10:13:44 -07:00
Aaron Gable bfd3f83717
Remove CFSSL issuance path (#5347)
Make the `NonCFSSLSigner` code path the only code path through the CA.
Remove all code related to the old, CFSSL-based code path. Update tests
to supply (or mock) issuers of the new kind. Remove or simplify a few
tests that were testing for behavior only exhibited by the old code
path, such as incrementing certain metrics. Remove code from `//cmd/`
for initializing the CFSSL library. Finally, mark the `NonCFSSLSigner`
feature flag itself as deprecated.

Delete the portions of the vendored CFSSL code which were only used
by these deleted code paths. This does not remove the CFSSL library
entirely, the rest of the cleanup will follow shortly.

Part of #5115
2021-03-18 16:39:52 -07:00
Aaron Gable ebba443cad
Remove cmd.LoadCert in favor of core.LoadCert (#5165)
Having both of these very similar methods sitting around
only serves to increase confusion. This removes the last
few places which use `cmd.LoadCert` and replaces them
with `core.LoadCert`, and deletes the method itself.

Fixes #5163
2020-11-10 13:00:46 -08:00
Jacob Hoffman-Andrews cb06fe8e13
log: Remove trailing newlines and escape internal newlines. (#4925)
Fixes #4914.
2020-07-06 14:17:23 -07:00
Jacob Hoffman-Andrews 324aaa0571
Intercept stdlib logger (try 2). (#4796)
This builds on #4665 and #4781. The problem we had previously was that
we were relying on a goroutine to consume bytes from a pipe in a
non-blocking manner, which meant that log.Fatal would cause us to exit
before writing out the data.

This version implements an io.Writer so we can make sure the log line
gets written in a blocking manner.
2020-04-27 11:21:43 -07:00
Jacob Hoffman-Andrews 91aa272354
Revert #4665: "Capture output from stdlib `log` library" (#4781)
The problem with this approach is that there is no way to guarantee the output
is copied to syslog / stdout before shutdown. This is particularly evident when
`log.Fatal` is used, because that calls `os.Exit` immediately after `l.Output`,
creating a race condition where the log line might or might not get printed
before the program exits.

Reverting this change means that in case some component does call `log.Fatal`
we'll still get the output from stdout.

This also changes one instance in cmd/shell.go where we call `log.Fatal` to use
`logger.Errf`.
2020-04-16 20:00:47 -07:00
Jacob Hoffman-Andrews 13a0bb32f1
Capture output from stdlib `log` library. (#4665)
Some components, particularly net/http, occasionally output log lines
via log.Print. We'd like to capture these and send them to rsyslog so
all our log data goes to the same place, and so that we can attach log
line checksums to them.

This uses log.SetOutput to change the log output to an io.Pipe,
then consumes that buffer line-by-line in a goroutine and sends it to
our rsyslog logger.

This seems to tickle an unrelated race condition in test/ocsp/helper.go,
so I fixed that too.

Also filters out a noisy and unimportant error from the grpcLog handler.

Fixes #4664
Fixes #4628
2020-02-05 09:28:38 -08:00
Jacob Hoffman-Andrews a98a206dd2 Remove references to test-ca.pem. (#3322)
shell_test.go and publisher_test.go had unnecessary references to
../test/test-ca.pem. This change makes them a little more self-contained.

Note: ca/ca_test.go still depends on test-ca.pem, but removing the dependency
turns out to be a little more complicated due to hardcoded expectations in some
of the test cases.
2018-01-05 12:07:12 -08:00
Jacob Hoffman-Andrews 0a64fd4066 Bring test/config up-to-date. (#3056)
Methodology: Copy test/config-next/* into test/config/, then manually review
the diffs, removing any diffs that are not yet in production.
2017-09-11 16:55:58 -04:00
Jacob Hoffman-Andrews 63a25bf913 Remove clientName everywhere. (#2862)
This used to be used for AMQP queue names. Now that AMQP is gone, these consts
were only used when printing a version string at startup. This changes
VersionString to just use the name of the current program, and removes
`const clientName = ` from many of our main.go's.
2017-07-12 10:28:54 -07:00
Daniel 1426604c0a
Adds test for ReadConfigFile 2016-11-26 18:01:59 -05:00
Daniel b66b54701e
Adds unit test for LoadCert 2016-11-26 17:49:34 -05:00
Daniel 4c1aa631ef
Adds test for VersionString 2016-11-26 17:39:29 -05:00
Daniel 111ab7478b
Adds a unit test for the cfsslLogger proxy. 2016-11-26 17:30:31 -05:00
Daniel 7fc349c890
Adds MysqlLogger test 2016-11-26 17:22:11 -05:00
Jeff Hodges c9010744b4 delete old challenge code
Specifically, delete the simpleHttp and dvsni.

Hooray!

Fixes #894
2015-12-10 15:41:40 -08:00
Richard Barnes 174011f6d8 Move validation and defaults out of UnmarshalJSON 2015-11-09 15:30:13 -05:00
Richard Barnes 38f553c48b Add tests for ValidChallenge 2015-11-07 16:15:42 -05:00