Commit Graph
142 Commits
Author SHA1 Message Date
Rafał Cieślak 81f319d3e3 build.assets Dockerfiles: Remove unnecessary ENV NODE_URL, pass fsSL to curl (#23182)
* build.assets Dockerfiles: Remove unnecessary ENV NODE_URL

NODE_URL is being redefined within the RUN instruction anyway. We suspect
it might be causing problems because sometimes the logs from build failures
suggest that the NODE_URL export was either ignored or ${NODE_URL} passed
to curl reads ENV NODE_URL and not the env var set within the shell.

* Pass fsSl flags to curl
2023-03-16 15:40:55 +00:00
Alan Parra 1787ae657d chore: Bump gci and golangci-lint (#22881)
* chore: Bump gci to v0.9.1

* chore: Bump golangci-lint to v1.51.2
2023-03-10 15:35:47 +00:00
Alan Parra c141bc2e6e chore: Bump Buf to v1.15.1 (#22841)
Update Buf to the latest version.

No format, lint or codegen changes.

https://github.com/bufbuild/buf/releases/tag/v1.15.1
2023-03-09 21:01:49 +00:00
Jakub Nyckowski 7e0479fa00 Use curl -fsS when downloading libbpf (#22425)
Related: #22380
2023-03-01 18:25:21 +00:00
Alan Parra 0ea9b9b377 chore: Bump Buf to v1.15.0 (#22430) 2023-03-01 15:10:39 +00:00
Tim Buckley f8681cf3d4 Make curl fail on server error when downloading binaries in buildbox (#22380)
* Make curl fail on bad URLs when downloading `buf` in buildbox

* Use `-f` everywhere, remove debugging

* `-f`-ify the other build.assets Dockerfiles
2023-02-28 22:28:25 +00:00
Alan Parra 1624d9807a Bump Buf to v1.14.0 (#21802)
Keep up with latest releases.

No format, lint or codegen changes.

* https://github.com/bufbuild/buf/releases/tag/v1.14.0
2023-02-14 17:06:14 +00:00
Jakub Nyckowski caddc88262 BPF build fix (#21770)
* BPF build fix

https://github.com/gravitational/teleport/pull/21745 switched CentOS 7 image to the upstream, but I missed a few other places were we're using our fork.
This change fixes all places.

* Add missing FIPS changes

* Update e
2023-02-14 00:34:26 +00:00
Jakub Nyckowski d1be9b1a57 Install libbpf 1.0.1 in buildboxes (#21596)
* Install libbpf 1.0.1 in buildboxes

* Remove unused deps when building libbpf
2023-02-13 14:15:54 +00:00
Rafał Cieślak 94ec267823 Update JS grpc-tools to 1.12.4 (#21452)
* Update JS grpc-tools to 1.12.4

1.11.2 didn't have support for arm64 so we had to do all this extra stuff
in the Dockerfile.

1.11.3 added support for Darwin arm64 and 1.12.4 finally adds support for
Linux arm64. This means we can completely remove extra cruft and just
install grpc-tools 1.12.4 on all architectures.

* Add comment to ptyHostService.proto
2023-02-09 07:40:45 +00:00
Jakub Nyckowski 79ebdc89c8 Bump golangci-lint to v1.51.1 (#21440) 2023-02-08 00:44:08 +00:00
Alan Parra bb5f828cd8 Bump OpenSSL and libcbor (#21420)
* Bump libcbor to v0.10.2

* https://github.com/PJK/libcbor/releases/tag/v0.10.2

* Bump OpenSSL to 1.1.1t

* https://github.com/openssl/openssl/blob/OpenSSL_1_1_1t/CHANGES
2023-02-07 18:58:54 +00:00
Hugo Shaka 12cec1db15 Pin helm-unittest plugin because of a broken release (#21013) 2023-01-31 20:02:01 +00:00
Alan Parra 4f30210153 Bump Buf to v1.13.1 (#20856) 2023-01-28 00:42:15 +00:00
Alan Parra 9e4ece3688 Rearrange buildbox layers for faster updates (#20822)
Rearrange buildbox layers so we take better advantage of layer caching, leading
to faster build times and better layer reuse for small changes.
2023-01-27 17:49:14 +00:00
Alan Parra bbcfc05ca4 Bump Buf to 1.13.0 (#20814)
Keep up with the latest updates.

No format, lint or codegen changes.

https://github.com/bufbuild/buf/releases/tag/v1.13.0
2023-01-27 17:34:36 +00:00
Rafał Cieślak 81d898628c Add docs on how to safely update build box Dockerfiles (#20559) 2023-01-26 14:13:28 +00:00
Rafał Cieślak 6791b48da9 Remove grpc-teleterm Make target and Dockerfile-teleterm (#20032)
* Remove CLANG_FORMAT from Makefiles

It was used to format protos but we use Buf for that since v10.

* Move installing grpc_node_plugin into Dockerfile

This commit basically takes grpc_node_plugin compilation from
Dockerfile-teleterm and moves it to Dockerfile.

* Replace Dockerfile-teleterm with Dockerfile

After moving grpc_node_plugin compilation to Dockerfile, the only remaining
thing that Dockerfile-teleterm does is installing rpm so that we can make
an RPM package for Connect during tag builds.

Installing this package can be simply moved to Dockerfile.

* Remove grpc-teleterm Make target in favor of grpc

* Add updated protobufs

It looks like they're a result of someone changing protos in lib/prehog
without running `make grpc-teleterm` separately. Which is why we're getting
rid of grpc-teleterm as a separate Make target in the first place. ;)
2023-01-26 09:41:07 +01:00
Jeff Pihach 30d51b6680 Add node and yarn to the buildboxes in preparation for the webapps merge (#20339)
* Add node and yarn to the buildboxes in preparation for the webapps merge.
2023-01-18 17:56:04 +00:00
Alan Parra e1a8604179 Bump Buf to v1.12.0 (#20155)
Keep up with the latest releases.

No lint, format, or codegen changes.

https://github.com/bufbuild/buf/releases/tag/v1.12.0
2023-01-13 15:18:12 +00:00
Alan Parra ac0129bd9d Bump libcbor from v0.9.0 to v0.10.1 (#19797)
Keep up with latest releases.

Dropped `-DCBOR_CUSTOM_ALLOC=ON`, since it's now obsolete (custom alloc is always on).

Release notes:
* https://github.com/PJK/libcbor/releases/tag/v0.10.0
* https://github.com/PJK/libcbor/releases/tag/v0.10.1
2023-01-04 15:26:46 +00:00
Alan Parra 4237ad3cc7 Bump Buf to v1.11.0 (#19515)
Update Buf to the latest release. No formatting, linter, or codegen changes.

https://github.com/bufbuild/buf/releases/tag/v1.11.0
2022-12-20 22:42:27 +00:00
Alan Parra f87fdc9f49 Bump shellcheck to v0.9.0 (#19379)
Keep up with new shellcheck releases.
2022-12-14 22:49:38 +00:00
Alan Parra f0333a34a5 Bump Buf to v1.10.0 (#19162)
Bump Buf to the latest version (housekeeping so we keep up with the releases).
No lint/format/generate changes.

See https://github.com/bufbuild/buf/releases/tag/v1.10.0.
2022-12-07 22:13:41 +00:00
Hugo Shaka 16b3059a24 Add new helm unittest plugin fork into the buildbox (#18945) 2022-12-02 22:38:50 +00:00
Jakub Nyckowski bbeb879b69 Fix buildbox build on arm64 (#18745) 2022-11-25 18:58:35 +00:00
Roman TkachenkoandVictor Sokolov d9bc3371c5 Install latest git to buildbox (#18498)
Signed-off-by: Roman Tkachenko <roman@goteleport.com>
Co-authored-by: Victor Sokolov <gzigzigzeo@gmail.com>
2022-11-15 19:44:12 -05:00
Jakub NyckowskiandAlan Parra bea2e89df5 Run GCI as make fix-imports (#17956)
Co-authored-by: Alan Parra <alan.parra@goteleport.com>
2022-11-04 15:46:46 +00:00
Alan Parra 315bc0997a Bump shellcheck to v0.8.0 (#18014)
Bump shellcheck to the more recent version, pulling from GitHub instead of apt.

See https://github.com/koalaman/shellcheck/tree/v0.8.0#installing (pre-compiled
binaries).
2022-11-03 16:16:50 +00:00
Alan Parra 02315f50d3 Bump Go tooling (#17721)
Updates:

* Buf: 1.8.0 -> 1.9.0
* golangci-lint: 1.50.0 -> 1.50.1

Release notes:
* https://github.com/bufbuild/buf/releases/tag/v1.9.0
* https://github.com/golangci/golangci-lint/releases/tag/v1.50.1

Additionally, add a fixed version for googleapi protos (noop change) and
reformat protos using the new Buf version.
2022-10-25 17:05:38 +00:00
Zac Bergquist d5b8f94d8b Disable desktop access for 32-bit ARM and 386 architectures (#17537)
Devices running these architectures are likely not powerful enough
to handle desktop sessions. This will also reduce the binary size
for these builds, making them slightly more convenient for smaller
resource-constrained devices.
2022-10-20 22:39:58 +00:00
Alan Parra b289295f93 Move away from deprecated protoc-gen-go plugin (#17267)
Moves from github.com/golang/protobuf protoc-gen-go plugin to google.golang.org/
plugins.

This change was a long-time coming, but is now possible to do since our
dependencies are up-to-date.

* Move away from deprecated protoc-gen-go plugin
* Embed unimplemented server in handler.Handler
* Embed unimplemented server in multiplexer_test.go
* Update generated protos
2022-10-13 14:01:44 +00:00
Alan Parra f9f0ca339e Bump grpc-related dependencies (#17265)
Bumps:

* protoc to v3.20.3
* protoc-gen-go to v1.5.2 (github.com/google/protobuf version, Teleterm only)
* google.golang.org/grpc to v1.50.0
* google.golang.org/grpc/examples
2022-10-11 14:29:01 +00:00
Alan Parra 2b44e5f23e Bump golangci-lint to 1.50.0 (#16966)
Update golangci-lint to v1.50.0 and fix a few linter issues.
2022-10-04 17:28:23 +00:00
Alan Parra 9b99a4831c Update libfido2 to 1.12.0 (#16732)
Update libfido2 to the latest release.

Centos7 builds require a newer toolchain: [-Wimplicit-fallthrough][1] is the
first hurdle for the old toolchain, but there are more after it.

Release notes: https://developers.yubico.com/libfido2/Release_Notes.html.

[1]: https://github.com/Yubico/libfido2/blob/659a02679f99fd34a44e06e35dce90794f6ecc86/CMakeLists.txt#L281
2022-09-28 14:13:25 +00:00
Alan Parra a75fcc21d8 Update golangci-lint to 1.49.0 (#16507)
Update metalinter, fix a few lint warnings and replace deprecated linters.

`deadcode`, `structcheck` and `varcheck` are abandoned and now replaced by [`unused`][1].

Since 1.19, `go fmt` reformats godocs according to https://go.dev/doc/comment. I've done a bulk-reformatting of the codebase to keep the linter happy. Backporting is mostly harmless (the exception being `lib/services/role_test.go`, that for some reason breaks the _old_ linter using the new format).

[1]: https://golangci-lint.run/usage/linters/

* Bump golangci-lint version
* Replace abandoned linters
* Fix bodyclose on lib/auth/github.com
* Fix bodyclose on lib/kube/proxy/streamproto/proto_test.go
* Fix bodyclose on lib/srv/alpnproxy/proxy_test.go
* Fix bodyclose on lib/web/conn_upgrade_test.go
* Silence staticcheck on lib/kube/proxy/forwarder_test.go
* Silence staticcheck on lib/utils/certs_test.go
* Address BuildNameToCertificate deprecation warnings
* Run `go fmt ./...`
* Run `go fmt ./...` on api/
* Ignore formatting in role_test.go
* Remove redundant initializers in lib/srv/uacc/
* Update e/
2022-09-19 22:38:59 +00:00
rosstimothy 739e4e12b4 Update buf version (#16499) 2022-09-19 21:41:24 +00:00
Trent Clarke 758c968748 Adds libpcsclite to buildbox & release image for PIV integration (#16083)
Adds libpcsclite to buildbox for PIV integration

See-Also: #15335
2022-09-05 21:40:47 +10:00
Alan Parra 0baf1d38d3 Drop libudev-dev from buildbox dependencies (#16099)
We use a manually-built libudev-zero, so that dependency is not required.
2022-09-02 15:54:06 +00:00
Alan Parra 0b76b44973 Use to Buf to lint, format and generate api/ protos (#15856)
Change the proto layout of `api/` to a more standard setup, allowing the use of
modern tools (like Buf) to format/lint (and maybe, one day, generate sources).

The new layout looks like this:

``` api/ proto/       <- root of protos and proto imports teleport/  <- base
package for Teleport protos (akin to "google/" or "gogoproto/") legacy/  <- root
of "legacy" protos (most linters disabled) client/ proto/ types/ events/
webauthn/ wrappers/ ```

Non-legacy `api/` protos are expected to follow this layout:

``` api/ proto/ teleport/ mynewpackage/  <- package name v1/          <- protos
explicitly versioned gen/      proto/  <- root for generated sources
(multi-language possible, separate from hand-written code) go/ mynewpackage/ v1
<- generate Go sources go here. ```

Some outstanding issues, like lack of `go_package` declarations and non-standard
import paths (`import "github.com/gravitational/teleport/.../some.proto"`) are
fixed.

Legacy protos still have irregular package declarations. It's possible to fix
that, but it's a bit harder to reason about, as generated sources change in
possibly-meaningful ways.

Future iterations could change legacy packages to match the directory structure
and apply a similar change to protos within lib/ packages, but this seems
sufficient for a first step.

* Add Buf to buildbox
* Unify API protos under Buf
* Fix proto generation
* Reformat protos
* Update generated protos
* Generate protos using Buf
* Appease linter
* Review: make sure gogo protobuf versions are in sync
* Clean leftovers from previous attempts
* Fix operator/Makefile
* Rename internal make gRPC targets to `*/host`
* Sort `make fix-license` targets (nit)
2022-08-26 18:11:38 +00:00
Edoardo Spadolini 0985151b02 Build-time cbindgen (#14177) 2022-07-19 20:10:27 +00:00
Trent Clarke e3ced072b7 Trims the buildbox (#14036)
- Enables the docker BuildKit in an attempt to speed up builds
 - Trims slightly under 2GB off image size
 - Break more dependencies out into separate build stages
 - Adds some simple supply-chain protections for dependencies sourced
   via git. The Docker build now checks that the commit SHAs are what
   we expect, and not just assume that the tags haven't changed.
 - Moves the `cbindgen` build to a stage to avoid pulling in extra
   dependencies not needed for the Teleport build
 - Combines the `gcloud` and firestore emulator install into one step to
   reduce the layer count.
 - Ports some of the above the Centos7 Dockerfile.
2022-07-07 12:28:35 +10:00
Zac Bergquist 61463166c1 Remove tctl roletester (#13863)
This code was unmaintained, created issues with our build system,
and didn't actually match the behavior of Teleport's RBAC engine.

We will revisit this functionality in the future when we investigate
"acess policies as code."
2022-06-25 04:01:21 +00:00
Zac Bergquist 8c7eb94c4b Fix CentOS 7 builds after upgrading prost (#13579)
Recent Rust dependency upgrades include a newer version of prost.
This new version no longer ships embedded protoc binaries, and
instead tries to build protoc from source. This would require us
to install cmake on our buildboxes. We want to avoid this and
instead leverage the version of protoc already installed.

This change was made to the standard buildbox, but the CentOS 7
buildbox was missed.

Additionally, I noticed that Rust was installed in
Dockerfile-centos7-fips, but not in Dockerfile-fips, which means
the FIPS binaries have different functionality depending on which
version you use. To correct this, I removed Rust from the CentOS 7
FIPS builds (since the Rust features are not FIPS compliant anyway).
2022-06-17 15:05:39 +00:00
Joel 3b394ae431 fix master CD by pointing prost at protoc (#13461) 2022-06-14 10:53:33 +00:00
Alex McGrath 5ef7270111 Add sudo to the Dockerfile (#13334) 2022-06-09 14:57:47 +00:00
Alan Parra 7567c5502d Build tsh with static libfido2 for macOS (#13001)
Add a script to build libfido2 (and its dependencies) on macOS and enable FIDO2
static builds.

I decided to build all dependencies instead of pulling from Homebrew for a few
reasons:

1. There is no libcbor.a in a brew package
2. This captures library versions within the Teleport source code, allowing us
   to build binaries against different versions of libfido2 (and its
   dependencies).

I've also bumped libfido2 to 1.11.0. I've been running it locally and we are
still pre-release, so it seems like a good time to do it.
(See https://developers.yubico.com/libfido2/Release_Notes.html.)

#9160

* Build libfido2 and dependencies for macOS
* Build tsh with static fido2 on Drone
* Bump libfido2 versions in all builds
* Attempt to appease linters
* Use temp dirs inside LIB_CACHE
* Move LIB_CACHE outside of HOME

HOME is reassigned in macOS builders, but we want a "stable" cache
directory. /tmp is used by build-package.sh and build-pkg-tsh.sh.

* Rename script to build-fido2-macos.sh
* Regenerate Drone files
2022-05-31 14:50:56 +00:00
Zac Bergquist a7ab44f15b Fix linter after Go 1.18 upgrade (#12585)
* Update golangci-lint

To accomodate the recent Go 1.18 upgrade

* Fix new lint warnings as a result of linter upgrade

* Set golangci-lint to Go 1.18 mode

golangci-lint will automatically skip linters that don't have support
for Go 1.18.

See: https://github.com/golangci/golangci-lint/issues/2649
2022-05-11 21:53:37 +00:00
Alan Parra af3488211c Reinstate FIDO2 builds for amd64/Centos7 and use pkg-config (#12093)
Reinstates Linux/amd64 and Centos7/amd64 builds using libfido2, now hidden
behind an explicit FIDO2 flag (similarly to FIPS).

This PR pulls in gravitational/go-libfido2#4 and adds the required pkg-config
setup so we can perform both dynamic (mostly testing) and static (tsh) builds.
Additionally, pkg-config is now the gateway for whether we run libfido2-related
tests (which should always happen in CI).

#9160

* Re-enable libfido2 builds for amd64 and Centos7
* Use pkg-config to build tsh with libfido2
* Install Centos7 libudev-zero to /usr/local/lib64
* Update gravitational/go-libfido2
* Remove /usr/local/lib from Centos PKG_CONFIG_PATH
2022-04-28 16:32:02 +00:00
Alan Parra 4534d97a95 Keep root as the default buildbox user (#12032)
Fixes breakages on GCB and Drone.

* Keep root as the default buildbox user
* Disable static tsh+fido2 builds
2022-04-18 18:06:59 +00:00