initial commit

This commit is contained in:
thomas 2022-04-06 00:49:19 +02:00
commit 9a0eabc249
13 changed files with 217 additions and 0 deletions

0
README.md Normal file
View File

6
debian/README vendored Normal file
View File

@ -0,0 +1,6 @@
The Debian Package vnctv
----------------------------
Comments regarding the Package
-- Thomas Leagy <thomas@unknown> Sun, 03 Apr 2022 12:36:14 +0200

5
debian/changelog vendored Normal file
View File

@ -0,0 +1,5 @@
vnctv (0.1.0) unstable; urgency=medium
* Initial Release.
-- Thomas Leagy <thomas@unknown> Sun, 03 Apr 2022 12:36:14 +0200

1
debian/conffiles vendored Normal file
View File

@ -0,0 +1 @@

16
debian/control vendored Normal file
View File

@ -0,0 +1,16 @@
Source: vnctv
Section: unknown
Priority: optional
Maintainer: Thomas Leagy <thomas@unknown>
Build-Depends: debhelper-compat (= 13)
Standards-Version: 4.5.1
Homepage: <insert the upstream URL, if relevant>
#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: <insert up to 60 chars description>
<insert long description, indented with spaces>

39
debian/copyright vendored Normal file
View File

@ -0,0 +1,39 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: vnctv
Upstream-Contact: <preferred name and address to reach the upstream project>
Source: <url://example.com>
Files: *
Copyright: <years> <put author's name and email here>
<years> <likewise for another author>
License: GPL-3.0+
Files: debian/*
Copyright: 2022 Thomas Leagy <thomas@unknown>
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 <https://www.gnu.org/licenses/>.
.
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/

25
debian/rules vendored Executable file
View File

@ -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)

1
debian/source/format vendored Normal file
View File

@ -0,0 +1 @@
3.0 (native)

3
debian/vnctv.install vendored Normal file
View File

@ -0,0 +1,3 @@
vnctv usr/share/vnctv/
/vnctv-web usr/share/vnctv/
*.service usr/lib//systemd/system/

9
vnctv Normal file
View File

@ -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

96
vnctv-web Normal file
View File

@ -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("""
<html>
<head>
<title>vnctv</title>
<style>
html, body {
height:100%;
width:100%;
margin:0;
padding:0;
}
label {
font-weight:bold;
margin-right:10px;
}
.table {
display:table;
text-align:center;
width:100%;
height:100%;
table-layout:fixed;
}
.cell {
display:table-cell;
vertical-align:middle;
}
form {
display:inline-block;
border:8px solid black;
width: 450px;
padding:50px 0;
}
input {
margin-bottom:15px;
}
</style>
</head>
<body>
<div class='table'>
<div class='cell'>
<form id="launch">
<label>Host:</label>
<input type="text" name="host" size="20" maxlength="30" value='""" + host + """' />
<input type="submit" value="Submit" />
<input type="reset" value="Cancel"/>
</form>
<ul>
<li>thomas-XPS15.net.lgy.fr</li>
</ul>
</div>
</div>
</body></html>
""", "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.")

9
vnctv-web.service Normal file
View File

@ -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

7
vnctv.service Normal file
View File

@ -0,0 +1,7 @@
[Unit]
Description=vnctv
[Service]
ExecStart=/usr/share/vnctv/vnctv
Restart=always
[Install]
WantedBy=multi-user.target