From 577db1da473bc02e9fad58a0abd3d652356706b4 Mon Sep 17 00:00:00 2001 From: PTah Date: Tue, 16 Jun 2026 11:37:52 +1000 Subject: [PATCH] chore(docs): sync repository URLs for kalinamall mirror --- README.md | 6 +++--- docs/auto-update.ru.md | 4 ++-- readme_eng.md | 4 ++-- scripts/Rewrite-GitHostUrls.ps1 | 12 ++++++------ scripts/rewrite-git-host-urls.sh | 12 ++++++------ update_ssh_monitor.sh | 2 +- 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index c641186..ce52b6c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# ssh-monitor +# ssh-monitor Bash-скрипт мониторинга **SSH**, **SUDO** и событий **`systemd-logind`** (локальные/графические сессии и др.) с уведомлениями в **Telegram** и по **электронной почте (SMTP)**, опциональным резервным webhook, авто-блокировкой IP (**ipset** + **iptables** / **ip6tables**: наборы `hash:ip` с таймаутом, одно правило `-m set`; нюансы — **`IPSET-NOTES.txt`**) и ежедневным отчётом. @@ -14,7 +14,7 @@ Bash-скрипт мониторинга **SSH**, **SUDO** и событий **` ## Конфигурация -> **Закрытый инстанс Gitea:** в доверенном закрытом репозитории допустимо хранить **`ssh-monitor.conf`** с боевыми токенами (файл не в `.gitignore`). В публичном [GitHub](https://github.com/PTah/ssh-monitor) такой файл игнорируется — используйте только `ssh-monitor.conf.example`. +> **Закрытый инстанс Gitea:** в доверенном закрытом репозитории допустимо хранить **`ssh-monitor.conf`** с боевыми токенами (файл не в `.gitignore`). В публичном [GitHub](https://git.kalinamall.ru/PapaTramp/ssh-monitor) такой файл игнорируется — используйте только `ssh-monitor.conf.example`. Скрипт читает параметры из `/etc/ssh-monitor.conf` в формате `KEY="value"`. @@ -163,7 +163,7 @@ bash -n ./ssh-monitor make dist ``` -Появится файл `ssh-monitor-<версия>.tar.gz` (через `git archive`). Готовые архивы для установки без клона репозитория прикладываются к [релизам на GitHub](https://github.com/PTah/ssh-monitor/releases). +Появится файл `ssh-monitor-<версия>.tar.gz` (через `git archive`). Готовые архивы для установки без клона репозитория прикладываются к [релизам на GitHub](https://git.kalinamall.ru/PapaTramp/ssh-monitor/releases). ## Установка скрипта, конфигурации и systemd diff --git a/docs/auto-update.ru.md b/docs/auto-update.ru.md index 28c852f..79376e2 100644 --- a/docs/auto-update.ru.md +++ b/docs/auto-update.ru.md @@ -41,7 +41,7 @@ flowchart LR | Переменная | По умолчанию | Назначение | |------------|--------------|------------| | `UPDATE_DIR` | `/opt/scripts/update` | Каталог для git-клона | -| `REPO_URL` | `https://github.com/PTah/ssh-monitor.git` | URL репозитория (на закрытом зеркале — URL своего Gitea) | +| `REPO_URL` | `https://git.kalinamall.ru/PapaTramp/ssh-monitor.git` | URL репозитория (на закрытом зеркале — URL своего Gitea) | | `LOCAL_SCRIPT_PATH` | `/usr/local/bin/ssh-monitor` | Куда копировать бинарник | | `LOG_FILE` | `/var/log/update_script.log` | Лог обновлений | | `DEBUG` | `0` | `1` — подробный DEBUG в лог | @@ -169,4 +169,4 @@ sudo /opt/scripts/update_ssh_monitor.sh - Обновляется **только** файл **`ssh-monitor`**, не конфиг и не watchdog. - При недоступном git **`git pull`** пишет предупреждение и продолжает с локальной копией. -- На **закрытом зеркале** в `update_ssh_monitor.sh` задайте **`REPO_URL`** своего Gitea; в публичном GitHub по умолчанию — `github.com/PTah/ssh-monitor`. +- На **закрытом зеркале** в `update_ssh_monitor.sh` задайте **`REPO_URL`** своего Gitea; в публичном GitHub по умолчанию — `git.kalinamall.ru/PapaTramp/ssh-monitor`. diff --git a/readme_eng.md b/readme_eng.md index 219ea6e..b1968c5 100644 --- a/readme_eng.md +++ b/readme_eng.md @@ -1,4 +1,4 @@ -# ssh-monitor +# ssh-monitor Bash script that monitors **SSH**, **SUDO**, and **`systemd-logind`** events (local/graphical sessions, etc.), sends alerts via **Telegram** and **SMTP email**, optional backup webhook, automatic IP blocking (**ipset** + **iptables** / **ip6tables**: `hash:ip` sets with timeout, single `-m set` rule; details in **`IPSET-NOTES.txt`**), and a daily report. @@ -160,7 +160,7 @@ Version is set as **`SSH_MONITOR_VERSION`** in **`ssh-monitor`** and **`version. make dist ``` -Produces `ssh-monitor-.tar.gz` (via `git archive`). Prebuilt archives are attached to [GitHub releases](https://github.com/PTah/ssh-monitor/releases). +Produces `ssh-monitor-.tar.gz` (via `git archive`). Prebuilt archives are attached to [GitHub releases](https://git.kalinamall.ru/PapaTramp/ssh-monitor/releases). ## Installing the script, config, and systemd diff --git a/scripts/Rewrite-GitHostUrls.ps1 b/scripts/Rewrite-GitHostUrls.ps1 index 87a40f5..bbd8952 100644 --- a/scripts/Rewrite-GitHostUrls.ps1 +++ b/scripts/Rewrite-GitHostUrls.ps1 @@ -28,15 +28,15 @@ switch ($Target) { $BaseHost = $Base -replace '^https://', '' $patterns = @( - @{ From = 'https://github.com/PTah/([^)/''"\s]+)/blob/main/'; To = "$Base/`$1$BlobSuffix/" } + @{ From = 'https://git.kalinamall.ru/PapaTramp/([^)/''"\s]+)/blob/main/'; To = "$Base/`$1$BlobSuffix/" } + @{ From = 'https://git.kalinamall.ru/PapaTramp/([^)/''"\s]+)/src/branch/main/'; To = "$Base/`$1$BlobSuffix/" } @{ From = 'https://git.kalinamall.ru/PapaTramp/([^)/''"\s]+)/src/branch/main/'; To = "$Base/`$1$BlobSuffix/" } - @{ From = 'https://git.papatramp.ru/PTah/([^)/''"\s]+)/src/branch/main/'; To = "$Base/`$1$BlobSuffix/" } - @{ From = 'https://github.com/PTah/'; To = "$Base/" } @{ From = 'https://git.kalinamall.ru/PapaTramp/'; To = "$Base/" } - @{ From = 'https://git.papatramp.ru/PTah/'; To = "$Base/" } - @{ From = 'github.com/PTah/'; To = "$BaseHost/" } + @{ From = 'https://git.kalinamall.ru/PapaTramp/'; To = "$Base/" } + @{ From = 'https://git.kalinamall.ru/PapaTramp/'; To = "$Base/" } + @{ From = 'git.kalinamall.ru/PapaTramp/'; To = "$BaseHost/" } + @{ From = 'git.kalinamall.ru/PapaTramp/'; To = "$BaseHost/" } @{ From = 'git.kalinamall.ru/PapaTramp/'; To = "$BaseHost/" } - @{ From = 'git.papatramp.ru/PTah/'; To = "$BaseHost/" } ) $extensions = @('*.md', '*.json', '*.service', '*.example', '*.sh', '*.ps1', '*.yml', '*.yaml') diff --git a/scripts/rewrite-git-host-urls.sh b/scripts/rewrite-git-host-urls.sh index 38c4dfe..a0b76a0 100644 --- a/scripts/rewrite-git-host-urls.sh +++ b/scripts/rewrite-git-host-urls.sh @@ -28,15 +28,15 @@ esac # Order matters: longer patterns first. PATTERNS=( - 's|https://github.com/PTah/\([^)/"'"'"' ]*\)/blob/main/|'"${BASE}"'/\1'"${BLOB_SUFFIX}"'/|g' + 's|https://git.kalinamall.ru/PapaTramp/\([^)/"'"'"' ]*\)/blob/main/|'"${BASE}"'/\1'"${BLOB_SUFFIX}"'/|g' + 's|https://git.kalinamall.ru/PapaTramp/\([^)/"'"'"' ]*\)/src/branch/main/|'"${BASE}"'/\1'"${BLOB_SUFFIX}"'/|g' 's|https://git.kalinamall.ru/PapaTramp/\([^)/"'"'"' ]*\)/src/branch/main/|'"${BASE}"'/\1'"${BLOB_SUFFIX}"'/|g' - 's|https://git.papatramp.ru/PTah/\([^)/"'"'"' ]*\)/src/branch/main/|'"${BASE}"'/\1'"${BLOB_SUFFIX}"'/|g' - 's|https://github.com/PTah/|'"${BASE}"'/|g' 's|https://git.kalinamall.ru/PapaTramp/|'"${BASE}"'/|g' - 's|https://git.papatramp.ru/PTah/|'"${BASE}"'/|g' - 's|github.com/PTah/|'"${BASE#https://}"'/|g' + 's|https://git.kalinamall.ru/PapaTramp/|'"${BASE}"'/|g' + 's|https://git.kalinamall.ru/PapaTramp/|'"${BASE}"'/|g' + 's|git.kalinamall.ru/PapaTramp/|'"${BASE#https://}"'/|g' + 's|git.kalinamall.ru/PapaTramp/|'"${BASE#https://}"'/|g' 's|git.kalinamall.ru/PapaTramp/|'"${BASE#https://}"'/|g' - 's|git.papatramp.ru/PTah/|'"${BASE#https://}"'/|g' ) FILES=() diff --git a/update_ssh_monitor.sh b/update_ssh_monitor.sh index 4b4faee..d82ef8a 100755 --- a/update_ssh_monitor.sh +++ b/update_ssh_monitor.sh @@ -3,7 +3,7 @@ # === Конфигурация скрипта === UPDATE_DIR="/opt/scripts/update" SCRIPT_NAME="ssh-monitor" -REPO_URL="https://github.com/PTah/ssh-monitor.git" +REPO_URL="https://git.kalinamall.ru/PapaTramp/ssh-monitor.git" LOCAL_SCRIPT_PATH="/usr/local/bin/ssh-monitor" LOG_FILE="/var/log/update_script.log"