feat(eltex): add ai-eltex launcher for corporate LLM proxy

ai-eltex runs Claude Code through the Eltex LiteLLM proxy
(http://llm.eltex.loc:4000, team GLM subscription). The personal key
from admins is checked via /v1/models and stored in
~/.config/ai-setup/eltex_key; the model is taken from the key's
allowed list (ELTEX_MODEL / ELTEX_BASE_URL override). The proxy
ignores effort/thinking, so no effort forcing. /logout-eltex and
/logout in ai-eltex drop the key; setup.sh status shows it.

ru-bypass: hosts block now has an end marker and only that block is
rewritten, manual entries outside it survive; llm.eltex.loc/llm2 added
since the VPN DNS does not resolve it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Виталий Никитенко
2026-10-01 12:21:02 +07:00
parent 08ad4bb429
commit 083a614940
10 changed files with 210 additions and 16 deletions

View File

@@ -162,10 +162,12 @@ fi
# Без этого DNS через VPN может вернуть внешний IP вместо внутреннего,
# и трафик пойдёт через VPN вместо прямого соединения.
HOSTS_MARKER="# ru-bypass: local hosts"
HOSTS_END_MARKER="# ru-bypass: end"
# Удаляем старый блок целиком (от маркера до конца файла)
# и заодно чистим дубликаты от старых версий скрипта (без маркера)
sed -i "/$HOSTS_MARKER/,\$ d; /eltex\.loc/d; /eltex-co\.ru/d" /etc/hosts
# Удаляем только свой блок (от маркера до конечного маркера).
# Записи, добавленные вручную вне блока, не трогаем.
# Блок старых версий без конечного маркера удаляется до конца файла.
sed -i "/^$HOSTS_MARKER\$/,/^$HOSTS_END_MARKER\$/d" /etc/hosts
# Добавляем актуальные
cat >> /etc/hosts <<_HOSTS
@@ -180,8 +182,10 @@ $HOSTS_MARKER
172.16.5.63 proxy.eltex.loc
10.80.0.16 ssw.eltex.loc
172.16.5.78 nexus.eltex.loc
172.16.4.68 llm.eltex.loc llm2.eltex.loc
172.16.1.149 cpe-worker.eltex.loc
172.16.5.22 mattermost.eltex-co.ru elph.eltex-co.ru ecss-elph-proxy.eltex-co.ru study-git.eltex-co.ru study-red.eltex-co.ru
$HOSTS_END_MARKER
_HOSTS
echo "Локальные хосты: *.eltex.loc, mattermost, elph → /etc/hosts"