diff --git a/README.md b/README.md index f8d429b1..c13e6dc9 100644 --- a/README.md +++ b/README.md @@ -204,6 +204,7 @@ other places to download copyparty from (non-github links): * https://copyparty.eu/py = https://copyparty.eu/copyparty-sfx.py = the sfx * https://copyparty.eu/en = https://copyparty.eu/copyparty-en.py = the english-only sfx * https://copyparty.eu/pyz = https://copyparty.eu/copyparty.pyz = the zipapp + * https://copyparty.eu/enz = https://copyparty.eu/copyparty-en.pyz = the enterprise pyz * https://copyparty.eu/cli = online cli helptext @@ -3078,7 +3079,8 @@ another emergency alternative, [copyparty.pyz](https://github.com/9001/copyparty run it by doubleclicking it, or try typing `python copyparty.pyz` in your terminal/console/commandline/telex if that fails it is a python [zipapp](https://docs.python.org/3/library/zipapp.html) meaning it doesn't have to unpack its own python code anywhere to run, so if the filesystem is busted it has a better chance of getting somewhere -* but note that it currently still needs to extract the web-resources somewhere (they'll land in the default TEMP-folder of your OS) + +> there is also [copyparty-en.pyz](https://github.com/9001/copyparty/releases/latest/download/copyparty-en.pyz), english-only and without smb support (enterprise-friendly) # install on android diff --git a/copyparty/httpsrv.py b/copyparty/httpsrv.py index da41fbca..2d35f802 100644 --- a/copyparty/httpsrv.py +++ b/copyparty/httpsrv.py @@ -383,8 +383,8 @@ class HttpSrv(object): if nloris < nconn / 2: continue - t = "slowloris (idle-conn): {} banned for {} min" - self.log(self.name, t.format(ip, self.args.loris, nclose), 1) + t = "slow%s (idle-conn): %s banned for %d min" # slowloris + self.log(self.name, t % ("loris", ip, self.args.loris), 1) self.bans[ip] = int(time.time() + self.args.loris * 60) if self.args.log_conn: diff --git a/scripts/make-pyz.sh b/scripts/make-pyz.sh index 5164e91e..91e30a9b 100755 --- a/scripts/make-pyz.sh +++ b/scripts/make-pyz.sh @@ -41,8 +41,10 @@ rm -rf pyz mkdir -p pyz cd pyz -cp -pR ../sfx/{copyparty,partftpy} . -cp -pR ../sfx/{ftp,j2}/* . +cp -pR ../sfx/copyparty . +cp -pR ../sfx/j2/* . +[ -e ../sfx/partftpy ] && cp -pR ../sfx/partftpy . +[ -e ../sfx/ftp ] && cp -pR ../sfx/ftp/* . true && { rm -rf copyparty/web/mde.* copyparty/web/deps/easymde* diff --git a/scripts/make-sfx.sh b/scripts/make-sfx.sh index 36d5a792..4ca9cbe8 100755 --- a/scripts/make-sfx.sh +++ b/scripts/make-sfx.sh @@ -445,14 +445,27 @@ iawk '/^class _Base/{s=1}!s' ftp/pyftpdlib/authorizers.py iawk '/^ {0,4}[a-zA-Z]/{s=0}/^ {4}def (serve_forever|_loop)/{s=1}!s' ftp/pyftpdlib/servers.py rm -f ftp/pyftpdlib/{__main__,prefork}.py -[ $no_ftp ] && +unhelp() { + iawk '!/add_argument\("--'$1'/{print;next} + /ent\("--'$1'"/{print gensub(/(help=")[^"]+/,"\\1not available in this build","1");next} + {sub(/help=.*/,"help=argparse.SUPPRESS)")}1' copyparty/__main__.py +} + +[ $no_ftp ] && { + unhelp ftp rm -rf copyparty/ftpd.py ftp +} -[ $no_tfp ] && +[ $no_tfp ] && { + unhelp tftp rm -rf copyparty/tftpd.py partftpy +} -[ $no_smb ] && +[ $no_smb ] && { + unhelp smb rm -f copyparty/smbd.py + ised 's/^( {8}elif )record\.name.*"impacket".*/\10:/' copyparty/util.py +} [ $no_zm ] && rm -rf copyparty/mdns.py copyparty/stolen/dnslib diff --git a/scripts/rls.sh b/scripts/rls.sh index 594753b2..048c6d14 100755 --- a/scripts/rls.sh +++ b/scripts/rls.sh @@ -49,14 +49,23 @@ while [ "$1" ]; do done ./make-pyz.sh +mv ../dist/copyparty{,-int}.pyz ./make-sfx.sh re lang eng "$@" mv ../dist/copyparty-{sfx,en}.py + +rm -rf /tmp/pe-copyparty* ../sfx +../dist/copyparty-en.py --version >/dev/null 2>&1 + +./make-sfx.sh re no-smb "$@" +./make-pyz.sh +mv ../dist/copyparty{,-en}.pyz +mv ../dist/copyparty{-int,}.pyz mv ../dist/copyparty-{int,sfx}.py ./genhelp.sh -[ $rls ] || exit # ---------------------------------------------------- +[ $rls ] || exit 0 # ---------------------------------------------------- ./prep.sh git add ../contrib/package/arch/PKGBUILD ../contrib/package/makedeb-mpr/PKGBUILD ../contrib/package/nix/copyparty/pin.json