copyparty 1.11.0__tar.gz → 1.11.1__tar.gz

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 (114) hide show
  1. {copyparty-1.11.0 → copyparty-1.11.1}/PKG-INFO +15 -2
  2. {copyparty-1.11.0 → copyparty-1.11.1}/README.md +14 -1
  3. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/__main__.py +1 -0
  4. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/__version__.py +2 -2
  5. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/httpcli.py +12 -12
  6. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/httpconn.py +1 -0
  7. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/httpsrv.py +1 -1
  8. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/tftpd.py +0 -2
  9. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/web/baguettebox.js.gz +0 -0
  10. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/web/browser.css.gz +0 -0
  11. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/web/browser.js.gz +0 -0
  12. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/web/md.css.gz +0 -0
  13. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/web/md.js.gz +0 -0
  14. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/web/md2.css.gz +0 -0
  15. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/web/md2.js.gz +0 -0
  16. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/web/mde.css.gz +0 -0
  17. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/web/mde.js.gz +0 -0
  18. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/web/msg.css.gz +0 -0
  19. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/web/splash.css.gz +0 -0
  20. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/web/splash.js.gz +0 -0
  21. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/web/ui.css.gz +0 -0
  22. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/web/up2k.js.gz +0 -0
  23. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/web/util.js.gz +0 -0
  24. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty.egg-info/PKG-INFO +15 -2
  25. {copyparty-1.11.0 → copyparty-1.11.1}/LICENSE +0 -0
  26. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/__init__.py +0 -0
  27. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/authsrv.py +0 -0
  28. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/bos/__init__.py +0 -0
  29. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/bos/bos.py +0 -0
  30. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/bos/path.py +0 -0
  31. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/broker_mp.py +0 -0
  32. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/broker_mpw.py +0 -0
  33. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/broker_thr.py +0 -0
  34. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/broker_util.py +0 -0
  35. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/cert.py +0 -0
  36. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/cfg.py +0 -0
  37. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/dxml.py +0 -0
  38. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/fsutil.py +0 -0
  39. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/ftpd.py +0 -0
  40. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/ico.py +0 -0
  41. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/mdns.py +0 -0
  42. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/metrics.py +0 -0
  43. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/mtag.py +0 -0
  44. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/multicast.py +0 -0
  45. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/pwhash.py +0 -0
  46. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/res/COPYING.txt +0 -0
  47. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/res/__init__.py +0 -0
  48. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/res/insecure.pem +0 -0
  49. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/smbd.py +0 -0
  50. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/ssdp.py +0 -0
  51. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/star.py +0 -0
  52. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/stolen/__init__.py +0 -0
  53. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/stolen/dnslib/__init__.py +0 -0
  54. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/stolen/dnslib/bimap.py +0 -0
  55. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/stolen/dnslib/bit.py +0 -0
  56. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/stolen/dnslib/buffer.py +0 -0
  57. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/stolen/dnslib/dns.py +0 -0
  58. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/stolen/dnslib/label.py +0 -0
  59. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/stolen/dnslib/lex.py +0 -0
  60. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/stolen/dnslib/ranges.py +0 -0
  61. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/stolen/ifaddr/__init__.py +0 -0
  62. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/stolen/ifaddr/_posix.py +0 -0
  63. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/stolen/ifaddr/_shared.py +0 -0
  64. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/stolen/ifaddr/_win32.py +0 -0
  65. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/stolen/qrcodegen.py +0 -0
  66. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/stolen/surrogateescape.py +0 -0
  67. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/sutil.py +0 -0
  68. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/svchub.py +0 -0
  69. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/szip.py +0 -0
  70. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/tcpsrv.py +0 -0
  71. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/th_cli.py +0 -0
  72. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/th_srv.py +0 -0
  73. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/u2idx.py +0 -0
  74. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/up2k.py +0 -0
  75. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/util.py +0 -0
  76. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/web/a/__init__.py +0 -0
  77. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/web/a/partyfuse.py +0 -0
  78. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/web/a/u2c.py +0 -0
  79. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/web/a/webdav-cfg.bat +0 -0
  80. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/web/browser.html +0 -0
  81. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/web/browser2.html +0 -0
  82. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/web/cf.html +0 -0
  83. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/web/dbg-audio.js.gz +0 -0
  84. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/web/dd/2.png +0 -0
  85. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/web/dd/3.png +0 -0
  86. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/web/dd/4.png +0 -0
  87. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/web/dd/5.png +0 -0
  88. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/web/dd/__init__.py +0 -0
  89. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/web/deps/__init__.py +0 -0
  90. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/web/deps/easymde.css.gz +0 -0
  91. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/web/deps/easymde.js.gz +0 -0
  92. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/web/deps/marked.js.gz +0 -0
  93. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/web/deps/mini-fa.css.gz +0 -0
  94. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/web/deps/mini-fa.woff +0 -0
  95. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/web/deps/prism.css.gz +0 -0
  96. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/web/deps/prism.js.gz +0 -0
  97. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/web/deps/prismd.css.gz +0 -0
  98. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/web/deps/scp.woff2 +0 -0
  99. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/web/deps/sha512.ac.js.gz +0 -0
  100. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/web/deps/sha512.hw.js.gz +0 -0
  101. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/web/md.html +0 -0
  102. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/web/mde.html +0 -0
  103. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/web/msg.html +0 -0
  104. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/web/splash.html +0 -0
  105. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/web/svcs.html +0 -0
  106. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/web/svcs.js.gz +0 -0
  107. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty/web/w.hash.js.gz +0 -0
  108. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty.egg-info/SOURCES.txt +0 -0
  109. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty.egg-info/dependency_links.txt +0 -0
  110. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty.egg-info/entry_points.txt +0 -0
  111. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty.egg-info/requires.txt +0 -0
  112. {copyparty-1.11.0 → copyparty-1.11.1}/copyparty.egg-info/top_level.txt +0 -0
  113. {copyparty-1.11.0 → copyparty-1.11.1}/pyproject.toml +0 -0
  114. {copyparty-1.11.0 → copyparty-1.11.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: copyparty
3
- Version: 1.11.0
3
+ Version: 1.11.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
@@ -129,6 +129,7 @@ turn almost any device into a file server with resumable uploads/downloads using
129
129
  * [themes](#themes)
130
130
  * [complete examples](#complete-examples)
131
131
  * [reverse-proxy](#reverse-proxy) - running copyparty next to other websites
132
+ * [real-ip](#real-ip) - teaching copyparty how to see client IPs
132
133
  * [prometheus](#prometheus) - metrics/stats can be enabled
133
134
  * [packages](#packages) - the party might be closer than you think
134
135
  * [arch package](#arch-package) - now [available on aur](https://aur.archlinux.org/packages/copyparty) maintained by [@icxes](https://github.com/icxes)
@@ -411,6 +412,9 @@ upgrade notes
411
412
  * firefox refuses to connect over https, saying "Secure Connection Failed" or "SEC_ERROR_BAD_SIGNATURE", but the usual button to "Accept the Risk and Continue" is not shown
412
413
  * firefox has corrupted its certstore; fix this by exiting firefox, then find and delete the file named `cert9.db` somewhere in your firefox profile folder
413
414
 
415
+ * the server keeps saying `thank you for playing` when I try to access the website
416
+ * you've gotten banned for malicious traffic! if this happens by mistake, and you're running a reverse-proxy and/or something like cloudflare, see [real-ip](#real-ip) on how to fix this
417
+
414
418
  * copyparty seems to think I am using http, even though the URL is https
415
419
  * your reverse-proxy is not sending the `X-Forwarded-Proto: https` header; this could be because your reverse-proxy itself is confused. Ensure that none of the intermediates (such as cloudflare) are terminating https before the traffic hits your entrypoint
416
420
 
@@ -651,7 +655,7 @@ this initiates an upload using `up2k`; there are two uploaders available:
651
655
  * `[🎈] bup`, the basic uploader, supports almost every browser since netscape 4.0
652
656
  * `[🚀] up2k`, the good / fancy one
653
657
 
654
- NB: you can undo/delete your own uploads with `[🧯]` [unpost](#unpost)
658
+ NB: you can undo/delete your own uploads with `[🧯]` [unpost](#unpost) (and this is also where you abort unfinished uploads, but you have to refresh the page first)
655
659
 
656
660
  up2k has several advantages:
657
661
  * you can drop folders into the browser (files are added recursively)
@@ -1437,6 +1441,15 @@ example webserver configs:
1437
1441
  * [apache2 config](contrib/apache/copyparty.conf) -- location-based
1438
1442
 
1439
1443
 
1444
+ ### real-ip
1445
+
1446
+ teaching copyparty how to see client IPs when running behind a reverse-proxy, or a WAF, or another protection service such as cloudflare
1447
+
1448
+ if you (and maybe everybody else) keep getting a message that says `thank you for playing`, then you've gotten banned for malicious traffic. This ban applies to the IP address that copyparty *thinks* identifies the shady client -- so, depending on your setup, you might have to tell copyparty where to find the correct IP
1449
+
1450
+ for most common setups, there should be a helpful message in the server-log explaining what to do, but see [docs/xff.md](docs/xff.md) if you want to learn more, including a quick hack to **just make it work** (which is **not** recommended, but hey...)
1451
+
1452
+
1440
1453
  ## prometheus
1441
1454
 
1442
1455
  metrics/stats can be enabled at URL `/.cpr/metrics` for grafana / prometheus / etc (openmetrics 1.0.0)
@@ -75,6 +75,7 @@ turn almost any device into a file server with resumable uploads/downloads using
75
75
  * [themes](#themes)
76
76
  * [complete examples](#complete-examples)
77
77
  * [reverse-proxy](#reverse-proxy) - running copyparty next to other websites
78
+ * [real-ip](#real-ip) - teaching copyparty how to see client IPs
78
79
  * [prometheus](#prometheus) - metrics/stats can be enabled
79
80
  * [packages](#packages) - the party might be closer than you think
80
81
  * [arch package](#arch-package) - now [available on aur](https://aur.archlinux.org/packages/copyparty) maintained by [@icxes](https://github.com/icxes)
@@ -357,6 +358,9 @@ upgrade notes
357
358
  * firefox refuses to connect over https, saying "Secure Connection Failed" or "SEC_ERROR_BAD_SIGNATURE", but the usual button to "Accept the Risk and Continue" is not shown
358
359
  * firefox has corrupted its certstore; fix this by exiting firefox, then find and delete the file named `cert9.db` somewhere in your firefox profile folder
359
360
 
361
+ * the server keeps saying `thank you for playing` when I try to access the website
362
+ * you've gotten banned for malicious traffic! if this happens by mistake, and you're running a reverse-proxy and/or something like cloudflare, see [real-ip](#real-ip) on how to fix this
363
+
360
364
  * copyparty seems to think I am using http, even though the URL is https
361
365
  * your reverse-proxy is not sending the `X-Forwarded-Proto: https` header; this could be because your reverse-proxy itself is confused. Ensure that none of the intermediates (such as cloudflare) are terminating https before the traffic hits your entrypoint
362
366
 
@@ -597,7 +601,7 @@ this initiates an upload using `up2k`; there are two uploaders available:
597
601
  * `[🎈] bup`, the basic uploader, supports almost every browser since netscape 4.0
598
602
  * `[🚀] up2k`, the good / fancy one
599
603
 
600
- NB: you can undo/delete your own uploads with `[🧯]` [unpost](#unpost)
604
+ NB: you can undo/delete your own uploads with `[🧯]` [unpost](#unpost) (and this is also where you abort unfinished uploads, but you have to refresh the page first)
601
605
 
602
606
  up2k has several advantages:
603
607
  * you can drop folders into the browser (files are added recursively)
@@ -1383,6 +1387,15 @@ example webserver configs:
1383
1387
  * [apache2 config](contrib/apache/copyparty.conf) -- location-based
1384
1388
 
1385
1389
 
1390
+ ### real-ip
1391
+
1392
+ teaching copyparty how to see client IPs when running behind a reverse-proxy, or a WAF, or another protection service such as cloudflare
1393
+
1394
+ if you (and maybe everybody else) keep getting a message that says `thank you for playing`, then you've gotten banned for malicious traffic. This ban applies to the IP address that copyparty *thinks* identifies the shady client -- so, depending on your setup, you might have to tell copyparty where to find the correct IP
1395
+
1396
+ for most common setups, there should be a helpful message in the server-log explaining what to do, but see [docs/xff.md](docs/xff.md) if you want to learn more, including a quick hack to **just make it work** (which is **not** recommended, but hey...)
1397
+
1398
+
1386
1399
  ## prometheus
1387
1400
 
1388
1401
  metrics/stats can be enabled at URL `/.cpr/metrics` for grafana / prometheus / etc (openmetrics 1.0.0)
@@ -1116,6 +1116,7 @@ def add_safety(ap):
1116
1116
  ap2.add_argument("--ban-url", metavar="N,W,B", type=u, default="9,2,1440", help="hitting more than \033[33mN\033[0m sus URL's in \033[33mW\033[0m minutes = ban for \033[33mB\033[0m minutes; applies only to permissions g/G/h (decent replacement for \033[33m--ban-404\033[0m if that can't be used)")
1117
1117
  ap2.add_argument("--sus-urls", metavar="R", type=u, default=r"\.php$|(^|/)wp-(admin|content|includes)/", help="URLs which are considered sus / eligible for banning; disable with blank or [\033[32mno\033[0m]")
1118
1118
  ap2.add_argument("--nonsus-urls", metavar="R", type=u, default=r"^(favicon\.ico|robots\.txt)$|^apple-touch-icon|^\.well-known", help="harmless URLs ignored from 404-bans; disable with blank or [\033[32mno\033[0m]")
1119
+ ap2.add_argument("--early-ban", action="store_true", help="if a client is banned, reject its connection as soon as possible; not a good idea to enable when proxied behind cloudflare since it could ban your reverse-proxy")
1119
1120
  ap2.add_argument("--aclose", metavar="MIN", type=int, default=10, help="if a client maxes out the server connection limit, downgrade it from connection:keep-alive to connection:close for \033[33mMIN\033[0m minutes (and also kill its active connections) -- disable with 0")
1120
1121
  ap2.add_argument("--loris", metavar="B", type=int, default=60, help="if a client maxes out the server connection limit without sending headers, ban it for \033[33mB\033[0m minutes; disable with [\033[32m0\033[0m]")
1121
1122
  ap2.add_argument("--acao", metavar="V[,V]", type=u, default="*", help="Access-Control-Allow-Origin; list of origins (domains/IPs without port) to accept requests from; [\033[32mhttps://1.2.3.4\033[0m]. Default [\033[32m*\033[0m] allows requests from all sites but removes cookies and http-auth; only ?pw=hunter2 survives")
@@ -1,8 +1,8 @@
1
1
  # coding: utf-8
2
2
 
3
- VERSION = (1, 11, 0)
3
+ VERSION = (1, 11, 1)
4
4
  CODENAME = "You Can (Not) Proceed"
5
- BUILD_DT = (2024, 3, 15)
5
+ BUILD_DT = (2024, 3, 18)
6
6
 
7
7
  S_VERSION = ".".join(map(str, VERSION))
8
8
  S_BUILD_DT = "{0:04d}-{1:02d}-{2:02d}".format(*BUILD_DT)
@@ -224,7 +224,7 @@ class HttpCli(object):
224
224
  "Cache-Control": "no-store, max-age=0",
225
225
  }
226
226
 
227
- if self.is_banned():
227
+ if self.args.early_ban and self.is_banned():
228
228
  return False
229
229
 
230
230
  if self.conn.ipa_nm and not self.conn.ipa_nm.map(self.conn.addr[0]):
@@ -319,9 +319,7 @@ class HttpCli(object):
319
319
  if "." in pip
320
320
  else ":".join(pip.split(":")[:4]) + ":"
321
321
  ) + "0.0/16"
322
- zs2 = (
323
- ' or "--xff-src=lan"' if self.conn.hsrv.xff_lan.map(pip) else ""
324
- )
322
+ zs2 = ' or "--xff-src=lan"' if self.conn.xff_lan.map(pip) else ""
325
323
  self.log(t % (self.args.xff_hdr, pip, cli_ip, zso, zs, zs2), 3)
326
324
  else:
327
325
  self.ip = cli_ip
@@ -492,9 +490,7 @@ class HttpCli(object):
492
490
  else ":".join(pip.split(":")[:4]) + ":"
493
491
  ) + "0.0/16"
494
492
  zs2 = (
495
- ' or "--xff-src=lan"'
496
- if self.conn.hsrv.xff_lan.map(pip)
497
- else ""
493
+ ' or "--xff-src=lan"' if self.conn.xff_lan.map(pip) else ""
498
494
  )
499
495
  self.log(t % (pip, idp_usr, idp_grp, zs, zs2), 3)
500
496
 
@@ -3601,8 +3597,6 @@ class HttpCli(object):
3601
3597
  return ret
3602
3598
 
3603
3599
  def tx_ups(self) :
3604
- have_unpost = self.args.unpost and "e2d" in self.vn.flags
3605
-
3606
3600
  idx = self.conn.get_u2idx()
3607
3601
  if not idx or not hasattr(idx, "p_end"):
3608
3602
  raise Pebkac(500, "sqlite3 is not available on the server; cannot unpost")
@@ -3626,8 +3620,14 @@ class HttpCli(object):
3626
3620
  )
3627
3621
  uret = x.get()
3628
3622
 
3629
- allvols = self.asrv.vfs.all_vols if have_unpost else {}
3630
- for vol in allvols.values():
3623
+ if not self.args.unpost:
3624
+ allvols = []
3625
+ else:
3626
+ allvols = list(self.asrv.vfs.all_vols.values())
3627
+
3628
+ allvols = [x for x in allvols if "e2d" in x.flags]
3629
+
3630
+ for vol in allvols:
3631
3631
  cur = idx.get_cur(vol.realpath)
3632
3632
  if not cur:
3633
3633
  continue
@@ -3679,7 +3679,7 @@ class HttpCli(object):
3679
3679
  for v in ret:
3680
3680
  v["vp"] = self.args.SR + v["vp"]
3681
3681
 
3682
- if not have_unpost:
3682
+ if not allvols:
3683
3683
  ret = [{"kinshi": 1}]
3684
3684
 
3685
3685
  jtxt = '{"u":%s,"c":%s}' % (uret, json.dumps(ret, indent=0))
@@ -54,6 +54,7 @@ class HttpConn(object):
54
54
  self.u2fh = hsrv.u2fh # mypy404
55
55
  self.ipa_nm = hsrv.ipa_nm
56
56
  self.xff_nm = hsrv.xff_nm
57
+ self.xff_lan = hsrv.xff_lan # type: ignore
57
58
  self.iphash = hsrv.broker.iphash
58
59
  self.bans = hsrv.bans
59
60
  self.aclose = hsrv.aclose
@@ -100,7 +100,7 @@ class HttpSrv(object):
100
100
  self.t0 = time.time()
101
101
  nsuf = "-n{}-i{:x}".format(nid, os.getpid()) if nid else ""
102
102
  self.magician = Magician()
103
- self.nm = NetMap([], {})
103
+ self.nm = NetMap([], [])
104
104
  self.ssdp = None
105
105
  self.gpwd = Garda(self.args.ban_pw)
106
106
  self.g404 = Garda(self.args.ban_404)
@@ -94,8 +94,6 @@ class Tftpd(object):
94
94
  cbak = []
95
95
  if not self.args.tftp_no_fast and not EXE:
96
96
  try:
97
- import inspect
98
-
99
97
  ptn = re.compile(r"(^\s*)log\.debug\(.*\)$")
100
98
  for C in Cs:
101
99
  cbak.append(C.__dict__)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: copyparty
3
- Version: 1.11.0
3
+ Version: 1.11.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
@@ -129,6 +129,7 @@ turn almost any device into a file server with resumable uploads/downloads using
129
129
  * [themes](#themes)
130
130
  * [complete examples](#complete-examples)
131
131
  * [reverse-proxy](#reverse-proxy) - running copyparty next to other websites
132
+ * [real-ip](#real-ip) - teaching copyparty how to see client IPs
132
133
  * [prometheus](#prometheus) - metrics/stats can be enabled
133
134
  * [packages](#packages) - the party might be closer than you think
134
135
  * [arch package](#arch-package) - now [available on aur](https://aur.archlinux.org/packages/copyparty) maintained by [@icxes](https://github.com/icxes)
@@ -411,6 +412,9 @@ upgrade notes
411
412
  * firefox refuses to connect over https, saying "Secure Connection Failed" or "SEC_ERROR_BAD_SIGNATURE", but the usual button to "Accept the Risk and Continue" is not shown
412
413
  * firefox has corrupted its certstore; fix this by exiting firefox, then find and delete the file named `cert9.db` somewhere in your firefox profile folder
413
414
 
415
+ * the server keeps saying `thank you for playing` when I try to access the website
416
+ * you've gotten banned for malicious traffic! if this happens by mistake, and you're running a reverse-proxy and/or something like cloudflare, see [real-ip](#real-ip) on how to fix this
417
+
414
418
  * copyparty seems to think I am using http, even though the URL is https
415
419
  * your reverse-proxy is not sending the `X-Forwarded-Proto: https` header; this could be because your reverse-proxy itself is confused. Ensure that none of the intermediates (such as cloudflare) are terminating https before the traffic hits your entrypoint
416
420
 
@@ -651,7 +655,7 @@ this initiates an upload using `up2k`; there are two uploaders available:
651
655
  * `[🎈] bup`, the basic uploader, supports almost every browser since netscape 4.0
652
656
  * `[🚀] up2k`, the good / fancy one
653
657
 
654
- NB: you can undo/delete your own uploads with `[🧯]` [unpost](#unpost)
658
+ NB: you can undo/delete your own uploads with `[🧯]` [unpost](#unpost) (and this is also where you abort unfinished uploads, but you have to refresh the page first)
655
659
 
656
660
  up2k has several advantages:
657
661
  * you can drop folders into the browser (files are added recursively)
@@ -1437,6 +1441,15 @@ example webserver configs:
1437
1441
  * [apache2 config](contrib/apache/copyparty.conf) -- location-based
1438
1442
 
1439
1443
 
1444
+ ### real-ip
1445
+
1446
+ teaching copyparty how to see client IPs when running behind a reverse-proxy, or a WAF, or another protection service such as cloudflare
1447
+
1448
+ if you (and maybe everybody else) keep getting a message that says `thank you for playing`, then you've gotten banned for malicious traffic. This ban applies to the IP address that copyparty *thinks* identifies the shady client -- so, depending on your setup, you might have to tell copyparty where to find the correct IP
1449
+
1450
+ for most common setups, there should be a helpful message in the server-log explaining what to do, but see [docs/xff.md](docs/xff.md) if you want to learn more, including a quick hack to **just make it work** (which is **not** recommended, but hey...)
1451
+
1452
+
1440
1453
  ## prometheus
1441
1454
 
1442
1455
  metrics/stats can be enabled at URL `/.cpr/metrics` for grafana / prometheus / etc (openmetrics 1.0.0)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes