9001 / copyparty

Portable file server with accelerated resumable uploads, dedup, WebDAV, FTP, TFTP, zeroconf, media indexer, thumbnails++ all in one file, no deps
MIT License
571 stars 34 forks source link

Invalid float value `#.#g` | `#g` | `#` #83

Closed parasiteoflife closed 4 months ago

parasiteoflife commented 4 months ago

Describe the bug I've added df: to my config file but it won't load unless I only use a decimal number and nothing else, these don't work:

df: 4.0g
df: 4g
df: 4

Also, I can't use neither of these? copyparty: error: unrecognized arguments: --gz --davrt --vmaxb=100.0g

9001 commented 4 months ago

thanks, didn't notice that the behavior for these options is so unintuitive -- I'll improve the helptext and documentation for the next ver :>

as for df, the syntax is different depending on whether you're setting it globally or for just one volume. Inside the [global] section it does not expect any suffix at all, just a number, which is always in gigabytes. But when setting it as a volflag, then it does expect a suffix. I think a better behavior would be to assume gigabytes if there is no suffix, and maybe also support a suffix for the global section too. I'll think about it.

as for gz, davrt, and vmaxb, these are volume-flags (as they are listed in --help-flags), but according to --help there is a way to set davrt globally, but the global flag is named dav-rt. This might be easier to see in the online copy of the helptext: https://ocv.me/copyparty/helptext.html

for reference, volume flags are set like this:

[/music]
  /srv/media
  accs:
    [...your permission setup...]
  flags:
    df: 128m

please ask if anything's unclear!