Commit graph

139 commits

Author SHA1 Message Date
8f12945d83 Fix up port state interactions in the face of configuration 2024-08-08 14:26:41 -07:00
6736cdd431 Additional tests for configuration 2024-08-08 10:26:36 -07:00
e1768a0433 Honor the configured description for a port, if any
Get rid of that dumb warning, can't believe I forgot to wire this for
so long.
2024-08-08 10:15:42 -07:00
2a582e25a8 Many fixes for the clipboard and others
- Reverse connections must be maintained to ensure messages are
  processed in order. (Whoops!)
- The clipboard context must remain live in order for the data to
  remain available for applications, at least on X11. (And it couldn't
  hurt elsewhere, either, I guess.)
- Print out the server version at startup time, so we can be sure what
  we're talking to.
- Print out the full details of the error when something goes wrong
  with `browse` or `clip`.
2024-08-08 10:07:57 -07:00
a3fa032500 Fix git status parsing 2024-08-08 07:18:13 -07:00
b8fe678ff0 Repository information in version 2024-08-07 12:14:17 -07:00
8a60f89110 Fix small JSON bugs, bring in test suite
Just decided to "harden" the JSON parser a little bit with the test
suite from https://github.com/nst/JSONTestSuite. Now I'm pretty sure
that we can handle whatever JSON docker throws at us.
2024-08-06 09:22:11 -07:00
9ef5515f01 Clippy 2024-08-06 06:51:03 -07:00
1f19792c58 Merge branch 'main' into quodlibetor/support-server-logs 2024-08-06 06:39:14 -07:00
Brandon W Maister
b983595049 feat: Show errored ports as an error state 2024-08-05 12:16:47 -07:00
5e96b37f5b Docker support
This is the most basic kind of docker querying you will find. Does not
support HTTPS. Seems to work for local docker engines. Has not been
tested against remote docker engines, or full URLs.

Note that if you want this to work you'll have to configure docker to
allow manipulation without being root, i.e., the user you connect as
will need to be in the `docker` group.

This was done instead of pulling in the `bollard` crate. Maybe I'm
being silly, but `bollard` uses a whole lot of other crates in the
name of being general and robust. These crates, however, add an
unacceptable size to the final binary. (In the experiment I ran, on a
release build, the binary size went from 2904696 to 4840968 bytes: an
increase of 1.8 MB. With this patch the release binary is 2986360
bytes, which is an increase of 80k.)

I wanted to see exactly what I could get away with when it came to
talking to docker. This here actually seems like a fine compromise:
HTTP is very simple if you only have to worry about one specific
server, and JSON is not very hard to parse if you don't care too much
about error handling, or are willing to play fast and loose with
punctuation (which I am).
2024-08-05 12:04:26 -07:00
Brandon W Maister
18da61ed32 make server logging show messages in the frontend
now you can use the log crate and get messages in the frontend.
2024-08-05 16:59:41 +01:00
8135f163f2 Refresh is async
Now we are ready for more asyncery (e.g., docker)
2024-08-04 08:29:33 -07:00
c2c57289cf Refactor refresh
Moving different mechanisms into different conditionally-compiled
modules. This way it can be extended, e.g. with docker lookups, MacOS
support, etc.
2024-08-04 08:14:19 -07:00
75343dbea2 Fix build break for windows (oops)
Really need to have better cross-building infrastructure for my own
personal garbage.
2024-08-04 08:11:00 -07:00
6335944591 One more test 2024-07-31 15:07:27 -07:00
3b1847d882 Require a file name for 'clip', use '-' for stdin
This makes argument parsing more reliable: to `fwd` to a server named
`clip` just leave off the file name.
2024-07-31 15:06:20 -07:00
46bd840bc0 Another test for clip garbage 2024-07-31 14:58:11 -07:00
604f31d8e6 Fix argument parsing (whoops)
This whole command line thing is actually busted; probably should make
it a little bit more robust.
2024-07-31 14:56:50 -07:00
3cb40bc2f4 Clippy 2024-07-31 14:45:20 -07:00
a40a493d39 Initial implementation of clipboard forwarding 2024-06-23 08:54:41 -07:00
fb86cbd0de Bump crate version for unreleased 2024-06-22 07:32:43 -07:00
3eba65f6e6 Refactor in prep for clip 2024-06-22 07:32:11 -07:00
3f7afc5b78 More clippy 2024-06-22 06:13:09 -07:00
08a41492b8 Clippy I guess 2024-06-21 08:26:56 -07:00
1e33561d92 Allow manual trigger of workflow dispatch 2024-04-14 06:51:26 -07:00
e11b6e025e Maybe release for aarch64? Who can say. 2024-04-13 14:59:19 -07:00
7766feafd4 Bump the version in the crate
Forgot to do this on release, whoops
2024-03-01 06:15:56 -08:00
10984034fa Supply the error message when connect fails
This might be too ugly
2024-02-29 13:16:16 -08:00
0368074ea0 Explicit tokio features
Somehow I thought this would make my binary smaller lol
2023-11-25 08:04:40 -08:00
2684d7f009 Upgrade dependencies 2023-11-25 07:58:00 -08:00
00daedeb95 Some silly refactoring 2023-11-25 07:57:52 -08:00
519b7bc415 Display the URL we're trying to open when it fails
This means that it is not lost forever and you can, I don't know,
click it in your terminal window or something.

