Update docker-compose.yml to add telemt-panel service and configure telemt-plus network. Modify SYNC_SETUP.md to change ownership settings from 999:999 to 65532:65532 for improved compatibility and document steps for reconfiguring existing B servers.
Publish telemt-bot Docker image / build-and-push (push) Successful in 35s
Publish telemt-bot Docker image / build-and-push (push) Successful in 35s
This commit is contained in:
+52
-6
@@ -109,7 +109,7 @@ sync {
|
|||||||
compress = true,
|
compress = true,
|
||||||
_extra = {
|
_extra = {
|
||||||
"--delete",
|
"--delete",
|
||||||
"--chown=999:999",
|
"--chown=65532:65532",
|
||||||
"--chmod=Du=rwx,Dg=rx,Do=,Fu=rw,Fg=r,Fo=",
|
"--chmod=Du=rwx,Dg=rx,Do=,Fu=rw,Fg=r,Fo=",
|
||||||
"-e", "ssh -i /root/.ssh/telemt_sync -o StrictHostKeyChecking=accept-new"
|
"-e", "ssh -i /root/.ssh/telemt_sync -o StrictHostKeyChecking=accept-new"
|
||||||
}
|
}
|
||||||
@@ -129,7 +129,7 @@ sync {
|
|||||||
compress = true,
|
compress = true,
|
||||||
_extra = {
|
_extra = {
|
||||||
"--delete",
|
"--delete",
|
||||||
"--chown=999:999",
|
"--chown=65532:65532",
|
||||||
"--chmod=Du=rwx,Dg=rx,Do=,Fu=rw,Fg=r,Fo=",
|
"--chmod=Du=rwx,Dg=rx,Do=,Fu=rw,Fg=r,Fo=",
|
||||||
"-e", "ssh -i /root/.ssh/telemt_sync -o StrictHostKeyChecking=accept-new"
|
"-e", "ssh -i /root/.ssh/telemt_sync -o StrictHostKeyChecking=accept-new"
|
||||||
}
|
}
|
||||||
@@ -149,7 +149,7 @@ sync {
|
|||||||
compress = true,
|
compress = true,
|
||||||
_extra = {
|
_extra = {
|
||||||
"--delete",
|
"--delete",
|
||||||
"--chown=999:999",
|
"--chown=65532:65532",
|
||||||
"--chmod=Du=rwx,Dg=rx,Do=,Fu=rw,Fg=r,Fo=",
|
"--chmod=Du=rwx,Dg=rx,Do=,Fu=rw,Fg=r,Fo=",
|
||||||
"-e", "ssh -i /root/.ssh/telemt_sync -o StrictHostKeyChecking=accept-new"
|
"-e", "ssh -i /root/.ssh/telemt_sync -o StrictHostKeyChecking=accept-new"
|
||||||
}
|
}
|
||||||
@@ -171,7 +171,7 @@ apt update && apt install -y rsync
|
|||||||
```bash
|
```bash
|
||||||
# B1: gt1.ivx.su
|
# B1: gt1.ivx.su
|
||||||
rsync -az --delete \
|
rsync -az --delete \
|
||||||
--chown=999:999 \
|
--chown=65532:65532 \
|
||||||
--chmod=Du=rwx,Dg=rx,Do=,Fu=rw,Fg=r,Fo= \
|
--chmod=Du=rwx,Dg=rx,Do=,Fu=rw,Fg=r,Fo= \
|
||||||
-e "ssh -i /root/.ssh/telemt_sync -o StrictHostKeyChecking=accept-new" \
|
-e "ssh -i /root/.ssh/telemt_sync -o StrictHostKeyChecking=accept-new" \
|
||||||
/opt/telemt-plus/telemt-data/ \
|
/opt/telemt-plus/telemt-data/ \
|
||||||
@@ -179,7 +179,7 @@ rsync -az --delete \
|
|||||||
|
|
||||||
# B2: gt2.ivx.su
|
# B2: gt2.ivx.su
|
||||||
rsync -az --delete \
|
rsync -az --delete \
|
||||||
--chown=999:999 \
|
--chown=65532:65532 \
|
||||||
--chmod=Du=rwx,Dg=rx,Do=,Fu=rw,Fg=r,Fo= \
|
--chmod=Du=rwx,Dg=rx,Do=,Fu=rw,Fg=r,Fo= \
|
||||||
-e "ssh -i /root/.ssh/telemt_sync -o StrictHostKeyChecking=accept-new" \
|
-e "ssh -i /root/.ssh/telemt_sync -o StrictHostKeyChecking=accept-new" \
|
||||||
/opt/telemt-plus/telemt-data/ \
|
/opt/telemt-plus/telemt-data/ \
|
||||||
@@ -187,7 +187,7 @@ rsync -az --delete \
|
|||||||
|
|
||||||
# B3: gt3.ivx.su
|
# B3: gt3.ivx.su
|
||||||
rsync -az --delete \
|
rsync -az --delete \
|
||||||
--chown=999:999 \
|
--chown=65532:65532 \
|
||||||
--chmod=Du=rwx,Dg=rx,Do=,Fu=rw,Fg=r,Fo= \
|
--chmod=Du=rwx,Dg=rx,Do=,Fu=rw,Fg=r,Fo= \
|
||||||
-e "ssh -i /root/.ssh/telemt_sync -o StrictHostKeyChecking=accept-new" \
|
-e "ssh -i /root/.ssh/telemt_sync -o StrictHostKeyChecking=accept-new" \
|
||||||
/opt/telemt-plus/telemt-data/ \
|
/opt/telemt-plus/telemt-data/ \
|
||||||
@@ -228,6 +228,52 @@ curl -s http://127.0.0.1:9091/v1/health
|
|||||||
|
|
||||||
В ответе ожидается `read_only: true`.
|
В ответе ожидается `read_only: true`.
|
||||||
|
|
||||||
|
## 8.1) Перенастройка существующих B (slave) на новый `uid/gid` и повторный запуск синхронизации
|
||||||
|
|
||||||
|
Если B-серверы уже были настроены со старым `--chown=999:999`, выполните эти шаги, чтобы синхронизация снова применялась корректно.
|
||||||
|
|
||||||
|
1. На A (`mtg.ivx.su`) обновить конфиг `lsyncd` и перезапустить демон (выполнять на `mtg.ivx.su` от root; желательно сначала остановить `telemt` на всех B по шагу 2, затем вставить блок целиком):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sed -i.bak 's/--chown=999:999/--chown=65532:65532/g' /etc/lsyncd/lsyncd.conf.lua
|
||||||
|
systemctl restart lsyncd
|
||||||
|
systemctl status lsyncd --no-pager
|
||||||
|
```
|
||||||
|
|
||||||
|
2. На каждом B (`gt1.ivx.su`, `gt2.ivx.su`, `gt3.ivx.su`) остановить `telemt` и выставить права под новый `uid/gid`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd /opt/telemt-plus
|
||||||
|
docker compose stop telemt
|
||||||
|
chown -R 65532:65532 telemt-data
|
||||||
|
find telemt-data -type d -exec chmod 750 {} \;
|
||||||
|
find telemt-data -type f -exec chmod 640 {} \;
|
||||||
|
chmod 660 telemt-data/config.toml 2>/dev/null || true
|
||||||
|
chmod 770 telemt-data/cache 2>/dev/null || true
|
||||||
|
```
|
||||||
|
|
||||||
|
3. На A выполнить повторную полную синхронизацию на все B (команды из шага 6 с `--chown=65532:65532`).
|
||||||
|
|
||||||
|
4. На A перезапустить `lsyncd`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
systemctl restart lsyncd
|
||||||
|
systemctl status lsyncd --no-pager
|
||||||
|
```
|
||||||
|
|
||||||
|
5. На каждом B поднять контейнер и проверить, что узел в режиме read-only:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd /opt/telemt-plus
|
||||||
|
docker compose up -d --force-recreate telemt
|
||||||
|
curl -s http://127.0.0.1:9091/v1/health
|
||||||
|
```
|
||||||
|
|
||||||
|
Ожидаемо:
|
||||||
|
- контейнер `telemt` стартует без ошибок прав доступа;
|
||||||
|
- в health-ответе `read_only: true`;
|
||||||
|
- после изменения `config.toml` на A файл автоматически обновляется на всех B.
|
||||||
|
|
||||||
## 9) Правило эксплуатации
|
## 9) Правило эксплуатации
|
||||||
|
|
||||||
- Мутации (`POST/PATCH/DELETE`) делать только на A (`mtg.ivx.su`).
|
- Мутации (`POST/PATCH/DELETE`) делать только на A (`mtg.ivx.su`).
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ services:
|
|||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
container_name: telemt-bot
|
container_name: telemt-bot
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
networks:
|
||||||
|
telemt-plus:
|
||||||
environment:
|
environment:
|
||||||
TELEGRAM_BOT_TOKEN: ${TELEGRAM_BOT_TOKEN}
|
TELEGRAM_BOT_TOKEN: ${TELEGRAM_BOT_TOKEN}
|
||||||
TELEGRAM_ADMIN_CHAT_ID: ${TELEGRAM_ADMIN_CHAT_ID}
|
TELEGRAM_ADMIN_CHAT_ID: ${TELEGRAM_ADMIN_CHAT_ID}
|
||||||
@@ -15,3 +17,24 @@ services:
|
|||||||
TELEMT_LINK_HOST: ${TELEMT_LINK_HOST}
|
TELEMT_LINK_HOST: ${TELEMT_LINK_HOST}
|
||||||
TELEMT_LINK_PORT: ${TELEMT_LINK_PORT:-9443}
|
TELEMT_LINK_PORT: ${TELEMT_LINK_PORT:-9443}
|
||||||
TELEMT_TLS_DOMAIN: ${TELEMT_TLS_DOMAIN:-}
|
TELEMT_TLS_DOMAIN: ${TELEMT_TLS_DOMAIN:-}
|
||||||
|
|
||||||
|
telemt-panel:
|
||||||
|
image: ghcr.io/amirotin/telemt_panel:latest
|
||||||
|
container_name: telemt-panel
|
||||||
|
restart: unless-stopped
|
||||||
|
user: "0:0"
|
||||||
|
volumes:
|
||||||
|
- /opt/telemt-plus/telemt-panel-data:/etc/telemt-panel
|
||||||
|
networks:
|
||||||
|
telemt-plus:
|
||||||
|
ipv4_address: 172.20.0.4
|
||||||
|
ports:
|
||||||
|
- "${TELEMT_PANEL_HTTP_PORT:-8080}:8080"
|
||||||
|
|
||||||
|
networks:
|
||||||
|
telemt-plus:
|
||||||
|
driver: bridge
|
||||||
|
ipam:
|
||||||
|
config:
|
||||||
|
- subnet: 172.20.0.0/24
|
||||||
|
gateway: 172.20.0.1
|
||||||
|
|||||||
Reference in New Issue
Block a user