Commit graph

3398 commits

Author SHA1 Message Date
ed 73f7249c5f decode and log request URLs; closes #125
as processing of a HTTP request begins (GET, HEAD, PUT, POST, ...),
the original query line is printed in its encoded form. This makes
debugging easier, since there is no ambiguity in how the client
phrased its request.

however, this results in very opaque logs for non-ascii languages;
basically a wall of percent-encoded characters. Avoid this issue
by printing an additional log-message if the URL contains `%`,
immediately below the original url-encoded entry.

also fix tests on macos, and an unrelated bad logmsg in up2k
2024-12-16 00:53:22 +01:00
ed 18c6559199 update pkgs to 1.16.5 2024-12-11 22:59:44 +00:00
ed e66ece993f v1.16.5 2024-12-11 22:36:19 +00:00
ed 0686860624 connectpage nitpick + update dompurify 2024-12-11 22:24:31 +00:00
ed 24ce46b380 avoid chrome webworker OOM bug; closes #124
chrome (and chromium-based browsers) can OOM when:

* the OS is Windows, MacOS, or Android (but not Linux?)
* the website is hosted on a remote IP (not localhost)
* webworkers are used to read files

unfortunately this also applies to Android, which heavily relies
on webworkers to make read-speeds anywhere close to acceptable

as for android, there are diminishing returns with more than 4
webworkers (1=1x, 2=2.3x, 3=3.8x, 4=4.2x, 6=4.5x, 8=5.3x), and
limiting the number of workers to ensure at least one idle core
appears to sufficiently reduce the OOM probability

on desktop, webworkers are only necessary for hashwasm, so
limit the number of workers to 2 if crypto.subtle is available
and otherwise use the nproc-1 rule for hashwasm in workers

bug report: https://issues.chromium.org/issues/383568268
2024-12-11 22:11:54 +00:00
ed a49bf81ff2 mdns: improve nic-ip changelog
if a NIC is brought up with several IPs,
it would only mention one of the new IPs in the logs

or if a PCIe bus crashes and all NICs drop dead,
it would only mention one of the IPs that disappeared

as both scenarios are oddly common, be more verbose
2024-12-10 00:36:58 +00:00
ed 64501fd7f1 hybrid IdP (check regular users too); closes #122
previously, when IdP was enabled, the password-based login would be
entirely disabled. This was a semi-conscious decision, based on the
assumption that you would always want to use IdP after enabling it.

it makes more sense to keep password-based login working as usual,
conditionally disengaging it for requests which contains a valid
IdP username header. This makes it possible to define fallback
users, or API-only users, and all similar escape hatches.
2024-12-08 17:18:20 +00:00
ed db3c0b0907 nice 2024-12-07 22:24:13 +00:00
ed edda117a7a update pkgs to 1.16.4 2024-12-07 01:10:50 +00:00
ed cdface0dd5 v1.16.4 2024-12-07 00:24:37 +00:00
ed be6afe2d3a improve ux for relocating partial uploads
if someone accidentally starts uploading a file in the wrong folder,
it was not obvious that you can forget that upload in the unpost tab

this '(explain)' button in the upload-error hopefully explains that,
and upload immediately commences when the initial attempt is aborted

on the backend, cleanup the dupesched when an upload is
aborted, and save some cpu by adding unique entries only
2024-12-06 23:34:47 +00:00
ed 9163780000 u2c: misc windows fixes
* support globbing/wildcards on windows

* add `osc 9;4` to show upload progress in the taskbar
   (currently windows-only; linux is picking it up)

* workaround msys2-terminal not normalizing
   absolute paths which contain whitespace

* show a helpful "now hashing..." while the
   first file is being hashed, since it kinda
   looks like a deadlock on windows otherwise
2024-12-06 18:44:05 +00:00
ed d7aa7dfe64 translations: new strings 2024-12-04 09:46:04 +00:00
ed f1decb531d update pkgs to 2024-12-04 00:41:34 +00:00
ed 99399c698b v1.16.3 2024-12-04 00:03:55 +00:00
ed 1f5f42f216 fix #121 (GET toplevel files with h) 2024-12-03 23:53:21 +00:00
ed 9082c4702f accesslog: exclude thumbnails by default 2024-12-03 22:17:49 +00:00
ed 6cedcfbf77 update deps:
* copyparty.exe: python 3.12.7 => 3.12.8
* webdeps:
  * hashwasm 4.10.0 => 4.12.0
  * dompurify 3.1.7 => 3.2.2
  * codemirror 5.65.16 => 5.65.18
2024-12-03 22:11:07 +00:00
ed 8a631f045e ui: fix final time-elapsed and speed for fsearch 2024-12-03 21:43:38 +00:00
ed a6a2ee5b6b sort on filename should forget other sorts
filenames are unique per folder; remembering other keys is pointless
2024-12-03 21:06:00 +00:00
ed 016708276c add sorting granularity options for media URLs 2024-12-03 20:01:19 +00:00
ed 4cfdc4c513 preserve active sort-prefs if more specific than url-hash 2024-12-03 02:13:12 +00:00
ed 0f257c9308 embed sort-order in gallery/media URLs
so anyone who clicks the link sees the files in the same order
2024-12-03 01:46:56 +00:00
ed c8104b6e78 js: 7x faster deepclone 2024-12-03 01:44:55 +00:00
ed 1a1d731043 misc cleanup:
* u2c: remove superfluous pathsep (harmless)
* tl: new strings
2024-12-02 22:52:39 +00:00
ed c5a000d2ae url-option for upload checksum type
url-param / header `ck` specifies hashing algo;
md5 sha1 sha256 sha512 b2 blake2 b2s blake2s

