copyparty 1.7.6__py3-none-any.whl → 1.8.1__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.
- copyparty/__main__.py +125 -11
- copyparty/__version__.py +3 -3
- copyparty/authsrv.py +96 -6
- copyparty/broker_mp.py +14 -1
- copyparty/cert.py +3 -1
- copyparty/cfg.py +7 -1
- copyparty/ftpd.py +7 -4
- copyparty/httpcli.py +122 -14
- copyparty/ico.py +17 -4
- copyparty/pwhash.py +145 -0
- copyparty/u2idx.py +1 -1
- copyparty/up2k.py +82 -15
- copyparty/util.py +34 -1
- copyparty/web/browser.css.gz +0 -0
- copyparty/web/browser.js.gz +0 -0
- copyparty/web/ui.css.gz +0 -0
- copyparty/web/util.js.gz +0 -0
- {copyparty-1.7.6.dist-info → copyparty-1.8.1.dist-info}/METADATA +41 -1
- {copyparty-1.7.6.dist-info → copyparty-1.8.1.dist-info}/RECORD +23 -22
- {copyparty-1.7.6.dist-info → copyparty-1.8.1.dist-info}/LICENSE +0 -0
- {copyparty-1.7.6.dist-info → copyparty-1.8.1.dist-info}/WHEEL +0 -0
- {copyparty-1.7.6.dist-info → copyparty-1.8.1.dist-info}/entry_points.txt +0 -0
- {copyparty-1.7.6.dist-info → copyparty-1.8.1.dist-info}/top_level.txt +0 -0
copyparty/util.py
CHANGED
@@ -1610,7 +1610,12 @@ def unhumanize(sz ) :
|
|
1610
1610
|
pass
|
1611
1611
|
|
1612
1612
|
mc = sz[-1:].lower()
|
1613
|
-
mi = {
|
1613
|
+
mi = {
|
1614
|
+
"k": 1024,
|
1615
|
+
"m": 1024 * 1024,
|
1616
|
+
"g": 1024 * 1024 * 1024,
|
1617
|
+
"t": 1024 * 1024 * 1024 * 1024,
|
1618
|
+
}.get(mc, 1)
|
1614
1619
|
return int(float(sz[:-1]) * mi)
|
1615
1620
|
|
1616
1621
|
|
@@ -2706,6 +2711,34 @@ def runhook(
|
|
2706
2711
|
return True
|
2707
2712
|
|
2708
2713
|
|
2714
|
+
def loadpy(ap , hot ) :
|
2715
|
+
"""
|
2716
|
+
a nice can of worms capable of causing all sorts of bugs
|
2717
|
+
depending on what other inconveniently named files happen
|
2718
|
+
to be in the same folder
|
2719
|
+
"""
|
2720
|
+
if ap.startswith("~"):
|
2721
|
+
ap = os.path.expanduser(ap)
|
2722
|
+
|
2723
|
+
mdir, mfile = os.path.split(absreal(ap))
|
2724
|
+
mname = mfile.rsplit(".", 1)[0]
|
2725
|
+
sys.path.insert(0, mdir)
|
2726
|
+
|
2727
|
+
if PY2:
|
2728
|
+
mod = __import__(mname)
|
2729
|
+
if hot:
|
2730
|
+
reload(mod)
|
2731
|
+
else:
|
2732
|
+
import importlib
|
2733
|
+
|
2734
|
+
mod = importlib.import_module(mname)
|
2735
|
+
if hot:
|
2736
|
+
importlib.reload(mod)
|
2737
|
+
|
2738
|
+
sys.path.remove(mdir)
|
2739
|
+
return mod
|
2740
|
+
|
2741
|
+
|
2709
2742
|
def gzip_orig_sz(fn ) :
|
2710
2743
|
with open(fsenc(fn), "rb") as f:
|
2711
2744
|
f.seek(-4, 2)
|
copyparty/web/browser.css.gz
CHANGED
Binary file
|
copyparty/web/browser.js.gz
CHANGED
Binary file
|
copyparty/web/ui.css.gz
CHANGED
Binary file
|
copyparty/web/util.js.gz
CHANGED
Binary file
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: copyparty
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.8.1
|
4
4
|
Summary: Portable file server with accelerated resumable uploads, deduplication, WebDAV, FTP, zeroconf, media indexer, video thumbnails, audio transcoding, and write-only folders
|
5
5
|
Author-email: ed <copyparty@ocv.me>
|
6
6
|
License: MIT
|
@@ -42,6 +42,8 @@ Requires-Dist: pyftpdlib ; extra == 'ftpd'
|
|
42
42
|
Provides-Extra: ftps
|
43
43
|
Requires-Dist: pyftpdlib ; extra == 'ftps'
|
44
44
|
Requires-Dist: pyopenssl ; extra == 'ftps'
|
45
|
+
Provides-Extra: pwhash
|
46
|
+
Requires-Dist: argon2-cffi ; extra == 'pwhash'
|
45
47
|
Provides-Extra: thumbnails
|
46
48
|
Requires-Dist: Pillow ; extra == 'thumbnails'
|
47
49
|
Provides-Extra: thumbnails2
|
@@ -115,12 +117,14 @@ turn almost any device into a file server with resumable uploads/downloads using
|
|
115
117
|
* [file parser plugins](#file-parser-plugins) - provide custom parsers to index additional tags
|
116
118
|
* [event hooks](#event-hooks) - trigger a program on uploads, renames etc ([examples](./bin/hooks/))
|
117
119
|
* [upload events](#upload-events) - the older, more powerful approach ([examples](./bin/mtag/))
|
120
|
+
* [handlers](#handlers) - redefine behavior with plugins ([examples](./bin/handlers/))
|
118
121
|
* [hiding from google](#hiding-from-google) - tell search engines you dont wanna be indexed
|
119
122
|
* [themes](#themes)
|
120
123
|
* [complete examples](#complete-examples)
|
121
124
|
* [reverse-proxy](#reverse-proxy) - running copyparty next to other websites
|
122
125
|
* [packages](#packages) - the party might be closer than you think
|
123
126
|
* [arch package](#arch-package) - now [available on aur](https://aur.archlinux.org/packages/copyparty) maintained by [@icxes](https://github.com/icxes)
|
127
|
+
* [fedora package](#fedora-package) - now [available on copr-pypi](https://copr.fedorainfracloud.org/coprs/g/copr/PyPI/)
|
124
128
|
* [nix package](#nix-package) - `nix profile install github:9001/copyparty`
|
125
129
|
* [nixos module](#nixos-module)
|
126
130
|
* [browser support](#browser-support) - TLDR: yes
|
@@ -134,6 +138,7 @@ turn almost any device into a file server with resumable uploads/downloads using
|
|
134
138
|
* [security](#security) - some notes on hardening
|
135
139
|
* [gotchas](#gotchas) - behavior that might be unexpected
|
136
140
|
* [cors](#cors) - cross-site request config
|
141
|
+
* [password hashing](#password-hashing) - you can hash passwords
|
137
142
|
* [https](#https) - both HTTP and HTTPS are accepted
|
138
143
|
* [recovering from crashes](#recovering-from-crashes)
|
139
144
|
* [client crashes](#client-crashes)
|
@@ -1029,6 +1034,8 @@ set upload rules using volflags, some examples:
|
|
1029
1034
|
|
1030
1035
|
* `:c,sz=1k-3m` sets allowed filesize between 1 KiB and 3 MiB inclusive (suffixes: `b`, `k`, `m`, `g`)
|
1031
1036
|
* `:c,df=4g` block uploads if there would be less than 4 GiB free disk space afterwards
|
1037
|
+
* `:c,vmaxb=1g` block uploads if total volume size would exceed 1 GiB afterwards
|
1038
|
+
* `:c,vmaxn=4k` block uploads if volume would contain more than 4096 files afterwards
|
1032
1039
|
* `:c,nosub` disallow uploading into subdirectories; goes well with `rotn` and `rotf`:
|
1033
1040
|
* `:c,rotn=1000,2` moves uploads into subfolders, up to 1000 files in each folder before making a new one, two levels deep (must be at least 1)
|
1034
1041
|
* `:c,rotf=%Y/%m/%d/%H` enforces files to be uploaded into a structure of subfolders according to that date format
|
@@ -1172,6 +1179,13 @@ note that this is way more complicated than the new [event hooks](#event-hooks)
|
|
1172
1179
|
note that it will occupy the parsing threads, so fork anything expensive (or set `kn` to have copyparty fork it for you) -- otoh if you want to intentionally queue/singlethread you can combine it with `--mtag-mt 1`
|
1173
1180
|
|
1174
1181
|
|
1182
|
+
## handlers
|
1183
|
+
|
1184
|
+
redefine behavior with plugins ([examples](./bin/handlers/))
|
1185
|
+
|
1186
|
+
replace 404 and 403 errors with something completely different (that's it for now)
|
1187
|
+
|
1188
|
+
|
1175
1189
|
## hiding from google
|
1176
1190
|
|
1177
1191
|
tell search engines you dont wanna be indexed, either using the good old [robots.txt](https://www.robotstxt.org/robotstxt.html) or through copyparty settings:
|
@@ -1274,6 +1288,19 @@ the party might be closer than you think
|
|
1274
1288
|
now [available on aur](https://aur.archlinux.org/packages/copyparty) maintained by [@icxes](https://github.com/icxes)
|
1275
1289
|
|
1276
1290
|
|
1291
|
+
## fedora package
|
1292
|
+
|
1293
|
+
now [available on copr-pypi](https://copr.fedorainfracloud.org/coprs/g/copr/PyPI/) , maintained autonomously -- [track record](https://copr.fedorainfracloud.org/coprs/g/copr/PyPI/package/python-copyparty/) seems OK
|
1294
|
+
|
1295
|
+
```bash
|
1296
|
+
dnf copr enable @copr/PyPI
|
1297
|
+
dnf install python3-copyparty # just a minimal install, or...
|
1298
|
+
dnf install python3-{copyparty,pillow,argon2-cffi,pyftpdlib,pyOpenSSL} ffmpeg-free # with recommended deps
|
1299
|
+
```
|
1300
|
+
|
1301
|
+
this *may* also work on RHEL but [I'm not paying IBM to verify that](https://www.jeffgeerling.com/blog/2023/dear-red-hat-are-you-dumb)
|
1302
|
+
|
1303
|
+
|
1277
1304
|
## nix package
|
1278
1305
|
|
1279
1306
|
`nix profile install github:9001/copyparty`
|
@@ -1615,6 +1642,17 @@ by default, except for `GET` and `HEAD` operations, all requests must either:
|
|
1615
1642
|
cors can be configured with `--acao` and `--acam`, or the protections entirely disabled with `--allow-csrf`
|
1616
1643
|
|
1617
1644
|
|
1645
|
+
## password hashing
|
1646
|
+
|
1647
|
+
you can hash passwords before putting them into config files / providing them as arguments; see `--help-pwhash` for all the details
|
1648
|
+
|
1649
|
+
`--ah-alg argon2` enables it, and if you have any plaintext passwords then it'll print the hashed versions on startup so you can replace them
|
1650
|
+
|
1651
|
+
optionally also specify `--ah-cli` to enter an interactive mode where it will hash passwords without ever writing the plaintext ones to disk
|
1652
|
+
|
1653
|
+
the default configs take about 0.4 sec and 256 MiB RAM to process a new password on a decent laptop
|
1654
|
+
|
1655
|
+
|
1618
1656
|
## https
|
1619
1657
|
|
1620
1658
|
both HTTP and HTTPS are accepted by default, but letting a [reverse proxy](#reverse-proxy) handle the https/tls/ssl would be better (probably more secure by default)
|
@@ -1662,6 +1700,8 @@ mandatory deps:
|
|
1662
1700
|
|
1663
1701
|
install these to enable bonus features
|
1664
1702
|
|
1703
|
+
enable hashed passwords in config: `argon2-cffi`
|
1704
|
+
|
1665
1705
|
enable ftp-server:
|
1666
1706
|
* for just plaintext FTP, `pyftpdlib` (is built into the SFX)
|
1667
1707
|
* with TLS encryption, `pyftpdlib pyopenssl`
|
@@ -1,23 +1,24 @@
|
|
1
1
|
copyparty/__init__.py,sha256=JA6xnECt2WITjgMEUsk7ZKYgxieda4QvXQtgxfnfkR4,1812
|
2
|
-
copyparty/__main__.py,sha256=
|
3
|
-
copyparty/__version__.py,sha256=
|
4
|
-
copyparty/authsrv.py,sha256=
|
5
|
-
copyparty/broker_mp.py,sha256=
|
2
|
+
copyparty/__main__.py,sha256=IFxnXMbKWw1_ZJE6zDVzyELg5TSrxWijxoAghcGENm4,76082
|
3
|
+
copyparty/__version__.py,sha256=j2HdvQx05WBQ_Nb_j2FWXld9K3ON-ZMT3J2tZFCTtRI,245
|
4
|
+
copyparty/authsrv.py,sha256=udRfFaybO119wg20HzsLx0pMMQ7YSJWQV4_pNv1QBCU,68482
|
5
|
+
copyparty/broker_mp.py,sha256=lWtjjoht5dsKnm9TkRlV3vdzGWOBh8JCWCgzWuRDNzI,3915
|
6
6
|
copyparty/broker_mpw.py,sha256=GlSn4PRd_OqqeG39FiXgNvPzXVQW6UCiAcqmBSr2q6g,3200
|
7
7
|
copyparty/broker_thr.py,sha256=eKr--HJGig5zqvNGwH9UoBG9Nvi9mT2axrRmJwknd0s,1759
|
8
8
|
copyparty/broker_util.py,sha256=CnX_LAhQQqouONcDLtVkVlcBX3Z6pWuKDQDmmbHGEg4,1489
|
9
|
-
copyparty/cert.py,sha256
|
10
|
-
copyparty/cfg.py,sha256=
|
9
|
+
copyparty/cert.py,sha256=QlfGJqxcVd_Ga5-ETSXhMOn9XDVaYLnuS3dUgrHOI2E,7135
|
10
|
+
copyparty/cfg.py,sha256=3psBpcVQY8eHY2kxCTohYB98i_mlpjNrLpi-L04RVLY,7173
|
11
11
|
copyparty/dxml.py,sha256=lZpg-kn-kQsXRtNY1n6fRaS-b7uXzMCyv8ovKnhZcZc,1548
|
12
12
|
copyparty/fsutil.py,sha256=c4fTvmclKbVABNsjU4rGddsjCgRwi9YExAyo-06ATc8,3932
|
13
|
-
copyparty/ftpd.py,sha256=
|
14
|
-
copyparty/httpcli.py,sha256=
|
13
|
+
copyparty/ftpd.py,sha256=7YQSsPn7LfRpGiuLRuGRG1JJX2L53NSJVLBUNGUhG40,15393
|
14
|
+
copyparty/httpcli.py,sha256=dJOT6ARbxsJiLnUorvnTOejvbew8riFKNyGHlSNYD2w,126305
|
15
15
|
copyparty/httpconn.py,sha256=CJU4wK_6QJFvgK9mQwEV55j6Muh_9k-GTe4AIehzJiw,6825
|
16
16
|
copyparty/httpsrv.py,sha256=vLKKLroFlbjLmbMIOXE2ErvrtyoZ5-QGrr469FbQMLY,15372
|
17
|
-
copyparty/ico.py,sha256=
|
17
|
+
copyparty/ico.py,sha256=q9UYAUcIaZ1WgLwVoVY5BFOTEKotF8HVEUZI2tpjDbo,3016
|
18
18
|
copyparty/mdns.py,sha256=xJS5GQS9z65nhhk0bvY78AXZcLy_9tBfA3KIQJXp6g4,17205
|
19
19
|
copyparty/mtag.py,sha256=xQAXjTPJtDclfQhOOsMjyv35e-QVzbm8v4ng1AA41WU,16844
|
20
20
|
copyparty/multicast.py,sha256=eQW1aBFjNNFhyaovSsYOgIqUK8daBCPj19ywCZnd96c,11520
|
21
|
+
copyparty/pwhash.py,sha256=6RcQE35B-vo7evU4SS2YktEvT1h-r0FZRWP5cSNp98c,3859
|
21
22
|
copyparty/smbd.py,sha256=jJtTJuh8oSY0ZBfGTn0ATwMtdvSVpN0Zu9-jCLiMeBA,10623
|
22
23
|
copyparty/ssdp.py,sha256=qtkLXkOiUse9P0Dh3iWFjNlmhVtRjPResI-upI_Ps3c,6379
|
23
24
|
copyparty/star.py,sha256=QRGVX--MZIK_vGhstBRuDv9gB1ykWuCjX5PVUBnTsMQ,2699
|
@@ -27,9 +28,9 @@ copyparty/szip.py,sha256=o8NzYcqUUjg2MPvESa4VnAaANqD_JofBSr7Sb7eWu4I,8166
|
|
27
28
|
copyparty/tcpsrv.py,sha256=IoiWQHbsdFQkKrFuZ9uuUvfZfRQMdX5KDGjgdQ_KekI,16753
|
28
29
|
copyparty/th_cli.py,sha256=hcb-GGN7krnHF3LIp3tDix_OYwXnCRoTpsiO0TaDqOg,3826
|
29
30
|
copyparty/th_srv.py,sha256=Aiy5EG3q4qa6lLJr-YWF0ji4qsNlUTZcHKsA0oxtoso,22379
|
30
|
-
copyparty/u2idx.py,sha256=
|
31
|
-
copyparty/up2k.py,sha256=
|
32
|
-
copyparty/util.py,sha256=
|
31
|
+
copyparty/u2idx.py,sha256=HMckWFh4fBis9f939gKTlB-8Ww2ZGSWI-uyZhcUUiD8,10589
|
32
|
+
copyparty/up2k.py,sha256=O_CchFvpWNT9ZRy_rTcVMxV82hEITa4t7l-rcHl3G_c,124240
|
33
|
+
copyparty/util.py,sha256=PBWeNKJ-M9CHzFX4eWVtls2joNt9-WlqlWHGqitSGZE,72768
|
33
34
|
copyparty/bos/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
34
35
|
copyparty/bos/bos.py,sha256=Md2RwMauEdOS7SfK5aiHby8T1KgQoTaoEjVCYU98_4I,1560
|
35
36
|
copyparty/bos/path.py,sha256=yEjCq2ki9CvxA5sCT8pS0keEXwugs0ZeUyUhdBziOCI,777
|
@@ -52,9 +53,9 @@ copyparty/stolen/ifaddr/_posix.py,sha256=-67NdfGrCktfQPakT2fLbjl2U00QMvyBGkSvrUu
|
|
52
53
|
copyparty/stolen/ifaddr/_shared.py,sha256=cJACl8cOxQ-HSYphZTzKMAjAx_TAFyJwUPjfD102Xqw,6111
|
53
54
|
copyparty/stolen/ifaddr/_win32.py,sha256=EE-QyoBgeB7lYQ6z62VjXNaRozaYfCkaJBHGNA8QtZM,4026
|
54
55
|
copyparty/web/baguettebox.js.gz,sha256=X9cgmzW13InKW92J1Z5UtvpPsu1fDaVWlumPIZYpdzY,7296
|
55
|
-
copyparty/web/browser.css.gz,sha256=
|
56
|
+
copyparty/web/browser.css.gz,sha256=9dzZVXXDVOiUuZgePs0ytazPi9dN8l2Bi1rM6frZH9s,11000
|
56
57
|
copyparty/web/browser.html,sha256=BToSFHN0idtjq5O9iqOvUctOp7aQYmEXD42Big9AuZo,5317
|
57
|
-
copyparty/web/browser.js.gz,sha256=
|
58
|
+
copyparty/web/browser.js.gz,sha256=rLBEglomQHfAKKjOywetn0rPCQ1l_b5F1sUomqctzjI,59170
|
58
59
|
copyparty/web/browser2.html,sha256=3kR3QiDXYqtAo7gOoBtdTP3eRvibUCZHVVAbmAfaAVU,1604
|
59
60
|
copyparty/web/cf.html,sha256=AQSPDFq1-Ww-9SyVLZtjVPfl054aqXs6svi5cQBlAdA,585
|
60
61
|
copyparty/web/dbg-audio.js.gz,sha256=Ma-KZtK8LnmiwNvNKFKXMPYl_Nn_3U7GsJ6-DRWC2HE,688
|
@@ -73,9 +74,9 @@ copyparty/web/splash.html,sha256=tqCewuM2HMkkR7MH8ijgtAM1LHqlawqJgTGvG7NzECY,374
|
|
73
74
|
copyparty/web/splash.js.gz,sha256=2VuxIx4y0hyW9I5NWG83Bcabk5NJDftQt7a_j9Gb5nY,1235
|
74
75
|
copyparty/web/svcs.html,sha256=ixFFuf6jykApGOyObPqdxqikPqxUL_A5c7ThmiyzWOA,10610
|
75
76
|
copyparty/web/svcs.js.gz,sha256=k81ZvZ3I-f4fMHKrNGGOgOlvXnCBz0mVjD-8mieoWCA,520
|
76
|
-
copyparty/web/ui.css.gz,sha256=
|
77
|
+
copyparty/web/ui.css.gz,sha256=uWDsQBzDZjrfsmb3zdW42ceqyUo3fGxxsLrTpbyIdgQ,2419
|
77
78
|
copyparty/web/up2k.js.gz,sha256=lbjF19iOkydDacc90PicA-uL1beDUzdlDQcKalJSuWc,21544
|
78
|
-
copyparty/web/util.js.gz,sha256=
|
79
|
+
copyparty/web/util.js.gz,sha256=RhIsykMif-eP7SmQM1nipkfiTofR0SD9jzYO7Wp8hWo,13146
|
79
80
|
copyparty/web/w.hash.js.gz,sha256=P9469QknH8-1aKwI_1n1_S4yKvIGOu7bGoty9N3zYMI,1060
|
80
81
|
copyparty/web/a/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
81
82
|
copyparty/web/a/partyfuse.py,sha256=mJKqR8LjX19P4Knqa02ob5ogwPVtJXSqxkEEGZU0r60,32276
|
@@ -98,9 +99,9 @@ copyparty/web/deps/prismd.css.gz,sha256=hzzspI_ptCygzmsIp9rKsf1M4yU12Ma7TfE-wyoX
|
|
98
99
|
copyparty/web/deps/scp.woff2,sha256=w99BDU5i8MukkMEL-iW0YO9H4vFFZSPWxbkH70ytaAg,8612
|
99
100
|
copyparty/web/deps/sha512.ac.js.gz,sha256=qELXngcl-Zitrpwolm4EWqVBPyEht013iP7uDuUDPk4,7043
|
100
101
|
copyparty/web/deps/sha512.hw.js.gz,sha256=0xJaw75Tghoblu72C2h4YoU1izSR99mBtDMoGqZ3xvs,8119
|
101
|
-
copyparty-1.
|
102
|
-
copyparty-1.
|
103
|
-
copyparty-1.
|
104
|
-
copyparty-1.
|
105
|
-
copyparty-1.
|
106
|
-
copyparty-1.
|
102
|
+
copyparty-1.8.1.dist-info/LICENSE,sha256=yyzj1id78vWoLs8zbMRJY7xkkLz0lv-9dfyeIauqdfM,1059
|
103
|
+
copyparty-1.8.1.dist-info/METADATA,sha256=T4lW_RBk-ph2HdSBe4en4qyEJXub2z4U0E3r9UEAJqw,98438
|
104
|
+
copyparty-1.8.1.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
|
105
|
+
copyparty-1.8.1.dist-info/entry_points.txt,sha256=4zw6a3rqASywQomiYLObjjlxybaI65LYYOTJwgKz7b0,128
|
106
|
+
copyparty-1.8.1.dist-info/top_level.txt,sha256=LnYUPsDyk-8kFgM6YJLG4h820DQekn81cObKSu9g-sI,10
|
107
|
+
copyparty-1.8.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|