webdeps: vendor asmcrypto.js;

npm is no longer able to build it, and the build output
never changed since copyparty v0.11.20 (2021-06-20) /
asmcrypto 2821dd1dedd1196c378f5854037dda5c869313f3 (2018-12-02)

one final pass of reasonable size-golfing was done by hand

deflated with pigz -11 -I250
This commit is contained in:
ed
2026-01-25 00:22:54 +00:00
parent d734786c1d
commit bef30ac04d
7 changed files with 26 additions and 18 deletions

View File

@@ -0,0 +1,18 @@
this folder *mostly* contains third-party dependencies; run `make -C scripts/deps-docker` to build the following files and have them appear here:
* `easymde.css.gz` and `easymde.js.gz` is the fancy markdown editor, [EasyMDE](https://github.com/Ionaru/easy-markdown-editor)
* `marked.js.gz` is the markdown rendering library [Marked](https://github.com/markedjs/marked)
* `mini-fa.css.gz` and `mini-fa.woff` is a small subset of [fontawesome](https://github.com/FortAwesome/Font-Awesome)
* `prism.css.gz` and `prism.js.gz` is the syntax highlighter [PrismJS](https://prismjs.com/)
* `scp.woff2` is a subset of the monospace font [Source Code Pro](https://github.com/adobe-fonts/source-code-pro)
* `sha512.hw.js.gz` is the Wasm sha512 library [hash-wasm](https://github.com/Daninet/hash-wasm)
additionally, the following files are vendored into the copyparty git repository, but do NOT originate from the copyparty project (as mentioned in `--license`):
* `sha512.ac.js.gz` is a compiled and slightly golfed/modified [asmcrypto.js](https://github.com/asmcrypto/asmcrypto.js), © 2013 Artem S Vybornov (MIT-Licensed)
* vendored because it no longer builds with modern versions of NodeJS/npm
* is only loaded by *really old* webbrowsers (ie11, firefox 51, chrome 56)
finally, there is also the following files which *does* originate from the copyparty project, yet appear here for technical reasons:
* `busy.mp3.gz` is a short mp3-file to make iphones stop glitching out

Binary file not shown.

View File

@@ -46,7 +46,7 @@ https://github.com/Daninet/hash-wasm/
C: 2020 Dani Biró
L: MIT
https://github.com/openpgpjs/asmcrypto.js/
https://github.com/asmcrypto/asmcrypto.js/
C: 2013 Artem S Vybornov
L: MIT

View File

@@ -1,7 +1,6 @@
FROM alpine:3.18
FROM alpine:3.23
WORKDIR /z
ENV ver_asmcrypto=c72492f4a66e17a0e5dd8ad7874de354f3ccdaa5 \
ver_hashwasm=4.12.0 \
ENV ver_hashwasm=4.12.0 \
ver_marked=4.3.0 \
ver_dompf=3.3.1 \
ver_mde=2.18.0 \
@@ -16,7 +15,6 @@ ENV ver_asmcrypto=c72492f4a66e17a0e5dd8ad7874de354f3ccdaa5 \
# https://github.com/codemirror/codemirror5/releases
# https://github.com/cure53/DOMPurify/releases
# https://github.com/Daninet/hash-wasm/releases
# https://github.com/openpgpjs/asmcrypto.js/commits/main/
# https://github.com/google/zopfli/tags
@@ -28,7 +26,6 @@ RUN mkdir -p /z/dist/no-pk \
bash brotli cmake make g++ git gzip lame npm patch pigz \
python3 python3-dev py3-brotli sox tar unzip wget \
&& rm -f /usr/lib/python3*/EXTERNALLY-MANAGED \
&& wget https://github.com/openpgpjs/asmcrypto.js/archive/$ver_asmcrypto.tar.gz -O asmcrypto.tgz \
&& wget https://github.com/markedjs/marked/archive/v$ver_marked.tar.gz -O marked.tgz \
&& wget https://github.com/Ionaru/easy-markdown-editor/archive/$ver_mde.tar.gz -O mde.tgz \
&& wget https://github.com/codemirror/codemirror5/archive/$ver_codemirror.tar.gz -O codemirror.tgz \
@@ -41,9 +38,6 @@ RUN mkdir -p /z/dist/no-pk \
&& (mkdir hash-wasm \
&& cd hash-wasm \
&& unzip ../hash-wasm.zip) \
&& (tar --no-same-owner -xf asmcrypto.tgz \
&& cd asmcrypto.js-$ver_asmcrypto \
&& npm install ) \
&& (tar --no-same-owner -xf marked.tgz \
&& cd marked-$ver_marked \
&& npm install \
@@ -71,6 +65,7 @@ RUN /z/busy-mp3.sh \
RUN tar --no-same-owner -xf zopfli.tgz \
&& cd zopfli* \
&& cmake \
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
-DCMAKE_INSTALL_PREFIX=/usr \
-DZOPFLI_BUILD_SHARED=ON \
-B build \
@@ -81,13 +76,6 @@ RUN tar --no-same-owner -xf zopfli.tgz \
&& python3 -m pip install fonttools zopfli
# build asmcrypto
RUN cd asmcrypto.js-$ver_asmcrypto \
&& echo "export { Sha512 } from './hash/sha512/sha512';" > src/entry-export_all.ts \
&& node -r esm build.js \
&& awk '/HMAC state/{o=1} /var HEAP/{o=0} /function hmac_reset/{o=1} /return \{/{o=0} /var __extends =/{o=1} /var Hash =/{o=0} /hmac_|pbkdf2_/{next} o{next} {gsub(/IllegalStateError/,"Exception")} {sub(/^ +/,"");sub(/^\/\/ .*/,"");sub(/;$/," ;")} 1' < asmcrypto.all.es5.js > /z/dist/sha512.ac.js
# build hash-wasm
RUN cd hash-wasm/dist \
&& mv sha512.umd.min.js /z/dist/sha512.hw.js

View File

@@ -151,6 +151,7 @@ done
rm -rf contrib
[ $fast ] && sed -ri s/573/10/ copyparty/web/Makefile
(cd copyparty/web && make -j$(nproc) && rm Makefile)
rm -f copyparty/web/deps/README.md
# build
python3 -m build

View File

@@ -435,7 +435,7 @@ find -name py.typed -delete
find -type f \( -name .DS_Store -or -name ._.DS_Store \) -delete
find -type f -name ._\* | while IFS= read -r f; do cmp <(printf '\x00\x05\x16') <(head -c 3 -- "$f") && rm -fv -- "$f"; done
rm -f copyparty/web/deps/*.full.* copyparty/web/dbg-* copyparty/web/Makefile
rm -f copyparty/web/deps/*.full.* copyparty/web/deps/README.md copyparty/web/dbg-* copyparty/web/Makefile
find copyparty | LC_ALL=C sort | sed -r 's/\.gz$//;s/$/,/' > have
cat have | while IFS= read -r x; do

View File

@@ -91,7 +91,8 @@ grep -qE "^VERSION *= \(${commaver}\)$" copyparty/__version__.py ||
}
rm -rf .vscode
rm \
rm -f \
copyparty/web/deps/README.md \
.gitattributes \
.gitignore