value 'no' or blank disables checksumming,
for when copyparty is running on ancient gear
and you don't really care about file integrity
2024-12-02 13:51:39 +00:00
ed 94d1924fa9 improve avahi-379 workaround 2024-12-01 21:24:41 +00:00
ed 6c1cf68bca mdns: add workaround for https://github.com/avahi/avahi/issues/379
Avahi's mDNS-reflection feature does not understand NSEC, so
it corrupts mDNS packets by not rewriting compressed labels
2024-12-01 19:01:40 +00:00
ed 395af051bd mdns: option to ignore invalid packets on the lan 2024-12-01 15:38:24 +00:00
ed 42fd66675e tests: improve specificity 2024-12-01 15:36:35 +00:00
ed 21a3f3699b webdav: add tests + fix minor edgecases
* allow depth:0 at top of unmapped root

* cannot use the Referer header to identify
   graphical browsers since rclone sends it
2024-12-01 14:44:41 +00:00
ed d168b2acac forget all shadowed files (uploads too); closes #120
shadowing is the act of intentinoally blocking off access to
files in a volume by placing another volume atop of a file/folder.

say you have volume '/' with a file '/a/b/c/d.txt'; if you create a
volume at '/a/b', then all files/folders inside the original folder
becomes inaccessible, and replaced with the contents of the new vol

the initial code for forgetting shadowed files from the parent vol
database would only forget files which were discovered during a
filesystem scan; any uploaded files would be intentionally preseved
in the parent volume's database, probably to avoid losing uploader
info in the event of a brief mistaken config change, where a volume
is shadowed by accident.

this precaution was a mistake, currently causing far more
issues than it solves (#61 and #120), so away it goes.

huge thanks to @Gremious for doing all the legwork on this!
2024-11-28 22:01:18 +00:00
ed 2ce8233921 webdav: auth-challenge clients correctly:
* return 403 instead of 404 in the following sitations:
  * viewing an RSS feed without necessary auth
  * accessing a file with the wrong filekey
  * accessing a file/folder without necessary auth
     (would previously 404 for intentional ambiguity)

* only allow PROPFIND if user has either read or write;
   previously a blank response was returned if user has
   get-access, but this could confuse webdav clients into
   skipping authentication (for example AuthPass)

* return 401 basic-challenge instead of 403 if the client
   appears to be non-graphical, because many webdav clients
   do not provide the credentials until they're challenged.
   There is a heavy bias towards assuming the client is a
   browser, because browsers must NEVER EVER get a 401
   (tricky state that is near-impossible to deal with)

* return 401 basic-challenge instead of 403 if a PUT
   is attempted without any credentials included; this
   should be safe, as graphical browsers never do that

this fixes the interoperability issues mentioned in
https://github.com/authpass/authpass/issues/379
where AuthPass would GET files without providing the
password because it expected a 401 instead of a 403;
AuthPass is behaving correctly, this is not a bug
2024-11-27 22:07:53 +00:00
ed 697a4fa8a4 exclude search results by regex (#120)
a better alternative to using `--no-idx` for this purpose since
this also excludes recent uploads, not just during fs-indexing,
and it doesn't prevent deduplication

also speeds up searches by a tiny amount due to building the
sanchecks into the exclude-filter while parsing the config,
instead of during each search query
2024-11-26 23:57:01 +00:00
ed 2f83c6c7d1 drop caches if certain volflags change (#120)
dhash would prevent a new noidx value from taking effect
2024-11-26 19:25:47 +00:00
ed 127f414e9c improve phrasing in indexer messages (#120) 2024-11-26 18:52:23 +00:00
ed 33c4ccffab vendor foss licenses
license downloader (for generating COPYING.txt) broke after
opensource.org changed their html, so just vendor all of it
2024-11-26 00:39:38 +00:00
ed bafe7f5a09 improve helptext exporters 2024-11-24 21:28:21 +00:00
ed baf41112d1 update pkgs to 1.16.2 2024-11-23 23:55:09 +00:00
ed a90dde94e1 v1.16.2 2024-11-23 23:36:15 +00:00
ed 7dfbfc7227 fix v1.16.0 webdav upload regression; closes #119 2024-11-23 23:32:56 +00:00
ed b10843d051 cosmetic eta improvements:
* u2c: strip hh:mm:ss past 30 days
* u2js: fix "infini.ty" in elapsed-times
2024-11-23 19:58:25 +00:00
ed 520ac8f4dc fix opening md files from gridview 2024-11-23 17:55:05 +00:00
ed 537a6e50e9 javascript... 2024-11-22 23:10:23 +00:00
ed 2d0cbdf1a8 video-player: support mov files 2024-11-22 22:47:42 +00:00
ed 5afb562aa3 avoid layout-shift for qr-codes 2024-11-22 22:44:44 +00:00
ed db069c3d4a fix shares qr-code on chrome 2024-11-22 22:28:00 +00:00
ed fae40c7e2f black 2024-11-22 22:26:34 +00:00
ed 0c43b592dc pave the way for more ux volflags
makes directory listings a tiny bit faster, about 7% or so
2024-11-22 22:24:56 +00:00
ed 2ab8924e2d tests/debug: plug some resource leaks 2024-11-22 22:21:43 +00:00