Первичная настройка, часть 3: установка ИШ из bj (скачать с nsd.ru или из файла; без графики: keyring, xvfb, dbus; база, служба) — проверено чистой установкой на Ubuntu 22.04; два контура НРД: каналы TEST3 и боевой в ИШ (адреса и отпечатки УЦ из документа НРД об ИШ 107), свои ключи (мастер ключа — выбор контура, профиль только к каналу контура), переключение bj между контурами с базой DEPO контура и подтверждением для боевого; папка входящих и слежение за связью — по активному контуру; пакеты ИШ в установщике и образе

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014FsEKyJrYF69Cj9ZXzFLRi
This commit is contained in:
zuevav
2026-10-05 16:35:53 +03:00
parent 17df53f25b
commit 4332e3309b
20 changed files with 709 additions and 46 deletions
+6 -2
View File
@@ -24,8 +24,11 @@ if [ "$ACTION" = "restart-ish" ]; then
fi
# ---- сертификаты НРД в справочнике активного профиля ИШ ----
# BJ_CHANNEL — начало кода канала ИШ контура (TEST3 | PROD): у тестового и боевого контуров свои ключи и профили
CHAN_PREFIX=$(printf '%s' "${BJ_CHANNEL:-}" | tr -cd 'A-Z0-9')
chan_where(){ if [ -n "$CHAN_PREFIX" ]; then echo "chanel_id in (select id from channels where code like '${CHAN_PREFIX}%')"; else echo "chanel_id is not null"; fi; }
prof_dir(){
PROFILE_NAME=$(su -s /bin/sh postgres -c "psql -d igate -tAc \"select value from parameters where name='cryptography.profile'\"" 2>/dev/null | tr -d '[:space:]')
PROFILE_NAME=$(su -s /bin/sh postgres -c "psql -d igate -tAc \"select value from parameters where name='cryptography.profile' and value<>'' and $(chan_where) order by chanel_id limit 1\"" 2>/dev/null | tr -d '[:space:]')
[ -n "$PROFILE_NAME" ] || err "профиль ИШ не задан (cryptography.profile)"
PROFDIR="$IGATE_PROFILES/$PROFILE_NAME"
[ -f "$PROFDIR/local.gdbm" ] && [ -f "$PROFDIR/local.pse" ] || err "нет справочника в $PROFDIR"
@@ -197,7 +200,8 @@ PY
fi
# подключить профиль к ИШ: cryptography.profile в БД igate (канал 33)
if [ "$IGATE_RES" = "ok" ]; then
if su -s /bin/sh postgres -c "psql -d igate -tAc \"update parameters set value='$PROFILE' where name='cryptography.profile'\"" >/dev/null 2>&1; then
# только канал контура этого ключа (BJ_CHANNEL); старый bj без контура — все каналы, как раньше. Канал с ключом включаем.
if su -s /bin/sh postgres -c "psql -d igate -tAc \"update parameters set value='$PROFILE' where name='cryptography.profile' and $(chan_where); update channels set enable=true where id in (select chanel_id from parameters where name='cryptography.profile' and value='$PROFILE'); update parameters set value='True' where name='enable' and chanel_id in (select chanel_id from parameters where name='cryptography.profile' and value='$PROFILE')\"" >/dev/null 2>&1; then
IGATE_RES="connected"
fi
fi