add mdns zeroconf announcer

This commit is contained in:
ed
2022-11-13 20:05:16 +00:00
parent fc0a941508
commit b3eb117e87
29 changed files with 2581 additions and 52 deletions

View File

@@ -18,6 +18,12 @@ f=../build/isc.txt
awk '/div>/{o=0}o>2;o{o++}/;OWNER/{o=1}' |
awk '{gsub(/<[^>]+>/,"")};/./{b=0}!/./{b++}b>1{next}1' >$f
f=../build/2bsd.txt
[ -e $f ] ||
curl https://opensource.org/licenses/BSD-2-Clause |
awk '/div>/{o=0}o>1;o{o++}/HOLDER/{o=1}' |
awk '{gsub(/<[^>]+>/,"")};1' >$f
f=../build/3bsd.txt
[ -e $f ] ||
curl https://opensource.org/licenses/BSD-3-Clause |
@@ -33,6 +39,7 @@ f=../build/ofl.txt
(sed -r 's/^L: /License: /;s/^C: /Copyright (c) /' <../docs/lics.txt
printf '\n\n--- MIT License ---\n\n'; cat ../build/mit.txt
printf '\n\n--- ISC License ---\n\n'; cat ../build/isc.txt
printf '\n\n--- BSD 2-Clause License ---\n\n'; cat ../build/2bsd.txt
printf '\n\n--- BSD 3-Clause License ---\n\n'; cat ../build/3bsd.txt
printf '\n\n--- SIL Open Font License v1.1 ---\n\n'; cat ../build/ofl.txt
) |

View File

@@ -27,6 +27,8 @@ help() { exec cat <<'EOF'
#
# `no-smb` saves ~3.5k by removing the smb / cifs server
#
# `no-zm` saves ~k by removing the zeroconf mDNS server
#
# _____________________________________________________________________
# web features:
#
@@ -101,6 +103,7 @@ while [ ! -z "$1" ]; do
gzz) shift;use_gzz=$1;use_gz=1; ;;
no-ftp) no_ftp=1 ; ;;
no-smb) no_smb=1 ; ;;
no-zm) no_zm=1 ; ;;
no-fnt) no_fnt=1 ; ;;
no-hl) no_hl=1 ; ;;
no-dd) no_dd=1 ; ;;
@@ -136,11 +139,22 @@ tmpdir="$(
[ $repack ] && {
old="$tmpdir/pe-copyparty.$(id -u)"
echo "repack of files in $old"
cp -pR "$old/"*{py2,j2,copyparty} .
cp -pR "$old/"*{py2,py37,j2,copyparty} .
cp -pR "$old/"*ftp . || true
}
[ $repack ] || {
echo collecting ipaddress
f="../build/ipaddress-1.0.23.tar.gz"
[ -e "$f" ] ||
(url=https://files.pythonhosted.org/packages/b9/9a/3e9da40ea28b8210dd6504d3fe9fe7e013b62bf45902b458d1cdc3c34ed9/ipaddress-1.0.23.tar.gz;
wget -O$f "$url" || curl -L "$url" >$f)
tar -zxf $f
mkdir py37
mv ipaddress-*/ipaddress.py py37/
rm -rf ipaddress-*
echo collecting jinja2
f="../build/Jinja2-2.11.3.tar.gz"
[ -e "$f" ] ||
@@ -237,6 +251,8 @@ tmpdir="$(
awk 'NR<4||NR>27;NR==4{print"# license: https://opensource.org/licenses/ISC\n"}' ../build/$n >copyparty/vend/$n
done
rm -f copyparty/stolen/*/README.md
# remove type hints before build instead
(cd copyparty; "$pybin" ../../scripts/strip_hints/a.py; rm uh)
@@ -322,6 +338,10 @@ rm have
rm -f copyparty/smbd.py &&
sed -ri '/add_argument\("--smb/d' copyparty/__main__.py
[ $no_zm ] &&
rm -rf copyparty/mdns.py copyparty/stolen/dnslib &&
sed -ri '/add_argument\("--zm/d' copyparty/__main__.py
[ $no_cm ] && {
rm -rf copyparty/web/mde.* copyparty/web/deps/easymde*
echo h > copyparty/web/mde.html
@@ -464,7 +484,7 @@ nf=$(ls -1 "$zdir"/arc.* | wc -l)
echo "copying.txt 404 pls rebuild"
mv ftp/* j2/* copyparty/vend/* .
rm -rf ftp j2 py2 copyparty/vend
rm -rf ftp j2 py2 py37 copyparty/vend
(cd copyparty; tar -cvf z.tar $t; rm -rf $t)
cd ..
pyoxidizer build --release --target-triple $tgt
@@ -481,7 +501,7 @@ nf=$(ls -1 "$zdir"/arc.* | wc -l)
echo gen tarlist
for d in copyparty j2 py2 ftp; do find $d -type f; done | # strip_hints
for d in copyparty j2 py2 py37 ftp; do find $d -type f; done | # strip_hints
sed -r 's/(.*)\.(.*)/\2 \1/' | LC_ALL=C sort |
sed -r 's/([^ ]*) (.*)/\2.\1/' | grep -vE '/list1?$' > list1

View File

@@ -18,6 +18,7 @@ copyparty/httpcli.py,
copyparty/httpconn.py,
copyparty/httpsrv.py,
copyparty/ico.py,
copyparty/mdns.py,
copyparty/mtag.py,
copyparty/res,
copyparty/res/COPYING.txt,
@@ -26,6 +27,20 @@ copyparty/smbd.py,
copyparty/star.py,
copyparty/stolen,
copyparty/stolen/__init__.py,
copyparty/stolen/dnslib,
copyparty/stolen/dnslib/__init__.py,
copyparty/stolen/dnslib/bimap.py,
copyparty/stolen/dnslib/bit.py,
copyparty/stolen/dnslib/buffer.py,
copyparty/stolen/dnslib/dns.py,
copyparty/stolen/dnslib/label.py,
copyparty/stolen/dnslib/lex.py,
copyparty/stolen/dnslib/ranges.py,
copyparty/stolen/ifaddr,
copyparty/stolen/ifaddr/__init__.py,
copyparty/stolen/ifaddr/_posix.py,
copyparty/stolen/ifaddr/_shared.py,
copyparty/stolen/ifaddr/_win32.py,
copyparty/stolen/qrcodegen.py,
copyparty/stolen/surrogateescape.py,
copyparty/sutil.py,

View File

@@ -28,6 +28,7 @@ CKSUM = None
STAMP = None
PY2 = sys.version_info < (3,)
PY37 = sys.version_info > (3, 7)
WINDOWS = sys.platform in ["win32", "msys"]
sys.dont_write_bytecode = True
me = os.path.abspath(os.path.realpath(__file__))
@@ -401,7 +402,7 @@ def run(tmp, j2, ftp):
t.daemon = True
t.start()
ld = (("", ""), (j2, "j2"), (ftp, "ftp"), (not PY2, "py2"))
ld = (("", ""), (j2, "j2"), (ftp, "ftp"), (not PY2, "py2"), (PY37, "py37"))
ld = [os.path.join(tmp, b) for a, b in ld if not a]
# skip 1