5
0
mirror of git://git.proxmox.com/git/pve-xtermjs.git synced 2024-12-22 17:35:56 +03:00
Commit Graph

22 Commits

Author SHA1 Message Date
Fabian Grünbichler
b3b1677289 bump pico-args to 0.5
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-07-29 09:36:38 +02:00
Thomas Lamprecht
9bf8b31e8d termproxy: bump version to 1.1.0
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-07-25 17:39:14 +02:00
Thomas Lamprecht
41f91fd42c termproxy: avoid gluing words together in CLI option names
Separate auth-port and auth-socket with a minus to make them easier to
read. Fallback to the old style for `authport` which is pre-existing
and used by, e.g. PBS. As the second option, now named `auth-socket`,
got only introduced very recently and was not shipped in any package,
we can ignore backwards compat for it.

Update and slightly rework the usage output too.

Note that even though this is an internal tool the cost doing so is
small and it can only help, e.g. on using this manually and/or during
debugging.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-07-25 17:25:06 +02:00
Thomas Lamprecht
4b8568cb4f termproxy: fix parsing free-form listen-port argument
While commit d8e9c1a ("termproxy: fix the command line help text")
corrected the usage text to match the behavior and was a good stop-gap
it simply is to easy to make this work as most CLI tools do and most
user expect.

Switch to parsing all options first and only then get the free-form
listen-port(-or-fd) argument.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-07-25 17:17:37 +02:00
Wolfgang Bumiller
69400e983e termproxy: clippy fixes
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-07-25 10:52:48 +02:00
Wolfgang Bumiller
b64e188aa5 termproxy: less dangerous const usage in match statement
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-07-25 10:52:41 +02:00
Wolfgang Bumiller
b9e4877be0 formatting fixup
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-07-25 10:46:31 +02:00
Dietmar Maurer
3da624d7af termproxy: allow to use unix sockets for auth requests
Remove ureq, because it does not support unix sockets.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2024-07-25 10:30:20 +02:00
Dietmar Maurer
d8e9c1a261 termproxy: fix the command line help text
The <listen-port> need to be the first argument.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2024-07-25 10:30:06 +02:00
Fabian Grünbichler
9e209b042b d/control: fix build-dependencies
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2023-12-14 09:30:43 +01:00
Thomas Lamprecht
e2e62fc673 termproxy: bump version to 1.0.1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-10-26 17:30:10 +02:00
Thomas Lamprecht
a69ef0b68e termproxy: avoid expensive proxmox-sys crate, copy over PTY module
This is only used here anyway, and proxmox-sys is one of those monster
crates still awaiting to be split up in more sensible pieces.

This halves (non-release) build times here from 8.5 to 4.1 seconds.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-10-23 10:42:45 +02:00
Thomas Lamprecht
15f29f119f termproxy: cargo: sort dependencies
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-10-23 10:19:45 +02:00
Thomas Lamprecht
7801b96c33 termproxy: split out CLI stuff to own module
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-10-23 10:12:12 +02:00
Thomas Lamprecht
83df2fc0ad termproxy: code/formatter cleanups
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-10-20 08:06:09 +02:00
Thomas Lamprecht
24d707d050 termproxy: switch from clap to pico-args for CLI argument handling
Not that clap is bad or anything the like, but for one it's rather
over engineered, and it has to be as long as it wants to provide a
dozen wildly different way to do things.
And the second, more important reason: it's still undergoing a lot of
churn every year or so.  Each upgrade to a major version needs like
two hours of understanding what's going on, at least if one wants to
Do It Right™.

Termproxy, otoh., is a small and internal tool that doesn't need an
overly fancy CLI targetting humans, as it will be only called by the
API anyway.

So, to reduce the time required to constantly catch up, and remove
some complexity, switch over to pico-args. That one provides a few
small interfaces for the most common things, does it right and uses
OsString as main type and has exactly zero dependencies on its own.
In other words, perfect for such internal tools (and possibly also
most others).

Copy over the help output from the clap based tool for convenience,
pico-args really doesn't bother with such things, and introduce an
Options struct to have a, well, more structured way of handling CLI
arguments/options.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-10-20 08:06:09 +02:00
Thomas Lamprecht
749ebb0907 termproxy: fix port/fd range check
The valid upper range was swapped, while at it switch from i32::Max to
RawFd::Max, while currently RawFd is a type alias to i32, it's easier
to grasp what's going on and might even change in the future.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-10-17 14:57:04 +02:00
Thomas Lamprecht
f451fe2768 termproxy: bump version to 1.0.0
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-10-17 10:51:25 +02:00
Thomas Lamprecht
55deb66575 termproxy: d/rules: drop bogus dh_build/install overrides for LIBEXECDIR
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-10-17 10:49:54 +02:00
Thomas Lamprecht
72c15d118f termproxy: install to usr/libexec directory
this is not a standard CLI tool that should be exposed to all users,
but an internal binary, so  move it to /usr/libexec/proxmox.
That location was chosen over a multiarch path
/usr/lib/<triplet>/proxmox to make resolving the path easier for the
caller, as the standard ways to get the multiarch triplet (e.g.,
"x86_64-linux-gnu") involve CC and are not easily/cheaply available in
perl – we would basically create an architecture specific package that
provides a path resolution with multiarch triplet resolved at "build"
time of that module; as we probably do not ever install termproxy
multiple times targeting different arch's on the same system, this is
just to much complexity.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-10-17 10:49:54 +02:00
Thomas Lamprecht
7d87397198 termproxy: enable full LTO
shaves of over 100KB of the final binary and this crate is small
enough to not notice a relevant compile time impact.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-10-17 10:49:54 +02:00
Thomas Lamprecht
145da0bf45 split upstream and our native into different source packages
We should have never added a upstream repackage and some custom tools
in the same source package, let alone binary package. Finally resolve
that tech debt and do a split.

This commit does a bit more than I'd like at once, but it's really not
trivial to make a clean split while keeping all sanely buildable in
multiple commits.

What roughly happens is:
- two complete separate source packages
  - one for xterm.js, we keep this purely to the xterm.js and our
    local additions and modifications that are relevant directly to
    xterm.js itself
  - one for termproxy, where only the rust-based tool is shipped.
    This also reduces churn, as the termproxy doesn't sees lots of
    updates, so no point in building it on every xterm.js update.
  - drop debcargo, which while great for library source code packages
    for build dependencies, is just a PITA for binary packages
    shipping actual compiled rust code, it adds almost nothing there
    but provides lots of special handling to get the correct result.
  - rename `termproxy` to `proxmox-termproxy` but keep a backward
    compat link for now, termproxy is way to general a name.
    Maybe we should also move this away from /bin in general, into the
    /lib/<arch-qualifier>/proxmox/ directory like we do for
    proxmox-backup.
  - clean ups all over the place

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-10-17 10:49:54 +02:00