(Thanks @quodlibetor for the patch!)
2023-11-25 07:33:44 -08:00
9671da9750 Make notes about the future 2023-08-28 09:25:46 -07:00
fd02779ba0 Bump version to 0.7.0 2023-04-30 07:33:55 -07:00
b85e3fa9a6 Fix crash on changing selection with no ports
No ports always means no selection
2023-04-30 07:33:06 -07:00
815ee5e86e Remove explanation for what fwd does
You probably know already, and it feels clunky here.
2023-04-30 07:24:18 -07:00
ec130d38b9 Support running server side with sudo
This allows forwarding ports that you would otherwise not be able to
see. More dangerous, probably not what you want most of the time, but
OK for now.

(I continue to resist adding clap as a dependency.)
2023-04-30 06:51:37 -07:00
d3d7b4f137 Bump cargo version to v0.6.2 2023-04-26 12:01:17 -07:00
59b8b8f3dc Cleanup some help text 2023-04-26 12:00:01 -07:00
0f8486d418 Upgrade dependencies 2023-04-26 11:53:15 -07:00
b74bf4aa9a The release that we create should be a draft
A human should have to publish it.
2023-04-26 11:47:48 -07:00
7deb8489e4 Bump the cargo version
Whoops I forgot.
2023-04-26 11:44:21 -07:00
a3c4c3ea5e Track the selection across refreshes by port number
The next step would obviously be to track the selection only by port
number, so that we remember the selection if the port goes away and
comes back.
2023-03-23 19:40:42 -07:00
99d377d4ce Make help modal
I don't like that ENTER and the arrow keys still manipulate the list
while help is showing. Ignore other keypresses while the help screen
is shown.

Also, make the spelling/capitalization a little cleaner.
2023-03-21 23:17:16 -07:00
34340e2575 Simplify centering math, don't crash if the rectangle clips
Also, tests
2023-03-21 23:07:08 -07:00
Brandon W Maister
290dcff9b6 tui: Add a help popup 2023-03-21 22:53:35 -07:00
Brandon W Maister
381c008665 tui: Add a fwd column with a ✓ to show that ports are being forwarded
I didn't realize that everything was forwarded by default, this makes it more
obvious.
2023-03-21 22:53:35 -07:00
7410ec5143 Add tests for keypresses 2023-03-21 22:48:06 -07:00
f174f364a4 Re-add assertions and simplify wrapping 2023-03-21 19:45:17 -07:00