copyparty 1.19.7__py3-none-any.whl → 1.19.8__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. copyparty/__init__.py +2 -0
  2. copyparty/__main__.py +38 -13
  3. copyparty/__version__.py +2 -2
  4. copyparty/authsrv.py +96 -8
  5. copyparty/bos/bos.py +38 -2
  6. copyparty/cfg.py +4 -0
  7. copyparty/ftpd.py +4 -25
  8. copyparty/httpcli.py +62 -24
  9. copyparty/httpsrv.py +1 -1
  10. copyparty/smbd.py +1 -1
  11. copyparty/svchub.py +27 -1
  12. copyparty/tcpsrv.py +4 -0
  13. copyparty/up2k.py +49 -25
  14. copyparty/util.py +8 -5
  15. copyparty/web/a/partyfuse.py +19 -11
  16. copyparty/web/a/u2c.py +6 -4
  17. copyparty/web/baguettebox.js.gz +0 -0
  18. copyparty/web/browser.css.gz +0 -0
  19. copyparty/web/browser.html +1 -1
  20. copyparty/web/browser.js.gz +0 -0
  21. copyparty/web/idp.html +5 -5
  22. copyparty/web/md.html +1 -1
  23. copyparty/web/md.js.gz +0 -0
  24. copyparty/web/md2.js.gz +0 -0
  25. copyparty/web/mde.html +1 -1
  26. copyparty/web/msg.html +1 -1
  27. copyparty/web/rups.html +1 -1
  28. copyparty/web/shares.html +5 -5
  29. copyparty/web/splash.css.gz +0 -0
  30. copyparty/web/splash.html +54 -38
  31. copyparty/web/splash.js.gz +0 -0
  32. copyparty/web/svcs.html +80 -39
  33. copyparty/web/svcs.js.gz +0 -0
  34. copyparty/web/up2k.js.gz +0 -0
  35. copyparty/web/util.js.gz +0 -0
  36. {copyparty-1.19.7.dist-info → copyparty-1.19.8.dist-info}/METADATA +8 -1
  37. {copyparty-1.19.7.dist-info → copyparty-1.19.8.dist-info}/RECORD +41 -41
  38. {copyparty-1.19.7.dist-info → copyparty-1.19.8.dist-info}/WHEEL +0 -0
  39. {copyparty-1.19.7.dist-info → copyparty-1.19.8.dist-info}/entry_points.txt +0 -0
  40. {copyparty-1.19.7.dist-info → copyparty-1.19.8.dist-info}/licenses/LICENSE +0 -0
  41. {copyparty-1.19.7.dist-info → copyparty-1.19.8.dist-info}/top_level.txt +0 -0
copyparty/web/idp.html CHANGED
@@ -10,7 +10,7 @@
10
10
  <meta name="theme-color" content="#{{ tcolor }}">
11
11
  <link rel="stylesheet" media="screen" href="{{ r }}/.cpr/shares.css?_={{ ts }}">
12
12
  <link rel="stylesheet" media="screen" href="{{ r }}/.cpr/ui.css?_={{ ts }}">
13
- {{ html_head }}
13
+ {{- html_head }}
14
14
  </head>
15
15
 
16
16
  <body>
@@ -23,17 +23,17 @@
23
23
  <th>user</th>
24
24
  <th>groups</th>
25
25
  </tr></thead><tbody>
26
- {% for un, gn in rows %}
26
+ {%- for un, gn in rows %}
27
27
  <tr>
28
28
  <td><a href="{{ r }}/?idp=rm={{ un|e }}">forget</a></td>
29
29
  <td>{{ un|e }}</td>
30
30
  <td>{{ gn|e }}</td>
31
31
  </tr>
32
- {% endfor %}
32
+ {%- endfor %}
33
33
  </tbody></table>
34
- {% if not rows %}
34
+ {%- if not rows %}
35
35
  (there are no IdP users in the cache)
36
- {% endif %}
36
+ {%- endif %}
37
37
  </div>
38
38
  <a href="#" id="repl">π</a>
39
39
  <script>
copyparty/web/md.html CHANGED
@@ -9,7 +9,7 @@
9
9
  {%- if edit %}
10
10
  <link rel="stylesheet" href="{{ r }}/.cpr/md2.css?_={{ ts }}">
11
11
  {%- endif %}
12
- {{ html_head }}
12
+ {{- html_head }}
13
13
  </head>
14
14
  <body>
15
15
  <div id="mn"></div>
copyparty/web/md.js.gz CHANGED
Binary file
copyparty/web/md2.js.gz CHANGED
Binary file
copyparty/web/mde.html CHANGED
@@ -8,7 +8,7 @@
8
8
  <link rel="stylesheet" href="{{ r }}/.cpr/mde.css?_={{ ts }}">
9
9
  <link rel="stylesheet" href="{{ r }}/.cpr/deps/mini-fa.css?_={{ ts }}">
10
10
  <link rel="stylesheet" href="{{ r }}/.cpr/deps/easymde.css?_={{ ts }}">
