5
0
mirror of git://git.proxmox.com/git/pve-xtermjs.git synced 2025-03-10 16:58:40 +03:00

146 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
872cf7c634 move .cargo/config to .cargo/config.toml
the old location has been deprecated for a while, and rustc 1.78 will start to warn about it.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-06-20 12:38:14 +02:00
Fabian Grünbichler
0f71672cd5 build: force debug symbols in release build
they then get stripped into their own package anyway, but without this we don't
get debug symbols at all with rustc >= 1.77

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-06-20 10:03:25 +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
3301e28678 xtermjs: bump version to 5.3.0-3
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-12-11 13:37:18 +01:00
Dominik Csapak
de938aa06c fix #5063: load WebGL addon in try block
since under certain circumstances (e.g. using safari < 16) the addon
constructor already throws an exception, not only the loading later.

To allow falling back to the canvas renderer, move it into the try
block after WebGL detection.

This should fix the xterm.js console on Apple's iOS.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2023-12-11 13:35:31 +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
3217c1d2a6 xtermjs: bump version to 5.3.0-2
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-10-25 18:54:16 +02:00
Thomas Lamprecht
38a6dd80fa xtermjs: update lintian-overrides for split and webgl
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-10-25 18:54:16 +02:00
Dominik Csapak
aa9a479c51 xtermjs: try to detect hardware support for webgl2
With the new WebGL renderer, chrome/chromium has buggy software
support for emulating this (see [0]), so we have to detect that
manually and prevent loading the add-on. This fixes the issue that on
chrome without HW-support, it would not always render every character.

Firefox does not have support for a software renderer and the
loading/detection throws an exception, falling back to the default
renderer.

0: https://github.com/xtermjs/xterm.js/issues/4574

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-10-25 18:54:12 +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
11c42e4fc7 xterm.js: bump version to 5.3.0-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-10-17 10:49:54 +02:00
Thomas Lamprecht
83a3b0745d xtermjs: hard-depent on proxmox-termproxy for now
Avoids that we need to bump all frontends with updated dependencies
and then add them to the proxmox-termproxy's Breaks info.

We can loosen this dependency on the next major release, or when all
users switch to the respective ones (with a versioned Break!).

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
Thomas Lamprecht
13e2e50222 termproxy: update clap crate to major version 4
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-10-04 17:19:49 +02:00
Thomas Lamprecht
8acab7c358 readme: update and reword slightly
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-10-04 15:40:01 +02:00
Dominik Csapak
154b65d5b9 download and use xterm-addon-webgl as renderer
since xterm.js 5.0.0, the previous default canvas renderer is not
built-in anymore and only recommended as a fallback. The new recommended
renderer is this webgl one, so use it with a fallback to the default
built-in dom renderer (which is slower, but still functional).

to use it we have to load the addon after `terminal.open` so move the
`open` call to before the addon loading. While we're touching that line,
remove the superfluous second 'true' parameter that did not do anything.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2023-09-26 10:20:11 +02:00
Dominik Csapak
1ad0d6aba6 upgrade to xterm.js 5.3.0
and update xterm-addon-fit to a compatible version (0.8.0)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2023-09-26 08:33:26 +02:00
Dominik Csapak
34d796a1e3 ui: fix typo in error handler
s/even/event/

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2023-09-26 08:30:57 +02:00
Thomas Lamprecht
1a99994c69 extend .gitignore
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-23 14:13:00 +02:00
Thomas Lamprecht
7f0ffe8aa4 d/source: set format to 3.0 (quilt)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-23 14:11:28 +02:00
Thomas Lamprecht
99c9d21425 bump version to 4.16.0-3
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-23 14:02:48 +02:00
Thomas Lamprecht
9683c7f7a3 update proxmox-sys to 0.5
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-23 14:02:48 +02:00
Thomas Lamprecht
149874209b d/control: define compat level via build-depends and raise to 13
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-23 14:02:48 +02:00
Thomas Lamprecht
0534882fe3 buildsys: derive upload dist automatically
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-23 14:02:48 +02:00
Thomas Lamprecht
d007d21eba buildsys: fix source tarball generation and add sbuild target
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-23 14:02:48 +02:00
Thomas Lamprecht
11430bcc1f buildsys: avoid debcargo and dh-cargo on build
debcargo package requires all dependencies to be installed, even if
we basically just use it for d/control generation, which makes it a
bad choice for build dir generation here (i.e., with a native
package) as the DSC should be buildable without requiring all build
dependencies.

Add a target to update d/control manually (not much tested) and move
the build away from dh-cargo

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-23 14:02:48 +02:00
Thomas Lamprecht
033c3cb412 buildsys: do not skip pre-cleaning source
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-23 14:02:48 +02:00
Thomas Lamprecht
3f491b8562 buildsys: smarter generation of xterm.js addon exclusion arguments
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-23 13:23:54 +02:00
Thomas Lamprecht
ff0954988b buildsys: use full DEB_VERSION and correct DEB_HOST_ARCH
and drop git and srcdir variable

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-23 13:23:54 +02:00
Thomas Lamprecht
d174283d1f makefile: convert to use simple parenthesis
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-23 13:23:54 +02:00
Thomas Lamprecht
b73169a3ea update cargo metadata
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-23 13:23:54 +02:00
Thomas Lamprecht
1c04ac68c0 update lintian-overrides for debhelper 13+
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-23 13:23:54 +02:00