diff --git a/README.md b/README.md index ccd851fd..d98c749b 100644 --- a/README.md +++ b/README.md @@ -200,7 +200,7 @@ and then theres the tabs below it, * `[ng]` is the uploads which failed / got rejected (already exists, ...) * `[done]` shows a combined list of `[ok]` and `[ng]`, chronological order * `[busy]` files which are currently hashing, pending-upload, or uploading - * plus up to 3 entries from `[done]` and `[que]` for context + * plus up to 3 entries each from `[done]` and `[que]` for context * `[que]` is all the files that are still queued ### file-search @@ -367,7 +367,8 @@ copyparty returns a truncated sha512sum of your PUT/POST as base64; you can gene quick outline of the up2k protocol, see [uploading](#uploading) for the web-client * the up2k client splits a file into an "optimal" number of chunks * 1 MiB each, unless that becomes more than 256 chunks - * tries 1.5, 2, 3, 4, 6, ... until <= 256 or chunksize >= 32M + * tries 1.5M, 2M, 3, 4, 6, ... until <= 256# or chunksize >= 32M +* client posts the list of hashes, filename, size, last-modified * server creates the `wark`, an identifier for this upload * `sha512( salt + filesize + chunk_hashes )` * and a sparse file is created for the chunks to drop into @@ -393,7 +394,7 @@ quick outline of the up2k protocol, see [uploading](#uploading) for the web-clie some bundled tools have copyleft dependencies, see [./bin/#mtag](bin/#mtag) -these are standalone and will never be imported / evaluated by copyparty +these are standalone programs and will never be imported / evaluated by copyparty # sfx diff --git a/copyparty/authsrv.py b/copyparty/authsrv.py index 29546de7..14dcb531 100644 --- a/copyparty/authsrv.py +++ b/copyparty/authsrv.py @@ -241,6 +241,7 @@ class AuthSrv(object): self.args = args self.log_func = log_func self.warn_anonwrite = warn_anonwrite + self.line_ctr = 0 if WINDOWS: self.re_vol = re.compile(r"^([a-zA-Z]:[\\/][^:]*|[^:]*):([^:]*):(.*)$") @@ -266,7 +267,9 @@ class AuthSrv(object): def _parse_config_file(self, fd, user, mread, mwrite, mflags, mount): vol_src = None vol_dst = None + self.line_ctr = 0 for ln in [x.decode("utf-8").strip() for x in fd]: + self.line_ctr += 1 if not ln and vol_src is not None: vol_src = None vol_dst = None @@ -296,7 +299,12 @@ class AuthSrv(object): mflags[vol_dst] = {} continue - lvl, uname = ln.split(" ") + if len(ln) > 1: + lvl, uname = ln.split(" ") + else: + lvl = ln + uname = "*" + self._read_vol_str( lvl, uname, mread[vol_dst], mwrite[vol_dst], mflags[vol_dst] ) @@ -374,7 +382,12 @@ class AuthSrv(object): if self.args.c: for cfg_fn in self.args.c: with open(cfg_fn, "rb") as f: - self._parse_config_file(f, user, mread, mwrite, mflags, mount) + try: + self._parse_config_file(f, user, mread, mwrite, mflags, mount) + except: + m = "\n\033[1;31m\nerror in config file {} on line {}:\n\033[0m" + print(m.format(cfg_fn, self.line_ctr)) + raise if not mount: # -h says our defaults are CWD at root and read/write for everyone