Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove PAM & BPF build tags from tsh & tctl targets in Makefile #11666

Merged
merged 1 commit into from
Apr 1, 2022

Conversation

ravicious
Copy link
Member

The PAM tag is not needed when building tsh. Moreover, it was causing the push-build-windows-amd64 pipeline to fail since lib/teleterm imports lib/srv/alpnproxy which in turn indirectly depends on lib/pam.

@ravicious ravicious requested review from espadolini and xacrimon April 1, 2022 14:11
@ravicious ravicious enabled auto-merge (squash) April 1, 2022 14:11
@github-actions github-actions bot requested review from jakule and rosstimothy April 1, 2022 14:11
@ravicious ravicious removed the request for review from jakule April 1, 2022 14:12
Copy link
Contributor

@espadolini espadolini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If someone could weigh in on tctl also needing PAM or not, that'd be great.

Copy link
Contributor

@espadolini espadolini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove $(PAM_TAG) and $(BPF_TAG) from tctl while you're touching this.

Copy link
Contributor

@xacrimon xacrimon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm once edoardo's comment is addressed

@ravicious ravicious force-pushed the ravicious/remove-pam-tag-from-tsh branch from 7072802 to 961fb2f Compare April 1, 2022 15:41
The PAM & BPF build tags are needed only when building teleport. For tsh
and tctl we have stub implementations under lib/bpf/bpf_nop.go &
lib/pam/pam_nop.go.

Building tsh with the PAM tag was causing the push-build-windows-amd64
pipeline to fail since lib/teleterm imports lib/srv/alpnproxy which in
turn indirectly depends on lib/pam.
@ravicious ravicious force-pushed the ravicious/remove-pam-tag-from-tsh branch from 961fb2f to a768239 Compare April 1, 2022 15:42
@ravicious ravicious changed the title Remove PAM build tag from tsh target in Makefile Remove PAM & BPF build tags from tsh & tctl targets in Makefile Apr 1, 2022
@ravicious ravicious merged commit d4314a2 into master Apr 1, 2022
@ravicious ravicious deleted the ravicious/remove-pam-tag-from-tsh branch April 1, 2022 16:06
ravicious added a commit that referenced this pull request Apr 25, 2022
The PAM tag is not needed when building tsh. Moreover, it was causing
the push-build-windows-amd64 pipeline to fail since lib/teleterm imports
lib/srv/alpnproxy which in turn indirectly depends on lib/pam.
ravicious added a commit that referenced this pull request Apr 27, 2022
* teleterm (alpha)

* 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] grpc/grpc-node#1405

* Use oneof for LoginRequest params

The login is either local or SSO but not both.

* Use db name for URI in Teleterm rather than db server host ID

The previous version of the code used GetHostId return value for the URI.
That caused problems as a single host can run multiple database servers.
This in turn resulted in stuff like Teleterm not listing all databases.

There's `Database.GetURI` function which I decided not to use, because it's
an URI on its own which might include stuff like port numbers and what not.
I wanted to avoid a situation in which the database URI creates some potential
conflicts with the Teleterm URIs.

I noticed that the Web UI code runs `DeduplicateDatabases` already and it
uses `Database.GetName` underneath, so I deemed it a good candidate to be
a part of a database URI in Teleterm.

Fixes gravitational/webapps.e#127

* Remove PAM build tag from tsh target in Makefile (#11666)

The PAM tag is not needed when building tsh. Moreover, it was causing
the push-build-windows-amd64 pipeline to fail since lib/teleterm imports
lib/srv/alpnproxy which in turn indirectly depends on lib/pam.

* Move WebConfig from lib/web/ui to api/client/webclient (#11690)

* Move WebConfig from lib/web/ui to api/client/webclient

Web config was shared with the Web UI through the dynamically generated
/web/config.js file available on the cluster. With the addition of
Teleport Terminal (RFD 63), the Electron app needs to get a hold of this
config as well.

However, unlike the Web UI which directly loads the file and injects
the config this way, any communication between the cluster and Teleport
Terminal is done through the tsh daemon (RFD 63). The tsh daemon needs
to essentially pipe this config from /web/config.js to the gRPC response
it gives to Teleport Terminal.

To achieve this, a GetWebConfig function was added to TeleportClient.
Unfortunately, this breaks the build on Windows as lib/web (where WebConfig
resides) includes code which is not meant to be compiled or run on Windows.

Since we need to share the web config with another frontend application,
it only makes sense to move it to the webclient package. We already have
types shared between the server and the client there, for example the
PingResponse struct.

Co-authored-by: Alexey Kontsevoy <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants