Commit graph

292 commits

Author SHA1 Message Date
Zac Bergquist ff4c307453
Update to Go 1.18.3 (#13103) 2022-06-02 16:10:57 +00:00
Alan Parra 8b104d1860
Consistently set macOS min version (#13070)
Set the macOS deployment target, ensuring that statically linked libfido2 `tsh`
builds run correctly on older macOS versions.

#9160

* Consistently set macOS min version
* Bump min macOS version to 10.13
2022-06-02 15:13:24 +00:00
Zac Bergquist 1286528748
Update Rust to 1.61.0 (#12779) 2022-06-01 22:24:21 +00:00
Alan Parra 1af3c11acf
Make sure LIB_CACHE exists before creating temp dir inside it (#13035)
Fixes Drone breakage.

#9160
2022-05-31 19:22:17 +00:00
Alan Parra 8302d467d1
Improved touch ID availability and diagnostics (#12963)
Since #12794 we now build `tsh` binaries with touch ID capabilities. This calls
for a more sophisticated mechanism to determine if touch ID functions should be
enabled, as compile-time support only is not enough.

I've added the following checks, on top of compile-time / `touchid` build tag:

Binary is signed
Binary has entitlements
Machine is touch ID capable
Machine has a Secure Enclave
Put together this give us a much better proxy on whether to enable touch ID.

I've also added the `tsh touchid diag` command, mentioned in the Passwordless
macOS RFD (see
https://github.com/gravitational/teleport/blob/master/rfd/0054-passwordless-macos.md#tsh-support-commands).

#9160

* Improved touch ID availability and diagnostics
* Add the `tsh touchid diag` command
* Set min macOS version to 10.12 (macOS Sierra)
2022-05-31 17:10:06 +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
Alan Parra 99ad5c59a4
Build macOS installer for tsh.app (#12751)
Changes how `make pkg-tsh` works so instead of building an installer for the
`tsh` binary, placed under `/usr/local/bin`, we install an app to
`/Applications/tsh-vXXX.app` and link its `tsh` binary to `/usr/local/bin`.

The app shell is necessary to distribute a provisioning profile along with the
signed/entitled/notarized binary. All of that is required for Touch ID to work.
Naked `tsh` binaries are unable to use Touch ID, even if built with the correct
build tags.

I've elected to split the logic from `build-package.sh` into a separate script -
it already does too much as-is. `build-pkg-tsh.sh` is more idiomatic, clears
additional `shellcheck` rules and is easier to dry-run.

#9160

* Build macOS installer for tsh.app
* Add resources to build the tshdev app
Moved from e/

* Add resources to build the tsh app (prod)
* Use production values
* Remove 'tsh' mode from build-package.tsh
* Appease buildbox linter
* Clarify one-time setup
2022-05-23 20:56:21 +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
Zac Bergquist f0bb6b4fef
Update to Go 1.18 (#12578)
And update e ref to pick up gravitational/teleport.e#424
2022-05-11 11:23:50 -06: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
Gus Luxton 8852a3e01d
docker: Add lint-helm to build.assets Makefile (#12178) 2022-04-26 12:01:01 +00:00
Alex McGrath c40d6dc701
Add enter-root to makefile (#12141) 2022-04-22 10:50:24 +00:00
Gus Luxton 6090379bce
docs: Don't lint external links when running in CI (#12058)
Original behaviour did not take effect in CI due to a different entrypoint.

This restores the original behaviour (which will link external links when using make -C build.assets test-docs) but disables the external linting in CI for reliability.

Updates #11940
2022-04-19 16:00:17 +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
Alan Parra 9c89c00806
Build tsh with static libfido2 in buildbox and Centos7 (#11849)
Build `tsh` with static `libfido2`, `libcbor`,`libcrypto` and `libudev-zero`.

Dockerfiles for buildbox and Centos7 changed. FIPS and macOS to be addressed at
a later date.

Add the `tsh fido2 diag` hidden command for ease of testing.

#9160

* Update go-libfido2 and tidy modules
* Add a fido2 diagnostic command to tsh
* Add a few build artifacts to .gitignore
* Build tsh with static libfido2 in buildbox
* Build tsh with static libfido2 in centos7
* Add a few relevant cmake flags
* Use illiliti/libudev-zero
* Do multi-stage build on centos7, image tweaks
* Add `make enter/centos7`
* s/OFf/OFF/g
2022-04-18 14:07:10 +00:00
Gus Luxton 0dac87080c
docs: Don't lint external links (#11940)
These tests are regularly registering false failures, likely due to rate limiting on the web hosts which are serving the external links.
2022-04-15 04:48:03 +00:00
Roman Tkachenko 715dbb8a5d
Bump Go to 1.17.9 (#11931) 2022-04-14 02:35:00 +00:00
Edoardo Spadolini a35b5c1959
Display elapsed time in render-tests output (#11828) 2022-04-12 14:25:09 +00:00
Rafał Cieślak 6fb9f871a3 Add grpc-teleterm Makefile target
The grpc-tools package is needed to generate gRPC files for JavaScript.
However, at the moment it can't be installed on M1 MacBooks because of
missing prebuilt binaries for arm64. [1]

One of them, protoc, is already installed in our buildbox. We still need
to compile grpc_node_plugin from source though. This adds significant
overhead as we need to pull in cmake, build-essential and then about
300 MB of git repos from protocolbuffers/protobuf.

Initially, those Teleterm gRPC were generated within `make grpc` with other
files. M1 users who don't work on Teleterm would not be happy about incurring
that additional overhead, hence I extracted everything into separate target
and Dockerfile.

Teleterm proto files don't depend on any other proto files. Once grpc-tools
adds support for arm64, we'll be able to essentially almost revert this
commit and generate Teleterm gRPC files within `make grpc`.

[1] https://github.com/grpc/grpc-node/issues/1405
2022-04-01 13:02:56 +02:00
Alexey Kontsevoy 4d0c0b2c84 teleterm (alpha) 2022-04-01 13:02:56 +02:00
Alan Parra 0d9354a424
Run tests and lint libfido2 code on buildbox (#11547)
- Lint libfido2 (and other) Go build tags
- `make test-go` exercises the libfido2 build tag, as long as `libfido2` is present in the system
- Install `libfido2` (and dependencies) in the teleport-buildbox image

Libraries are installed from source, instead of apt or ppas, so we can guarantee deterministic (and current!) versions.
(Binary releases are not available.)

At the present moment, `librdp_client` and `libfido2` can't be used together. This is because `librdp_client` embeds
openssl/`libcrypto`, which is also a dependency for `libfido2`, causing duplicate symbol errors. In practice both
libraries never coexist in the same binary, so it's easy to sidestep the issue (`librdp_client` links to `teleport`,
while FIDO2 code is only used by `tsh`). I may be able to make them coexist, but not without changes to how go-libfido2
builds.

This change is only for linting/testing libfido2 code, I'll address `tsh` releases in a future PR.

#9160

* Install libfido2 in buildbox

libfido2 and libcbor are installed from source to make sure we get
deterministic versions (apt is outdated and ppas are likely to move
forward with time).

* Run libfido2 tests on test-go
* Lint libfido2 Go build tag
* Lint other Go build tags
* Comment build tags that break the linter
* Tidy modules
* Re-enable roletester linter
* Pass tags conditionally to golangci-lint
* Clarify and improve libfido2 wildcard
* Drop `:$LD_LIBRARY_PATH` from variable
* Replace LD_LIBRARY_PATH with `ldconfig`
* Test for ARM homebrew location too
2022-03-30 17:52:29 +00:00
Edoardo Spadolini fb4ae0f280
Fix 32-bit arm deb and 64-bit arm rpm packages (#11318) 2022-03-29 16:46:55 +00:00
fheinecke 1daf7d2302
[master forward-port] Fixed RPMs using artifacts compiled against a too-new version of glibc (#11026)
* Fixed RPMs using artifacts compiled against a too-new version of glibc

* Fixed RPM naming issue

* Apply suggestions from code review

Co-authored-by: Gus Luxton <gus@goteleport.com>

Co-authored-by: Gus Luxton <gus@goteleport.com>
2022-03-25 20:55:31 +00:00
Zac Bergquist 3c74adf218
Add Helm unit tests (#11062)
* POC for Helm unit tests

This uses https://github.com/vbehar/helm3-unittest to define
expectations of our helm templates

* Test that enterprise is configured correctly

* Added tests for teleport-cluster

* Added tests for teleport-kube-agent

* Removed tests for teleport chart

* Add tests for teleport-cluster Deployment

* Run shorter tests first

* Fix Docker plugin installation and add update-helm-snapshots target

* Add README

* Fix lint syntax error and add some missing linters

* Add missing ImagePullPolicy to Deployment and StatefulSet

* Add Deployment tests for teleport-kube-agent

* Fix replicaCount logic

* Add clarification to values

* Add StatefulSet suite for teleport-kube-agent

* Update snapshots after merge with master

* Helm tests are quicker than bash tests

* Add tests for extraEnv

* Random space

* Tidy up formatting of multiple tests

* [debug] List helm plugins and directories

* Special case Helm linting when running in CI

* Make trailing line breaks consistent

* Special case Helm linting when running in CI

* Add contribution guidelines for Helm charts

* Add contribution guidelines to READMEs

* Deprecate old charts

* Typo

* Spacing

* Clarification

* Update examples/chart/CONTRIBUTING.md

* Don't erroneously set extraEnv for initContainers

* Rename update-helm-snapshots -> test-helm-update-snapshots for clarity

Co-authored-by: Gus Luxton <gus@goteleport.com>
Co-authored-by: Roman Tkachenko <roman@goteleport.com>
2022-03-20 19:01:58 +00:00
Gus Luxton 0d257c4e0b
ci: Add helm3-unittest into CI Dockerfile (#11187)
Required for #11062 to work
2022-03-17 15:10:39 +11:00
Brian Joerger 3fc479c146
Update gomod path for beta/alpha pre-releases. (#10866) 2022-03-10 01:44:24 +00:00
Walt eae66c0ed3
Do not block apt publishing if there is a more current pre-release (#10804)
We do not publish pre-releases to apt repos, but we do publish them to
github.  That means we need to filter them out when considering if an
apt release should be published.  We don't want v8.3.3 to be blocked by
v9.0.0-dev.1, only by v9.0.0.

Honestly, this is a bit of a mess, but it only needs to hold out a bit
longer until https://github.com/gravitational/teleport/pull/10746 lands.

Contributes to https://github.com/gravitational/teleport/issues/10800
2022-03-04 06:46:27 +00:00
Tim Buckley 6d83fed8d7
Include tbot binary in Teleport packages and installs (#10646)
* Include tbot binary in Teleport packages and installs

This includes the tbot binary in .rpm, .deb, and .pkg distributions,
and ensures the binary is installed using the `install` script in
.tar.gz packages.

* Remove tbot from macOS client-only builds
2022-03-03 03:25:23 +00:00
Trent Clarke 3beb29832f
Upgrade buildbox to go 1.17.7 & tag as teleport10 (#10611)
Prior to this patch the teleport buildbox version has been tagged with the Go version for the current release. This bit us during the Teleport 9 development cycle, as both Teleport 8 and 9 use the same version of Go but require different versions of Rust, and we were unable to distinguish between the 2 buildbox versions.

At the time, Teleport 8 was individually patched to create a new `teleport8` buildbox tag, decoupling the buildbox version from the Go version. This was never ported into master and now we find the teleport 9 branch sharing the same buildbox tag as master.

This patch forward-ports all the changes made to `branch/v8` and updates them for master, creating a new `teleport10` buildbox tag. The idea is that we will create a new tag for teleport11 at the same time the release branch for Teleport 10 is mad at some point in the future.

Once this is merged, Drone will create and push new buildbox images, which will become available for CI. A subsequent patch will update the CI scripts to use the new `teleport10` buildbox images.
2022-03-01 15:31:46 +11:00
Alan Parra 69c67fd0bf
Read API_IMPORT_PATH from api/go.mod in make grpc (#10478)
API_IMPORT_PATH is consistently being resolved as an empty string, breaking
proto generation.

Since the path is fixed, it seems simpler to read api/go.mod and do away with
the Go program.

* Explicitly set API_IMPORT_PATH
* Delete the print-import-path program
* Read api module from api/go.mod, push variables to target
2022-02-22 19:39:35 +00:00
Jakub Nyckowski 7c19757d28
Install gcloud in /opt, so it can be accessed by non root (#10400) 2022-02-17 06:25:48 +00:00
Walt Della 7df4d77f47 Add a command to query the latest release
This gives us a robust way to find the latest published release for a
Major or Major.Minor version.  This logic is useful for our automation
that publishes up-to-date teleport:X docker images

Contributes to https://github.com/gravitational/teleport/issues/9494
2022-02-16 17:19:17 -08:00
Walt Della e5b9df2e89 Switch to testify
This saves us a couple lines of code and is a consistent review
recommendation. Better to learn it myself than keep pushing back. :)
2022-02-16 17:19:17 -08:00
Walt Della cf3109862f Exclude draft releases from latest version logic
These should not be factored in when checking for the latest release
when we decide if we should release apt packages.

This also fixes a bug in sorting logic, where we were sorting
lexigraphically instead of by semver.
2022-02-16 17:19:17 -08:00
Walt Della adcaf7bca7 Fix release sorting
9 was comparing greater than 10, due to use of lexographic sorting

This would cause us to fail to publish apt packages when we roll over to
a patch release > 9.
2022-02-16 17:19:17 -08:00
Walt Della d74ecdf86a Add an lexicographic test case
We are failing to sort properly when "9" is compared to "10".
2022-02-16 17:19:17 -08:00
Walt Della f49feacb24 Integrate version-check into build.assets/tooling
This is a unified home as suggested by Trent here:

  https://github.com/gravitational/teleport/pull/10295#discussion_r807499882

Furthermore, I've split cmd code from lib code, in preparation for a new
command that will reuse the library code.
2022-02-16 17:19:17 -08:00
Zac Bergquist eb487ce360 Remove CentOS 6 builds for Teleport 9 2022-02-15 18:40:48 -07:00
Zac Bergquist b2ffe8cc61
Update the PR description for auto webassets udpates (#10212)
The script for updating webassets uses the commit message from
webapps as the commit message for the PR to teleport.

This commit message is almost always a merged PR, which has the format:

    do some awesome thing (#123)

Where '#123' is the number of the **webapps** PR that was merged.

The problem with this is, when the teleport PR is created, it interprets
the #123 as the number of a **teleport** PR. And since the Teleport repo
has a lot more issues/PRs than webapps, Github ends up linking to an old
and completely unrelated PR.

Fix this by replacing (#123) with (gravitational/webapps#123), which
Github correctly renders as a link to the webapps PR in question.
2022-02-08 19:10:47 +00:00
rosstimothy 896261acaf
Add more lint coverage (#10049)
* Add more lint coverage

golanglint-ci doesn't pick up subdirectories with their own go.mod
which left certain directories unlinted. To get around this we can
run golanglint-ci directly against those submodules.
2022-02-07 12:03:10 -05:00
Brian Joerger d33f51d17f
x11 forwarding (#9897) 2022-02-04 23:47:03 +00:00
Brian Joerger 5d9a4033ef
Add xauth binary to buildbox for X11 forwarding. (#10164) 2022-02-04 20:36:15 +00:00
Jakub Nyckowski c974f2781a
Use SDK Cloud script to install gcloud (#9941)
* Use SDK Cloud script to install gcloud in buildbox Docker container

* Add missing gcloud components and dependencies.
2022-01-28 23:18:50 +00:00
Zac Bergquist 2aba666dc9
Update to Rust 1.58.1 (#9985)
In Rust 1.58, deriving Debug no longer counts as using a struct's
fields, so we need to allow dead_code for our structs that implement
RDP protocols. (Just because we don't use the fields doesn't mean
we shoudln't decode them)
2022-01-28 02:34:45 +00:00
Brian Joerger eb40cdc73e
make protoc generation compatible with api v2+ (#9673)
Starting with the Teleport 9 release, we will be versioning the
API module. This change ensures that the generated protobuf code
imports the correct version of the API by:

- introducing a small new command to print the correct version
- adding import rewrite rules to the protoc invocation
2022-01-24 19:16:05 +00:00
Jakub Nyckowski 538fcaa980
Remove devbox - build box now supports AMR64. (#9847) 2022-01-20 01:05:25 +00:00
Walt 854053326a
Conditionally publish deb packages (#9496)
This patch makes a couple changes:

  1. deb archives are not published to apt if they're not the latest
     release ever
  2. both rpm and deb archives are no longer published to yum / apt if
     they contain any pre-release indicator or build metadata
  3. nothing is published if the commit isn't tagged.

Contributes to https://github.com/gravitational/teleport/issues/8166
2022-01-14 03:52:15 +00:00
Edoardo Spadolini c7797fcb1f
Don't shell out to go list when not needed (#9776) 2022-01-13 11:00:33 -05:00
Zac Bergquist d0eb86191d Remove vendor
- Remove the vendor directory
- Update bot to stop accounting for vendor
- Update linter config
- Remove update-vendor make target
2022-01-07 02:15:11 -07:00
Trent Clarke 4ba0248769
Restrores CI lint for non-go files (#9663)
Linting for non-go files was accidentally dropped in the transition to
GCB (sorry!). This patch restores linting for non-go files and fixes
any lint failures that have crept in during the interim.
2022-01-06 22:20:56 +11:00