From 85332a624523b156327eedfb9b57d255bd906800 Mon Sep 17 00:00:00 2001 From: rustdesk Date: Wed, 18 May 2022 01:44:42 +0800 Subject: [PATCH] yarn.lock is not useless, yuv.js must be in /, because it is called in global.js as web worker, deploy.sh not tested yet --- flutter/deploy.sh | 5 +++++ flutter/web/.gitignore | 3 ++- flutter/web/index.html | 7 +++---- flutter/web/js/index.html | 27 +++++++++++++-------------- flutter/web/yarn.lock | 4 ++++ flutter/web/{libs => }/yuv.js | 0 flutter/web/{libs => }/yuv.wasm | Bin 7 files changed, 27 insertions(+), 19 deletions(-) create mode 100644 flutter/web/yarn.lock rename flutter/web/{libs => }/yuv.js (100%) rename flutter/web/{libs => }/yuv.wasm (100%) mode change 100755 => 100644 diff --git a/flutter/deploy.sh b/flutter/deploy.sh index c18803419..f6826fd87 100755 --- a/flutter/deploy.sh +++ b/flutter/deploy.sh @@ -1,7 +1,12 @@ #!/usr/bin/env bash cd build/web/ python3 -c 'x=open("./main.dart.js", "rt").read();import re;y=re.search("https://.*canvaskit-wasm@([\d\.]+)/bin/",x);dirname="canvaskit@"+y.groups()[0];z=x.replace(y.group(),"/"+dirname+"/");f=open("./main.dart.js", "wt");f.write(z);import os;os.system("ln -s canvaskit " + dirname);' +mv jds/dist/index.js ./ +mv jds/dist/vendor.js ./ +/bin/rm -rf js python3 -c 'import hashlib;x=hashlib.sha1(open("./main.dart.js").read().encode()).hexdigest()[:10];y=open("index.html","rt").read().replace("main.dart.js", "main.dart.js?v="+x);open("index.html","wt").write(y)' +python3 -c 'import hashlib;x=hashlib.sha1(open("./index.js").read().encode()).hexdigest()[:10];y=open("index.html","rt").read().replace("js/dist/index.js", "index.js?v="+x);open("index.html","wt").write(y)' +python3 -c 'import hashlib;x=hashlib.sha1(open("./vendor.js").read().encode()).hexdigest()[:10];y=open("index.html","rt").read().replace("js/dist/vendor.js", "vendor.js?v="+x);open("index.html","wt").write(y)' tar czf x * scp x sg:/tmp/ ssh sg "sudo tar xzf /tmp/x -C /var/www/html/web.rustdesk.com/ && /bin/rm /tmp/x && sudo chown www-data:www-data /var/www/html/web.rustdesk.com/ -R" diff --git a/flutter/web/.gitignore b/flutter/web/.gitignore index 716b75f62..6290a3f63 100644 --- a/flutter/web/.gitignore +++ b/flutter/web/.gitignore @@ -5,4 +5,5 @@ js/src/rendezvous.ts ogvjs* libopus.js libopus.wasm -yuv-canvas* \ No newline at end of file +yuv-canvas* +node_modules diff --git a/flutter/web/index.html b/flutter/web/index.html index 28990548d..b466df662 100644 --- a/flutter/web/index.html +++ b/flutter/web/index.html @@ -32,11 +32,10 @@ RustDesk - - + - +