From 9a0eabc24903dedf316de8e2725922ee11ee874a Mon Sep 17 00:00:00 2001 From: thomas Date: Wed, 6 Apr 2022 00:49:19 +0200 Subject: [PATCH] initial commit --- README.md | 0 debian/README | 6 +++ debian/changelog | 5 +++ debian/conffiles | 1 + debian/control | 16 ++++++++ debian/copyright | 39 ++++++++++++++++++ debian/rules | 25 ++++++++++++ debian/source/format | 1 + debian/vnctv.install | 3 ++ vnctv | 9 +++++ vnctv-web | 96 ++++++++++++++++++++++++++++++++++++++++++++ vnctv-web.service | 9 +++++ vnctv.service | 7 ++++ 13 files changed, 217 insertions(+) create mode 100644 README.md create mode 100644 debian/README create mode 100644 debian/changelog create mode 100644 debian/conffiles create mode 100644 debian/control create mode 100644 debian/copyright create mode 100755 debian/rules create mode 100644 debian/source/format create mode 100644 debian/vnctv.install create mode 100644 vnctv create mode 100644 vnctv-web create mode 100644 vnctv-web.service create mode 100644 vnctv.service diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/debian/README b/debian/README new file mode 100644 index 0000000..50d47d5 --- /dev/null +++ b/debian/README @@ -0,0 +1,6 @@ +The Debian Package vnctv +---------------------------- + +Comments regarding the Package + + -- Thomas Leagy Sun, 03 Apr 2022 12:36:14 +0200 diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..bc54cb6 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +vnctv (0.1.0) unstable; urgency=medium + + * Initial Release. + + -- Thomas Leagy Sun, 03 Apr 2022 12:36:14 +0200 diff --git a/debian/conffiles b/debian/conffiles new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/debian/conffiles @@ -0,0 +1 @@ + diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..c0de1c6 --- /dev/null +++ b/debian/control @@ -0,0 +1,16 @@ +Source: vnctv +Section: unknown +Priority: optional +Maintainer: Thomas Leagy +Build-Depends: debhelper-compat (= 13) +Standards-Version: 4.5.1 +Homepage: +#Vcs-Browser: https://salsa.debian.org/debian/vnctv +#Vcs-Git: https://salsa.debian.org/debian/vnctv.git +Rules-Requires-Root: no + +Package: vnctv +Architecture: all +Depends: ${misc:Depends} +Description: + diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..eebe543 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,39 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: vnctv +Upstream-Contact: +Source: + +Files: * +Copyright: + +License: GPL-3.0+ + +Files: debian/* +Copyright: 2022 Thomas Leagy +License: GPL-3.0+ + +License: GPL-3.0+ + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + . + This package 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 General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see . + . + On Debian systems, the complete text of the GNU General + Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". + +# Please also look if there are files or directories which have a +# different copyright/license attached and list them here. +# Please avoid picking licenses with terms that are more restrictive than the +# packaged work, as it may make Debian's contributions unacceptable upstream. +# +# If you need, there are some extra license texts available in two places: +# /usr/share/debhelper/dh_make/licenses/ +# /usr/share/common-licenses/ diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..59ea751 --- /dev/null +++ b/debian/rules @@ -0,0 +1,25 @@ +#!/usr/bin/make -f +# See debhelper(7) (uncomment to enable) +# output every command that modifies files on the build system. +#export DH_VERBOSE = 1 + + +# see FEATURE AREAS in dpkg-buildflags(1) +#export DEB_BUILD_MAINT_OPTIONS = hardening=+all + +# see ENVIRONMENT in dpkg-buildflags(1) +# package maintainers to append CFLAGS +#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic +# package maintainers to append LDFLAGS +#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed + + +%: + dh $@ + + +# dh_make generated override targets +# This is example for Cmake (See https://bugs.debian.org/641051 ) +#override_dh_auto_configure: +# dh_auto_configure -- \ +# -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH) diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..89ae9db --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (native) diff --git a/debian/vnctv.install b/debian/vnctv.install new file mode 100644 index 0000000..342af61 --- /dev/null +++ b/debian/vnctv.install @@ -0,0 +1,3 @@ +vnctv usr/share/vnctv/ +/vnctv-web usr/share/vnctv/ +*.service usr/lib//systemd/system/ diff --git a/vnctv b/vnctv new file mode 100644 index 0000000..f8d68ba --- /dev/null +++ b/vnctv @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +xset -dpms +xset s off +while true +do + HOST=$(nc -lp 4444 -s 127.0.0.1) + echo $HOST + /usr/bin/directvnc $HOST --nolocalcursor --noshared #--encodings copyrect +done diff --git a/vnctv-web b/vnctv-web new file mode 100644 index 0000000..7c05d6a --- /dev/null +++ b/vnctv-web @@ -0,0 +1,96 @@ +#!/usr/bin/env python3 +from http.server import BaseHTTPRequestHandler, HTTPServer +from urllib.parse import urlparse, parse_qs +import re +from time import sleep +import socket + +hostName = "0.0.0.0" +serverPort = 8080 + +class MyServer(BaseHTTPRequestHandler): + def do_GET(self): + self.send_response(200) + self.send_header("Content-type", "text/html") + self.end_headers() + parsed_path = urlparse(self.path) + param=parse_qs(parsed_path.query) + host=str(self.client_address[0]) + if "host" in param: + p = re.compile("[a-zA-Z0-9_.-]*") + print(param["host"][0]) + if p.match(param["host"][0])[0] == param["host"][0]: + host=param["host"][0] + try: + s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + s.connect(("127.0.0.1",4444)) + s.send(bytes(host,"UTF-8")) + s.close() + except: + pass + else: + host="invalide" + self.wfile.write(bytes(""" + + + vnctv + + + +
+
+
+ + + + +
+
    +
  • thomas-XPS15.net.lgy.fr
  • +
+
+
+ +""", "utf-8")) +if __name__ == "__main__": + webServer = HTTPServer((hostName, serverPort), MyServer) + print("Server started http://%s:%s" % (hostName, serverPort)) + + try: + webServer.serve_forever() + except KeyboardInterrupt: + pass + + webServer.server_close() + print("Server stopped.") diff --git a/vnctv-web.service b/vnctv-web.service new file mode 100644 index 0000000..98a1d18 --- /dev/null +++ b/vnctv-web.service @@ -0,0 +1,9 @@ +[Unit] +Description=vnctv-web +[Service] +user=vnctv +group=vnctv +ExecStart=/usr/share/vnctv/vnctv-web +Restart=always +[Install] +WantedBy=multi-user.target diff --git a/vnctv.service b/vnctv.service new file mode 100644 index 0000000..69ad065 --- /dev/null +++ b/vnctv.service @@ -0,0 +1,7 @@ +[Unit] +Description=vnctv +[Service] +ExecStart=/usr/share/vnctv/vnctv +Restart=always +[Install] +WantedBy=multi-user.target