Skip to content

Commit e659cad

Browse files
committed
more sanitization for user inputs
1 parent 94c2572 commit e659cad

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

koboldcpp.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5375,7 +5375,7 @@ def run_tunnel():
53755375
else:
53765376
print("Starting Cloudflare Tunnel for Linux, please wait...", flush=True)
53775377
tunnelbinary = "./cloudflared-linux-amd64"
5378-
tunnelproc = subprocess.Popen(f"{tunnelbinary} tunnel --url {httpsaffix}://localhost:{args.port}{ssladd}", text=True, encoding='utf-8', shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.PIPE)
5378+
tunnelproc = subprocess.Popen(f"{tunnelbinary} tunnel --url {httpsaffix}://localhost:{int(args.port)}{ssladd}", text=True, encoding='utf-8', shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.PIPE)
53795379
time.sleep(10)
53805380
def tunnel_reader():
53815381
nonlocal tunnelproc,tunneloutput,tunnelrawlog
@@ -5509,6 +5509,8 @@ def load_config_cli(filename):
55095509
print("Loading .kcpps configuration file...")
55105510
with open(filename, 'r', encoding='utf-8', errors='ignore') as f:
55115511
config = json.load(f)
5512+
if "onready" in config:
5513+
config["onready"] = "" #do not allow onready commands from config
55125514
args.istemplate = False
55135515
raw_args = (sys.argv[1:]) #a lousy hack to allow for overriding kcpps
55145516
for key, value in config.items():

0 commit comments

Comments
 (0)