2023-10-16 22:30:10 +02:00
|
|
|
module github.com/wavetermdev/waveterm/wavesrv
|
2022-06-12 22:39:48 +02:00
|
|
|
|
2023-02-24 00:17:47 +01:00
|
|
|
go 1.18
|
2022-06-12 22:39:48 +02:00
|
|
|
|
|
|
|
require (
|
2023-02-15 01:17:54 +01:00
|
|
|
github.com/alessio/shellescape v1.4.1
|
|
|
|
github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2
|
|
|
|
github.com/creack/pty v1.1.18
|
ssh config import (#156)
* create migrations for required database change
This is a first attempt that does not appear to be working properly. It
requires review.
* fix errors in db migrations
The previous commit had an extra json call that broke the update and did
not remove the imported interies during a downgrade.
* change migrations to use column instead of json
It makes more sense to associate the source of a config with the remote
type than the sshopts type. This change makes that clear in the database
structure.
* ensure adding a remote manually tags correctly
Using the usual way of adding a remote should result in a sshconfigsrc
of "waveterm-manual". This will be important for filtering out remotes
installed manually and remotes installed via import
* create basic structure for parsing ssh config
This entails creating a new command, making it possible to query only
the imported remotes from the database, and implementing the logic to
handle all of the updates needed.
This needs improvements in a few areas:
- the /etc/ssh/config needs to be parsed as well
- the logic for editing exisiting imported remotes needs to be written
- error handling needs to be improved
- update packet responses need to be provided
* add sshkey support and implement editing
We now search for the ssh identity keyfile and add it if it is found.
Additionally, the logic to edit previously imported ssh hosts has been
added.
* combine hosts from user and system ssh config
We now check both the user ~/.ssh/config as well as the /etc/ssh/config
for hosts. This loops through each file starting with the user one. For
each host, it selects the first pattern without a wildcard and chooses
that to be the alias. If any future hosts are found to have the same
alias, they are skipped. Errors are raised if neither config file can be
opened or no aliases were found.
* improve logging and error reporting
Error reporting is now shortcircuited in cases of individual remotes in
order to allow the other remotes to continue. These errors are now
printed to logs instead.
* allow imports to edit ssh port
Previously, ssh ports could not be edited after the fact. Unfortunately,
this can cause problems since the port can be changed in an ssh config
file. To address this, we allow imports to change the port if a host
with the same canonical name had previously been imported.
* fix response to parse command
* fix error handline for alias parsing
Small mistake of checking for equality instead of inequality
* fix the ability to overwrite hostName with alias
if ssh_config does not find Hostname, it won't output an error. Now we
compare against the result instead of looking for an error.
* fix the error catching for User and Port
This fixes the same problem where parsing the config doesn't give an
error in the case when nothing is found. As before, this checks for a
blank result instead.
* remove unused code
* remove repeated canonical name check
The logic that checks for an existing canonical name already exists in
the AddRemote function, so it is not needed here.
Secondly, we now only allow edits of previously created remotes if they
have not been archived. If they have, the usual logic for creating a new
remote takes precedence.
Lastly, there is no need to archive a remote that has already been
archived so an additional check has been added.
* allow archives to preserve the SSHConfigSrc
* add log message for archiving of imported remotes
* create variables for string variants
Matches existing code style
* add cleanup for opened files
* move migration 25 to migration 26 (already merged a migration 25)
* fix RemoteRuntimeState in ModelUpdate by moving type to sstore.go. Fix some bugs in remote:parse. Fix key/identityfile, return value, and remote editing (should go through msh). remote sudo. add info messages around parse status
* fix issue with archiving the sshconfigsrc
A bug in RemoteType's FromMap caused the loss of sshconfigsrc during the
conversion. This has been corrected and the schema has been updated.
* fix order of archiving removed imported remotes
Previously, if the canonical name changed, the code would try to create
a new remote before archiving the old one. This did not work if the
alias didn't change. Now we archive first and add a new remote after.
* fix ability to change port when importing config
Importing from sshconfig needs to allow the port to change. This was not
happening because of a bug that has been corrected.
* always use host in place of hostname
Since host is the key actually searched for in the ssh config file,
searching for user@hostName may not actually work. To avoid this, we now
always use user@host instead.
* automatically determine ConnectMode
This aims to select a connection mode based off what is provided in the
ssh config file. It aims for auto connections when possible but will
fall back to manual if we can't easily support it
* remove sshkeysource migration number confilict
Previously had conflicting migration numbers of 26. The change not in
the main branch has been moved to 27 to remove the conflict.
* move sshkeysource migration to migration 28
* add WaveOptions flag parsing for ssh config
This is currently being used to allow users to force manual connect mode
if desired. It will also be used to force skipping options in the future
but that is not complete in this commit.
* implement ignore flag for ssh config parsing
The ignore flag will now archive an imported remote if it previously
existed and not create a new remote in its place.
* fix discovery of identity file
Previously, a ~ in the identity file's path was not expanded to the home
dir. Because of this, files with a ~ were previously identified as
invalid files. By expanding it during the search, this is no longer the
case.
* disable frontend edit button for imported remotes
Imported Remotes should not be editable in waveterm by users. This edit
makes it clear that the button will not work for those cases. Further
edits may be needed to explain why it doesn't work and what to do
instead.
* add backend rejection of updating imported remote
As before, we don't want manual editing of an imported remote inside the
app. This ensures that it can't happen on the backend.
* create tooltips for sshconfig edit/delete buttons
For remotes that are imported, edits are not allowed. This adds a
tooltip that explains what to do instead.
Deleting remotes that are imported is allowed, but they will come back
if the user imports again. The tooltip explains a way to avoid this.
* add logo after name for imported remotes
In the connections screen, there previously was not a way to tell
imported connections from manually created connections. This change adds
a logo after the imported ones to differentiate them.
* small formatting updates
* add import tooltip to connection modal
Added the logo for an imported config to the connection modal. It also
provides a short description when it the mouse hovers over it.
* add button to import ssh config
Make the command into a button for a simple gui interface.
Also ran prettier to clean up some syntax.
* remove strict casing on WaveOptions
WaveOptions was previously very specific about the casing of the ignore
and connectmode subcommands. With this update, the casing is
automatically converted to lowercase and can be ignored.
* add status dot before name in connections screen
* add space and tooltip to connection imported icon
* re-prettier
2023-12-28 20:09:41 +01:00
|
|
|
github.com/kevinburke/ssh_config v1.2.0
|
2023-08-03 23:58:56 +02:00
|
|
|
github.com/golang-migrate/migrate/v4 v4.16.2
|
2022-07-01 02:02:19 +02:00
|
|
|
github.com/google/uuid v1.3.0
|
|
|
|
github.com/gorilla/mux v1.8.0
|
|
|
|
github.com/gorilla/websocket v1.5.0
|
2022-07-01 19:48:14 +02:00
|
|
|
github.com/jmoiron/sqlx v1.3.5
|
2023-08-03 23:58:56 +02:00
|
|
|
github.com/mattn/go-sqlite3 v1.14.16
|
2023-10-12 02:59:22 +02:00
|
|
|
github.com/sashabaranov/go-openai v1.9.0
|
2023-04-18 02:31:30 +02:00
|
|
|
github.com/sawka/txwrap v0.1.2
|
2023-10-17 04:17:44 +02:00
|
|
|
github.com/wavetermdev/waveterm/waveshell v0.0.0
|
2023-12-19 05:45:00 +01:00
|
|
|
golang.org/x/crypto v0.17.0
|
2023-10-12 02:59:22 +02:00
|
|
|
golang.org/x/mod v0.10.0
|
2023-12-19 05:45:00 +01:00
|
|
|
golang.org/x/sys v0.15.0
|
2023-10-12 02:59:22 +02:00
|
|
|
mvdan.cc/sh/v3 v3.7.0
|
2022-07-01 02:02:19 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
require (
|
2023-12-16 02:43:54 +01:00
|
|
|
github.com/google/go-github/v57 v57.0.0 // indirect
|
2022-07-01 19:48:14 +02:00
|
|
|
github.com/hashicorp/errwrap v1.1.0 // indirect
|
|
|
|
github.com/hashicorp/go-multierror v1.1.1 // indirect
|
|
|
|
go.uber.org/atomic v1.7.0 // indirect
|
2023-10-16 22:30:10 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
replace github.com/wavetermdev/waveterm/waveshell => ../waveshell
|
2024-01-10 03:04:19 +01:00
|
|
|
replace github.com/kevinburke/ssh_config => github.com/wavetermdev/ssh_config v0.0.0-20240109090616-36c8da3d7376
|