Commit graph

1313 commits

Author SHA1 Message Date
Tiago Silva 106af761e2
Add UI node lock to use server_id instead (#27395)
PR #27018 generalized locks to other roles besides `RoleNode` by adding
a new field `server_id` that forbids the agent to connect to the cluster
independently of the roles it has associated.

This PR converts the UI lock of nodes from `node` to the new `server_id`
field.
2023-06-08 08:13:08 +00:00
Lisa Kim ad295055e3
Fix not being able to "login" with auth type set to sso but no connectors set yet (#27510)
* Delete ping service

* Move flags from web config instead of calling ping

* Clarify TODO comment
2023-06-07 19:44:43 +00:00
Michelle Bergquist f0db2090e7
add styles to tooltip for team pages (#27417) 2023-06-07 19:35:31 +00:00
Steven Martin c08cd3e626
Update description of Roles UI (#22404)
* Update description of Roles UI

* Update phrasing

* lint fix

* Update role description

Co-authored-by: Alex Fornuto <alex.fornuto@goteleport.com>

* Change verbiage

* lint fix

---------

Co-authored-by: Alex Fornuto <alex.fornuto@goteleport.com>
2023-06-07 13:34:51 +00:00
Lisa Kim 89dfb4cc64
Web: Plugin tweaks and new plugin icons (#27427)
Move plugin kinds so we have only one source of truth
2023-06-07 00:57:32 +00:00
Michelle Bergquist 5c3c84ab73
add new CTA event property (#27216) 2023-06-06 22:03:54 +00:00
Ben Arent fb15f1de44
Change Campaign to utm_campaign (#26819)
* Change Campaign to utm_campaign

* yarn prettier-write

* Fix Tests

* Update Support.story.test.tsx.snap

* Update ButtonLockedFeature.test.tsx
2023-06-06 21:56:28 +00:00
Jakub Nyckowski 724f6a1f76
[Assist] Do not parse event data is there is none (#27431)
* [Assist] Do not parse event data is there is none

If there is no session data UI should not try to parse them, otherwise it will crash as this happens currently.

* Move more code.

* Update web/packages/teleport/src/Assist/contexts/messages.tsx

Co-authored-by: Lisa Kim <lisa@goteleport.com>

---------

Co-authored-by: Lisa Kim <lisa@goteleport.com>
2023-06-05 23:31:44 +00:00
Lisa Kim 8b994fcec0
WebDiscover: Check for RDS length before setting a limit for listing DBs (#27194)
* Fix bug: Check for fetched rds results before determining limit for fetching db servers

* Address crs
2023-06-05 18:56:08 +00:00
Lisa Kim c01fafeac0
Create api handler specifically for FormData (#27178) 2023-06-05 15:37:27 +00:00
Grzegorz Zdunek ed2bb4b54b
Connect: Adjust to the light theme (#27080)
* Adjust Connect to light theme

* Remove `clusters/*` element

* Add terminal colors

* Remove warning about using `false` as `color`

* Add custom styling for `Toggle`

* Fix light theme for file transfer, use the same border color for the drop area as for the input

* Do not hardcode color in `CliCommand`

* Use #000 as black

* Convert rgba colors to be non-opaque

* Fix two slightly incorrect colors
2023-06-05 13:01:35 +00:00
Ryan Clark b539b5f388
Assist bug fixes (#27266)
* Remove react-use-websocket

* Stop large command outputs from overflowing

* Try to select a login that isn't root/ubuntu/etc

* Stop the navigation switcher from closing whilst assist tooltip is shown

* Update web/packages/teleport/src/Assist/contexts/messages.tsx

Co-authored-by: Jakub Nyckowski <jakub.nyckowski@goteleport.com>

* Sort logins alphabetically and put the root logins last

* Add a test for logins sorting

---------

Co-authored-by: Jakub Nyckowski <jakub.nyckowski@goteleport.com>
2023-06-05 10:06:18 +00:00
Isaiah Becker-Mayer d5856d0ec7
removes now irrelevant webpackChunkName comments, which vite doesn't recognize (#27259) 2023-06-03 00:16:33 +00:00
Lisa Kim cc148f2b8e
Web: Fix local storage clearing (#27256)
* Fix local storage clearing

* Address cR
2023-06-02 17:47:41 +00:00
Michelle Bergquist 82f1fec490
add circle icon helper (#27185) 2023-06-02 15:52:12 +00:00
Jakub Nyckowski 5a7751fd96
[Assist] Allow removing assist conversations (#26788)
* [Assist] Allow removing assist conversations

* Display landing page after the conversion is removed

* Improve styling and add a confirmation dialog

* Change the icon opacity to copy the main navigation

* Remove unused minus icon

* Add missing trace.wrap

---------

Co-authored-by: Ryan Clark <ryan.clark@goteleport.com>
2023-05-31 21:18:35 +00:00
Zac Bergquist 771ae9a8f1
web: remove old GCB build code (#27158) 2023-05-31 21:11:09 +00:00
Lisa Kim f2449a93ee
Web: Emit integration events (aws oidc) and touch ups (#26926)
* Setup global crypto test config

* Change data test-id

* Export mocks

* Emit event for aws oidc integration
2023-05-31 17:35:20 +00:00
Justinas Stankevičius c5d2a946e0
Fix display of Assist command executions with empty output (#27010)
* Fix display of Assist executions with empty output

* Lint

* Nit

* Improve display of commands that failed with code

* Address lint
2023-05-30 18:14:55 +00:00
matheus 668d8edf48
Improve CTA/locked features tests (#27078)
* Add tests to ButtonLockedFeature

* Snapshots

* License
2023-05-30 17:20:20 +00:00
Steven Martin 9333665340
update ui and config to refer to service as Teleport Service (#26654)
* update to refer to service as Teleport Service

* update references to Teleport SSH Service to Teleport Service

* lint fix
2023-05-26 13:24:00 +00:00
Rafał Cieślak b3e7a30f8b
Remove initCommand from DocumentPtySession (#26837) 2023-05-26 09:28:00 +00:00
Lisa Kim 4d8f2d20e7
Add integration enroll usage event (#26880)
* Add integration enroll usage event

* Add new events to the frontend
2023-05-25 16:51:04 +00:00
Jakub Nyckowski 9db248f9a8
[Assist] MFA support (#26719)
* Initial support for MFA in Assist

* UI webauth handler

* WebUI - WIP

* Run prettier

* Perform MFA ceremony only once.

* Cleanup JS

* Remove hacky WS logic

* Add cancel MFA logic
2023-05-25 15:49:52 +00:00
Yassine Bounekhla d19f2ff2d0
fix console node list scroll and close session join dialog (#26622) 2023-05-25 15:15:43 +00:00
Rafał Cieślak 296aeb0d75
Capture the error if the gateway CLI client executable is not found (#26581)
* Add onStartError to PTY process

* Add logging to frontend PtyEventsStreamHandler

* Return cleanup functions from pty process onEvent functions

* Extract DocumentReconnect from DocumentTerminal

The Reconnect component will be useful when handling startError.

* Add getPtyId to PtyProcess

This will act as the key for the Terminal component, allowing us to
make sure we mount it only once for any given PTY process.

* Capture startError and display an error state

* Terminal/ctrl: Cleanup ptyProcess onData listener

* Include command name and args in startError error message

* Remove ptyId field from PtyProcess
2023-05-23 15:48:45 +00:00
Rafał Cieślak daca5bf29b
Preserve backwards compatibility of teleport.lib.teleterm.v1.Gateway (#26705) 2023-05-23 12:08:38 +00:00
Ryan Clark 821b9c3d61
Always render the portal for the assist title to go into (#26733) 2023-05-22 22:28:41 +00:00
Lisa Kim 882f63d36e
Web: Add back buttons and remove exit buttons (discover & integrations) (#26493)
* Add back button for enrolling aws oidc integration

* Remove exit buttons and replace some with back buttons

The back buttons will replace the back arrow buttons
Added back button to Setup Access screen for databases
2023-05-22 18:45:37 +00:00
Rafał Cieślak 2d9a75537a
Spawn gateway CLI client directly (#26441)
* Return os.exec.Cmd as gateway CLI command

* Remove separate Props type from DocumentTerminal

* Refactor Kind type exported from documentsService

* Export makeRuntimeSettings from MainProcess mock

* PtyProcess: Join args in logger name

* ptyHostService: Pass ptyOptions explicitly instead of using spread

I noticed that we pass both argsList and args to the PtyProcess constructor.
While TypeScript allows that, it is a bit confusing when inspecting the
actual values received in the constructor.

* Add empty DocumentGatewayCliClient

* Start terminal from DocumentGatewayCliClient

* Add waiting state for DocumentGatewayCliClient

* Remove targetSubresourceName from DocumentGatewayCliClient title
2023-05-22 08:40:33 +00:00
Sakshyam Shah c10cfde5ea
jamf icon for integration table and added jamf type to PluginKind (#26582) 2023-05-19 16:01:50 +00:00
Yassine Bounekhla c9b38035cc
add polyfill for randomuuid (#26368) 2023-05-19 14:58:54 +00:00
Lisa Kim 3044187e2d
Remove intel label from macOS (#26520) 2023-05-19 13:53:14 +00:00
Roman Tkachenko 79b54d859d
Add support for automatic database users for Postgres (#25614) 2023-05-18 23:22:14 +00:00
Grzegorz Zdunek a568361a26
Show dev-related tools only in dev mode (#26324) 2023-05-18 10:13:02 +00:00
Lisa Kim c1853cf012
WebDiscover: Revert deleting the app wizard (#26282)
* Reverting app wizard (copy pasta deleted code)

* Render modal for application resource

* Update snapshot
2023-05-17 17:05:18 +00:00
Ryan Clark 8926feb1d1
Update assist warning wording, add link to ToS (#26396) 2023-05-16 20:54:09 +00:00
Lisa Kim 9bac74aeac
Web: Provide accurate actionable steps with duplicate db name error (#26116)
* Add aws rds fields to databases responses

* Type ApiError response field

* Add utility func for returning err msg from Error

* Implement checking for existing db servers when fetching rds dbs

* Disable selecting table row when db servers exists

* Provide a more accurate actionable steps in case of dup err

* Fix blank id on resuming discover flow

* Address code review

* Fix lint: missing license

* Remove increasing limit +5, corner case handling seems unnecessary
2023-05-16 19:10:14 +00:00
Ryan Clark 0b442085be
Assist UI improvements (#26365) 2023-05-16 18:09:33 +00:00
Rafał Cieślak 79ded4dfeb
Disable "Open new terminal" if there's no active workspace (#25892)
* Render the separator from within MenuItem

This will make it easier to show the separator in the story.

* Use spotBackground for keyboard shortcut background

* Add disabled state for additional actions

* Dim only the text and icon color when disabled

* Use text.disabled instead of buttons.textDisabled
2023-05-16 11:26:58 +00:00
Mike Jensen 7f331a5f11
Rename ChatGPT to GPT-4 (#26272)
* Rename `ChatGPT` to `GPT4`

ChatGPT is a user friendly name, but is technically inaccurate.

* Apply suggestions from code review

Co-authored-by: Reed Loden <reed@goteleport.com>

* Lint fix

* Additional ChatGPT --> OpenAI GPT-4 fixes

---------

Co-authored-by: Reed Loden <reed@goteleport.com>
2023-05-16 06:20:22 +00:00
Grzegorz Zdunek a5679debf5
Update electron and electron-builder (#26072)
* Upgrade electron and electron-builder

* Update the path to x64 build

* Update electron to 24.3.0

* Use the latest after-install and after-remove scripts

* Run prettier

* Use correct indentation

* Use app path in `update-alternatives --remove`
2023-05-15 15:59:12 +00:00
Justinas Stankevičius 21c534b17c
Add rate limiting to Assist (#26011)
* Add rate limiting to Assist

* Only rate limit Assist in Cloud

* Add a comment to assistantLimiter

* Fixes after rebase

* Add 'rate-limited' test case to assistant_test

* Handle CHAT_MESSAGE_UI in Assist web UI

* Add godoc

* CHAT_MESSAGE_UI -> CHAT_MESSAGE_ERROR

* Run assistant test cases in parallel
2023-05-15 15:48:52 +00:00
Jakub Nyckowski 9f794f1049
[Assist] Fix random user selection (#26183)
Currently, after selecting a user for command execution in Teleport Assist the user can randomly change. This PR fixes this behavior.
2023-05-15 15:37:04 +00:00
Jakub Nyckowski 5fddd75d0f
Assist - Web endpoints (#26046)
* Assist - Web endpoints

* GCI

* proto rpc

* enforce endpoint checks

* disable in ui if disallowed by auth

* add comment

* unwrap stack

* Refactor code

---------

Co-authored-by: Joel Wejdenstål <jwejdenstal@icloud.com>
2023-05-13 05:00:44 +00:00
matheus 004420b1ae
Add params to CTA redirect URL (#26086)
* Add params to redirect URL

* Change casing of constant

* Update button to use `as="a"`

* Update tests and stories

* Use ButtonPrimary instead of Border
2023-05-12 16:51:45 +00:00
Lisa Kim 3cae807a84
Web: Integrations touchups (#26048)
* Fix storybook deprecated warning

* Define required role arn rule check

* Implement editing integrations

- Create a re-usable component for rendering dialogues
  based on operation type (enterprise)

* Add thumbprint validation

* Fix text color mash in light theme

* Address CR
2023-05-12 16:37:36 +00:00
Sakshyam Shah 6d09ff03a6
Add JamF icon (#25932)
* add jamf icon

* svg file downloaded from design system
2023-05-12 16:33:52 +00:00
Rafał Cieślak c046606a25
Remove privileged APIs from window after app initialization (#26057)
* Remove privileged APIs from the window object

* Attach app context to window only in dev mode
2023-05-12 15:53:23 +00:00
Rafał Cieślak 67181c8000
Get rid of update on unmounted component in ResultList (#26143) 2023-05-12 15:52:25 +00:00
Ryan Clark cad5633dc9
Move the favicon so Teleport serves the static file (#26084) 2023-05-12 14:38:57 +00:00
Jakub Nyckowski efd49b3692
Assist - port WebUI changes (#25930)
* Assist - port WebUI changes

This PR port all WebUI changes used by Teleport Assist.

* Minor formatting changes
Remove console.log

* Update web/packages/teleport/src/Assist/Chat/Examples/ExampleList.tsx

Co-authored-by: Lisa Kim <lisa@goteleport.com>

* Address code review comments

* Code review improvements

---------

Co-authored-by: Ryan Clark <ryan.clark@goteleport.com>
Co-authored-by: Lisa Kim <lisa@goteleport.com>
2023-05-11 18:56:53 +00:00
Steven Martin 1476d15ac9
only show windows domain in audit log ui if applicable (#26063)
* only show windows domain in audit log if applicable

* lint fix
2023-05-11 15:46:37 +00:00
Rafał Cieślak 8b4400ae07
Search bar: Take cluster filter into account when listing offline clusters (#25910)
* Wrap action picker status tests in describe groups based on search mode

* Take cluster filter into account when listing offline clusters
2023-05-11 15:02:21 +00:00
Michelle Bergquist ce33cd5fbf
push the feature check to ctx.init (#26007) 2023-05-11 14:15:31 +00:00
Rafał Cieślak 16eee15b1c
Show resource search errors in search bar when fetching a preview (#25791)
* Show resource search errors in search bar when fetching a preview

* Add a comment for ActionPickerStatus

* Add NoResultsItem with no expired clusters to the story

* Destructure searchMode properties
2023-05-11 13:19:03 +00:00
Rafał Cieślak ee2cbcb985
Clean up staticConfig mocks (#26054)
staticConfig.ts used to match on "development" and "production" only.
In tests, jest sets NODE_ENV to "test" which required us to mock
staticConfig.ts.

Since we don't need a separate config for dev and tests, we can reuse dev
config for now.
2023-05-11 11:46:43 +00:00
Michelle Bergquist 89fdad50d0
create e-imports package (#25992)
* create e-imports package

* Set package name for e-imports

---------

Co-authored-by: Rafał Cieślak <rafal.cieslak@goteleport.com>
2023-05-10 23:11:07 +00:00
Isaiah Becker-Mayer e42b072d62
Fixes a SharedDirectoryAnnounce incompatibility (#25931)
* Fixes a SharedDirectoryAnnounce incompatibility

The SharedDirectoryAnnounce message was changed to remove an unnecessary
completionID field, however this change caused an incompatibility between
the proxy and previous versions of the wds. This commit reverts that specific
change and adds notes to the code explaining the situation.

The original change is here: https://github.com/gravitational/teleport/pull/25260/files#diff-98a4bee57beb7f007614e4810d2cf8413bddf48484c8aad6dd0756a218797c36R677-R678

* changes completionId to discard

* adds discard bit to sda.Encode to make fuzz tests happy
2023-05-10 20:37:59 +00:00
Lisa Kim 7922af1567
Allow aws svg icon to take on the themes main color (#25961)
- Fixes the previous aws icon blending in with light theme
- Remove duplicate sources of aws icon
- Create stories for svg's icon, preferring them over
  existing font icons from icomoon
2023-05-10 17:36:23 +00:00
Michael Wilson 1bfb859f88
Add in Okta audit events. (#25934)
* Add in Okta audit events.

Okta audit events have been added in to support the Okta Service enterprise
feature.

* Don't have separate failure events.

* UI linting.

* Add in missing icons.

* Use warning icon for Okta failures.

* Correct voicing of failure events.
2023-05-10 15:01:12 +00:00
Rafał Cieślak aed64e4d6b
Upgrade TypeScript to 5.0.4 (#25879)
* Upgrade TypeScript to 5.0.4

* Increase ForkTsCheckerWebpackPlugin mem limit to 4 GB

This matches the memory limit of `yarn type-check`.
2023-05-10 10:08:20 +00:00
Rafał Cieślak 3112431fa6
Remove code related to the command bar from Connect (#25882)
* Remove search bar feature flag

* Remove code related to the command bar

* Document deprecated features to remove in 14.0.0
2023-05-09 13:36:15 +00:00
matheus 7ca111193b
Allow adding 'locked' features to menu items and routes (#25588)
* Add locked feature options

* Remove routes from items with locked parents

* Refactor to simplify features

* Add type for LockedFeatures

* Improve comment

* Fix call to isLockedAndUpdatedRouteAndNavigationItem wrong param

* Set locked features based on usage based billing

* Add back lockedRoute and list items

* Use simpler sintax

Co-authored-by: Grzegorz Zdunek <gzdunek@users.noreply.github.com>

* Simplify isParentLocked

* Improve navigation item rendering

* Remove unucessary condition from if

* Prevent adding a route if the feature is locked

* Throw error instead of logging

* Improve if condition

---------

Co-authored-by: Grzegorz Zdunek <gzdunek@users.noreply.github.com>
2023-05-09 11:22:27 +00:00
Yassine Bounekhla 4bfdcabb9d
desktop discovery theme fixes (#25499) 2023-05-08 18:00:30 +00:00
Yassine Bounekhla 5bd7240094
fix auditlog error (#25344) 2023-05-08 17:57:00 +00:00
Grzegorz Zdunek 6875666526
Make notification more readable (#25789) 2023-05-08 11:21:04 +00:00
Grzegorz Zdunek ef0cb91b03
Update docs related to the search bar (#24515)
* Update docs related to the search bar

* Rename "more options menu" to "additional actions menu"

* Inform that terminal tabs are bound to the selected cluster

* Apply suggestions from code review

Co-authored-by: Rafał Cieślak <rafal.cieslak@goteleport.com>

* Update screenshots

* Crop app screenshots

* optimize images

* Apply @ravicious suggestions

Co-authored-by: Rafał Cieślak <rafal.cieslak@goteleport.com>

---------

Co-authored-by: Rafał Cieślak <rafal.cieslak@goteleport.com>
Co-authored-by: alexfornuto <alex.fornuto@goteleport.com>
2023-05-08 10:52:19 +00:00
Rafał Cieślak 0a6fb68550
Make TS a dev dep of root package.json, fix design dev deps (#25683)
* Make typescript a dev dep of root package.json

* Make @gravitational/build a dev dep of @gravitational/design
2023-05-08 10:41:30 +00:00
Rafał Cieślak b745a82cd1
Show errors if fetching ParameterPicker suggestions fails (#25703)
* ResultList: Reset active item on pick

* Extract inner item component with icon to ResultList

We want to reuse it in ParameterPicker.

* Remove hardcoded icon color of ResourceSearchErrorsItem

* Handle errors when getting suggestions for ParameterPicker
2023-05-08 09:41:28 +00:00
Rafał Cieślak 273d1d9a1e
Fix flaky resolveNetworkAddress test (#25249)
* Make sure code 0 is reported properly

* Ensure the test process prints to stdout before exiting

* Fix license
2023-05-08 09:37:28 +00:00
matheus 0697011eaa
Add events to cta clicks (#25325)
* (wip) add unlock feature button to support page

* Fix typo

* (wip) add locked feature join session

* Improve session join style

* Add session join lock button

* Remove hover on locked join menu

* Update copy

* Only show `join as...` when appropriate

* (wip)

* Make ButtonLockedFeature theme sensitive

* Remove debug stuff

* Adjust feature button height

* Fix session join button on locked

* Remove unused import

* typo

* Add link to cta button

* Remove teams flag

* Add cta service

* Update snapshots

* Lock button style

* Add cta to context

* Rename cta to ctaService

* Stories and tests

* Add comments clarifying that ctas are not used currently

* add showActiveSessionsCTA to useSessions

* Licenses

* Lint license

* Remove commented out code

* Add missing types

* Replace cta service for an object with cta on context

* Fix menu hack

* small refactor in styled stuff

* Update SessionJoinBtn to use master code

* Snapshot update

* Add events to cta clicks

* rebase

* revert e ref update

* Revert e change

* Update proto message to start at 1

* Use enum from proto files instead of rewriting

* Improve comments on usageevents.proto cta enum

* Fix import

* Fix type errs

* Add comments

* Rename CtaEvents > CtaEvent

* Copy the CtaEvent enum instead of importing from proto

* Add back blank line

* Fix import order

* Update proto files

* Add TODO comment
2023-05-05 18:53:02 +00:00
Grzegorz Zdunek 17394c2342
Use solid color for table row border to fix Safari rendering issue (#25682)
* Use solid color for table row border to fix Safari rendering issue

* Use `emphasize` function

* Improve comment

* Add fallback value to alpha

* Clarify comment
2023-05-05 14:32:25 +00:00
Rafał Cieślak f01e675249
Close search bar in Connect on blur (#25186)
* Remove closeAndResetInput

* Remove unnecessary input focus from `open`

As the comment in SearchBar explains, the focus wasn't actually achieving
anything. I added it only because I was testing SearchContext in separation
and depended on the input getting focused in the test.

This doesn't reflect how the input is actually used so I adjusted the test.

* Move onFocus on input, add onBlur to input

* Remove nesting from handling outside click

* SearchContext: Rename onInputValueChange to setInputValue

* Do proper type check before calling focus on previouslyActive

* Add a temp workaround for tsc issue

* Make TypeScript 4.8.4 happy
2023-05-05 10:48:33 +00:00
Rafał Cieślak ae48e31652
Remove logging of search results in Connect (#25625)
The logging was added for pre-launch debugging purposes and is no longer
needed.
2023-05-05 10:13:21 +00:00
Michael 76074b4f1c
Disable approve button after approval (#25655) 2023-05-04 20:55:13 +00:00
Cam Hutchison d3eed17856
build: Support arm64 and universal binaries for MacOS (#25460)
* build: Support ARM64 (cross)builds of fido2 et al

Add support for building/cross-building the fido2 libraries (cbor,
openssl and fido2), supporting ARM64 builds. This is done by adding the
appropriate flags to the library builds in `build-fido2-macos.sh` based
on the `C_ARCH` environment variable. If unset then the host
architecture is used. The `Makefile` defined `C_ARCH` based on the
`ARCH` variable, mapping it to an appropriate value for the C compiler.

Building the libraries should now be done through the new `build-fido2`
target, and getting the pkg-config path should be done with the
`print-fido2-pkg-path`. This is instead of calling the
`build-fido2-macos.sh` script directly as the `Makefile` takes care of
setting the `C_ARCH` environment variable appropriately.

* build: Add make target to install rust cross toolchain

Add the `rustup-set-target-toolchain` target to the Makefile to ensure
the right rust toolchain is installed for the version of Rust we use as
well as the target architecture we wish to generate code for, based on
the `ARCH` variable. This is intended to be used by CI jobs to ensure
they build with the correct toolchain.

* build: Support building MacOS packages for ARM64

Remove the restriction that allows only AMD64 packages to be built on
MacOS for the teleport and tsh packages. This is via the existing `-a`
flag to `build-package.sh` and a newly added `-a` flag to
`build-pkg-tsh.sh`.

This adds the architecture to the filename of the package to distinguish
the packages for different architectures.

Update the comments in the Makefile mentioning that `arch` is ignored.

build: add architecture to package names

* build: Build Teleport Connect with target architecture

When packaging Teleport Connect with electron-builder, pass an
architecture flag so that we can cross-build Teleport Connect. This will
allow us to build MacOS ARM64 binaries on the AMD64 runners.

Add the architecture to the `dmg` filename via the electron-builder
config, so that the filenames for different architectures don't clash.

* build: Copy Mac release artifacts to release directory

Copy the Mac release artifacts to a release artifact directory so that
the CI scripts do not have to. This makes it clearer what is and is not
a release artifact and puts the logic in the Makefile instead of the CI
yaml, so it can more easily be tested locally and to make it easier to
migrate to the next CI system.

This will also be useful for building universal binaries for Mac as the
CI system can put the architecture-specific binaries from a previous
workflow job into a common location.

We should look at copying all release artifacts for the other builds
(Linux tarballs and packages, etc) into this directory too. It may help
with unifying the GitHub Actions release workflows.

* build: Add MacOS universal builds

Add support for ARCH=universal on Darwin to produce universal (fat)
binaries from pre-built arm64 and amd64 binaries.

Packages (pkg) and disk images (dmg) for containing universal binaries
are named without an architecture in the filename, as that is the
current naming for the current AMD64-only releases. These universal ones
will replace those AMD64-only ones providing a single release artifact
working across architectures.

Co-authored-by: Grzegorz Zdunek <grzegorz.zdunek@goteleport.com>

* build: Do not clean before release-darwin

Remove the `clean` prerequisite from the `release-darwin-unsigned`
target as it is not needed when building on GitHub Actions, as it starts
with a fresh slate each run. We do not make releases manually so we
don't need to ensure a clean working directory there either.

Not doing a clean makes it easier to build a MacOS universal release as
it depends on the architecture-specific tarballs from a previous release
build. We would need to manually save the tarballs from the first
architecture release build as they would get deleted by the `clean` from
the second. So just stop cleaning as it is not needed.

---------

Co-authored-by: Grzegorz Zdunek <grzegorz.zdunek@goteleport.com>
2023-05-04 20:47:49 +00:00
matheus 57690ee961
Add IsUsageBased to features and send it to web UI (#25465)
* Add IsUsageBased to features and send to web UI

* Update flag name

* Improve comment

* Add comments and improve field name

* Remove duplicated property
2023-05-04 14:57:48 +00:00
Grzegorz Zdunek 1870c80cdb
Theme fixes (#24883)
* Make pagination icons a little more visible

* Use different color for `tr` border

* Use `opacity: 1` for placeholders

* Include `borderRadius` in `StyledPanel` to fix rounded corners in Connect custom tables

* Use `colors.text.primary` for items in `MenuLogin`

* Adjust Connect theme to the updated dark theme

* Remove unused component

* Update snapshots

* Remove `surfaceSecondary` and `sunkenSecondary` colors

* Remove unneeded `inherit`

* Do not hardcode bg color in `TextArea`

* Expand comment

* Simplify the look of top bar elements

* Remove unused component

* Remove `text.contrast`

* Use the same dark theme for WebUI and Connect

* Revert "Make pagination icons a little more visible"

This reverts commit 1fe1d7baec.

* Add shadow for the tabs

* Post-merge fixes

* Do not use Arial on custom buttons

* Revert snapshot changes

* Fix colors in `ActionPicker`

* Apply hover styles directly on `SearchBar` input

* Use white color for "Database Connection" header

* Add shadow directly to `StyledTabs`

* Run prettier

* Update e

* Add some top padding to the terminal

* Review fixes

* Move SearchBar hover to the Flex element

* Table-related improvements  (#25333)

* Use a better icon for the reverse tunnel cell

* Use `ButtonIcon` for pagination icons

* Fix rendering table border on Safari

* Manually add a visual separator between the table and the element below it

* Add bottom padding to resource tables in Connect

* Update snapshots

* Update snapshots

* Revert e
2023-05-04 14:52:17 +00:00
Rafał Cieślak 473e80fb3e
Ensure useDocumentGateway creates the gateway only on mount (#25322)
* Remove unnecessary useEffect

* Remove offline cluster handling on reconnect

We used to have to handle this manually, but nowadays it's handled by
retryWithRelogin that's used in createGateway.

* Create a gateway only once on mount

* Fix and refactor DocumentGateway story
2023-05-04 13:41:32 +00:00
Rafał Cieślak 48bf3a93f3
UI improvements for empty search input (#25314)
* ResourcesService.searchResources: Use named args

* Always show TypeToSearchItem if input is empty

* Fetch search preview after selecting a filter
2023-05-04 13:30:52 +00:00
Michael Wilson 4632105587
Add missing user groups entry to getEmptyResource state. (#25585)
* Add missing user groups entry to getEmptyResource state.

UserGroups will be requestable, so the UI needs to include user_group in the
empty resource state.

* Update test for object change.

* Add missing references to user_group.
2023-05-03 22:54:47 +00:00
Gabriel Corado 9200cae34f
Add specific message for network errors on app launch (Web UI) (#25527)
* feat(web): add network error message for app launch

* Update web/packages/teleport/src/AppLauncher/AppLauncher.tsx

Co-authored-by: Roman Tkachenko <roman@goteleport.com>

* refactor(web): update error message

* chore(web): fix linter

---------

Co-authored-by: Roman Tkachenko <roman@goteleport.com>
2023-05-03 22:48:43 +00:00
Michael f814b2d510
Add sshserver file transfer handlers (#24580)
Add web terminal handlers for file transfer requests (#24581)
2023-05-03 20:53:57 +00:00
Michael Wilson 598e09f202
Support UI methods for user groups, label match user groups in API. (#25559)
* Support UI methods for user groups, label match user groups in API.

UI methods have been added to User Groups to support the enterprise Okta
service. This will allow groups to be queried and displayed on the new
access request page appropriately.

Additionally, after adding group labels to roles, the access checking was
not added to the appropriate user groups endpoints in auth_with_roles.
This has been added to ensure that users can only see the user groups they're
supposed to see when requesting access.

* UI lint issues.
2023-05-03 18:06:49 +00:00
Michael cd3a1e2dd1
Fix vite config (#25514) 2023-05-02 22:10:17 +00:00
Ryan Clark e4995ed6af
Only pass process.env.NODE_ENV through vite (#25501) 2023-05-02 19:20:32 +00:00
Alan Parra 4d2b43442e
Use new device event layout in Web UI (#25355)
* Use new device event layout in Web UI

* Maintain compatibility with legacy/v12 events

* Update snapshots
2023-05-02 18:38:14 +00:00
Lisa Kim 7c117216e1
WebDiscover: Put back IamPolicy screen and some tweaks (#25438)
* Let count be 0 (it will be zero on error)

* Put back IamPolicy screen with updated links

* Fix typo

* Remove port for 443 from very beginning of AWS integration flow

in addition fix inconsistent animation JSON policy

* Remove hard coded colors and remove unnecessary border
2023-05-02 16:34:15 +00:00
Michelle Bergquist 3468812d22
add billing to navigation (#25192) 2023-05-02 15:46:00 +00:00
matheus e082318913
Team plan CTAs (#25073)
* (wip) add unlock feature button to support page

* Fix typo

* (wip) add locked feature join session

* Improve session join style

* Add session join lock button

* Remove hover on locked join menu

* Update copy

* Only show `join as...` when appropriate

* (wip)

* Make ButtonLockedFeature theme sensitive

* Remove debug stuff

* Adjust feature button height

* Fix session join button on locked

* Remove unused import

* typo

* Add link to cta button

* Remove teams flag

* Add cta service

* Update snapshots

* Lock button style

* Add cta to context

* Rename cta to ctaService

* Stories and tests

* Add comments clarifying that ctas are not used currently

* add showActiveSessionsCTA to useSessions

* Licenses

* Lint license

* Remove commented out code

* Add missing types

* Replace cta service for an object with cta on context

* Fix menu hack

* small refactor in styled stuff

* Update SessionJoinBtn to use master code

* Snapshot update

* Minor stuff
2023-05-02 14:02:27 +00:00
STeve (Xin) Huang a415879322
Update WebUI database type (#25270)
* Update WebUI database type

* run prettier

* Snowflake
2023-05-02 13:54:51 +00:00
Cam Hutchison 97db758e84
darwin: Use notarytool to notarize instead of altool (#25407)
Switch to using the newer `notarytool` to notarize MacOS binaries
instead of the older `altool`, as `altool` is deprecated and will no
longer work come Fall 2023. This also makes for a quieter build as
altool's output was quite verbose, and anecdotally, it seems to be more
reliable - I haven't had a single notarization failure this way as
opposed to the many we see in CI with `altool`.

We used to use `gon` as part of our notarizing tool. `gon` still has an
open issue to upgrade to `notarytool`, so we've switched away from it
and used the Apple CLI tools instead to do the notarization. This is
available now that we have moved to GitHub Actions for builds as it has
a newer Xcode that contains notarytool.

Update the Teleport Connect notarization, which was quite a bit simpler,
although we do need an extra `$TEAMID` input, so handle it when that is
not supplied and document in the README that it is needed.
2023-05-01 19:58:08 +00:00
Lisa Kim a0773f9cd0
Redo web lock feature (#25305)
Also reverts body `overflow: hidden`
Fixes https://github.com/gravitational/teleport/issues/24885
2023-05-01 18:47:25 +00:00
Isaiah Becker-Mayer 1267c72df1
webapi cleanup (#24363)
* Add isModeratedSession flag to web ssh session

* Fix lint

* Change to snakecase

* Change to moderated

* Ensures every Session has a valid Kind field.

Also cleans up the client code to distinguish between
terminalSessionPath and activeAndPendingSessionsPath.

* Entirely removes siteSessionGet which was not being used

* removes siteSessionGenerate which was not being used

* removes test testing webapi/sites/<cluster-name>/sessions post call, which is no longer used by the frontend

* removing unused struct

---------

Co-authored-by: Michael Myers <michael.myers@goteleport.com>
2023-04-28 20:49:11 +00:00
Yassine Bounekhla 4a2b422b1a
redesign participant modes join menu (#24961) 2023-04-26 20:10:08 +00:00
Yassine Bounekhla 1d7785971e
theme-related fixes (#25119) 2023-04-26 17:55:46 +00:00
Grzegorz Zdunek 5bf72af28a
Connect: Fix logout sequence (#24978)
* Fix logout sequence

* Adjust `useLoggedInUser` documentation

* Mark clusters as disconnected after logging out

* Refactor `ClusterLogout` to not use the hook/container pattern

* Run prettier

* Fix test

* Use `routing.belongsToProfile`
2023-04-26 10:01:08 +00:00
Rafał Cieślak 839afa8509
Account for request errors when displaying "no results" message in the search bar (#25061)
* Render ExtraTopComponent based on computed action picker status

* Fix formatting

* Use named args for getActionPickerStatus

* Use const for nonRetryableResourceSearchErrors

* Fix logic behind determining remaining filters
2023-04-26 09:52:52 +00:00
Rafał Cieślak e32a3e5207
Retry search in Connect if current workspace cert has expired (#24880)
* Adjust copy of db action

* Use retryWithRelogin when getting db usernames

* useAsync: Remove unnecessary useCallback

The state setter coming from useState is always stable.

https://legacy.reactjs.org/docs/hooks-reference.html#usestate

* useAsync: Expand docs with `run` return value example

* useSearch: Rename `restrictions` to `filters`

* useSearch: Remove unnecessary useState calls

* Refactor lockOpen into pauseUserInteraction

lockOpen worked great when we were concerned only about user interaction
with a modal closing the search bar as well. However, in the next commit
I'm going to add a login modal that's shown if the search fails with a
retryable error.

In that scenario, pressing Enter in the modal wouldn't work, as it would
be captured by the window listener that ResultList adds.

To work around this problem, I refactored lockOpen into pauseUserInteraction.
It still works pretty much the same way. But then instead of having checking
isLockedOpen in the close function, we have a new addWindowEventListener
function.

addWindowEventListener automatically removes the listener after
pauseUserInteraction is called. This solves both the problem of closing
the modal and the problem of using the enter key in the modal.

* Relogin & retry resource search if current workspace cert has expired

* addWindowEventListener: Name the cleanup function

* Make addWindowEventListener a prop of ResultList
2023-04-26 08:31:53 +00:00