From 145da0bf450e9f6447c9dad2d6d967ea7f0ca011 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Wed, 4 Oct 2023 14:57:46 +0200 Subject: [PATCH] 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//proxmox/ directory like we do for proxmox-backup. - clean ups all over the place Signed-off-by: Thomas Lamprecht --- .gitignore | 16 +- Makefile | 128 --------------- debian/copyright | 42 ----- debian/debcargo.toml | 16 -- debian/install | 1 - debian/rules | 27 --- debian/rules.debcargo.hint | 6 - Cargo.toml => termproxy/Cargo.toml | 6 +- termproxy/Makefile | 86 ++++++++++ {debian => termproxy/debian}/changelog | 8 +- {debian => termproxy/debian}/control | 23 ++- termproxy/debian/copyright | 19 +++ {debian => termproxy/debian}/docs | 0 termproxy/debian/links | 1 + termproxy/debian/rules | 38 +++++ termproxy/debian/source/format | 1 + {src => termproxy/src}/main.rs | 0 xterm.js/Makefile | 81 +++++++++ xterm.js/debian/changelog | 154 ++++++++++++++++++ xterm.js/debian/control | 18 ++ xterm.js/debian/copyright | 46 ++++++ xterm.js/debian/docs | 1 + xterm.js/debian/install | 1 + xterm.js/debian/rules | 12 ++ {debian => xterm.js/debian}/source/format | 0 .../debian}/source/lintian-overrides | 0 {src/www => xterm.js/src}/index.html.hbs.in | 0 {src/www => xterm.js/src}/index.html.tpl.in | 0 {src/www => xterm.js/src}/main.js | 0 {src/www => xterm.js/src}/style.css | 0 {src/www => xterm.js/src}/util.js | 0 {src/www => xterm.js/src}/xterm-addon-fit.js | 0 .../src}/xterm-addon-fit.js.map | 0 .../www => xterm.js/src}/xterm-addon-webgl.js | 0 .../src}/xterm-addon-webgl.js.map | 0 {src/www => xterm.js/src}/xterm.css | 0 {src/www => xterm.js/src}/xterm.js | 0 {src/www => xterm.js/src}/xterm.js.map | 0 38 files changed, 488 insertions(+), 243 deletions(-) delete mode 100644 Makefile delete mode 100644 debian/copyright delete mode 100644 debian/debcargo.toml delete mode 100644 debian/install delete mode 100755 debian/rules delete mode 100755 debian/rules.debcargo.hint rename Cargo.toml => termproxy/Cargo.toml (89%) create mode 100644 termproxy/Makefile rename {debian => termproxy/debian}/changelog (93%) rename {debian => termproxy/debian}/control (62%) create mode 100644 termproxy/debian/copyright rename {debian => termproxy/debian}/docs (100%) create mode 100644 termproxy/debian/links create mode 100755 termproxy/debian/rules create mode 100644 termproxy/debian/source/format rename {src => termproxy/src}/main.rs (100%) create mode 100644 xterm.js/Makefile create mode 100644 xterm.js/debian/changelog create mode 100644 xterm.js/debian/control create mode 100644 xterm.js/debian/copyright create mode 100644 xterm.js/debian/docs create mode 100644 xterm.js/debian/install create mode 100755 xterm.js/debian/rules rename {debian => xterm.js/debian}/source/format (100%) rename {debian => xterm.js/debian}/source/lintian-overrides (100%) rename {src/www => xterm.js/src}/index.html.hbs.in (100%) rename {src/www => xterm.js/src}/index.html.tpl.in (100%) rename {src/www => xterm.js/src}/main.js (100%) rename {src/www => xterm.js/src}/style.css (100%) rename {src/www => xterm.js/src}/util.js (100%) rename {src/www => xterm.js/src}/xterm-addon-fit.js (100%) rename {src/www => xterm.js/src}/xterm-addon-fit.js.map (100%) rename {src/www => xterm.js/src}/xterm-addon-webgl.js (100%) rename {src/www => xterm.js/src}/xterm-addon-webgl.js.map (100%) rename {src/www => xterm.js/src}/xterm.css (100%) rename {src/www => xterm.js/src}/xterm.js (100%) rename {src/www => xterm.js/src}/xterm.js.map (100%) diff --git a/.gitignore b/.gitignore index 76abd70..7480d9c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,9 @@ -/*.build -/*.buildinfo -/*.changes -/*.deb -/*.dsc -/*.tar* -/rust-termproxy-*/ +*.build +*.buildinfo +*.changes +*.deb +*.dsc +*.tar* +Cargo.lock +/termproxy/proxmox-termproxy-[0-9]*/ +/xterm.js/pve-xtermjs-[0-9]*/ diff --git a/Makefile b/Makefile deleted file mode 100644 index 4ea718d..0000000 --- a/Makefile +++ /dev/null @@ -1,128 +0,0 @@ -include /usr/share/dpkg/pkg-info.mk -include /usr/share/dpkg/architecture.mk - -PACKAGE=pve-xtermjs -CRATENAME=termproxy - -BUILDDIR ?= $(DEB_SOURCE)-$(DEB_VERSION_UPSTREAM) -ORIG_SRC_TAR=$(DEB_SOURCE)_$(DEB_VERSION_UPSTREAM).orig.tar.gz - -export VERSION=$(DEB_VERSION_UPSTREAM_REVISION) - -XTERMJSVER=5.3.0 -XTERMJSTGZ=xterm-$(XTERMJSVER).tgz - -FITADDONVER=0.8.0 -FITADDONTGZ=xterm-addon-fit-$(FITADDONVER).tgz - -WEBGLADDONVER=0.16.0 -WEBGLADDONTGZ=xterm-addon-webgl-$(WEBGLADDONVER).tgz - -DEB=$(PACKAGE)_$(DEB_VERSION_UPSTREAM_REVISION)_$(DEB_HOST_ARCH).deb -DBG_DEB=$(PACKAGE)-dbgsym_$(DEB_VERSION_UPSTREAM_REVISION)_$(DEB_HOST_ARCH).deb -DSC=rust-$(CRATENAME)_$(DEB_VERSION_UPSTREAM_REVISION).dsc - -CARGO ?= cargo -ifeq ($(BUILD_MODE), release) -CARGO_BUILD_ARGS += --release -COMPILEDIR := target/release -else -COMPILEDIR := target/debug -endif - -PREFIX = /usr -BINDIR = $(PREFIX)/bin -TERMPROXY_BIN := $(addprefix $(COMPILEDIR)/,termproxy) - -all: - -install: $(TERMPROXY_BIN) - install -dm755 $(DESTDIR)$(BINDIR) - install -m755 $(TERMPROXY_BIN) $(DESTDIR)$(BINDIR)/ - -$(TERMPROXY_BIN): .do-cargo-build -.do-cargo-build: - $(CARGO) build $(CARGO_BUILD_ARGS) - touch .do-cargo-build - - -.PHONY: cargo-build -cargo-build: .do-cargo-build - -update-dcontrol: - rm -rf $(BUILDDIR) - $(MAKE) $(BUILDDIR) - cd $(BUILDDIR); debcargo package \ - --config debian/debcargo.toml \ - --changelog-ready \ - --no-overlay-write-back \ - --directory build \ - $(CRATENAME) \ - $(DEB_VERSION_UPSTREAM) - cd $(BUILDDIR)/build; wrap-and-sort -tkn - cp --remove-destination $(BUILDDIR)/build/debian/control debian/control - -$(BUILDDIR): - rm -rf $@ $@.tmp - mkdir $@.tmp - cp -a debian/ src/ Makefile Cargo.toml $@.tmp - echo "git clone git://git.proxmox.com/git/pve-xtermjs.git\\ngit checkout $$(git rev-parse HEAD)" \ - > $@.tmp/debian/SOURCE - mv $@.tmp $@ - - -$(ORIG_SRC_TAR): $(BUILDDIR) - tar czf $(ORIG_SRC_TAR) --exclude="$(BUILDDIR)/debian" $(BUILDDIR) - -.PHONY: deb -deb: $(DEB) -$(DBG_DEB): $(DEB) -$(DEB): $(BUILDDIR) - cd $(BUILDDIR); dpkg-buildpackage -b -uc -us - lintian $(DEB) - @echo $(DEB) - -.PHONY: dsc -dsc: - rm -rf $(DSC) $(BUILDDIR) - $(MAKE) $(DSC) - lintian $(DSC) - -$(DSC): $(BUILDDIR) $(ORIG_SRC_TAR) - cd $(BUILDDIR); dpkg-buildpackage -S -us -uc -d - -sbuild: $(DSC) - sbuild $(DSC) - -EXCLUDED_ADDONS=attach fullscreen search terminado webLinks zmodem -X_EXCLUSIONS=$(foreach ADDON,$(EXCLUDED_ADDONS),--exclude=addons/$(ADDON)) - -.PHONY: download -download: - wget https://registry.npmjs.org/xterm/-/$(XTERMJSTGZ) -O $(XTERMJSTGZ).tmp - wget https://registry.npmjs.org/xterm-addon-fit/-/$(FITADDONTGZ) -O $(FITADDONTGZ).tmp - wget https://registry.npmjs.org/xterm-addon-webgl/-/$(WEBGLADDONTGZ) -O $(WEBGLADDONTGZ).tmp - mv $(XTERMJSTGZ).tmp $(XTERMJSTGZ) - mv $(FITADDONTGZ).tmp $(FITADDONTGZ) - mv $(WEBGLADDONTGZ).tmp $(WEBGLADDONTGZ) - tar -C src/www -xf $(XTERMJSTGZ) package/lib package/css --strip-components=2 $(X_EXCLUSIONS) - tar -C src/www -xf $(FITADDONTGZ) package/lib --strip-components=2 $(X_EXCLUSIONS) - tar -C src/www -xf $(WEBGLADDONTGZ) package/lib --strip-components=2 $(X_EXCLUSIONS) - rm $(XTERMJSTGZ) $(FITADDONTGZ) $(WEBGLADDONTGZ) - -.PHONY: upload -upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION) -upload: $(DEB) $(DBG_DEB) - tar cf - $(DEB) $(DBG_DEB) |ssh -X repoman@repo.proxmox.com -- upload --product pmg,pve,pbs --dist $(UPLOAD_DIST) --arch $(DEB_HOST_ARCH) - -.PHONY: distclean -distclean: clean - -.PHONY: clean -clean: - $(CARGO) clean - rm -rf $(DEB_SOURCE)-[0-9]*/ build/ *.deb *.changes *.dsc *.tar.* *.buildinfo *.build .do-cargo-build - -.PHONY: dinstall -dinstall: deb - dpkg -i $(DEB) diff --git a/debian/copyright b/debian/copyright deleted file mode 100644 index f9d2553..0000000 --- a/debian/copyright +++ /dev/null @@ -1,42 +0,0 @@ -Copyright (C) 2017-2020 Proxmox Server Solutions GmbH - -This software is written by Proxmox Server Solutions GmbH - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -------------- - -xterm.js - -Copyright (c) 2017-2019, The xterm.js authors (https://github.com/xtermjs/xterm.js) -Copyright (c) 2014-2016, SourceLair Private Company (https://www.sourcelair.com) -Copyright (c) 2012-2013, Christopher Jeffrey (https://github.com/chjj/) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/debian/debcargo.toml b/debian/debcargo.toml deleted file mode 100644 index bad78f7..0000000 --- a/debian/debcargo.toml +++ /dev/null @@ -1,16 +0,0 @@ -overlay = "." -crate_src_path = ".." -bin_name = "pve-xtermjs" -maintainer = "Proxmox Support Team " - -[source] -section = "admin" -homepage = "https://www.proxmox.com" -vcs_git = "git://git.proxmox.com/git/pve-xtermjs.git" -vcs_browser = "https://git.proxmox.com/?p=pve-xtermjs.git;a=summary" - -[packages.bin] -summary = "HTML/JS Shell client for Proxmox projects" -description = """This package provides an xterm.js client/proxy for Proxmox\ - projects' Hosts, Proxmox VE containers or Proxmox VE VM's serial-terminals.\ - """ diff --git a/debian/install b/debian/install deleted file mode 100644 index 04be689..0000000 --- a/debian/install +++ /dev/null @@ -1 +0,0 @@ -src/www/* /usr/share/pve-xtermjs/ diff --git a/debian/rules b/debian/rules deleted file mode 100755 index 6049291..0000000 --- a/debian/rules +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/make -f - -include /usr/share/dpkg/pkg-info.mk -include /usr/share/rustc/architecture.mk - -export BUILD_MODE=release - -export CFLAGS CXXFLAGS CPPFLAGS LDFLAGS -export DEB_HOST_RUST_TYPE DEB_HOST_GNU_TYPE -export CARGO_HOME = $(CURDIR)/debian/cargo_home - -export DEB_CARGO_CRATE=termproxy_$(DEB_VERSION_UPSTREAM) -export DEB_CARGO_PACKAGE=pve-xtermjs - -%: - dh $@ - -override_dh_auto_build: - dh_auto_build - sed -e 's/@VERSION@/$(DEB_VERSION)/' src/www/index.html.tpl.in > src/www/index.html.tpl - sed -e 's/@VERSION@/$(DEB_VERSION)/' src/www/index.html.hbs.in > src/www/index.html.hbs - rm src/www/index.html.tpl.in src/www/index.html.hbs.in - -override_dh_auto_configure: - rm -f Cargo.lock - /usr/share/cargo/bin/cargo prepare-debian $(CURDIR)/debian/cargo_registry --link-from-system - dh_auto_configure diff --git a/debian/rules.debcargo.hint b/debian/rules.debcargo.hint deleted file mode 100755 index 92c239b..0000000 --- a/debian/rules.debcargo.hint +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/make -f -%: - dh $@ --buildsystem cargo - -override_dh_auto_test: - dh_auto_test -- test --all diff --git a/Cargo.toml b/termproxy/Cargo.toml similarity index 89% rename from Cargo.toml rename to termproxy/Cargo.toml index 7b05c47..ee17382 100644 --- a/Cargo.toml +++ b/termproxy/Cargo.toml @@ -1,12 +1,12 @@ [package] -name = "termproxy" +name = "proxmox-termproxy" description = "Execute a terminal command and proxy I/O via network" -version = "4.16.0" +version = "1.0.0" authors = [ "Proxmox Support Team ", "for xterm.js parts: The xterm.js authors ", ] -edition = "2018" +edition = "2021" license = "AGPL-3" exclude = [ "build", "debian" ] diff --git a/termproxy/Makefile b/termproxy/Makefile new file mode 100644 index 0000000..dbc7b85 --- /dev/null +++ b/termproxy/Makefile @@ -0,0 +1,86 @@ +include /usr/share/dpkg/default.mk + +PACKAGE=proxmox-termproxy +CRATENAME=proxmox-termproxy + +BUILDDIR ?= $(PACKAGE)-$(DEB_VERSION_UPSTREAM) +ORIG_SRC_TAR=$(PACKAGE)_$(DEB_VERSION_UPSTREAM).orig.tar.gz + +DEB=$(PACKAGE)_$(DEB_VERSION)_$(DEB_HOST_ARCH).deb +DBG_DEB=$(PACKAGE)-dbgsym_$(DEB_VERSION)_$(DEB_HOST_ARCH).deb +DSC=$(PACKAGE)_$(DEB_VERSION).dsc + +CARGO ?= cargo +ifeq ($(BUILD_MODE), release) +CARGO_BUILD_ARGS += --release +COMPILEDIR := target/release +else +COMPILEDIR := target/debug +endif + +PREFIX = /usr +BINDIR = $(PREFIX)/bin +TERMPROXY_BIN := $(addprefix $(COMPILEDIR)/,proxmox-termproxy) + +all: + +install: $(TERMPROXY_BIN) + install -dm755 $(DESTDIR)$(BINDIR) + install -m755 $(TERMPROXY_BIN) $(DESTDIR)$(BINDIR)/ + +$(TERMPROXY_BIN): .do-cargo-build +.do-cargo-build: + $(CARGO) build $(CARGO_BUILD_ARGS) + touch .do-cargo-build + + +.PHONY: cargo-build +cargo-build: .do-cargo-build + +$(BUILDDIR): + rm -rf $@ $@.tmp + mkdir $@.tmp + cp -a debian/ src/ Makefile Cargo.toml $@.tmp + echo "git clone git://git.proxmox.com/git/pve-xtermjs.git\\ngit checkout $$(git rev-parse HEAD)" \ + > $@.tmp/debian/SOURCE + mv $@.tmp $@ + + +$(ORIG_SRC_TAR): $(BUILDDIR) + tar czf $(ORIG_SRC_TAR) --exclude="$(BUILDDIR)/debian" $(BUILDDIR) + +.PHONY: deb +deb: $(DEB) +$(DBG_DEB): $(DEB) +$(DEB): $(BUILDDIR) + cd $(BUILDDIR); dpkg-buildpackage -b -uc -us + lintian $(DEB) + @echo $(DEB) + +.PHONY: dsc +dsc: + rm -rf $(DSC) $(BUILDDIR) + $(MAKE) $(DSC) + lintian $(DSC) + +$(DSC): $(BUILDDIR) $(ORIG_SRC_TAR) + cd $(BUILDDIR); dpkg-buildpackage -S -us -uc -d + +sbuild: $(DSC) + sbuild $(DSC) + +.PHONY: upload +upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION) +upload: $(DEB) $(DBG_DEB) + tar cf - $(DEB) $(DBG_DEB) |ssh -X repoman@repo.proxmox.com -- upload --product pmg,pve,pbs --dist $(UPLOAD_DIST) --arch $(DEB_HOST_ARCH) + +.PHONY: clean distclean +distclean: clean +clean: + $(CARGO) clean + rm -rf $(PACKAGE)-[0-9]*/ build/ + rm -f *.deb *.changes *.dsc *.tar.* *.buildinfo *.build .do-cargo-build + +.PHONY: dinstall +dinstall: deb + dpkg -i $(DEB) diff --git a/debian/changelog b/termproxy/debian/changelog similarity index 93% rename from debian/changelog rename to termproxy/debian/changelog index acfff31..da8db2c 100644 --- a/debian/changelog +++ b/termproxy/debian/changelog @@ -1,4 +1,10 @@ -rust-termproxy (4.16.0-3) bookworm; urgency=medium +proxmox-termproxy (1.0.0) bookworm; urgency=medium + + * split out the system console wrapper termproxy into own package + + -- Proxmox Support Team Fri, 13 Oct 2023 11:07:08 +0200 + +proxmox-term-proxy (4.16.0-3) bookworm; urgency=medium * re-build for Debian 12 Bookworm based releases diff --git a/debian/control b/termproxy/debian/control similarity index 62% rename from debian/control rename to termproxy/debian/control index d06ae3b..383bdbe 100644 --- a/debian/control +++ b/termproxy/debian/control @@ -1,4 +1,4 @@ -Source: rust-termproxy +Source: proxmox-termproxy Section: admin Priority: optional Build-Depends: cargo:native, @@ -20,18 +20,17 @@ Standards-Version: 4.6.1 Vcs-Git: git://git.proxmox.com/git/pve-xtermjs.git Vcs-Browser: https://git.proxmox.com/?p=pve-xtermjs.git;a=summary Homepage: https://www.proxmox.com -X-Cargo-Crate: termproxy Rules-Requires-Root: no -Package: pve-xtermjs +Package: proxmox-termproxy Architecture: any Multi-Arch: allowed -Depends: ${cargo:Depends}, ${misc:Depends}, ${shlibs:Depends}, -Recommends: ${cargo:Recommends}, -Suggests: ${cargo:Suggests}, -Provides: ${cargo:Provides}, -Built-Using: ${cargo:Built-Using}, -XB-X-Cargo-Built-Using: ${cargo:X-Cargo-Built-Using} -Description: HTML/JS Shell client for Proxmox projects - This package provides an xterm.js client/proxy for Proxmoxprojects' Hosts, - Proxmox VE containers or Proxmox VE VM's serial-terminals. +Depends: ${misc:Depends}, ${shlibs:Depends}, +Recommends: pve-xtermjs +Breaks: pve-xtermjs (<< 5.3.0~) +Replaces: pve-xtermjs (<< 5.3.0~) +Description: Wrapper proxy for executing programs in the system terminal + This package provides an wrapper for running commands in a system terminal, + redirecting input via a special protocol and returning the PTY output 1:1. + It's used for the backend of the xterm.js based host and virtual guest + consoles in Proxmox projects like Proxmox VE or Proxmox Backup Server. diff --git a/termproxy/debian/copyright b/termproxy/debian/copyright new file mode 100644 index 0000000..8249a3a --- /dev/null +++ b/termproxy/debian/copyright @@ -0,0 +1,19 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Source: https://git.proxmox.com/?p=pve-xtermjs.git;a=summary + +Files: + * +Copyright: 2017 - 2023 Proxmox Server Solutions GmbH +License: AGPL-3.0-or-later + This program is free software: you can redistribute it and/or modify it under + the terms of the GNU Affero General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) any + later version. + . + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more + details. + . + You should have received a copy of the GNU Affero General Public License along + with this program. If not, see . diff --git a/debian/docs b/termproxy/debian/docs similarity index 100% rename from debian/docs rename to termproxy/debian/docs diff --git a/termproxy/debian/links b/termproxy/debian/links new file mode 100644 index 0000000..d89c53b --- /dev/null +++ b/termproxy/debian/links @@ -0,0 +1 @@ +usr/bin/proxmox-termproxy usr/bin/termproxy diff --git a/termproxy/debian/rules b/termproxy/debian/rules new file mode 100755 index 0000000..d2407de --- /dev/null +++ b/termproxy/debian/rules @@ -0,0 +1,38 @@ +#!/usr/bin/make -f +# See debhelper(7) (uncomment to enable) +# output every command that modifies files on the build system. +DH_VERBOSE = 1 + +include /usr/share/dpkg/pkg-info.mk +include /usr/share/rustc/architecture.mk + +export BUILD_MODE=release + +CARGO=/usr/share/cargo/bin/cargo + +export CFLAGS CXXFLAGS CPPFLAGS LDFLAGS +export DEB_HOST_RUST_TYPE DEB_HOST_GNU_TYPE +export CARGO_HOME = $(CURDIR)/debian/cargo_home + +export DEB_CARGO_CRATE=proxmox-termproxy_$(DEB_VERSION_UPSTREAM) +export DEB_CARGO_PACKAGE=proxmox-termproxy + +%: + dh $@ + +override_dh_auto_configure: + @perl -ne 'if (/^version\s*=\s*"(\d+(?:\.\d+)+)"/) { my $$v_cargo = $$1; my $$v_deb = "$(DEB_VERSION_UPSTREAM)"; \ + die "ERROR: d/changelog <-> Cargo.toml version mismatch: $$v_cargo != $$v_deb\n" if $$v_cargo ne $$v_deb; exit(0); }' Cargo.toml + $(CARGO) prepare-debian $(CURDIR)/debian/cargo_registry --link-from-system + dh_auto_configure + +override_dh_missing: + dh_missing --fail-missing + +override_dh_auto_build: + dh_auto_build -- \ + LIBEXECDIR=/usr/lib/$(DEB_HOST_MULTIARCH) + +override_dh_auto_install: + dh_auto_install -- \ + LIBEXECDIR=/usr/lib/$(DEB_HOST_MULTIARCH) diff --git a/termproxy/debian/source/format b/termproxy/debian/source/format new file mode 100644 index 0000000..89ae9db --- /dev/null +++ b/termproxy/debian/source/format @@ -0,0 +1 @@ +3.0 (native) diff --git a/src/main.rs b/termproxy/src/main.rs similarity index 100% rename from src/main.rs rename to termproxy/src/main.rs diff --git a/xterm.js/Makefile b/xterm.js/Makefile new file mode 100644 index 0000000..563a594 --- /dev/null +++ b/xterm.js/Makefile @@ -0,0 +1,81 @@ +include /usr/share/dpkg/default.mk + +PACKAGE=pve-xtermjs + +BUILDDIR ?= $(PACKAGE)-$(DEB_VERSION_UPSTREAM) +ORIG_SRC_TAR=$(PACKAGE)_$(DEB_VERSION_UPSTREAM).orig.tar.gz + +DEB=$(PACKAGE)_$(DEB_VERSION)_all.deb +DSC=$(PACKAGE)_$(DEB_VERSION).dsc + +# for downloading new version use `make XTERMJS_VERSION=X.Y.Z download` +XTERMJS_VERSION ?= $(DEB_VERSION_UPSTREAM) +FIT_ADDON_VERSION = 0.8.0 +WEBGL_ADDON_VERSION = 0.16.0 + +all: + +$(BUILDDIR): + rm -rf $@ $@.tmp + mkdir $@.tmp + cp -a debian/ src/ Makefile $@.tmp + echo "git clone git://git.proxmox.com/git/pve-xtermjs.git\\ngit checkout $$(git rev-parse HEAD)" \ + > $@.tmp/debian/SOURCE + mv $@.tmp $@ + + +$(ORIG_SRC_TAR): $(BUILDDIR) + tar czf $(ORIG_SRC_TAR) --exclude="$(BUILDDIR)/debian" $(BUILDDIR) + +.PHONY: deb +deb: $(DEB) +$(DEB): $(BUILDDIR) + cd $(BUILDDIR); dpkg-buildpackage -b -uc -us + lintian $(DEB) + @echo $(DEB) + +.PHONY: dsc +dsc: + rm -rf $(DSC) $(BUILDDIR) + $(MAKE) $(DSC) + lintian $(DSC) + +$(DSC): $(BUILDDIR) $(ORIG_SRC_TAR) + cd $(BUILDDIR); dpkg-buildpackage -S -us -uc -d + +sbuild: $(DSC) + sbuild $(DSC) + +EXCLUDED_ADDONS=attach fullscreen search terminado webLinks zmodem +X_EXCLUSIONS=$(foreach ADDON,$(EXCLUDED_ADDONS),--exclude=addons/$(ADDON)) + +.PHONY: download +download: XTERMJS_TGZ = xterm-$(XTERMJS_VERSION).tgz +download: FIT_ADDON_TGZ = xterm-addon-fit-$(FIT_ADDON_VERSION).tgz +download: WEBGL_ADDON_TGZ = xterm-addon-webgl-$(WEBGL_ADDON_VERSION).tgz +download: + wget https://registry.npmjs.org/xterm/-/$(XTERMJS_TGZ) -O $(XTERMJS_TGZ).tmp + wget https://registry.npmjs.org/xterm-addon-fit/-/$(FIT_ADDON_TGZ) -O $(FIT_ADDON_TGZ).tmp + wget https://registry.npmjs.org/xterm-addon-webgl/-/$(WEBGL_ADDON_TGZ) -O $(WEBGL_ADDON_TGZ).tmp + mv $(XTERMJS_TGZ).tmp $(XTERMJS_TGZ) + mv $(FIT_ADDON_TGZ).tmp $(FIT_ADDON_TGZ) + mv $(WEBGL_ADDON_TGZ).tmp $(WEBGL_ADDON_TGZ) + tar -C src -xf $(XTERMJS_TGZ) package/lib package/css --strip-components=2 $(X_EXCLUSIONS) + tar -C src -xf $(FIT_ADDON_TGZ) package/lib --strip-components=2 $(X_EXCLUSIONS) + tar -C src -xf $(WEBGL_ADDON_TGZ) package/lib --strip-components=2 $(X_EXCLUSIONS) + rm $(XTERMJS_TGZ) $(FIT_ADDON_TGZ) $(WEBGL_ADDON_TGZ) + +.PHONY: upload +upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION) +upload: $(DEB) + tar cf - $(DEB) |ssh -X repoman@repo.proxmox.com -- upload --product pmg,pve,pbs --dist $(UPLOAD_DIST) + +.PHONY: clean distclean +distclean: clean +clean: + rm -rf $(PACKAGE)-[0-9]*/ build/ + rm -f *.deb *.changes *.dsc *.tar.* *.buildinfo *.build .do-cargo-build + +.PHONY: dinstall +dinstall: deb + dpkg -i $(DEB) diff --git a/xterm.js/debian/changelog b/xterm.js/debian/changelog new file mode 100644 index 0000000..2e89229 --- /dev/null +++ b/xterm.js/debian/changelog @@ -0,0 +1,154 @@ +pve-xtermjs (5.3.0-1) bookworm; urgency=medium + + * update to upstream stable release 5.3.0 + + * ship WebGL addon + + * split out our native tooling from repackaged upstream for cleaner + packaging and to reduce maintenance burden + + -- Proxmox Support Team Tue, 23 May 2023 13:48:44 +0200 + +rust-termproxy (4.16.0-3) bookworm; urgency=medium + + * re-build for Debian 12 Bookworm based releases + + -- Proxmox Support Team Tue, 23 May 2023 13:48:44 +0200 + +rust-termproxy (4.16.0-2) bullseye; urgency=medium + + * switch from curl to ureq + + * detect not running guests and add start button + + * various smaller build system updates and improvements + + -- Proxmox Support Team Mon, 22 May 2023 15:35:35 +0200 + +rust-termproxy (4.16.0-1) bullseye; urgency=medium + + * upgrade xterm.js from 4.12.0 to 4.16.0 + + -- Proxmox Support Team Tue, 25 Jan 2022 15:32:15 +0100 + +rust-termproxy (4.12.0-1) bullseye; urgency=medium + + * upgrade xterm.js to new upstream release 4.12.0 + + * re-build for Debian 11 Bullseye based releases + + -- Proxmox Support Team Fri, 14 May 2021 08:26:36 +0200 + +rust-termproxy (4.7.0-3) pve pmg; urgency=medium + + * fix console window title for rust template + + * fix #2980: do not prompt for leaving on reconnect/disconnect + + -- Proxmox Support Team Tue, 24 Nov 2020 14:53:10 +0100 + +rust-termproxy (4.7.0-2) pve pmg; urgency=medium + + * fix corner case handling of pre-defined command options + + -- Proxmox Support Team Fri, 28 Aug 2020 13:51:42 +0200 + +rust-termproxy (4.7.0-1) pve pmg; urgency=medium + + * upgrade xterm.js to new upstream release 4.3.0 + + * rewrite system console wrapper in rust + + -- Proxmox Support Team Thu, 23 Jul 2020 12:20:16 +0200 + +pve-xtermjs (4.3.0-1) pve pmg; urgency=medium + + * upgrade xterm.js to new upstream release 4.3.0 + + -- Proxmox Support Team Wed, 22 Jan 2020 12:17:59 +0100 + +pve-xtermjs (3.13.2-1) pve pmg; urgency=medium + + * update sources to 3.13.2 + + * build for Debian Buster + + -- Proxmox Support Team Wed, 22 May 2019 20:04:12 +0200 + +pve-xtermjs (3.12.0-1) unstable; urgency=medium + + * allow xtermjs on ipv6 only host + + * update to upstream 3.12.0 release + + -- Proxmox Support Team Tue, 26 Mar 2019 07:44:39 +0100 + +pve-xtermjs (3.10.1-2) unstable; urgency=medium + + * support new 'cmd' parameter + + -- Proxmox Support Team Thu, 28 Feb 2019 11:13:08 +0100 + +pve-xtermjs (3.10.1-1) unstable; urgency=medium + + * update to xterm.js 3.10.1 + + -- Proxmox Support Team Thu, 17 Jan 2019 16:38:51 +0100 + +pve-xtermjs (1.0-5) unstable; urgency=medium + + * change localhost to 127.0.0.1 + + -- Proxmox Support Team Tue, 08 May 2018 11:20:25 +0200 + +pve-xtermjs (1.0-4) unstable; urgency=medium + + * reload on container reboot + + * do not try to reconnect the host shell + + * focus terminal when starting + + -- Proxmox Support Team Mon, 07 May 2018 15:16:07 +0200 + +pve-xtermjs (1.0-3) unstable; urgency=medium + + * update to xterm.js 3.2.0 + + * implement reconnect logic + + -- Proxmox Support Team Wed, 11 Apr 2018 14:32:28 +0200 + +pve-xtermjs (1.0-2) unstable; urgency=medium + + * make perm an optional parameter + + * remove dependcy to libpve-access-control + + -- Proxmox Support Team Mon, 11 Dec 2017 14:39:10 +0100 + +pve-xtermjs (1.0-1) unstable; urgency=medium + + * bump to 1.0-1 + + * update dependencies + + * check ticket via api instead of verify_vnc_ticket + + -- Proxmox Support Team Thu, 07 Dec 2017 13:24:37 +0100 + +pve-xtermjs (0.1-1) unstable; urgency=medium + + * bump to 0.1-1 + + * update dependencies + + * give pty object to process_queue on first call + + -- Proxmox Support Team Mon, 04 Dec 2017 10:29:52 +0100 + +pve-xtermjs (0.1-1~rc1) unstable; urgency=medium + + * initial package + + -- Proxmox Support Team Mon, 20 Nov 2017 08:25:32 +0100 diff --git a/xterm.js/debian/control b/xterm.js/debian/control new file mode 100644 index 0000000..5069d1b --- /dev/null +++ b/xterm.js/debian/control @@ -0,0 +1,18 @@ +Source: pve-xtermjs +Section: admin +Priority: optional +Build-Depends: debhelper-compat (= 13), +Maintainer: Proxmox Support Team +Standards-Version: 4.6.1 +Vcs-Git: git://git.proxmox.com/git/pve-xtermjs.git +Vcs-Browser: https://git.proxmox.com/?p=pve-xtermjs.git;a=summary +Homepage: https://www.proxmox.com +Rules-Requires-Root: no + +Package: pve-xtermjs +Architecture: all +Depends: ${misc:Depends}, +Recommends: proxmox-termproxy +Description: HTML/TypeScript based fully-featured terminal for Proxmox projects + Provides the xterm.js frontend for the terminal feature in Proxmox projects' + web UI's, like for host administration or Proxmox VE containers shells. diff --git a/xterm.js/debian/copyright b/xterm.js/debian/copyright new file mode 100644 index 0000000..669f2eb --- /dev/null +++ b/xterm.js/debian/copyright @@ -0,0 +1,46 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: xterm.js +Source: https://github.com/xtermjs/xterm.js + +Files: + * +Comment: Based on the sources LICENSE file +Copyright: 2017-2019 The xterm.js authors (https://github.com/xtermjs/xterm.js) + 2014-2016 SourceLair Private Company (https://www.sourcelair.com) + 2012-2013 Christopher Jeffrey (https://github.com/chjj/) +License: Expat + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + . + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + + +Files: + debian/* +Copyright: 2017-2023 Proxmox Server Solutions GmbH +License: AGPL-3.0-or-later + This program is free software: you can redistribute it and/or modify it under + the terms of the GNU Affero General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) any + later version. + . + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more + details. + . + You should have received a copy of the GNU Affero General Public License along + with this program. If not, see . diff --git a/xterm.js/debian/docs b/xterm.js/debian/docs new file mode 100644 index 0000000..8696672 --- /dev/null +++ b/xterm.js/debian/docs @@ -0,0 +1 @@ +debian/SOURCE diff --git a/xterm.js/debian/install b/xterm.js/debian/install new file mode 100644 index 0000000..0291a3d --- /dev/null +++ b/xterm.js/debian/install @@ -0,0 +1 @@ +src/* /usr/share/pve-xtermjs/ diff --git a/xterm.js/debian/rules b/xterm.js/debian/rules new file mode 100755 index 0000000..55b24ac --- /dev/null +++ b/xterm.js/debian/rules @@ -0,0 +1,12 @@ +#!/usr/bin/make -f + +include /usr/share/dpkg/pkg-info.mk + +%: + dh $@ + +override_dh_auto_build: + dh_auto_build + sed -e 's/@VERSION@/$(DEB_VERSION)/' src/index.html.tpl.in > src/index.html.tpl + sed -e 's/@VERSION@/$(DEB_VERSION)/' src/index.html.hbs.in > src/index.html.hbs + rm src/index.html.tpl.in src/index.html.hbs.in diff --git a/debian/source/format b/xterm.js/debian/source/format similarity index 100% rename from debian/source/format rename to xterm.js/debian/source/format diff --git a/debian/source/lintian-overrides b/xterm.js/debian/source/lintian-overrides similarity index 100% rename from debian/source/lintian-overrides rename to xterm.js/debian/source/lintian-overrides diff --git a/src/www/index.html.hbs.in b/xterm.js/src/index.html.hbs.in similarity index 100% rename from src/www/index.html.hbs.in rename to xterm.js/src/index.html.hbs.in diff --git a/src/www/index.html.tpl.in b/xterm.js/src/index.html.tpl.in similarity index 100% rename from src/www/index.html.tpl.in rename to xterm.js/src/index.html.tpl.in diff --git a/src/www/main.js b/xterm.js/src/main.js similarity index 100% rename from src/www/main.js rename to xterm.js/src/main.js diff --git a/src/www/style.css b/xterm.js/src/style.css similarity index 100% rename from src/www/style.css rename to xterm.js/src/style.css diff --git a/src/www/util.js b/xterm.js/src/util.js similarity index 100% rename from src/www/util.js rename to xterm.js/src/util.js diff --git a/src/www/xterm-addon-fit.js b/xterm.js/src/xterm-addon-fit.js similarity index 100% rename from src/www/xterm-addon-fit.js rename to xterm.js/src/xterm-addon-fit.js diff --git a/src/www/xterm-addon-fit.js.map b/xterm.js/src/xterm-addon-fit.js.map similarity index 100% rename from src/www/xterm-addon-fit.js.map rename to xterm.js/src/xterm-addon-fit.js.map diff --git a/src/www/xterm-addon-webgl.js b/xterm.js/src/xterm-addon-webgl.js similarity index 100% rename from src/www/xterm-addon-webgl.js rename to xterm.js/src/xterm-addon-webgl.js diff --git a/src/www/xterm-addon-webgl.js.map b/xterm.js/src/xterm-addon-webgl.js.map similarity index 100% rename from src/www/xterm-addon-webgl.js.map rename to xterm.js/src/xterm-addon-webgl.js.map diff --git a/src/www/xterm.css b/xterm.js/src/xterm.css similarity index 100% rename from src/www/xterm.css rename to xterm.js/src/xterm.css diff --git a/src/www/xterm.js b/xterm.js/src/xterm.js similarity index 100% rename from src/www/xterm.js rename to xterm.js/src/xterm.js diff --git a/src/www/xterm.js.map b/xterm.js/src/xterm.js.map similarity index 100% rename from src/www/xterm.js.map rename to xterm.js/src/xterm.js.map -- 2.39.2