11
- {{ html_head }}
11
+ {{- html_head }}
12
12
  </head>
13
13
  <body>
14
14
  <div id="mw">
copyparty/web/msg.html CHANGED
@@ -8,7 +8,7 @@
8
8
  <meta name="viewport" content="width=device-width, initial-scale=0.8">
9
9
  <meta name="theme-color" content="#{{ tcolor }}">
10
10
  <link rel="stylesheet" media="screen" href="{{ r }}/.cpr/msg.css?_={{ ts }}">
11
- {{ html_head }}
11
+ {{- html_head }}
12
12
  </head>
13
13
 
14
14
  <body>
copyparty/web/rups.html CHANGED
@@ -10,7 +10,7 @@
10
10
  <meta name="theme-color" content="#{{ tcolor }}">
11
11
  <link rel="stylesheet" media="screen" href="{{ r }}/.cpr/rups.css?_={{ ts }}">
12
12
  <link rel="stylesheet" media="screen" href="{{ r }}/.cpr/ui.css?_={{ ts }}">
13
- {{ html_head }}
13
+ {{- html_head }}
14
14
  </head>
15
15
 
16
16
  <body>
copyparty/web/shares.html CHANGED
@@ -10,7 +10,7 @@
10
10
  <meta name="theme-color" content="#{{ tcolor }}">
11
11
  <link rel="stylesheet" media="screen" href="{{ r }}/.cpr/shares.css?_={{ ts }}">
12
12
  <link rel="stylesheet" media="screen" href="{{ r }}/.cpr/ui.css?_={{ ts }}">
13
- {{ html_head }}
13
+ {{- html_head }}
14
14
  </head>
15
15
 
16
16
  <body>
@@ -36,7 +36,7 @@
36
36
  <th>hrs</th>
37
37
  <th>add time</th>
38
38
  </tr></thead><tbody>
39
- {% for k, pw, vp, pr, st, un, t0, t1 in rows %}
39
+ {%- for k, pw, vp, pr, st, un, t0, t1 in rows %}
40
40
  <tr>
41
41
  <td>
42
42
  <a href="{{ r }}{{ shr }}{{ k }}?qr">qr</a>
@@ -54,11 +54,11 @@
54
54
  <td>{{ "inf" if not t1 else "dead" if t1 < now else ((t1 - now) / 3600) | round(1) }}</td>
55
55
  <td></td>
56
56
  </tr>
57
- {% endfor %}
57
+ {%- endfor %}
58
58
  </tbody></table>
