Commit Graph
2192 Commits
Author SHA1 Message Date
Michael Gaffney 194b3af678 chore: exclude storage protobuf files from API linting (#2254) 2022-07-11 17:23:09 -04:00
Jeff MitchellandJim 7ab7c8eaf4 Have fallback eventing use json format (#2216)
* Have fallback eventing use json format

The server will initialize a logger via InitFallbackLogger(...)
after setting up the server's logging (and honoring the related
cmd flags).  This fallback logger will be used if when no eventer
is initialized.

If no fallback logger is initialized, then a event.defaultLogger() will
be used if no eventer is defined.

Co-authored-by: Jim <jlambert@hashicorp.com>
2022-07-11 16:12:02 -04:00
Jeff Mitchell fb3b2209e5 Add WithType to worker listing (#2252) 2022-07-11 15:14:22 -04:00
Johan Brandhorst-Satzkorn 0315c999fe fix: support building docker images on M1 (#2250)
Now developers on the M1 can use
DEV_DOCKER_GOARCH=arm64 make docker-build-dev
2022-07-11 11:48:07 -04:00
Jim 3da78aa7e4 refactor (kms): Update dependency required a small refactor (#2253) 2022-07-11 11:40:03 -04:00
Jeff Mitchell 81af61ae7d Add client next protos to KMS connection info (#2246)
This builds on the previous change in the nodeenrollment library to
allow KMS connections to store incoming ALPN NextProto information.
2022-07-08 15:58:57 -04:00
Jeff Mitchell 1596ff3d1c Update against new nodee conn type (#2245) 2022-07-08 14:14:17 -04:00
Jeff Mitchell 6b48346bf3 Add managed worker address fetching (#2244) 2022-07-07 19:02:16 -04:00
Jeff Mitchell ca387223b8 Retry faster on initial status (#2243)
Right now there is a bit of a race condition in that a status call that
indirectly tells the controller that a worker is ready to accept
sessions can have its response unable to be processed in time for an
actual session to come in from a client. It's very unlikely but
technically there.

This changes where we check if we have ever successfully authenticated
from the function called by the ticker to the ticker itself, allowing us
to reset the timer to a very short time if we have not yet
authenticated. We already have the initial timer set to 0 for "as soon
as possible" behavior, but if that initial status failed we'd wait for
the normal interval. Now we will instead continue with the "as soon as
possible" behavior, and reduce the very unlikely race condition to
extremely unlikely.

(There are more permanent fixes but those are bigger and can come
later.)
2022-07-07 12:13:17 -04:00
Todd 155c5f578b Create session manager for workers to use to interact with sessions (#2235) 2022-07-06 13:37:49 -07:00
Danielle Miu 6cbf598369 chore: Prep next release 2022-07-06 16:07:16 -04:00
Danielle Miu 15f8f63b2d chore: Prep for 0.9.1 release 2022-07-06 12:25:30 -04:00
Jeff Malnick 1f66685864 feat: set default connection limit to unlimited (-1) instead of 1 (#2234)
This avoids the confusion behavior of a session terminating as soon
as a single connection using that session is closed.
2022-07-06 12:02:56 -04:00
Haotian 83bf38f030 feat(worker): add/set/delete repo worker tags (#2236)
implements repo changes for add/set/delete worker tag operations
2022-07-05 15:49:21 -07:00
Timothy Messier fd5d15af27 feat(config): Add database config options for idle connection management (#2176)
This adds two new config options for the `database` stanza:

- `max_idle_connections`
- `max_idle_time`

These correspond to settings for the underlying `sql.DB` instance. They
can be used to have finer control over the controller's database
connection pool. For example this can be used to mitigate the high
connection overhead when connecting to postgres by setting a high
`max_idle_connections` and either setting `max_idle_time` to zero or to
a high duration.

Alternatively, if using a connection pool like pgpool-II or pgbouncer,
`max_idle_connections` can be set to 0.

See:
    https://pkg.go.dev/database/sql#DB.SetMaxIdleConns
    https://pkg.go.dev/database/sql#DB.SetConnMaxIdleTime
    https://www.pgpool.net/mediawiki/index.php/Main_Page
    https://www.pgbouncer.org/
2022-07-05 15:25:55 -04:00
Carlos Alcaide Corvo d33c4f7f6d Bump UI version (#2242) 2022-07-05 11:10:09 -07:00
Jeff Mitchell 0d2422aad8 Add Azure dep fix into changelog 2022-07-05 11:41:06 -04:00
Jeff Mitchell 79440c5d82 Add worker resource to perms table (#2241) 2022-07-05 11:34:01 -04:00
Johan Brandhorst-Satzkorn a537491cbc chore: Update changelog with plugin fix (#2240) 2022-06-29 13:23:31 -04:00
Jeff Mitchell d2ce2a81c7 Update azurekeyvault kms plugin 2022-06-29 11:56:32 -04:00
Jeff Mitchell b8eb87561c Update configutil dependency in sdk 2022-06-28 19:55:39 -04:00
Johan Brandhorst-Satzkorn ed406e2853 fix: Upgrade configutil dependency (#2239)
Fixes https://discuss.hashicorp.com/t/latest-boundary-versions-ignoring-plugins-execution-dir/41281

See: https://github.com/hashicorp/go-secure-stdlib/commit/bf6d78ef5b727b83b2f8f41b473eb9764b446df4
2022-06-28 15:12:36 -04:00
Damian Debkowski 3e9c99c217 refactor(user_password) rename all references of user_password to username_password (#2232) 2022-06-27 14:03:12 -07:00
Damian Debkowski afd4437492 fix(error) validate credential store id when creating username/password credentials (#2231) 2022-06-24 09:16:11 -07:00
Todd 9af6c09c36 Move generated pb.go file in to the internal/gen directory (#2225) 2022-06-23 12:16:16 -07:00
Robin Beck 0ff4be119e updates learn links (#2230) 2022-06-23 12:06:39 -06:00
Jeff Mitchell 396edfca80 Add an extra cleanup task for sessions stuck in canceling state (#2229)
* Add an extra cleanup task for sessions stuck in canceling state

See the comment on the migrations file for details.
2022-06-23 12:25:55 -04:00
Louis Ruch 4cacd0a605 bug(scheduler): Fix controller id length check (#2226)
* bug(scheduler): Fix controller id length check

The job_run table has a foreign key to the server_controller private_id.
While this column is called a prviate_id it does not implement the wt_private_id
postgres domain type, and therefore does not have a minimum length of 10 characters.
2022-06-22 13:20:27 -07:00
Jeff Mitchell 86141ffb65 Add some OSS/HCP Boundary distinctions in docs (#2227) 2022-06-22 03:31:16 -04:00
c05fa66096 Hashiconf docs changes (#2178)
Co-authored-by: Robin Beck <stellarsquall@users.noreply.github.com>

Co-authored-by: XingLu Wang <95828202+xingluw@users.noreply.github.com>

Co-authored-by: Loann Le <84412881+taoism4504@users.noreply.github.com>

Co-authored-by: Jeff Mitchell <jeffrey.mitchell@gmail.com>

Co-authored-by: irenarindos <irena.rindos@gmail.com>

Co-authored-by: Irena Rindos <irenarindos@users.noreply.github.com>

Co-authored-by: Louis Ruch <louisruch@gmail.com>

Co-authored-by: XingLu Wang <xinglu.wang@hashicorp.com>

Co-authored-by: XingLu Wang <95828202+xingluw@users.noreply.github.com>
2022-06-22 02:37:49 -04:00
Timothy Messier 5c83182cc7 Merge pull request #2184 from hashicorp/tmessi-reduce-test-output-noise
This introduces two changes to reduce the output of tests in CI and for
local developers:

- Silences gorm db logs
- Silences log indicating the lack of an eventer
2022-06-21 10:51:04 -04:00
Timothy Messier 21c0509a82 chore(event): Reduce log noise for tests
This silences error messages when:
- There is no eventer in the context.Context
- There is no SysEventer
- And a new env var is set

Previously when the first two conditions where met, the error was logged
to a default hclog.Logger with the error being wrapped in a message to
note the lack of an eventer. In production this is a very important
message to help operators fix a likely misconfiguration.  However, in
tests it is common to not have an eventer setup, meaning this generates
a lot of noise. This uses the CI environment variable which is an
environment variable set by most common CI environments. Developers can
set this variable locally to reduce the log noise:

    export CI=true

See:
    https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables
    https://circleci.com/docs/2.0/env-vars/#built-in-environment-variables
    https://docs.travis-ci.com/user/environment-variables/#default-environment-variables
2022-06-21 14:28:02 +00:00
Timothy Messier f3c90df300 chore(db): Silence db logs by default for tests
This removes a lot of log clutter from normal test execution with `go
test -v`. There are a number of test that expect no results from the
database or other error cases from the database. The previous default
log level of dbw.Error would cause these cases to generate logs in the
success case, creating noise in the test output.

The new default for tests is dbw.Silent. This can be overriden in two
ways. A test can be updated to pass in the db.WithTestLogLevel option,
which allows for targeting specific tests to include additional output.
This may make sense for tests that normally should not cause errors, but
would report an error if it fails.

Alternatively a new environment variable can be set,
DEFAULT_TEST_LOG_LEVEL. This allows for adjusting the log level without
changing any test file. The environment variable should be set to the
string value of the log level, and is treated as case insensitive, ie:

    export DEFAULT_TEST_LOG_LEVEL="error"
2022-06-21 14:28:02 +00:00
Timothy Messier 07a9789abc chore(release): Format hcl 2022-06-21 14:17:48 +00:00
Sam Salisbury cb9bdbe7e4 fix actions-docker-build invocation (#2223) 2022-06-21 14:26:27 +01:00
Todd 19b549c44a Rename package servers to server (#2222) 2022-06-20 18:20:17 -07:00
Michele Degges fb0e5ea1ce [CI-only] Notarize darwin arm (#2221)
Currently, darwin arm binaries are not being notarized (called out by Louis!) This adds that in.
2022-06-20 17:34:45 -07:00
Louis Ruch 07406c2d18 chore(release): prep for next release 2022-06-20 12:26:22 -07:00
Jeff Mitchell ffa7dea4f6 A bit more changelog wordsmithing 2022-06-20 12:51:01 -05:00
Jeff Mitchell 093af978fa Minor wordsmithing on changelog 2022-06-20 12:50:33 -05:00
Cameron Perera bebe4f5c37 update ui version to latest commit on main (#2220) 2022-06-20 13:08:10 -04:00
Jim aaf669a044 fix (API): check attributes missing appropriately. (#2219)
* fix (API): check attributes missing appropriately.
2022-06-19 10:55:37 -04:00
Louis Ruch 08c2e71272 chore(release): prep changelog for release 2022-06-18 13:49:28 -07:00
Jim 4114917d27 chore (changelog): add pki workers (#2218) 2022-06-18 16:46:33 -04:00
Dharini Jeeva f3e234cc16 bump up ui version which includes static cred updates (#2217) 2022-06-18 15:17:04 -04:00
Jeff Mitchell f5bf3b2c0c Add events on session activation and connection authz/close (#2215)
* Add events on session activation and connection authz/close

* Only send success event on actual success
2022-06-17 16:20:01 -04:00
Jeff Mitchell c31b8a4383 Fix harmless but nasty-looking error (#2214)
If a worker starts up and tries to connect to a controller before the
controller has a chance for its rotate roots job to run, it'll spit out
a nasty-looking error. It's harmless (things just retry and then work)
but scary (`tls: internal error`).

Rotating at creation time ensures that it's ready by the time a worker
is able to perform any connection against the cluster port.
2022-06-17 16:08:01 -04:00
Jeff Mitchell 77c3ce1cd2 Update nodeenrollment to v0.1.4 2022-06-17 15:07:15 -05:00
Jeff Mitchell 90c6b1bad8 Update nodeenrollment dep to 0.1.3 2022-06-17 13:03:07 -05:00
Johan Brandhorst-Satzkorn 77bc45ae62 chore: Split proto breaking change detection config (#2212)
We generally care about preserving JSON compatibility for protobuf
files, but for some files, where we only use pure gRPC, we only
care about preserving wire compatibility.

Split our buf breaking invocation into two invocations, one that checks
for WIRE_JSON compatibility, and one that checks only for WIRE
compatibility. The former check ignores protos in controller/servers,
since they do not need to adhere to this stricter definition.
2022-06-17 11:58:37 -04:00