mirror of https://github.com/9001/r0c.git
revision: proxy support, and map the delete-key
* option to specify list of known proxy IPs; any connections coming from these IPs will be forced through the config wizard, to avoid mixing up client configs * the delete-key now works as expected in most clients
This commit is contained in:
parent
7c82c316f2
commit
f8780fef2e
|
@ -49,6 +49,7 @@ def optgen(ap, pwd):
|
|||
ac.add_argument("-pw", metavar="PWD", type=u, default=pwd, help="admin password")
|
||||
ac.add_argument("--ara", action="store_true", help="admin-access requires auth (even for localhost)")
|
||||
ac.add_argument("--nsalt", metavar="TXT", type=u, default="lammo/", help="salt for generated nicknames based on IP")
|
||||
ac.add_argument("--proxy", metavar="A,A", type=u, default="", help="comma-sep. list of IPs which are relays to disable config persistence on")
|
||||
|
||||
ac = ap.add_argument_group("logging")
|
||||
ac.add_argument("--log-rx", action="store_true", help="log incoming traffic from clients")
|
||||
|
@ -197,6 +198,8 @@ class Core(object):
|
|||
rap = run_ap
|
||||
|
||||
ar = self.ar = rap(argv, pwd) # type: argparse.Namespace
|
||||
ar.proxy = ar.proxy.split(",")
|
||||
|
||||
Util.HEX_WIDTH = ar.hex_w
|
||||
Itelnet.init(ar)
|
||||
|
||||
|
|
|
@ -485,6 +485,9 @@ class VT100_Client(object):
|
|||
self.user.admin = self.adr[0] == "127.0.0.1" and not self.ar.ara
|
||||
|
||||
try:
|
||||
if self.adr[0] in self.ar.proxy:
|
||||
raise Exception()
|
||||
|
||||
(
|
||||
ts,
|
||||
nick,
|
||||
|
@ -2884,6 +2887,16 @@ class VT100_Client(object):
|
|||
self.user.exec_cmd("a")
|
||||
elif act == "tab":
|
||||
self.tabcomplete()
|
||||
elif act == "del":
|
||||
self.linepos += 1
|
||||
if self.linepos > len(self.linebuf):
|
||||
self.linepos = len(self.linebuf)
|
||||
if self.linepos > 0:
|
||||
self.linebuf = (
|
||||
self.linebuf[: self.linepos - 1]
|
||||
+ self.linebuf[self.linepos :]
|
||||
)
|
||||
self.linepos -= 1
|
||||
else:
|
||||
print("unimplemented action: {0}".format(act))
|
||||
|
||||
|
|
Loading…
Reference in New Issue