Fixes#8218
Removes `wsconncache` and related "is legacy?" functions and API calls that were used by it.
The only leftover is that Agents still use the legacy IP, so that back level clients or workspace proxies can dial them correctly.
We should eventually remove this: #11819
* wip: commit current progress on usePaginatedQuery
* chore: add cacheTime to users query
* chore: update cache logic for UsersPage usersQuery
* wip: commit progress on Pagination
* chore: add function overloads to prepareQuery
* wip: commit progress on usePaginatedQuery
* docs: add clarifying comment about implementation
* chore: remove optional prefetch property from query options
* chore: redefine queryKey
* refactor: consolidate how queryKey/queryFn are called
* refactor: clean up pagination code more
* fix: remove redundant properties
* refactor: clean up code
* wip: commit progress on usePaginatedQuery
* wip: commit current pagination progress
* docs: clean up comments for clarity
* wip: get type signatures compatible (breaks runtime logic slightly)
* refactor: clean up type definitions
* chore: add support for custom onInvalidPage functions
* refactor: clean up type definitions more for clarity reasons
* chore: delete Pagination component (separate PR)
* chore: remove cacheTime fixes (to be resolved in future PR)
* docs: add clarifying/intellisense comments for DX
* refactor: link users queries to same queryKey implementation
* docs: remove misleading comment
* docs: more comments
* chore: update onInvalidPage params for more flexibility
* fix: remove explicit any
* refactor: clean up type definitions
* refactor: rename query params for consistency
* refactor: clean up input validation for page changes
* refactor/fix: update hook to be aware of async data
* chore: add contravariance to dictionary
* refactor: increase type-safety of usePaginatedQuery
* docs: more comments
* chore: move usePaginatedQuery file
* fix: add back cacheTime
* chore: swap in usePaginatedQuery for users table
* chore: add goToFirstPage to usePaginatedQuery
* fix: make page redirects work properly
* refactor: clean up clamp logic
* chore: swap in usePaginatedQuery for Audits table
* refactor: move dependencies around
* fix: remove deprecated properties from hook
* refactor: clean up code more
* docs: add todo comment
* chore: update testing fixtures
* wip: commit current progress for tests
* fix: update useEffectEvent to sync via layout effects
* wip: commit more progress on tests
* wip: stub out all expected test cases
* wip: more test progress
* wip: more test progress
* wip: commit more test progress
* wip: AHHHHHHHH
* chore: finish two more test cases
* wip: add in all tests (still need to investigate prefetching
* refactor: clean up code slightly
* fix: remove math bugs when calculating pages
* fix: wrap up all testing and clean up cases
* docs: update comments for clarity
* fix: update error-handling for invalid page handling
* fix: apply suggestions
* chore: move `/gitauth` to `/externalauth` on the frontend
This actually took a lot more jank than anticipated,
so I wanted to split this up before adding the ability
to embed new providers.
* Rename FE
* Fix em' up
* Fix linting error
* Fix e2e tests
* chore: update helm golden files
* add token actions
* added basic token form
* removed token switch
* refined date field
* limiting lifetime days to maxTokenLifetime
* broke apart files
* added loader and error
* fixed form layout
* added some unit tests
* fixed be tests
* no authorize check
* add tokens switch
* reorged TokensPage
* using Trans component for description
* using Trans component on DeleteDialog
* add owner col
* simplify hook return
* lint
* type for response
* PR feedback
* fix lint
* added query for tokens by user id
* updated query args
* adding owner col
* fix request params
* update-golden-files
* added owners col to ls table output
* added ttoken translations
* prettier
* format table according to arg
* using slice.Contains
* refactored token state
* cleanup
* chore: rename `AgentConn` to `WorkspaceAgentConn`
The codersdk was becoming bloated with consts for the workspace
agent that made no sense to a reader. `Tailnet*` is an example
of these consts.
* chore: remove `Get` prefix from *Client functions
* chore: remove `BypassRatelimits` option in `codersdk.Client`
It feels wrong to have this as a direct option because it's so infrequently
needed by API callers. It's better to directly modify headers in the two
places that we actually use it.
* Merge `appearance.go` and `buildinfo.go` into `deployment.go`
* Merge `experiments.go` and `features.go` into `deployment.go`
* Fix `make gen` referencing old type names
* Merge `error.go` into `client.go`
`codersdk.Response` lived in `error.go`, which is wrong.
* chore: refactor workspace agent functions into agentsdk
It was odd conflating the codersdk that clients should use
with functions that only the agent should use. This separates
them into two SDKs that are closely coupled, but separate.
* Merge `insights.go` into `deployment.go`
* Merge `organizationmember.go` into `organizations.go`
* Merge `quota.go` into `workspaces.go`
* Rename `sse.go` to `serversentevents.go`
* Rename `codersdk.WorkspaceAppHostResponse` to `codersdk.AppHostResponse`
* Format `.vscode/settings.json`
* Fix outdated naming in `api.ts`
* Fix app host response
* Fix unsupported type
* Fix imported type
* added script for table creation
* added tags to audit-logs.md
* removed log
* removed empty block line
* PR feedback
* modify check_unstaged
* third times the charm maybe
* spelling
* relative path
* excluding from the right script this time
* sorted resources to ensure table order
* running make cmd
* running make again
* ensuring order on subtable
* Start to port over provisioner daemons PR
* Move to Enterprise
* Begin adding tests for external registration
* Move provisioner daemons query to enterprise
* Move around provisioner daemons schema
* Add tags to provisioner daemons
* make gen
* Add user local provisioner daemons
* Add provisioner daemons
* Add feature for external daemons
* Add command to start a provisioner daemon
* Add provisioner tags to template push and create
* Rename migration files
* Fix tests
* Fix entitlements test
* PR comments
* Update migration
* Fix FE types
* chore: Separate the provisionerd server into it's own package
This code should be thoroughly tested now that we understand the abstraction.
I separated it to make our lives a bit easier for external provisioner daemons
as well!
* Add tests
* Add workspace builds
* Add test for workspace resources
* feat: HA tailnet coordinator
* fixup! feat: HA tailnet coordinator
* fixup! feat: HA tailnet coordinator
* remove printlns
* close all connections on coordinator
* impelement high availability feature
* fixup! impelement high availability feature
* fixup! impelement high availability feature
* fixup! impelement high availability feature
* fixup! impelement high availability feature
* Add replicas
* Add DERP meshing to arbitrary addresses
* Move packages to highavailability folder
* Move coordinator to high availability package
* Add flags for HA
* Rename to replicasync
* Denest packages for replicas
* Add test for multiple replicas
* Fix coordination test
* Add HA to the helm chart
* Rename function pointer
* Add warnings for HA
* Add the ability to block endpoints
* Add flag to disable P2P connections
* Wow, I made the tests pass
* Add replicas endpoint
* Ensure close kills replica
* Update sql
* Add database latency to high availability
* Pipe TLS to DERP mesh
* Fix DERP mesh with TLS
* Add tests for TLS
* Fix replica sync TLS
* Fix RootCA for replica meshing
* Remove ID from replicasync
* Fix getting certificates for meshing
* Remove excessive locking
* Fix linting
* Store mesh key in the database
* Fix replica key for tests
* Fix types gen
* Fix unlocking unlocked
* Fix race in tests
* Update enterprise/derpmesh/derpmesh.go
Co-authored-by: Colin Adler <colin1adler@gmail.com>
* Rename to syncReplicas
* Reuse http client
* Delete old replicas on a CRON
* Fix race condition in connection tests
* Fix linting
* Fix nil type
* Move pubsub to in-memory for twenty test
* Add comment for configuration tweaking
* Fix leak with transport
* Fix close leak in derpmesh
* Fix race when creating server
* Remove handler update
* Skip test on Windows
* Fix DERP mesh test
* Wrap HTTP handler replacement in mutex
* Fix error message for relay
* Fix API handler for normal tests
* Fix speedtest
* Fix replica resend
* Fix derpmesh send
* Ping async
* Increase wait time of template version jobd
* Fix race when closing replica sync
* Add name to client
* Log the derpmap being used
* Don't connect if DERP is empty
* Improve agent coordinator logging
* Fix lock in coordinator
* Fix relay addr
* Fix race when updating durations
* Fix client publish race
* Run pubsub loop in a queue
* Store agent nodes in order
* Fix coordinator locking
* Check for closed pipe
Co-authored-by: Colin Adler <colin1adler@gmail.com>
* fix: await promises in WorkspacePage.test.tsx
* chore: add eventsourcemock to cspell words
* fix: clean up UsersPage.test.tsx
* refactor: clean up eventsource mock
* revert: remove changes from WorkspacePage.test.tsx
* feat: Add trial property to licenses
This allows the frontend to display whether the user is on
a trial license of Coder. This is useful for advertising
Enterprise functionality.
* Improve tests for license enablement code
* Add all features property
* chore: update cSpell words
* chore: add ignorePaths for cSpell
* fix: update isNotificationTextPrefixed
This removes an eslint-disable rule and adds two new tests to ensure
isNotificationTextPrefixed is working as expected.
* fix(e2e): remove filter in workspacesPage
* fix: Add coder user to docker group on installation
This makes for a simpler setup, and reduces the likelihood
a user runs into a strange issue.
* Add wgnet
* Add ping
* Add listening
* Finish refactor to make this work
* Add interface for swapping
* Fix conncache with interface
* chore: update gvisor
* fix tailscale types
* linting
* more linting
* Add coordinator
* Add coordinator tests
* Fix coordination
* It compiles!
* Move all connection negotiation in-memory
* Migrate coordinator to use net.conn
* Add closed func
* Fix close listener func
* Make reconnecting PTY work
* Fix reconnecting PTY
* Update CI to Go 1.19
* Add CLI flags for DERP mapping
* Fix Tailnet test
* Rename ConnCoordinator to TailnetCoordinator
* Remove print statement from workspace agent test
* Refactor wsconncache to use tailnet
* Remove STUN from unit tests
* Add migrate back to dump
* chore: Upgrade to Go 1.19
This is required as part of #3505.
* Fix reconnecting PTY tests
* fix: update wireguard-go to fix devtunnel
* fix migration numbers
* linting
* Return early for status if endpoints are empty
* Update cli/server.go
Co-authored-by: Colin Adler <colin1adler@gmail.com>
* Update cli/server.go
Co-authored-by: Colin Adler <colin1adler@gmail.com>
* Fix frontend entites
* Fix agent bicopy
* Fix race condition for the last node
* Fix down migration
* Fix connection RBAC
* Fix migration numbers
* Fix forwarding TCP to a local port
* Implement ping for tailnet
* Rename to ForceHTTP
* Add external derpmapping
* Expose DERP region names to the API
* Add global option to enable Tailscale networking for web
* Mark DERP flags hidden while testing
* Update DERP map on reconnect
* Add close func to workspace agents
* Fix race condition in upstream dependency
* Fix feature columns race condition
Co-authored-by: Colin Adler <colin1adler@gmail.com>
This allows deployments using our Prometheus export t determine
the number of active users in the past hour.
The interval is an hour to align with API key last used refresh times.
SSH connections poll to check shutdown time, so this will be accurate
even on long-running connections without dashboard requests.
* fix: Remove explicit coverpkg github.com/coder/coder/codersdk
This package is already covered by ./...
* fix: Ignore test utils in coverage (clitest, coderdtest, ptytest)
This cleans up agent association code to explicitly map a single
agent to a single resource. This will fix#1884, and unblock
a prospect from beginning a POC.