Commit graph

258 commits

Author SHA1 Message Date
ed 3f05b6655c add UI to abort an unfinished upload; suggested in #77
to abort an upload, refresh the page and access the unpost tab,
which now includes unfinished uploads (sorted before completed ones)

can be configured through u2abort (global or volflag);
by default it requires both the IP and account to match

https://a.ocv.me/pub/g/nerd-stuff/2024-0310-stoltzekleiven.jpg
2024-03-11 01:32:02 +01:00
ed d744f3ff8f improve smoketests, warnings and error-messages:
* docker: warn if there are config-files in ~/.config/copyparty
   because somebody copied their config into
   /cfg/copyparty instead of /cfg as intended

* docker: warn if there are no config-files in an included directory

* make misconfigured reverse-proxies more obvious
  * explain cors rejections in server log
  * indicate cors rejection in error toast
2024-03-07 19:47:38 +00:00
ed 1b52ef1f8a Merge branch 'hovudstraum' into idp 2024-02-23 22:25:48 +00:00
ed fd552842d4 fix other possible division-by-zeros;
u2c: also fix exe detection
2024-02-17 23:19:11 +00:00
ed a96d9ac6cb idp: users can be in multiple groups 2024-02-08 20:25:32 +00:00
ed caf7e93f5e IdP (#62): add groups + dynamic vols (non-persistent)
features which should be good to go:
* user groups
* assigning permissions by group
* dynamically created volumes based on username/groupname
* rebuild vfs when new users/groups appear

but several important features still pending;
* detect dangerous configurations
   * dynamic vol below readable path
* remember volumes created during previous runs
   * helps prevent unintended access
   * correct filesystem-scan on startup
2024-01-30 19:13:42 +01:00
ed 14bccbe45f backports from IdP branch:
* allow mounting `/` (the entire filesystem) as a volume
  * not that you should (really, you shouldn't)
* improve `-v` helptext
* change IdP group symbol to @ because % is used for file inclusion
  * not technically necessary but is less confusing in docs
2024-01-25 21:39:30 +00:00
ed 3313503ea5 retry deleting busy files on windows:
some clients (clonezilla-webdav) rapidly create and delete files;
this fails if copyparty is still hashing the file (usually the case)

and the same thing can probably happen due to antivirus etc

add global-option --rm-retry (volflag rm_retry) specifying
for how long (and how quickly) to keep retrying the deletion

default: retry for 5sec on windows, 0sec (disabled) on everything else
because this is only a problem on windows
2024-01-17 20:27:53 +00:00
ed e01ba8552a warn if a user doesn't have privileges anywhere
(since the account system isn't super-inutitive and at least
 one dude figured that -a would default to giving admin rights)
2024-01-11 00:24:34 +00:00
ed ab40ff5051 add permission "A" (alias of "rwmda."); closes #70 2023-12-31 18:20:24 +00:00
ed 10bc2d9205 unsuccessful attempt at dirkeys (#64) 2023-12-17 22:30:22 +00:00
ed 0c50ea1757 list dotfiles only for specific volumes or users (#66):
* permission `.` grants dotfile visibility if user has `r` too
* `-ed` will grant dotfiles to all `r` accounts (same as before)
* volflag `dots` likewise

also drops compatibility for pre-0.12.0 `-v` syntax
(`-v .::red` will no longer translate to `-v .::r,ed`)
2023-12-16 15:38:48 +00:00
ed 900cc463c3 v1.9.24 2023-12-01 02:10:20 +00:00
ed 8c52b88767 make linters happier 2023-11-30 17:33:07 +00:00
ed c9fd26255b support environment variables mostly everywhere,
useful for docker/systemd stuff

also makes logfiles flush to disk per line by default;
can be disabled for a small performance gain with --no-logflush
2023-11-30 10:22:52 +00:00
ed ee3333362f v1.9.17 2023-11-11 17:38:43 +00:00
ed 713fffcb8e also mkdir missing intermediates,
unless requester is a webdav client (those expect a 409)
2023-11-03 23:23:49 +00:00
ed 8020b11ea0 improve/simplify validation/errorhandling:
* some malicious requests are now answered with HTTP 422,
   so that they count against --ban-422
* do not include request headers when replying to invalid requests,
   in case there is a reverse-proxy inserting something interesting
2023-11-03 23:07:16 +00:00
ed 95566e8388 cosmetics:
* fix toast/tooltip colors on splashpage
* properly warn if --ah-cli or --ah-gen is used without --ah-alg
* support ^D during --ah-cli
* improve flavor texts
2023-11-03 16:52:43 +00:00
ed 1f75314463 placeholder expansion in readme and logues; closes #56
also fixes the "scan" volflag which broke in v1.9.14
2023-10-24 16:37:32 +00:00
ed 5280792cd7 list existing tags even if tagscanning is disabled 2023-10-21 13:09:37 +00:00
ed 2529aa151d tersen volume listing on startup 2023-10-21 12:11:49 +00:00
ed fc658e5b9e utcfromtimestamp was deprecated and nobody told me,
not even the deprecationwarning that got silently generated burning
20~30% of all CPU-time without actually displaying it anywhere, nice

python 3.12.0 is now only 5% slower than 3.11.6

also fixes some other, less-performance-fatal deprecations
2023-10-20 23:41:58 +00:00
ed 4b5a0787ab option to show upload timestamps in directory listing;
enable with -mte +.ip_at
or volflag mte=+.ip_at

worst-case performance impact: 18%
2023-10-17 17:51:27 +00:00
ed db668ba491 spectrograms are never cropped; share thumbcache 2023-10-15 11:42:57 +00:00
ed 0dc3c23b42 add alternative filekey generator; closes #52 2023-10-06 13:41:22 +00:00
ed 18c763ac08 smb: upgrade to impacket 0.11, full user account support,
permissions are now per-account instead of coalescing

also stops windows from freaking out if there's an offline volume
2023-09-09 12:46:37 +00:00
ed 3d9fb753ba stuff 2023-09-08 21:42:05 +00:00
ed 5a968f9e47 add permission 'h': folders redirect to index.html;
safest way to make copyparty like a general-purpose webserver where
index.html is returned as expected yet directory listing is entirely
disabled / unavailable
2023-09-07 23:30:01 +00:00
ed 30cc9defcb cosmetics:
* in case someone gets a confusing access-related error message,
  include more context in serverlogs (exact path)
* fix js console spam in search results
* same markdown line-height in viewer and browser
2023-08-31 21:27:14 +00:00
ed 48a3898aa6 suggest enabling the database on startup 2023-08-16 19:57:19 +00:00
ed f5407b2997 docker: persist autogenerated seeds, disable certgen, and
mention how to run the containers with selinux enabled
* assumes that a /cfg docker volume is provided
2023-08-15 15:07:33 +00:00
ed 474d5a155b android's got hella strict filename rules 2023-08-15 06:46:57 +02:00
ed 406e413594 hint at additional context in exceptions 2023-08-15 01:42:13 +02:00
ed e17bf8f325 require the new admin permission for the admin-panel 2023-07-15 18:39:41 +00:00
ed 22fc4bb938 add event-hook for banning users 2023-07-13 22:29:32 +00:00
ed 551d99b71b add permission "a" to show uploader IPs (#45) 2023-07-12 21:36:55 +00:00
ed b54b7213a7 more thumbnailer configs available as volflags:
--th-convt = convt
--th-no-crop = nocrop
--th-size = thsize
2023-07-11 22:15:37 +00:00
ed 5d8cb34885 404/403 can be handled with plugins 2023-07-07 21:33:40 +00:00
ed a0c1239246 v1.8.0 2023-06-26 00:05:12 +00:00
ed e197895c10 support hashed passwords; closes #39 2023-06-25 21:50:33 +00:00
ed 8b0cf2c982 volflags to limit volume size / num files; closes #40 2023-06-19 00:42:45 +00:00
ed 2cca6e0922 warn when sharing certain system locations 2023-05-12 21:38:16 +00:00
ed db51f1b063 cfg: allow trailing colon on category headers 2023-05-12 21:01:34 +00:00
ed b6fd555038 panic if two accounts have the same password 2023-05-05 20:24:24 +00:00
ed 544e0549bc make xvol and xdev apply at runtime (closes #24):
* when accessing files inside an xdev volume, verify that the file
   exists on the same device/filesystem as the volume root

* when accessing files inside an xvol volume, verify that the file
   exists within any volume where the user has read access
2023-04-29 21:10:02 +00:00
ed cb6de0387d a bit faster 2023-04-26 19:56:27 +00:00
ed 673b4f7e23 option to show symlink's lastmod instead of deref;
mainly motivated by u2cli's folder syncing in turbo mode
which would un-turbo on most dupes due to wrong lastmod

disabled by default for regular http listings
(to avoid confusion in most regular usecases),
enable per-request with urlparam lt

enabled by default for single-level webdav listings
(because rclone hits the same issue as u2cli),
can be disabled with arg --dav-rt or volflag davrt

impossible to enable for recursive webdav listings
2023-04-26 18:54:21 +00:00
ed d999f06bb9 volflags can be -unset 2023-04-23 21:05:29 +00:00
ed fdd6f3b4a6 tar/zip: use volume name as toplevel fallback 2023-04-23 20:55:34 +00:00
ed 8f5f8a3cda expand userhomes everywhere:
* -c
* -lo
* --hist
* hist volflag
* --ssl-log
2023-04-14 18:55:19 +02:00
ed 05e0c2ec9e add xiu (batching hook; runs on idle after uploads) +
bunch of tweaks/fixes for hooks
2023-02-26 18:23:32 +00:00
ed 76bd005bdc cgen fixes 2023-02-21 19:42:08 +00:00
ed 8f61e1568c transcode chiptunes to opus;
* new audio/MPT formats: apac bonk dfpwm ilbc it itgz itr itz mo3 mod mptm mt2 okt s3gz s3m s3r s3z xm xmgz xmr xmz xpk
* new image/PIL formats: blp dcx emf eps fits flc fli fpx im j2k j2p psd spi wmf
2023-02-11 11:17:37 +00:00
ed 853ae6386c config load summary + safer windows defaults 2023-02-10 21:32:42 +00:00
ed a4b56c74c7 support long filepaths on win7 + misc windows fixes 2023-02-10 18:37:37 +00:00
ed d7f1951e44 fix --cgen for 'g' perms 2023-02-08 22:38:21 +00:00
ed 9b423396ec better description for anonymous permissions 2023-02-07 20:12:45 +00:00
ed 84937d1ce0 add v2 config syntax (#20) 2023-02-07 19:54:08 +00:00
ed 98cce66aa4 cgen: update set of multivalue keys 2023-02-06 07:26:23 +00:00
ed 043c2d4858 cgen: fix permissions listing 2023-02-06 07:23:35 +00:00
ed 99cc434779 add config explainer + generator (#20) 2023-02-05 22:09:17 +00:00
ed 87d835ae37 dont allow multiple volumes at the same fs-path 2023-02-05 21:16:36 +00:00
ed 4ad6e45216 only load *.conf files when including a folder 2023-02-05 00:01:10 +00:00
ed 1e20eafbe0 volflag to randomize all upload filenames 2023-02-01 21:58:01 +00:00
ed e413007eb0 hide dotfiles from search results by default 2023-01-31 18:13:33 +00:00
ed d4c5fca15b sandbox readme.md / prologue / epilogue 2023-01-28 21:24:40 +00:00
ed 9b7b9262aa promote dedup control to volflags 2023-01-25 21:46:15 +00:00
ed ead31b6823 add eventhook sanchecks 2023-01-25 20:51:02 +00:00
ed f8e3e87a52 add event hooks 2023-01-22 23:35:31 +00:00
ed 70f1642d0d allow tar/zip download of hidden folders 2023-01-21 20:56:44 +00:00
ed 19cd96e392 cleanup + optimizations 2022-12-11 14:16:51 +00:00
ed 7704b9c8a2 sqlite durability profiles 2022-12-10 10:01:33 +00:00
ed fbed322d3b option to skip database syncs entirely 2022-12-07 21:35:04 +00:00
ed 9b0f519e4e switch to wal for ~2x faster uploads 2022-12-07 20:52:17 +00:00
ed 99efc290df fix mdns on windows 2022-12-03 13:31:00 +00:00
ed 89c9f45fd0 add option for cross-volume dedupe 2022-12-02 17:25:37 +00:00
ed 04f44c3c7c add global option for rejecting dupe uploads 2022-11-21 10:58:15 +00:00
ed b2ab8f971e add config-file preprocessor (%include) 2022-11-04 23:48:14 +00:00
ed edad3246e0 make pylance happier 2022-10-29 20:40:25 +00:00
ed 835f8a20e6 default-enable webdav 2022-10-23 23:37:32 +02:00
ed f3a501db30 add SMB/CIFS server 2022-10-23 23:08:00 +02:00
ed 20eeacaac3 add webdav write support + fix http 200/201 2022-10-21 18:47:48 +02:00
ed fe57321853 correct 401/403 usage for webdav 2022-10-18 20:29:06 +02:00
ed 8510804e57 initial webdav support 2022-10-18 19:36:52 +02:00
ed 12219c1bea more fun with symlinks 2022-10-08 21:08:51 +02:00
ed d8bddede6a new permission G returns filekey on write-only uploads 2022-10-08 01:17:41 +02:00
ed 0b87a4a810 allow setting lifetimes from up2k ui 2022-09-19 23:49:07 +02:00
ed 9401b5ae13 add filetype detection for nameless uploads 2022-09-18 17:30:57 +02:00
ed 11d1267f8c option to keep files in index when deleted 2022-09-07 01:07:21 +02:00
ed 51c152ff4a indicate sqlite thread-safety + some cleanup 2022-08-05 01:20:16 +02:00
ed 4aaa111925 v1.3.9 2022-08-04 00:39:37 +02:00
ed 680f8ae814 add xdev/xvol indexing guards 2022-08-03 22:20:28 +02:00
ed 1c3894743a fix filekeys inside symlinked volumes 2022-08-02 20:26:51 +02:00
ed 74a3f97671 cleanup + bump deps 2022-07-27 00:15:49 +02:00
ed 4a76663fb2 ensure free disk space 2022-07-17 22:33:08 +02:00
ed 3fa377a580 sqlite diag 2022-07-16 20:43:26 +02:00
ed 48b957f1d5 add -e2v (file integrity checker) 2022-07-13 00:48:39 +02:00
ed 438384425a add types, isort, errorhandling 2022-06-16 01:07:15 +02:00
ed fe73f2d579 cleanup 2022-06-07 23:08:43 +02:00