From 278258ee9f3265ccad9914206ebd67b79ba24146 Mon Sep 17 00:00:00 2001
From: ed
Date: Sat, 11 Jan 2025 15:23:47 +0000
Subject: [PATCH] connect-page:
* add sharex, ishare
* change placeholder password from `pw` to `hunter2`
* add a button to use a real password instead of a placeholder
---
copyparty/httpcli.py | 4 ++--
copyparty/web/svcs.html | 45 ++++++++++++++++++++++++++++++++++++++---
copyparty/web/svcs.js | 33 ++++++++++++++++++++++++++++++
3 files changed, 77 insertions(+), 5 deletions(-)
diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py
index 937d9f95..894b14ce 100644
--- a/copyparty/httpcli.py
+++ b/copyparty/httpcli.py
@@ -4568,12 +4568,12 @@ class HttpCli(object):
else self.conn.hsrv.nm.map(self.ip) or host
)
# safer than html_escape/quotep since this avoids both XSS and shell-stuff
- pw = re.sub(r"[<>&$?`\"']", "_", self.pw or "pw")
+ pw = re.sub(r"[<>&$?`\"']", "_", self.pw or "hunter2")
vp = re.sub(r"[<>&$?`\"']", "_", self.uparam["hc"] or "").lstrip("/")
pw = pw.replace(" ", "%20")
vp = vp.replace(" ", "%20")
if pw in self.asrv.sesa:
- pw = "pwd"
+ pw = "hunter2"
html = self.j2s(
"svcs",
diff --git a/copyparty/web/svcs.html b/copyparty/web/svcs.html
index 3cc23207..199abcdd 100644
--- a/copyparty/web/svcs.html
+++ b/copyparty/web/svcs.html
@@ -9,7 +9,7 @@
-
+
{{ html_head }}
@@ -31,11 +31,12 @@
placeholders:
- {% if accs %}{{ pw }}
=password, {% endif %}W:
=mountpoint
+ {% if accs %}{{ pw }}
=password, {% endif %}W:
=mountpoint
- {% if accs %}{{ pw }}
=password, {% endif %}mp
=mountpoint
+ {% if accs %}{{ pw }}
=password, {% endif %}mp
=mountpoint
+ use real password
to upload screenshots using ShareX v12 or v15+, save this as copyparty.sxcu
and run it:
+ { "Name": "copyparty", + "RequestURL": "http{{ s }}://{{ ep }}/{{ rvp }}", + "Headers": { + {% if accs %}"pw": "{{ pw }}",{% endif %} + "accept": "url" + }, + "DestinationType": "ImageUploader, TextUploader, FileUploader", + "FileFormName": "f" } ++
to upload screenshots using ishare, save this as copyparty.iscu
and run it:
+ { "Name": "copyparty", + "RequestURL": "http{{ s }}://{{ ep }}/{{ rvp }}", + "Headers": { + {% if accs %}"pw": "{{ pw }}",{% endif %} + "accept": "json" + }, + "ResponseURL": "{{ '{{fileurl}}' }}", + "FileFormName": "f" } ++