Commit graph

317 commits

Author SHA1 Message Date
ed 20870fda79 Merge branch 'dirkeys' into hovudstraum 2024-03-25 10:34:08 +00:00
ed d30ae8453d idp: precise expansion of ${u} (fixes #79);
it is now possible to grant access to users other than `${u}`
(the user which the volume belongs to)

previously, permissions did not apply correctly to IdP volumes due to
the way `${u}` and `${g}` was expanded, which was a funky iteration
over all known users/groups instead of... just expanding them?

also adds another sanchk that a volume's URL must contain a
`${u}` to be allowed to mention `${u}` in the accs list, and
similarly for `${g}` / `@${g}` since users can be in multiple groups
2024-03-21 20:10:27 +00:00
ed 66abf17bae black 2024-03-14 18:37:05 +00:00
ed fd89f7ecb9 idp: abandon idea for persisting idp volumes;
too fraught with subtle dangers, such as other copyparty instances
ending up sharing knowledge of volumes unintentionally, and
configuration becoming mysteriously sticky (not to mention
this would all become hella difficult to reason about)

instead, rely entirely on users seeing the big red warning
added in 2ebfdc25 if their configuration is dangerous

this decision has the drawback that there will be server stuttering
whenever a new user makes themselves known since the last restart,
as it realizes the volumes exist and does the usual e2ds indexing,
instead of doing it early during startup

but it's probably good enough
2024-03-13 21:49:49 +00:00
ed 2ebfdc2562 idp: add anon-read sanchk 2024-03-13 21:36:36 +00:00
ed dbf1cbc8af idp: hide login/logout UI + improve html_head handling 2024-03-13 18:22:24 +00:00
ed d71f844b43 IdP: add safeguard --idp-h-key and also require --xff-src 2024-03-12 22:57:47 +00:00
ed e8b7f65f82 IdP: parallel user init + rename idp-h-sep to idp-gsep
`--idp-h-sep` is still supported and will map to its new name
2024-03-12 21:21:53 +00:00
ed f193f398c1 Merge branch 'hovudstraum' into idp 2024-03-12 17:31:27 +00:00
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
ed 2fb46551a2 avoid pointless recursion + show scan summary 2022-05-09 23:43:59 +02:00
ed 6bcf330ae0 symlink-checker: print base vpath in nonverbose mode 2022-05-09 20:17:03 +00:00
ed 2a1cda42e7 avoid deadlocks on windows 2022-04-27 22:27:49 +02:00
ed 9697fb3d84 option to disable thumbnails per volume 2022-04-14 17:11:26 +02:00
ed bf658a522b naming 2022-04-09 20:41:08 +02:00
ed f3e8308718 eh, better as volflags 2022-03-20 05:45:07 +01:00
ed c1a7f9edbe ftpd: add indexing, delete, windows support 2022-02-13 13:58:16 +01:00
ed b4800d9bcb option to disable onboot-scans per-volume 2021-12-06 20:54:13 +01:00
ed 8164910fe8 support setting argv from config files 2021-11-06 03:11:21 +01:00
ed 3498644055 fix permission parser so it matches the documentation 2021-11-06 03:09:03 +01:00
ed 19161425f3 if no args, try to bind 80 and 443 as well 2021-10-29 23:01:07 +02:00
ed ce70f62a88 catch shady vfs configs 2021-10-25 21:13:51 +02:00
ed a033388d2b sort volume listing 2021-10-13 00:21:54 +02:00
ed 2f021a0c2b skip indexing files by regex 2021-10-12 01:40:19 +02:00
ed 2d0696e048 allow appending mte in volflags 2021-10-03 19:35:51 +02:00
ed 9fe1edb02b support multiple volume flags in one group 2021-09-18 23:45:43 +02:00
ed ef1c55286f add filekeys 2021-09-15 23:17:02 +02:00
ed 5849c446ed new access level g 2021-09-15 01:01:20 +02:00
ed 9a146192b7 don't unwrap single folders in zip/tar downloads 2021-09-07 00:43:51 +02:00
ed c1d77e1041 add upload lifetimes 2021-08-09 22:17:41 +02:00
ed 8d755d41e0 per-volume rescan interval 2021-08-09 01:31:20 +02:00
ed 621471a7cb add streaming upload compression 2021-08-08 02:45:50 +02:00
ed 4fcfd87f5b fix transfer limit 2021-08-07 18:40:28 +02:00
ed 9a45549b66 adding upload rules 2021-08-07 03:45:50 +02:00
ed 051998429c fix argv compat on windows paths 2021-08-05 20:46:08 +02:00
ed 3993605324 add -mth (deafult-hidden columns) 2021-08-02 00:47:07 +02:00
ed 35dce1e3e4 v0.12.4 2021-07-30 08:52:15 +02:00
ed c164fc58a2 add unpost 2021-07-29 23:53:08 +02:00
ed f6279b356a fix more signal handler jank 2021-07-27 22:11:33 +02:00
ed 23b20ff4a6 bos abspath 2021-07-26 23:53:13 +02:00
ed 279c9d706a list volumes/permissions on startup 2021-07-26 20:07:23 +02:00
ed 7671d791fa rename works + more symlink fixes 2021-07-26 17:44:20 +02:00
ed 980c6fc810 add scheduled rescans + fix mv bugs 2021-07-26 02:34:56 +02:00
ed fb40a484c5 mv(folder) works 2021-07-26 01:26:58 +02:00
ed d020527c6f centralize mojibake support stuff 2021-07-24 21:56:55 +02:00
ed 4451485664 mv/rm (serverside), 100% untested 2021-07-24 20:08:31 +02:00
ed a4e1a3738a more deletion progress 2021-07-23 23:42:07 +02:00
ed 4339dbeb8d mv/rm handlers 2021-07-23 01:14:49 +02:00
ed 5b0605774c add move/delete permission flags 2021-07-22 23:48:29 +02:00
ed bac301ed66 get rid of iffy default-args 2021-07-12 00:15:13 +02:00
ed 21c3570786 detect more recursive symlinks 2021-07-05 23:50:03 +02:00