59
- {% if not rows %}
59
+ {%- if not rows %}
60
60
  (you don't have any active shares btw)
61
- {% endif %}
61
+ {%- endif %}
62
62
  </div>
63
63
  <a href="#" id="repl">π</a>
64
64
  <script>
Binary file
copyparty/web/splash.html CHANGED
@@ -9,7 +9,7 @@
9
9
  <meta name="theme-color" content="#{{ tcolor }}">
10
10
  <link rel="stylesheet" media="screen" href="{{ r }}/.cpr/splash.css?_={{ ts }}">
11
11
  <link rel="stylesheet" media="screen" href="{{ r }}/.cpr/ui.css?_={{ ts }}">
12
- {{ html_head }}
12
+ {{- html_head }}
13
13
  </head>
14
14
 
15
15
  <body>
@@ -18,12 +18,16 @@
18
18
  <a id="a" href="{{ r }}/?h{{ re }}" class="af">refresh</a>
19
19
  <a id="v" href="{{ r }}/?hc" class="af">connect</a>
20
20
 
21
- {%- if this.uname == '*' %}
22
- <p id="b">howdy stranger &nbsp; <small>(you're not logged in)</small></p>
23
- {%- else %}
24
- <a id="c" href="{{ r }}/?pw=x" class="logout">logout</a>
25
- <p><span id="m">welcome back,</span> <strong id="un">{{ this.uname|e }}</strong></p>
26
- {%- endif %}
21
+ {%- if this.uname == '*' %}
22
+ <p id="b">howdy stranger &nbsp; <small>(you're not logged in)</small></p>
23
+ {%- else %}
24
+ {%- if this.args.idp_logout %}
25
+ <a id="c" href="{{ this.args.idp_logout }}" class="logout">logout</a>
26
+ {%- else %}
27
+ <a id="c" href="{{ r }}/?pw=x" class="logout">logout</a>
28
+ {%- endif %}
29
+ <p><span id="m">welcome back,</span> <strong id="un">{{ this.uname|e }}</strong></p>
30
+ {%- endif %}
27
31
  {%- endif %}
28
32
 
29
33
  {%- if msg %}
@@ -37,9 +41,9 @@
37
41
  <table class="vols">
38
42
  <thead><tr><th>%</th><th>speed</th><th>eta</th><th>idle</th><th>dir</th><th>file</th></tr></thead>
39
43
  <tbody>
40
- {% for u in ups %}
44
+ {%- for u in ups %}
41
45
  <tr><td>{{ u[0] }}</td><td>{{ u[1] }}</td><td>{{ u[2] }}</td><td>{{ u[3] }}</td><td><a href="{{ u[4] }}">{{ u[5]|e }}</a></td><td>{{ u[6]|e }}</td></tr>
42
- {% endfor %}
46
+ {%- endfor %}
43
47
  </tbody>
44
48
  </table>
45
49
  {%- endif %}
@@ -49,9 +53,9 @@
49
53
  <table class="vols">
50
54
  <thead><tr><th>%</th><th>sent</th><th>speed</th><th>eta</th><th>idle</th><th></th><th>dir</th><th>file</th></tr></thead>
51
55
  <tbody>
52
- {% for u in dls %}
56
+ {%- for u in dls %}
53
57
  <tr><td>{{ u[0] }}</td><td>{{ u[1] }}</td><td>{{ u[2] }}</td><td>{{ u[3] }}</td><td>{{ u[4] }}</td><td>{{ u[5] }}</td><td><a href="{{ u[6] }}">{{ u[7]|e }}</a></td><td>{{ u[8] }}</td></tr>
54
- {% endfor %}
58
+ {%- endfor %}
55
59
  </tbody>
56
60
  </table>
57
61
  {%- endif %}
@@ -70,11 +74,11 @@
70
74
  <table class="vols">
71
75
  <thead><tr><th>vol</th><th id="t">action</th><th>status</th></tr></thead>
72
76
  <tbody>
73
- {% for mp in avol %}
77
+ {%- for mp in avol %}
74
78
  {%- if mp in vstate and vstate[mp] %}
75
79
  <tr><td><a href="{{ r }}{{ mp }}{{ url_suf }}">{{ mp }}</a></td><td><a class="s" href="{{ r }}{{ mp }}?scan">rescan</a></td><td>{{ vstate[mp] }}</td></tr>
76
80
  {%- endif %}
77
- {% endfor %}
81
+ {%- endfor %}
78
82
  </tbody>
79
83
  </table>
80
84
  </td></tr></table>
@@ -87,18 +91,18 @@
87
91
  {%- if rvol %}
88
92
  <h1 id="f">you can browse:</h1>
89
93
  <ul>
90
- {% for mp in rvol %}
94
+ {%- for mp in rvol %}
91
95
  <li><a href="{{ r }}{{ mp }}{{ url_suf }}">{{ mp }}</a></li>
92
- {% endfor %}
96
+ {%- endfor %}
93
97
  </ul>
94
98
  {%- endif %}
95
99
 
96
100
  {%- if wvol %}
97
101
  <h1 id="g">you can upload to:</h1>
98
102
  <ul>
99
- {% for mp in wvol %}
103
+ {%- for mp in wvol %}
100
104
  <li><a href="{{ r }}{{ mp }}{{ url_suf }}">{{ mp }}</a></li>
101
- {% endfor %}
105
+ {%- endfor %}
102
106
  </ul>
103
107
  {%- endif %}
104
108
 
@@ -110,71 +114,83 @@
110
114
  <input type="password" id="lp" name="cppwd" placeholder=" password" />
111
115
  <input type="hidden" name="uhash" id="uhash" value="x" />
112
116
  <input type="submit" id="ls" value="Unlock" />
113
- {% if ahttps %}
117
+ {%- if ahttps %}
114
118
  <a id="w" href="{{ ahttps }}">switch to https</a>
115
- {% endif %}
119
+ {%- endif %}
116
120
  </form>
117
121
  </div>
118
122
  {%- else %}
119
123
  <h1 id="l">login for more:</h1>
120
124
  <div>
125
+ {%- if this.args.idp_login %}
126
+ <ul><li>
127
+ <a href="{{ this.args.idp_login | replace("{dst}",r+"/"+qvpath) }}">{{ this.args.idp_login_t }}</a>
128
+ {%- if this.args.ao_have_pw %}or alternatively:{%- endif %}
129
+ </li></ul>
130
+ {%- endif %}
131
+ {%- if this.args.ao_have_pw %}
121
132
  <form id="lf" method="post" enctype="multipart/form-data" action="{{ r }}/{{ qvpath }}">
122
133
  <input type="hidden" id="la" name="act" value="login" />
123
- {% if this.args.usernames %}
134
+ {%- if this.args.usernames %}
124
135
  <input type="text" id="lu" name="uname" placeholder=" username" size="12" />
125
136
  <input type="password" id="lp" name="cppwd" placeholder=" password" size="12" />
126
- {% else %}
137
+ {%- else %}
127
138
  <input type="password" id="lp" name="cppwd" placeholder=" password" />
128
- {% endif %}
139
+ {%- endif %}
129
140
  <input type="hidden" name="uhash" id="uhash" value="x" />
130
141
  <input type="submit" id="ls" value="login" />
131
- {% if chpw %}
142
+ {%- if chpw %}
132
143
  <a id="x" href="#">change password</a>
133
- {% endif %}
134
- {% if ahttps %}
144
+ {%- endif %}
145
+ {%- if ahttps %}
135
146
  <a id="w" href="{{ ahttps }}">switch to https</a>
136
- {% endif %}
147
+ {%- endif %}
137
148
  </form>
149
+ {%- endif %}
138
150
  </div>
139
151
  {%- endif %}
140
152
 
141
153
  <h1 id="cc">other stuff:</h1>
142
154
  <ul>
155
+ {%- if ahttps %}
156
+ <li><a id="wb" href="{{ ahttps }}">switch to https</a></li>
157
+ {%- endif %}
158
+
143
159
  {%- if this.uname in this.args.idp_adm_set %}
144
160
  <li><a id="ag" href="{{ r }}/?idp">view idp cache</a></li>
145
- {% endif %}
161
+ {%- endif %}
146
162
 
147
163
  {%- if this.uname != '*' and this.args.shr %}
148
164
  <li><a id="y" href="{{ r }}/?shares">edit shares</a></li>
149
- {% endif %}
165
+ {%- endif %}
150
166
 
151
- {% if k304 or k304vis %}
152
- {% if k304 %}
167
+ {%- if k304 or k304vis %}
168
+ {%- if k304 %}
153
169
  <li><a id="h" href="{{ r }}/?cc&setck=k304=n">disable k304</a> (currently enabled)
154
170
  {%- else %}
155
171
  <li><a id="i" href="{{ r }}/?cc&setck=k304=y" class="r">enable k304</a> (currently disabled)
156
- {% endif %}
172
+ {%- endif %}
157
173
  <blockquote id="j">enabling k304 will disconnect your client on every HTTP 304, which can prevent some buggy proxies from getting stuck (suddenly not loading pages), <em>but</em> it will also make things slower in general</blockquote></li>
158
- {% endif %}
174
+ {%- endif %}
159
175
 
160
- {% if no304 or no304vis %}
161
- {% if no304 %}
176
+ {%- if no304 or no304vis %}
177
+ {%- if no304 %}
162
178
  <li><a id="ab" href="{{ r }}/?cc&setck=no304=n">disable no304</a> (currently enabled)
163
179
  {%- else %}
164
180
  <li><a id="ac" href="{{ r }}/?cc&setck=no304=y" class="r">enable no304</a> (currently disabled)
165
- {% endif %}
181
+ {%- endif %}
166
182
  <blockquote id="ad">enabling no304 will disable all caching; try this if k304 wasn't enough. This will waste a huge amount of network traffic!</blockquote></li>
167
- {% endif %}
183
+ {%- endif %}
168
184
 
169
185
  <li><a id="af" href="{{ r }}/?ru">show recent uploads</a></li>
170
186
  <li><a id="k" href="{{ r }}/?reset" class="r" onclick="localStorage.clear();return true">reset client settings</a></li>
171
187
 
172
- {%- if this.uname != '*' %}
188
+ {%- if this.uname != '*' and not in_shr %}
173
189
  <li><form method="post" enctype="multipart/form-data">
174
190
  <input type="hidden" name="act" value="logout" />
175
191
  <input type="submit" id="lo" value="logout “{{ this.uname|e }}” everywhere" />
176
192
  </form></li>
177
- {% endif %}
193
+ {%- endif %}
178
194
  </ul>
179
195
 
180
196
  </div>
Binary file
copyparty/web/svcs.html CHANGED
@@ -10,7 +10,7 @@
10
10
  <link rel="stylesheet" media="screen" href="{{ r }}/.cpr/splash.css?_={{ ts }}">
11
11
  <link rel="stylesheet" media="screen" href="{{ r }}/.cpr/ui.css?_={{ ts }}">
12
12
  <style>ul{padding-left:1.3em}li{margin:.4em 0}.txa{float:right;margin:0 0 0 1em}</style>
13
- {{ html_head }}
13
+ {{- html_head }}
14
14
  </head>
15
15
 
16
16
  <body>
@@ -31,10 +31,10 @@
31
31
  <br />
32
32
  <span class="os win lin mac">placeholders:</span>
33
33
  <span class="os win">
34
- {% if accs %}<code><b id="pw0">{{ pw }}</b></code>=password, {% endif %}<code><b>W:</b></code>=mountpoint
34
+ {% if accs %}{% if un %}<code><b id="un0">{{ un }}</b></code>=username, <code><b id="up0">{{ unpw }}</b></code>=username:password, {% endif %}<code><b id="pw0">{{ pw }}</b></code>=password, {% endif %}<code><b>W:</b></code>=mountpoint
35
35
  </span>
36
36
  <span class="os lin mac">
37
- {% if accs %}<code><b id="pw0">{{ pw }}</b></code>=password, {% endif %}<code><b>mp</b></code>=mountpoint
37
+ {% if accs %}{% if un %}<code><b id="un0">{{ un }}</b></code>=username, <code><b id="up0">{{ unpw }}</b></code>=username:password, {% endif %}<code><b id="pw0">{{ pw }}</b></code>=password, {% endif %}<code><b>mp</b></code>=mountpoint
38
38
  </span>
39
39
  {% if accs %}<a href="#" id="setpw">use real password</a>{% endif %}
40
40
  <a href="#" id="qr">show qr</a>
@@ -44,7 +44,7 @@
44
44
 
45
45
  {% if args.have_idp_hdrs %}
46
46
  <p style="line-height:2em"><b>WARNING:</b> this server is using IdP-based authentication, so this stuff may not work as advertised. Depending on server config, these commands can probably only be used to access areas which don't require authentication, unless you auth using any non-IdP accounts defined in the copyparty config. Please see <a href="https://github.com/9001/copyparty/blob/hovudstraum/docs/idp.md#connecting-webdav-clients">the IdP docs</a></p>
47
- {% endif %}
47
+ {%- endif %}
48
48
 
49
49
 
50
50
 
@@ -54,50 +54,64 @@
54
54
  <div class="os win">
55
55
  <p>if you can, install <a href="https://winfsp.dev/rel/">winfsp</a>+<a href="https://downloads.rclone.org/rclone-current-windows-amd64.zip">rclone</a> and then paste this in cmd:</p>
56
56
  <pre>
57
- rclone config create {{ aname }}-dav webdav url=http{{ s }}://{{ rip }}{{ hport }} vendor=owncloud pacer_min_sleep=0.01ms{% if accs %} user=k pass=<b>{{ pw }}</b>{% endif %}
57
+ rclone config create {{ aname }}-dav webdav url=http{{ s }}://{{ rip }}{{ hport }} vendor=owncloud pacer_min_sleep=0.01ms{% if accs %} user={{ b_un }} pass=<b>{{ pw }}</b>{% endif %}
58
58
  rclone mount --vfs-cache-mode writes --dir-cache-time 5s {{ aname }}-dav:{{ rvp }} <b>W:</b>
59
59
  </pre>
60
60
  <ul>
61
- {% if s %}
61
+ {%- if s %}
62
62
  <li>running <code>rclone mount</code> on LAN (or just dont have valid certificates)? add <code>--no-check-certificate</code></li>
63
- {% endif %}
63
+ {%- endif %}
64
64
  <li>old version of rclone? replace all <code>=</code> with <code>&nbsp;</code> (space)</li>
65
65
  </ul>
66
66
 
67
67
  <p>if you want to use the native WebDAV client in windows instead (slow and buggy), first run <a href="{{ r }}/.cpr/a/webdav-cfg.bat">webdav-cfg.bat</a> to remove the 47 MiB filesize limit (also fixes latency and password login), then connect:</p>
68
68
  <pre>
69
+ {%- if un %}
70
+ net use <b>w:</b> http{{ s }}://{{ ep }}/{{ rvp }}{% if accs %} <b>{{ pw }}</b> /user:{{ b_un }}{% endif %}
71
+ {%- else %}
69
72
  net use <b>w:</b> http{{ s }}://{{ ep }}/{{ rvp }}{% if accs %} k /user:<b>{{ pw }}</b>{% endif %}
73
+ {%- endif %}
70
74
  </pre>
71
75
  </div>
72
76
 
73
77
  <div class="os lin">
74
78
  <p>rclone (v1.63 or later) is recommended:</p>
75
79
  <pre>
76
- rclone config create {{ aname }}-dav webdav url=http{{ s }}://{{ rip }}{{ hport }} vendor=owncloud pacer_min_sleep=0.01ms{% if accs %} user=k pass=<b>{{ pw }}</b>{% endif %}
80
+ rclone config create {{ aname }}-dav webdav url=http{{ s }}://{{ rip }}{{ hport }} vendor=owncloud pacer_min_sleep=0.01ms{% if accs %} user={{ b_un }} pass=<b>{{ pw }}</b>{% endif %}
77
81
  rclone mount --vfs-cache-mode writes --dir-cache-time 5s {{ aname }}-dav:{{ rvp }} <b>mp</b>
78
82
  </pre>
79
83
  <ul>
80
- {% if s %}
84
+ {%- if s %}
81
85
  <li>running <code>rclone mount</code> on LAN (or just dont have valid certificates)? add <code>--no-check-certificate</code></li>
82
- {% endif %}
86
+ {%- endif %}
83
87
  <li>running <code>rclone mount</code> as root? add <code>--allow-other</code></li>
84
88
  <li>old version of rclone? replace all <code>=</code> with <code>&nbsp;</code> (space)</li>
85
89
  </ul>
86
90
  <p>alternatively use davfs2 (requires root, is slower, forgets lastmodified-timestamp on upload):</p>
87
91
  <pre>
88
92
  yum install davfs2
93
+ {%- if un %}
94
+ {% if accs %}printf '%s\n' {{ b_un }} <b>{{ pw }}</b> | {% endif %}mount -t davfs -ouid=1000 http{{ s }}://{{ ep }}/{{ rvp }} <b>mp</b>
95
+ {%- else %}
89
96
  {% if accs %}printf '%s\n' <b>{{ pw }}</b> k | {% endif %}mount -t davfs -ouid=1000 http{{ s }}://{{ ep }}/{{ rvp }} <b>mp</b>
97
+ {%- endif %}
90
98
  </pre>
99
+ {%- if accs %}
91
100
  <p>make davfs2 automount on boot:</p>
92
101
  <pre>
102
+ {%- if un %}
103
+ printf '%s\n' "http{{ s }}://{{ ep }}/{{ rvp }} {{ b_un }} <b>{{ pw }}</b>" >> /etc/davfs2/secrets
104
+ {%- else %}
93
105
  printf '%s\n' "http{{ s }}://{{ ep }}/{{ rvp }} <b>{{ pw }}</b> k" >> /etc/davfs2/secrets
106
+ {%- endif %}
94
107
  printf '%s\n' "http{{ s }}://{{ ep }}/{{ rvp }} <b>mp</b> davfs rw,user,uid=1000,noauto 0 0" >> /etc/fstab
95
108
  </pre>
109
+ {%- endif %}
96
110
  <p>or the emergency alternative (gnome/gui-only):</p>
97
111
  <!-- gnome-bug: ignores vp -->
98
112
  <pre>
99
113
  {%- if accs %}
100
- echo <b>{{ pw }}</b> | gio mount dav{{ s }}://k@{{ ep }}/{{ rvp }}
114
+ echo <b>{{ pw }}</b> | gio mount dav{{ s }}://{{ b_un }}@{{ ep }}/{{ rvp }}
101
115
  {%- else %}
102
116
  gio mount -a dav{{ s }}://{{ ep }}/{{ rvp }}
103
117
  {%- endif %}
@@ -107,18 +121,18 @@
107
121
 
108
122
  <div class="os mac">
109
123
  <pre>
110
- osascript -e ' mount volume "http{{ s }}://k:<b>{{ pw }}</b>@{{ ep }}/{{ rvp }}" '
124
+ osascript -e ' mount volume "http{{ s }}://{{ b_un }}:<b>{{ pw }}</b>@{{ ep }}/{{ rvp }}" '
111
125
  </pre>
112
126
  <p>or you can open up a Finder, press command-K and paste this instead:</p>
113
127
  <pre>
114
- http{{ s }}://k:<b>{{ pw }}</b>@{{ ep }}/{{ rvp }}
128
+ http{{ s }}://{{ b_un }}:<b>{{ pw }}</b>@{{ ep }}/{{ rvp }}
115
129
  </pre>
116
130
 
117
- {% if s %}
131
+ {%- if s %}
118
132
  <p><em>replace <code>https</code> with <code>http</code> if it doesn't work</em></p>
119
- {% endif %}
133
+ {%- endif %}
120
134
  </div>
121
- {% endif %}
135
+ {%- endif %}
122
136
 
123
137
 
124
138
 
@@ -127,51 +141,71 @@
127
141
 
128
142
  <div class="os win">
129
143
  <p>if you can, install <a href="https://winfsp.dev/rel/">winfsp</a>+<a href="https://downloads.rclone.org/rclone-current-windows-amd64.zip">rclone</a> and then paste this in cmd:</p>
130
- {% if args.ftp %}
144
+ {%- if args.ftp %}
131
145
  <p>connect with plaintext FTP:</p>
132
146
  <pre>
147
+ {%- if un %}
148
+ rclone config create {{ aname }}-ftp ftp host={{ rip }} port={{ args.ftp }} user={% if accs %}{{ b_un }} pass=<b>{{ pw }}</b>{% else %}anonymous pass=k{% endif %} tls=false
149
+ {%- else %}
133
150
  rclone config create {{ aname }}-ftp ftp host={{ rip }} port={{ args.ftp }} pass=k user={% if accs %}<b>{{ pw }}</b>{% else %}anonymous{% endif %} tls=false
151
+ {%- endif %}
134
152
  rclone mount --vfs-cache-mode writes --dir-cache-time 5s {{ aname }}-ftp:{{ rvp }} <b>W:</b>
135
153
  </pre>
136
- {% endif %}
137
- {% if args.ftps %}
154
+ {%- endif %}
155
+ {%- if args.ftps %}
138
156
  <p>connect with TLS-encrypted FTPS:</p>
139
157
  <pre>
158
+ {%- if un %}
159
+ rclone config create {{ aname }}-ftps ftp host={{ rip }} port={{ args.ftps }} user={% if accs %}{{ b_un }} pass=<b>{{ pw }}</b>{% else %}anonymous pass=k{% endif %} tls=false explicit_tls=true
160
+ {%- else %}
140
161
  rclone config create {{ aname }}-ftps ftp host={{ rip }} port={{ args.ftps }} pass=k user={% if accs %}<b>{{ pw }}</b>{% else %}anonymous{% endif %} tls=false explicit_tls=true
162
+ {%- endif %}
141
163
  rclone mount --vfs-cache-mode writes --dir-cache-time 5s {{ aname }}-ftps:{{ rvp }} <b>W:</b>
142
164
  </pre>
143
- {% endif %}
165
+ {%- endif %}
144
166
  <ul>
145
- {% if args.ftps %}
167
+ {%- if args.ftps %}
146
168
  <li>running on LAN (or just dont have valid certificates)? add <code>no_check_certificate=true</code> to the config command</li>
147
- {% endif %}
169
+ {%- endif %}
148
170
  <li>old version of rclone? replace all <code>=</code> with <code>&nbsp;</code> (space)</li>
149
171
  </ul>
150
172
  <p>if you want to use the native FTP client in windows instead (please dont), press <code>win+R</code> and run this command:</p>
151
173
  <pre>
174
+ {%- if un %}
175
+ explorer {{ "ftp" if args.ftp else "ftps" }}://{% if accs %}{{ b_un }}:<b>{{ pw }}</b>@{% endif %}{{ host }}:{{ args.ftp or args.ftps }}/{{ rvp }}
176
+ {%- else %}
152
177
  explorer {{ "ftp" if args.ftp else "ftps" }}://{% if accs %}<b>{{ pw }}</b>:k@{% endif %}{{ host }}:{{ args.ftp or args.ftps }}/{{ rvp }}
178
+ {%- endif %}
153
179
  </pre>
154
180
  </div>
155
181
 
156
182
  <div class="os lin">
157
- {% if args.ftp %}
183
+ {%- if args.ftp %}
158
184
  <p>connect with plaintext FTP:</p>
159
185
  <pre>
186
+ {%- if un %}
187
+ rclone config create {{ aname }}-ftp ftp host={{ rip }} port={{ args.ftp }} user={% if accs %}{{ b_un }} pass=<b>{{ pw }}</b>{% else %}anonymous pass=k{% endif %} tls=false
188
+ {%- else %}
160
189
  rclone config create {{ aname }}-ftp ftp host={{ rip }} port={{ args.ftp }} pass=k user={% if accs %}<b>{{ pw }}</b>{% else %}anonymous{% endif %} tls=false
190
+ {%- endif %}
161
191
  rclone mount --vfs-cache-mode writes --dir-cache-time 5s {{ aname }}-ftp:{{ rvp }} <b>mp</b>
162
192
  </pre>
163
- {% endif %}
164
- {% if args.ftps %}
193
+ {%- endif %}
194
+ {%- if args.ftps %}
165
195
  <p>connect with TLS-encrypted FTPS:</p>
166
196
  <pre>
197
+ {%- if un %}
198
+ rclone config create {{ aname }}-ftps ftp host={{ rip }} port={{ args.ftps }} user={% if accs %}{{ b_un }} pass=<b>{{ pw }}</b>{% else %}anonymous pass=k{% endif %} tls=false explicit_tls=true
199
+ {%- else %}
167
200
  rclone config create {{ aname }}-ftps ftp host={{ rip }} port={{ args.ftps }} pass=k user={% if accs %}<b>{{ pw }}</b>{% else %}anonymous{% endif %} tls=false explicit_tls=true
201
+ {%- endif %}
168
202
  rclone mount --vfs-cache-mode writes --dir-cache-time 5s {{ aname }}-ftps:{{ rvp }} <b>mp</b>
169
203
  </pre>
170
- {% endif %}
204
+ {%- endif %}
171
205
  <ul>
172
- {% if args.ftps %}
206
+ {%- if args.ftps %}
173
207
  <li>running on LAN (or just dont have valid certificates)? add <code>no_check_certificate=true</code> to the config command</li>
174
- {% endif %}
208
+ {%- endif %}
175
209
  <li>running <code>rclone mount</code> as root? add <code>--allow-other</code></li>
176
210
  <li>old version of rclone? replace all <code>=</code> with <code>&nbsp;</code> (space)</li>
177
211
  </ul>
@@ -179,7 +213,7 @@
179
213
  <!-- gnome-bug: ignores vp -->
180
214
  <pre>
181
215
  {%- if accs %}
182
- echo <b>{{ pw }}</b> | gio mount ftp{{ "" if args.ftp else "s" }}://k@{{ host }}:{{ args.ftp or args.ftps }}/{{ rvp }}
216
+ echo <b>{{ pw }}</b> | gio mount ftp{{ "" if args.ftp else "s" }}://{{ b_un }}@{{ host }}:{{ args.ftp or args.ftps }}/{{ rvp }}
183
217
  {%- else %}
184
218
  gio mount -a ftp{{ "" if args.ftp else "s" }}://{{ host }}:{{ args.ftp or args.ftps }}/{{ rvp }}
185
219
  {%- endif %}
@@ -189,10 +223,10 @@
189
223
  <div class="os mac">
190
224
  <p>note: FTP is read-only on macos; please use WebDAV instead</p>
191
225
  <pre>
192
- open {{ "ftp" if args.ftp else "ftps" }}://{% if accs %}k:<b>{{ pw }}</b>@{% else %}anonymous:@{% endif %}{{ host }}:{{ args.ftp or args.ftps }}/{{ rvp }}
226
+ open {{ "ftp" if args.ftp else "ftps" }}://{% if accs %}{{ b_un }}:<b>{{ pw }}</b>@{% else %}anonymous:@{% endif %}{{ host }}:{{ args.ftp or args.ftps }}/{{ rvp }}
193
227
  </pre>
194
228
  </div>
195
- {% endif %}
229
+ {%- endif %}
196
230
 
197
231
 
198
232
 
@@ -204,11 +238,11 @@
204
238
  <span class="os lin">doesn't need root</span>
205
239
  </p>
206
240
  <pre>
207
- partyfuse.py{% if accs %} -a <b>{{ pw }}</b>{% endif %} http{{ s }}://{{ ep }}/{{ rvp }} <b><span class="os win">W:</span><span class="os lin mac">mp</span></b>
241
+ partyfuse.py{% if accs %} -a <b>{{ unpw }}</b>{% endif %} http{{ s }}://{{ ep }}/{{ rvp }} <b><span class="os win">W:</span><span class="os lin mac">mp</span></b>
208
242
  </pre>
209
- {% if s %}
243
+ {%- if s %}
210
244
  <ul><li>if you are on LAN (or just dont have valid certificates), add <code>-td</code></li></ul>
211
- {% endif %}
245
+ {%- endif %}
212
246
  <p>
213
247
  you can use <a href="{{ r }}/.cpr/a/u2c.py">u2c.py</a> to upload (sometimes faster than web-browsers)
214
248
  </p>
@@ -217,6 +251,10 @@
217
251
  {% if args.smb %}
218
252
  <h1>SMB / CIFS</h1>
219
253
 
254
+ {%- if un %}
255
+ <h2>not available on this server because <code>--usernames</code> is enabled in the server config</h2>
256
+ {%- else %}
257
+
220
258
  <div class="os win">
221
259
  <pre>
222
260
  net use <b>w:</b> \\{{ host }}\a{% if accs %} k /user:<b>{{ pw }}</b>{% endif %}
@@ -234,7 +272,8 @@
234
272
  <pre class="os mac">
235
273
  open 'smb://<b>{{ pw }}</b>:k@{{ host }}/a'
236
274
  </pre>
237
- {% endif %}
275
+ {%- endif %}
276
+ {%- endif %}
238
277
 
239
278
 
240
279
 
@@ -247,7 +286,7 @@
247
286
  { "Version": "15.0.0", "Name": "copyparty",
248
287
  "RequestURL": "http{{ s }}://{{ ep }}/{{ rvp }}",
249
288
  "Headers": {
250
- {% if accs %}"pw": "<b>{{ pw }}</b>", {% endif %}"accept": "url"
289
+ {% if accs %}"pw": "<b>{{ unpw }}</b>", {% endif %}"accept": "url"
251
290
  },
252
291
  "DestinationType": "ImageUploader, TextUploader, FileUploader",
253
292
  "Body": "MultipartFormData", "URL": "{response}",
@@ -260,7 +299,7 @@
260
299
  { "Name": "copyparty",
261
300
  "RequestURL": "http{{ s }}://{{ ep }}/{{ rvp }}",
262
301
  "Headers": {
263
- {% if accs %}"pw": "<b>{{ pw }}</b>", {% endif %}"accept": "url"
302
+ {% if accs %}"pw": "<b>{{ unpw }}</b>", {% endif %}"accept": "url"
264
303
  },
265
304
  "DestinationType": "ImageUploader, TextUploader, FileUploader",
266
305
  "FileFormName": "f" }
@@ -278,7 +317,9 @@
278
317
  { "Name": "copyparty",
279
318
  "RequestURL": "http{{ s }}://{{ ep }}/{{ rvp }}",
280
319
  "Headers": {
281
- {% if accs %}"pw": "<b>{{ pw }}</b>",{% endif %}
320
+ {%- if accs %}
321
+ "pw": "<b>{{ unpw }}</b>",
322
+ {%- endif %}
282
323
  "accept": "json"
283
324
  },
284
325
  "ResponseURL": "{{ '{{fileurl}}' }}",
@@ -295,7 +336,7 @@
295
336
 
296
337
  <pre class="dl" name="flameshot.sh">
297
338
  #!/bin/bash
298
- pw="<b>{{ pw }}</b>"
339
+ pw="<b>{{ unpw }}</b>"
299
340
  url="http{{ s }}://{{ ep }}/{{ rvp }}"
300
341
  filename="$(date +%Y-%m%d-%H%M%S).png"
301
342
  flameshot gui -s -r | curl -sT- "$url$filename?want=url&pw=$pw" | xsel -ib
copyparty/web/svcs.js.gz CHANGED
Binary file
copyparty/web/up2k.js.gz CHANGED
Binary file
copyparty/web/util.js.gz CHANGED
Binary file