Commit Graph

9 Commits

Author SHA1 Message Date
Mike Sawka
2735b03cb8
update go.sum files (#391) 2024-03-06 14:47:41 -08:00
Sylvie Crowe
6091305bb3
SSH Quick Fixes (#385)
* fix: allow ssh user to use numbers/capital letters

Prior to this change, usernames could not start with numbers and could
not contain capital letters at all. Note that the username can also
start with capital letters.

* fix: update ssh_config with IdentityFiles fix

This adds the update that provides the ssh2 defaults for IdentityFiles.
This will allow the usual defaults to be searched when none are
explicitly provided.

* fix: overwrite identity files instead of appending

This change makes it so a waveterm configured identity file will
overwrite the one in the config instead of attempting to append it. This
matches the behavior of openssh.

* style: use regular font for markdown user input

This makes the Markdown User Input indistinct from user input without
markdown. It changes the font and makes a couple small adjustments to
the font size and line height.

* fix: use font property instead of font-family

The markdown css for User Input can be simplified with the font being
set by the "font" property rather than the "font-family" property.
2024-03-06 12:33:01 -08:00
Evan Simkowitz
bde2a9ccfe
Update dependencies (#383)
* Bump go-github and update license disclaimers

* update go version

* upgrade electron-builder
2024-03-05 16:12:52 -08:00
Sylvie Crowe
6c115716b0
Integrate SSH Library with Waveshell Installation/Auto-update (#322)
* refactor launch code to integrate install easier

The previous set up of launch was difficult to navigate. This makes it
much clearer which will make the auto install flow easier to manage.

* feat: integrate auto install into new ssh setup

This change makes it possible to auto install using the ssh library
instead of making a call to the ssh cli command. This will auto install
if the installed waveshell version is incorrect or cannot be found.

* chore: clean up some lints for sshclient

There was a context that didn't have it's cancel function deferred and
an error that wasn't being handle. They're fixed now.

* fix: disconnect client if requested or launch fail

A recent commit made it so a client remained part of the MShellProc
after being disconnected. This is undesireable since a manual
disconnection indicates that the user will need to enter their
credentials again if required. Similarly, if the launch fails with an
error, the expectation is that credentials will have to be entered
again.

* fix: use legacy timer for the time being

The legacy timer frustrates me because it adds a lot of state to the
MShellProc struct that is complicated to manage. But it currently works,
so I will be keeping it for the time being.

* fix: change separator between remoteref and name

With the inclusion of the port number in the canonical id, the :
separator between the remoteref and remote name causes problems if the
port is parsed instead. This changes it to a # in order to avoid this
conflict.

* fix: check for null when closing extra files

It is possible for the list of extra files to contain null files. This
change ensures the null files will not be erroneously closed.

* fix: change connecting method to show port once

With port added to the canonicalname, it no longer makes sense to append
the port afterward.

* feat: use user input modal for sudo connection

The sudo connection used to have a unique way of entering a password.
This change provides an alternative method using the user input modal
that the other connection methods use. It does not work perfectly with
this revision, but the basic building blocks are in place. It needs a
few timer updates to be complete.

* fix: remove old timer to prevent conflicts with it

With this change the old timer is no longer needed. It is not fully
removed yet, but it is disabled so as to not get in the way.
Additionally, error handling has been slightly improved.

There is still a bug where an incorrect password prints a new password
prompt after the error message. That needs to be fixed in the future.
2024-02-29 11:37:03 -08:00
Mike Sawka
3f83b30b06
add support for "Hack" font family (#309)
* testing hack font

* updates to allow font to be variable

* allow setting of font-family.  get initial font family from electron (needed for loading)

* add termfontfamily

* update wave logos for README

* hook up fontfamily setting, remove old dropdown active var

* get app to reload on font change.  reload fonts

* on termfontsize change, bump render version as well
2024-02-22 11:45:43 -08:00
Sylvie Crowe
00e709d515
reload ssh config files when importing them (#219)
The ssh_config library only loaded the config data the first time
certain functions are used. After that, cached values are used instead.
This library has been updated in a fork to add a method that allows the
configuration files to be reloaded. This update takes advantage of that
change so the config files can be updated without restarting waveterm.
2024-01-09 18:04:19 -08:00
Sylvie Crowe
8d88e2cf94
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 11:09:41 -08:00
Evan Simkowitz
b733724c7d
Add sidebar banner when new release is available (#147)
* Server impl

* add update check setting

* add commands

* fix capitalization of commands

* apply suggestions

* add migration and fix backend bugs

* Add sidebar banner

* remove installedversion, add 5s timeout

* add icon, capture and log errors from release check

* missing return nil

* remove highlight

* remove commented less

* do not fail releasecheckoncommand if release check operation fails

* remove debug condition

* fix update on auto check, move banner display logic into frontend

* remove unnecessary import

* simplify null check

* clean up the invoking of the releasechecker
2023-12-15 17:43:54 -08:00
sawka
7c11296a94 add go.work for helping with VSCode gopls 2023-10-16 19:17:44 -07:00