From 378bedc2895f88e898eeb96d36d8e72b0fc46992 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CNaeel=E2=80=9D?= Date: Fri, 22 May 2026 21:14:24 +0400 Subject: [PATCH] =?UTF-8?q?germany:=20=D1=84=D0=B8=D0=BA=D1=81=20deploy=5F?= =?UTF-8?q?lang.sh=20=E2=80=94=20=D0=BA=D0=BB=D1=8E=D1=87=20=D0=BB=D0=BE?= =?UTF-8?q?=D0=BA=D0=B0=D0=BB=D1=8C=D0=BD=D0=BE,=20=D0=B1=D0=B5=D0=B7=20se?= =?UTF-8?q?d=20=D0=B0=D0=B4=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy_lang.sh | 32 +++++++++++++++----------------- dist/index.html | 2 +- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/deploy_lang.sh b/deploy_lang.sh index 781824f..5fee7a3 100755 --- a/deploy_lang.sh +++ b/deploy_lang.sh @@ -3,24 +3,22 @@ set -e VM="root@95.179.252.111" SSH="ssh -i ~/.ssh/vultr_openssh -o StrictHostKeyChecking=no" -echo "=== rsync repo -> VM ===" +echo "=== build ===" +~/lang/.venv/bin/python3 ~/lang/build.sh + +echo "=== inject API key ===" +KEY=$(cat ~/lang/token.txt) +python3 -c " +h = open('$HOME/lang/dist/index.html').read() +h = h.replace(\"const GROQ_API_KEY = '';\", \"const GROQ_API_KEY = '$KEY';\") +open('$HOME/lang/dist/index.html', 'w').write(h) +" +echo " done" + +echo "=== rsync -> VM ===" rsync -az -e "$SSH" --exclude='.git' --exclude='.venv' --exclude='__pycache__' ~/lang/ ${VM}:/opt/lyngvo/ -echo "=== build + deploy ===" -$SSH $VM "bash -c ' - cd /opt/lyngvo - python3 build.sh - KEY=\$(cat token.txt) - sed -i \"s|const GROQ_API_KEY = .*;|const GROQ_API_KEY = '\\\''\$KEY'\\\'';|\" dist/index.html - cp dist/index.html /var/www/lyngvo/index.html - if [ -f server/lang.kube5s.ru.conf ]; then - cp server/lang.kube5s.ru.conf /etc/nginx/conf.d/ - nginx -t && systemctl reload nginx - fi - if [ -f server/proxy.py ]; then - cp server/proxy.py /opt/groq-proxy/proxy.py - systemctl reload groq-proxy 2>/dev/null || true - fi -'" +echo "=== apply on VM ===" +$SSH $VM 'cp /opt/lyngvo/dist/index.html /var/www/lyngvo/index.html && echo OK' echo "=== https://lang.kube5s.ru ===" diff --git a/dist/index.html b/dist/index.html index a4b6c4f..b6d540e 100644 --- a/dist/index.html +++ b/dist/index.html @@ -692,7 +692,7 @@ async function doCompare(blob, originalText, duration) {