Commit Graph

28 Commits

Author SHA1 Message Date
Aaron Gable b9a681dbcc
Delete notify-mailer, expiration-mailer, and id-exporter (#8230)
These services existed solely for the purpose of sending emails, which
we no longer do.

Part of https://github.com/letsencrypt/boulder/issues/8199
2025-06-12 15:45:04 -07:00
Aaron Gable 83b6b05177
Update golangci-lint to v2 (#8228)
The golangci-lint project has released a v2, which is noticeably faster,
splits linters and formatters into separate categories, has greatly
improved support for staticcheck, and has an incompatible config file
format. Update our boulder-tools version of golangci-lint to v2, remove
our standalone staticcheck, and update our config file to match.
2025-06-06 14:38:15 -07:00
James Renken 648ab05b37
policy: Support IP address identifiers (#8173)
Add `pa.validIP` to test IP address validity & absence from IANA
reservations.

Modify `pa.WillingToIssue` and `pa.WellFormedIdentifiers` to support IP
address identifiers.

Add a map of allowed identifier types to the `pa` config.

Part of #8137
2025-05-14 13:49:51 -07:00
Aaron Gable 212a66ab49
Update go versions in CI and release (#7971)
Update from go1.23.1 to go1.23.6 for our primary CI and release builds.
This brings in a few security fixes that aren't directly relevant to us.

Add go1.24.0 to our matrix of CI and release versions, to prepare for
switching to this next major version in prod.
2025-02-19 14:37:01 -08:00
Phil Porada 0c04b0e3f7
Allow validating config.Duration type (#7564)
Fixes #7505
2024-06-27 13:45:19 -04:00
Aaron Gable d57edfa0f1
Run more go vet checks (#7255)
Enable the atomicalign, deepequalerrors, findcall, nilness,
reflectvaluecompare, sortslice, timeformat, and unusedwrite go vet
analyzers, which golangci-lint does not enable by default. Additionally,
enable new go vet analyzers by default as they become available.

The fieldalignment and shadow analyzers remain disabled because they
report so many errors that they should be fixed in a separate PR.

Note that the nilness analyzer appears to have found one very real bug
in tlsalpn.go.
2024-01-17 12:27:55 -05:00
Jacob Hoffman-Andrews a2b2e53045
cmd: fail without panic (#6935)
For "ordinary" errors like "file not found" for some part of the config,
we would prefer to log an error and exit without logging about a panic
and printing a stack trace.

To achieve that, we want to call `defer AuditPanic()` once, at the top
of `cmd/boulder`'s main. That's so early that we haven't yet parsed the
config, which means we haven't yet initialized a logger. We compromise:
`AuditPanic` now calls `log.Get()`, which will retrieve the configured
logger if one has been set up, or will create a default one (which logs
to stderr/stdout).

AuditPanic and Fail/FailOnError now cooperate: Fail/FailOnError panic
with a special type, and AuditPanic checks for that type and prints a
simple message before exiting when it's present.

This PR also coincidentally fixes a bug: panicking didn't previously
cause the program to exit with nonzero status, because it recovered the
panic but then did not explicitly exit nonzero.

Fixes #6933
2023-06-20 12:29:02 -07:00
Samantha b2224eb4bc
config: Add validation tags to all configuration structs (#6674)
- Require `letsencrypt/validator` package.
- Add a framework for registering configuration structs and any custom
validators for each Boulder component at `init()` time.
- Add a `validate` subcommand which allows you to pass a `-component`
name and `-config` file path.
- Expose validation via exported utility functions
`cmd.LookupConfigValidator()`, `cmd.ValidateJSONConfig()` and
`cmd.ValidateYAMLConfig()`.
- Add unit test which validates all registered component configuration
structs against test configuration files.

Part of #6052
2023-03-21 14:08:03 -04:00
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