Commit Graph

1517 Commits

Author SHA1 Message Date
Evan Simkowitz
d431ac1ecf
Upgrade to Typescript 5, along with a bunch of other minor bumps (#224)
* Bump electron and dependencies

* upgrade typescript and webpack

* upgrade remaining outdated

* bump node types
2024-01-11 18:57:15 -08:00
dependabot[bot]
f8024799ed
Bump follow-redirects from 1.15.3 to 1.15.4 (#222)
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.3 to 1.15.4.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.15.3...v1.15.4)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-11 18:31:07 -08:00
Evan Simkowitz
ebdf8b5aee
Remove unused and unmaintained react-json-view (#223) 2024-01-11 18:28:21 -08:00
Evan Simkowitz
ed2a345555
Add support for opening web links in the default browser (#221)
* Add support for opening web links in the default browser

* require modifier key to click

* undo emain change

* remove newline
2024-01-11 17:49:13 -08:00
Cole Lashley
ea3be8115a
Chat GPT Command Info Chat (#207)
* first draft at ui

* first draft connecting openai to cmd info ui

* added more updates and added prompt engineering

* focus textarea on mount

* fix aichat layout issue

* added focus back to input after closing cmd info chat

* added ability to clear chat history, closes on command enter, better initial greeting message, and small things like user can refocus the help textarea by pressing ctrl + space again

* added a bunch of small upgrades

* added context for chatgpt info command

* added context to chatgpt cmd info command

* added ability to use arrow keys to grab code markdown

* added error handling as well as fixed the text area outline bug

* slightly changed the ui for selecting

* revamped ui and added correct scroll behavior

* changed ui, fixed up code block selection, some other small changes

* deep copied cmd info chat when we return

* added error checking and removed logs

* made deep copy code more clear

* prettier with the right version

* more prettier changes

* removed extraneous comment
2024-01-11 17:34:23 -08:00
Red J Adaya
077cb2be03
Split up modals.tsx file (#220)
* init

* diconnected and clientstop modals

* alert and createremoteconn modals

* tabswitcher, view and edit remoteconn modals

* migrate clientstop modal to Modal

* LinkButton

* import styles for createremoteconn modal

* import tabswitcher modal styles

* disable buttons while status is 'connecting'

* minor refactor

* apply changes to viewremoteconn modal from main
2024-01-11 09:42:03 -08:00
Red J Adaya
8f39f0fc5e
Add a modal confirmation before installing WaveShell (#212)
* init

* integrate showShellPrompt flag

* renive debugging code

* remove debugging code

* run gofmt. add migration files.

* remove debugging code

* remove migrations and adjust code. show prompt on import ssh configs as well.

* fix show/hide logic

* reset mmap.go

* use resolveBool and utilfn.ContainsStr

* make AlertModal take a generic 'confirmkey' instead of hard coding hideShellPrompt

* rename confirmkey to confirmflag (to be consistent).  move confirmflag checking into the alertmodal.  short circuit with Promise.resolve(true) if noConfirm checked.

* disable buttons while status is 'connecting'

* minor refactor
2024-01-10 15:00:18 -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
c2a894b280
SSH Configuration Import Alert Modal (#218)
* add an alert modal for the sshconfig import button

When the sshconfig import button is pressed, there currently is no
visual indicator of what changed. This adds an alert modal to pop up
only in the case where the gui button is used.

* improve alert modal for sshconfig imports

The previous message for SSH configuration imports was vague and did not
provide detailed information as what happened during the import. This
clarifies that by specifying which remotes were deleted, created, and
updated. Updates are only ran and recorded if they would actually change
something.

* fix port value limiting

The SSH config import port limiting was correct but set off a warning in
linters. It has been updated to do the same behavior in a different way.

Also, port limiting was never added to manually adding a new remote.
This change adds it there as well.

* change user-facing term to connection

Previously, the ssh configuration alert modal used to use the word
"remote" to describe connections. "Remote" is the internal name but it
isn't consistent with what is being displayed to users. So it has been
replaced with "Connection" instead to match.

* change remote to connection for ssh import buttons

Like the previous change, the word "remote" was used instead of
"connection." This was for the tooltips added to connections that had
been imported in the connections menu.

* update one more remote -> connection
2024-01-09 16:13:23 -08:00
Mike Sawka
fad48b0d09
bind cmd-w to delete a screen (with a confirm message). also fix 'esc' so it closes the alert modal with a 'cancel' (#215) 2024-01-08 22:59:17 -08:00
Mike Sawka
8ac1943d56
Add Icon / HotKey to Delete Line (Cmd-D) (#214)
* work on cmd-d to delete a selected line

* call stoppropagation when code.tsx captures keyboard input

* finish up with line delete.  add a trash icon to line.  prevent delete when cmd is running (show error msg)
2024-01-08 22:58:32 -08:00
Red J Adaya
f6a6068674
Connection Screen Terminal "Flash" Making it Impossible to Enter Manual Passwords (#217)
* fix flashing view modal

* cleanup

* fix name typo, also unset setRecentConnAdded once the modal is open
2024-01-08 22:56:49 -08:00
Sylvie Crowe
e1e5b67ff6
I18n fixes (#211)
* remove byte sanitization for user commands

When serializing jsonBytes in packet.go::MarshalPacket, a step existed
that attempted to manually sanitize the bytes before sending them. This
was initially done to avoid invalid characters in json; however, go
should handle this for us. But this sanitization broke
internationalization because it excluded characters required for unicode
in other languages. Because of that, it has been removed.

* properly decode non-ascii on frontend

The functions atob and btoa do not convert base 64 to strings in the
expected way. The base64ToArray function handles it properly but other
cases do not. These other cases have been replaced with a helper
function that makes use of the base64-js package. This package has
already been included as a dependency of another package we use, but it
was added to the package.json file to make the inclusion explicit.

* automatically set/share LANG var with waveshell

Waveterm previously did not set the LANG environment variable which
caused problems for international users. On Linux, this is done
automatically, but it needs to be done manually on macos.

Even on linux, the wavesrv LANG variable is shared with waveshell to
ensure the same one is used on remotes.

* only set the lang var if not previously set

In order to prevent waveterm from overriding the lang var entirely, this
ensures that it is only manually determined if it hasn't previously been
set.

* use envMap instead of os to determine var

This is slightly more performant and relies more directly on our code
instead of external code.
2024-01-08 18:31:17 -08:00
sawka
0bb80b6a74 run both mac builds 2024-01-08 00:35:38 -08:00
sawka
631a0867aa fix go cache dependency 2024-01-08 00:28:54 -08:00
sawka
5bd7f73746 updates to build workflow 2024-01-08 00:12:07 -08:00
sawka
ed1dff320d upload build artifact 2024-01-07 23:58:46 -08:00
Mike Sawka
7f91efc314
working on a macos x86 build workflow (#216)
must check in to main to test
2024-01-07 23:48:10 -08:00
sawka
f737c2af86 add autofocus prop to button 2024-01-07 00:30:25 -08:00
Sylvie Crowe
8cbee1e1c3
Allow dots in alias and add port to canonical name (#209)
* allow numerical start and allow dots in ssh alias

We previously restricted the ssh alias to start with an
alphabetic character and did not allow dots within it. This caused
problems with users wanting to use an ip address as an alias. This lifts
that restriction so both can freely be used.

Note that while it is common to use the hostname as the alias, hostnames
are not allowed to use the underscore character. However, we do allow
the alias to contain an underscore. I do not think we can remove this
from aliases now but it is something to watch out for in the future.

* allow backslash in username

This involved converting the regexp string into a raw string to able to
use the backslash character. this is important.

* Revert "allow backslash in username"

This reverts commit cafe281241. Upon
reflection, more time is needed to evaluate that this actually corrects
the issue. It will be performed with proper diligence at a later time.

* add port to end of canoncial names when not 22

The canonical name is the identifying key in the database, so it causes
problems if another remote entry has the same canonical name. By adding
the port number to the end of this, it is possible to differentiate the
two.

* add db migrations for adding port to canonicalname

The up migration adds the port to the existing canonical id if it exists
and is not 22. The down migration strips the port off the canonical name
and deletes extra remotes with the same canonical name. If all remotes
with that canonical name have been archived, it keeps the first one
added to the database. If any have not been archived, it keeps the first
added to the database from the non-archived group.

* remove ability to edit port number via ssh import

Previously, ssh imports could edit the port number since it was possible
to change them in the config file without changin the canonical name.
Now that the canonical name contains the port, a change in the port will
simply create a new database entry. For this reason, the ability to
modify the ssh port is dead code and has been removed.

* allow backslash in username

This involved converting the regexp string into a raw string to able to
use the backslash character. this is important.

* simplify up migration logic

The previous up migration was suboptimal because it was accounting for a
corner case not found in production. That case no longer needs to be
considered, so the procedure was simplified.
2024-01-04 10:16:26 -08:00
Red J Adaya
b2a1bb3818
When client is disconnected change log to show last 50 lines of wavesrv.log (#210)
* improved disconnected modal

* wrap pre with div

* make number of a lines param a constant

* revert app.tsx

* use tail command and capture the output instead

* reset TabSwitcherModal
2024-01-04 10:13:40 -08:00
Sylvie Crowe
d1319c0a2c
Fix Commands that Require Quoted Paths (#198)
* fix commands that require quoted paths

Several commands did not wrap the path in quotes which caused problems
when attempting to store the waveterm installation in a place that had a
space in the path. This corrects this in the particular case where the
username does not have spaces but the path to the executable does.

Note: the case of a user name having spaces has not been tested but
likely does not work.

* fix logging problem for wavesrv

A previous fix replaced the getWaveSrvCmd with getWaveSrvPath. This
needs to be getWaveSrvCmd to enable logging.

* fix variable name
2023-12-30 22:52:30 -08:00
Red J Adaya
2c9272e3a7
fix tabs scrollbar jump (#203) 2023-12-30 22:42:46 -08:00
Red J Adaya
452836bffc
Cmd-P feature -- Quick Tab Selector (#200)
* register cmd+p shortcut

* tab switcher modal

* initial implementation

* tab switcher modal content

* fix styles

* fix scroll bugs

* set selected index when clicking option

* hover effect for options

* switch when Enter key is pressed

* remove fuse.js

* only use switchscreen for switching sessions and tabs

* var naming changes

* fix multiple focused options on mouse hover

* fix duplicate focused options and scrollbar

* clean imports

* fix wrong function name

* merge color styles in app.less

* remove debugging code

* use For component when iterating thru options

* minor style fix

* remove mouse interaction, keep focusedIdx in bounds, increase max number of tabs shown, small layout adjustment for big tab names (and more space for icon)
2023-12-30 22:34:05 -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
Mike Sawka
2f7cce294c
big update to screen/session delete, and clear (#199)
* sync schema.sql with running schema

* remove incognito field from history table. also don't add empty FeState vars

* history updates, add festate, durationms, exitcode, status, and tags into history table

* update screen/session delete, and clear to no longer purge history items.  move deleted screens/sessions into a tombstone table.

* update schema

* fix alias -> fn

* quiet the security warning about an unchecked byte conversion. no real security issue here, but add a range check for good measure.
2023-12-27 13:11:53 -08:00
sawka
01074af129 fix warnings in waveshell 2023-12-26 15:03:17 -08:00
Mike Sawka
6a1b2c8bd4
Screen MemStore (#197)
* working on an in-memory store for screen information

* nostrpos sentinel

* textareainput now tracks selection (to update backend)

* make websocket connections much safer.  add a defer/panic handler for each ws message handled on backend.  don't allow client to reconnect to backend ws handler more than once per second (handles issue with lots of fast fails)

* use onSelect to have frontend textarea sync state to backend ScreenMem store

* restore cmdline when switching screens

* prettier
2023-12-26 12:59:25 -08:00
Evan Simkowitz
9980a6b204
Display open-source license acknowledgements (#193)
* Add script to generate license disclaimers for all dependencies

* update readme

* Upload current acknowledgements

* Add acknowledgements link to about, remove unnecessary width setting

* revert gitignore

* update readme wording

* i was wrong, we can output for both backend mods at the same time

* update wording

* remove license button in about modal (replaced with acknowledgements)
2023-12-24 11:41:51 -08:00
Red J Adaya
019eaecdaa
Immediately hide modal when deleting workspace (#187)
* immediately hide modal when deleting workspace

* only pop modal when purging is successful
2023-12-23 12:31:11 -08:00
Red J Adaya
de9c029ba8
ScreenTabs refactor (#182)
* inital implementation

* cleanup

* ui jump fix

* fix wrong first tab top right border radius

* add comment

* remove react.fragment.  only do initial screens populate on componentDidMount, rename this.scrollIntoViewTimeout (add Id to distinguish from state.scrollIntoViewTimeout).

* clean up some imports

* use single tabRef
2023-12-22 19:14:48 -08:00
Evan Simkowitz
e7725e0e11
Clean up cirfile and cirfile_tests, ensure we are using contexts with cancellation signals (#183)
* Fix unvalidated path warning in cirfile.go

* Adding test

* move dir path vars into global scope, set wave home in test if not set already

* separate validation code into own testable func

* do removal of cir file in cleanup

* rename test file names

* flock should return err if waiting without done fn

* update comment

* use timeout context

* remove redundant validation

* add more error messages

* use filepath.join instead

* validate when creating cirfile too

* support .ptyout.cf, etc.

* remove validation as cirfile is "trusted", since it only accepts pre-validated input

* revert to passing nil context for flock in the Create file case
2023-12-22 18:07:58 -08:00
Evan Simkowitz
092a8de715
Escape error output in main-server to quiet security alert (#185) 2023-12-22 17:55:20 -08:00
sawka
c56ee23843 add lines to ignored variables 2023-12-21 14:32:27 -08:00
sawka
19e856a3be bump version to 0.5.3 2023-12-21 12:31:54 -08:00
sawka
8246f8118e bump to v0.5.3 to fix #174 2023-12-21 12:30:57 -08:00
Red J Adaya
75d1a435ae
fix missing session ID (#178) 2023-12-19 16:18:44 -08:00
Mike Sawka
426f9546e5
fix connection edit modal (#170)
* fix connection edit modal

* apply prettier
2023-12-18 23:28:49 -08:00
sawka
d410e5d07f add keys to force new components whenever workspaces changes 2023-12-18 21:47:01 -08:00
sawka
e66f34c9b5 upgrade go crypto library 2023-12-18 20:45:00 -08:00
sawka
58e971276e minor fixes 2023-12-18 20:41:15 -08:00
Cole Lashley
2d08037782
Fixed open ai renderer not scrolling correctly (#165)
* added scrolling to open ai renderer css

* fixed max width

* small fixes - added max width - added padding - fixed flex issue
2023-12-18 17:20:13 -08:00
Evan Simkowitz
226699732d
Run release check in the background when toggling the setting (#169)
* Run release check in the background when toggling the setting

* change var name

* use new err variable
2023-12-18 17:19:11 -08:00
Evan Simkowitz
03b1e410e7
Small tweak to the checkbox toggle slider (#168) 2023-12-18 16:41:35 -08:00
Mike Sawka
38c784bf8e
sidebar render delay of 0.5s, and a 0.5s transition on main window width (#167)
* sidebar render delay of 0.5s, and a 0.5s transition on main window width

* fix width calculation and how we apply the buffer width for sidebar

* also add the model.ts change
2023-12-18 16:40:26 -08:00
Sylvie Crowe
40af311e5b
remove handleKeyDown for NumberField (#166)
handleKeyDown was a method that filtered out specific keypresses if they
weren't specific keycodes. This did not play well with all keyboards
which made it impossible to enter port numbers. furthermore,
handleInputChange should already filter out non-numeric characters, so
the filtering still works properly with this removal.
2023-12-18 16:03:51 -08:00
Evan Simkowitz
112fda912f
Modify "Check for Updates" setting name (#164) 2023-12-18 15:28:35 -08:00
sawka
f2eb383cc3 add special case for conda activate/deactivate as well to rtnstate detection 2023-12-18 15:07:13 -08:00
sawka
8d71f5538c update rtnstate detection, support blocks, and binary expressions 2023-12-18 15:02:55 -08:00
sawka
7a37fdb942 create new contexts for goroutine calls 2023-12-18 14:41:53 -08:00