feat: add Mieru management

This commit is contained in:
andrey271192
2026-06-08 00:56:27 +03:00
parent 771d9446b1
commit a53e5fc27f
7 changed files with 596 additions and 6 deletions

View File

@@ -47,6 +47,12 @@ create_backup() {
if [ -f "$PCATELEGRAM_WEB_DIR/warp.json" ]; then
cp "$PCATELEGRAM_WEB_DIR/warp.json" "$tmp_dir/warp.json" 2>/dev/null
fi
if [ -f "$PCATELEGRAM_WEB_DIR/mieru.json" ]; then
cp "$PCATELEGRAM_WEB_DIR/mieru.json" "$tmp_dir/mieru.json" 2>/dev/null
fi
if [ -f "$PCATELEGRAM_WEB_DIR/mieru_server_config.json" ]; then
cp "$PCATELEGRAM_WEB_DIR/mieru_server_config.json" "$tmp_dir/mieru_server_config.json" 2>/dev/null
fi
# Language marker (i18n)
if [ -f "$PCATELEGRAM_WEB_DIR/.language" ]; then
@@ -253,6 +259,12 @@ restore_backup() {
if [ ! -f "$backup_dir/warp.json" ] && [ -f "$tmp_dir/opt/pcatelegram_web/warp.json" ]; then
cp "$tmp_dir/opt/pcatelegram_web/warp.json" "$backup_dir/warp.json" 2>/dev/null || true
fi
if [ ! -f "$backup_dir/mieru.json" ] && [ -f "$tmp_dir/opt/pcatelegram_web/mieru.json" ]; then
cp "$tmp_dir/opt/pcatelegram_web/mieru.json" "$backup_dir/mieru.json" 2>/dev/null || true
fi
if [ ! -f "$backup_dir/mieru_server_config.json" ] && [ -f "$tmp_dir/opt/pcatelegram_web/mieru_server_config.json" ]; then
cp "$tmp_dir/opt/pcatelegram_web/mieru_server_config.json" "$backup_dir/mieru_server_config.json" 2>/dev/null || true
fi
# Проверяем метаданные
if [ -f "$backup_dir/metadata.json" ]; then
@@ -314,6 +326,16 @@ restore_backup() {
cp "$backup_dir/warp.json" "$PCATELEGRAM_WEB_DIR/warp.json" 2>/dev/null
chmod 600 "$PCATELEGRAM_WEB_DIR/warp.json" 2>/dev/null || true
fi
if [ -f "$backup_dir/mieru.json" ]; then
mkdir -p "$PCATELEGRAM_WEB_DIR"
cp "$backup_dir/mieru.json" "$PCATELEGRAM_WEB_DIR/mieru.json" 2>/dev/null
chmod 600 "$PCATELEGRAM_WEB_DIR/mieru.json" 2>/dev/null || true
fi
if [ -f "$backup_dir/mieru_server_config.json" ]; then
mkdir -p "$PCATELEGRAM_WEB_DIR"
cp "$backup_dir/mieru_server_config.json" "$PCATELEGRAM_WEB_DIR/mieru_server_config.json" 2>/dev/null
chmod 600 "$PCATELEGRAM_WEB_DIR/mieru_server_config.json" 2>/dev/null || true
fi
# Восстанавливаем language marker (i18n)
if [ -f "$backup_dir/.language" ]; then