Add build system, versioning, releases, multilingual docs
- version.py with v1.0.0 - build.py (PyInstaller cross-platform build script) - build.sh / build.bat for quick builds - releases/ServerManager-v1.0.0-win-x64.exe (Windows x64 binary) - README.md with docs in English, Russian, Chinese - CHANGELOG.md Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -10,6 +10,9 @@ dist/
|
|||||||
build/
|
build/
|
||||||
*.spec
|
*.spec
|
||||||
|
|
||||||
|
# Releases are tracked (large binaries)
|
||||||
|
# releases/ is NOT ignored
|
||||||
|
|
||||||
# IDE
|
# IDE
|
||||||
.vscode/
|
.vscode/
|
||||||
.idea/
|
.idea/
|
||||||
|
|||||||
13
CHANGELOG.md
Normal file
13
CHANGELOG.md
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
# Changelog
|
||||||
|
|
||||||
|
## [1.0.0] - 2026-02-23
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- Server CRUD (SSH, Telnet, RDP, MariaDB, MSSQL, PostgreSQL)
|
||||||
|
- SSH Terminal with auto-sudo
|
||||||
|
- SFTP file transfer with progress bar
|
||||||
|
- SSH key management (generate, install, copy)
|
||||||
|
- Background status monitoring (online/offline)
|
||||||
|
- Dark theme (CustomTkinter)
|
||||||
|
- Search and filter servers
|
||||||
|
- Build scripts for Windows, Linux, macOS
|
||||||
237
README.md
237
README.md
@@ -1,36 +1,235 @@
|
|||||||
# ServerManager
|
# ServerManager
|
||||||
|
|
||||||
Desktop GUI-приложение для управления удалёнными серверами. CustomTkinter + Paramiko.
|
<p align="center">
|
||||||
|
<strong>Desktop GUI for managing remote servers</strong><br>
|
||||||
|
CustomTkinter + Paramiko | Dark Theme
|
||||||
|
</p>
|
||||||
|
|
||||||
## Возможности
|
<p align="center">
|
||||||
|
<a href="#english">English</a> |
|
||||||
|
<a href="#русский">Русский</a> |
|
||||||
|
<a href="#中文">中文</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
- CRUD серверов (SSH, Telnet, RDP, MariaDB, MSSQL, PostgreSQL)
|
---
|
||||||
- Терминал — выполнение команд через SSH с auto-sudo
|
|
||||||
- SFTP — загрузка и скачивание файлов с прогресс-баром
|
|
||||||
- SSH-ключи — генерация, установка, копирование
|
|
||||||
- Мониторинг — фоновая проверка online/offline
|
|
||||||
- Тёмная тема
|
|
||||||
|
|
||||||
## Установка
|
## English
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
- **Server CRUD** — add, edit, delete servers (SSH, Telnet, RDP, MariaDB, MSSQL, PostgreSQL)
|
||||||
|
- **SSH Terminal** — execute commands with auto-sudo (password via stdin, invisible in `ps`)
|
||||||
|
- **SFTP Transfer** — upload/download files with progress bar
|
||||||
|
- **SSH Keys** — generate ed25519, install on server, copy to clipboard
|
||||||
|
- **Status Monitor** — background check every 60 sec (online/offline badges)
|
||||||
|
- **Dark Theme** — modern CustomTkinter interface
|
||||||
|
|
||||||
|
### Installation
|
||||||
|
|
||||||
|
#### From source
|
||||||
```bash
|
```bash
|
||||||
|
git clone https://git.sensey24.ru/aibot777/server-manager.git
|
||||||
|
cd server-manager
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
```
|
|
||||||
|
|
||||||
## Запуск
|
|
||||||
|
|
||||||
```bash
|
|
||||||
python main.py
|
python main.py
|
||||||
```
|
```
|
||||||
|
|
||||||
## Конфигурация
|
#### Pre-built binary
|
||||||
|
Download from [`releases/`](releases/) folder — standalone `.exe` (Windows) or binary (Linux/Mac).
|
||||||
|
No Python installation required.
|
||||||
|
|
||||||
При первом запуске создаётся `config/servers.json` из шаблона.
|
### Building
|
||||||
Добавляйте серверы через GUI (кнопка "+ Add").
|
|
||||||
|
|
||||||
## Безопасность
|
Build for your current platform:
|
||||||
|
```bash
|
||||||
|
pip install pyinstaller
|
||||||
|
python build.py
|
||||||
|
```
|
||||||
|
|
||||||
|
Output goes to `releases/ServerManager-v1.0.0-{platform}.exe`
|
||||||
|
|
||||||
|
### Usage
|
||||||
|
|
||||||
|
1. **Launch** — `python main.py` or run the executable
|
||||||
|
2. **Add server** — click "+ Add" in sidebar, fill alias, IP, port, user, password, type
|
||||||
|
3. **Terminal** — select server → Terminal tab → type command → Run
|
||||||
|
4. **Files** — select server → Files tab → set paths → Upload/Download
|
||||||
|
5. **Keys** — Keys tab → Generate Key → Install on Server
|
||||||
|
6. Status badges update automatically (green = online, red = offline)
|
||||||
|
|
||||||
|
### Configuration
|
||||||
|
|
||||||
|
On first launch, `config/servers.json` is created from template.
|
||||||
|
Add servers via GUI or edit the JSON directly.
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"servers": [
|
||||||
|
{
|
||||||
|
"alias": "my-server",
|
||||||
|
"ip": "1.2.3.4",
|
||||||
|
"port": 22,
|
||||||
|
"user": "root",
|
||||||
|
"password": "secret",
|
||||||
|
"type": "ssh",
|
||||||
|
"notes": "Production"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Security
|
||||||
|
|
||||||
|
- `config/servers.json` is in `.gitignore` — never committed
|
||||||
|
- Passwords stored locally only
|
||||||
|
- SSH keys (ed25519) — recommended auth method
|
||||||
|
- sudo password sent via stdin (not visible in process list)
|
||||||
|
|
||||||
|
### Project Structure
|
||||||
|
|
||||||
|
```
|
||||||
|
ServerManager/
|
||||||
|
├── main.py # Entry point
|
||||||
|
├── version.py # Version info
|
||||||
|
├── build.py # PyInstaller build script
|
||||||
|
├── core/ # Business logic
|
||||||
|
│ ├── server_store.py # CRUD + JSON + observer
|
||||||
|
│ ├── ssh_client.py # Paramiko SSH/SFTP wrapper
|
||||||
|
│ ├── status_checker.py # Background monitoring
|
||||||
|
│ └── connection_factory.py
|
||||||
|
├── gui/ # CustomTkinter UI
|
||||||
|
│ ├── app.py # Main window
|
||||||
|
│ ├── sidebar.py # Server list + search
|
||||||
|
│ ├── server_dialog.py # Add/Edit modal
|
||||||
|
│ ├── tabs/ # Terminal, Files, Info, Keys
|
||||||
|
│ └── widgets/ # StatusBadge
|
||||||
|
├── config/ # Server configs
|
||||||
|
├── releases/ # Built executables
|
||||||
|
└── docs/ # Documentation
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Русский
|
||||||
|
|
||||||
|
### Возможности
|
||||||
|
|
||||||
|
- **Управление серверами** — добавление, редактирование, удаление (SSH, Telnet, RDP, MariaDB, MSSQL, PostgreSQL)
|
||||||
|
- **SSH-терминал** — выполнение команд с авто-sudo (пароль через stdin, не виден в `ps`)
|
||||||
|
- **SFTP** — загрузка и скачивание файлов с прогресс-баром
|
||||||
|
- **SSH-ключи** — генерация ed25519, установка на сервер, копирование
|
||||||
|
- **Мониторинг** — фоновая проверка каждые 60 сек (бейджи online/offline)
|
||||||
|
- **Тёмная тема** — современный интерфейс CustomTkinter
|
||||||
|
|
||||||
|
### Установка
|
||||||
|
|
||||||
|
#### Из исходников
|
||||||
|
```bash
|
||||||
|
git clone https://git.sensey24.ru/aibot777/server-manager.git
|
||||||
|
cd server-manager
|
||||||
|
pip install -r requirements.txt
|
||||||
|
python main.py
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Готовый бинарник
|
||||||
|
Скачайте из папки [`releases/`](releases/) — автономный `.exe` (Windows) или бинарник (Linux/Mac).
|
||||||
|
Python не требуется.
|
||||||
|
|
||||||
|
### Сборка
|
||||||
|
|
||||||
|
Сборка под текущую платформу:
|
||||||
|
```bash
|
||||||
|
pip install pyinstaller
|
||||||
|
python build.py
|
||||||
|
```
|
||||||
|
|
||||||
|
Результат в `releases/ServerManager-v1.0.0-{платформа}.exe`
|
||||||
|
|
||||||
|
### Использование
|
||||||
|
|
||||||
|
1. **Запуск** — `python main.py` или запустите скомпилированный файл
|
||||||
|
2. **Добавить сервер** — нажмите "+ Add" в боковой панели, заполните alias, IP, порт, пользователь, пароль, тип
|
||||||
|
3. **Терминал** — выберите сервер → вкладка Terminal → введите команду → Run
|
||||||
|
4. **Файлы** — выберите сервер → вкладка Files → укажите пути → Upload/Download
|
||||||
|
5. **Ключи** — вкладка Keys → Generate Key → Install on Server
|
||||||
|
6. Бейджи статуса обновляются автоматически (зелёный = online, красный = offline)
|
||||||
|
|
||||||
|
### Конфигурация
|
||||||
|
|
||||||
|
При первом запуске `config/servers.json` создаётся из шаблона.
|
||||||
|
Добавляйте серверы через GUI или редактируйте JSON напрямую.
|
||||||
|
|
||||||
|
### Безопасность
|
||||||
|
|
||||||
- `config/servers.json` в `.gitignore` — никогда не коммитится
|
- `config/servers.json` в `.gitignore` — никогда не коммитится
|
||||||
- Пароли хранятся только локально
|
- Пароли хранятся только локально
|
||||||
- SSH-ключи (ed25519) — рекомендуемый метод аутентификации
|
- SSH-ключи (ed25519) — рекомендуемый метод аутентификации
|
||||||
- sudo пароль передаётся через stdin (не виден в `ps aux`)
|
- sudo-пароль передаётся через stdin (не виден в списке процессов)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 中文
|
||||||
|
|
||||||
|
### 功能特点
|
||||||
|
|
||||||
|
- **服务器管理** — 添加、编辑、删除服务器(SSH、Telnet、RDP、MariaDB、MSSQL、PostgreSQL)
|
||||||
|
- **SSH终端** — 自动sudo执行命令(密码通过stdin传递,在`ps`中不可见)
|
||||||
|
- **SFTP传输** — 带进度条的文件上传/下载
|
||||||
|
- **SSH密钥** — 生成ed25519、安装到服务器、复制到剪贴板
|
||||||
|
- **状态监控** — 每60秒后台检查(在线/离线徽标)
|
||||||
|
- **深色主题** — 现代CustomTkinter界面
|
||||||
|
|
||||||
|
### 安装
|
||||||
|
|
||||||
|
#### 从源码安装
|
||||||
|
```bash
|
||||||
|
git clone https://git.sensey24.ru/aibot777/server-manager.git
|
||||||
|
cd server-manager
|
||||||
|
pip install -r requirements.txt
|
||||||
|
python main.py
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 预编译版本
|
||||||
|
从 [`releases/`](releases/) 文件夹下载 — 独立的 `.exe`(Windows)或二进制文件(Linux/Mac)。
|
||||||
|
无需安装Python。
|
||||||
|
|
||||||
|
### 编译
|
||||||
|
|
||||||
|
为当前平台编译:
|
||||||
|
```bash
|
||||||
|
pip install pyinstaller
|
||||||
|
python build.py
|
||||||
|
```
|
||||||
|
|
||||||
|
输出至 `releases/ServerManager-v1.0.0-{平台}.exe`
|
||||||
|
|
||||||
|
### 使用方法
|
||||||
|
|
||||||
|
1. **启动** — `python main.py` 或运行可执行文件
|
||||||
|
2. **添加服务器** — 点击侧栏 "+ Add",填写别名、IP、端口、用户名、密码、类型
|
||||||
|
3. **终端** — 选择服务器 → Terminal标签 → 输入命令 → Run
|
||||||
|
4. **文件** — 选择服务器 → Files标签 → 设置路径 → Upload/Download
|
||||||
|
5. **密钥** — Keys标签 → Generate Key → Install on Server
|
||||||
|
6. 状态徽标自动更新(绿色 = 在线,红色 = 离线)
|
||||||
|
|
||||||
|
### 配置
|
||||||
|
|
||||||
|
首次启动时,`config/servers.json` 从模板自动创建。
|
||||||
|
通过GUI添加服务器或直接编辑JSON文件。
|
||||||
|
|
||||||
|
### 安全性
|
||||||
|
|
||||||
|
- `config/servers.json` 在 `.gitignore` 中 — 永不提交
|
||||||
|
- 密码仅存储在本地
|
||||||
|
- SSH密钥(ed25519)— 推荐的认证方式
|
||||||
|
- sudo密码通过stdin传递(在进程列表中不可见)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
MIT
|
||||||
|
|
||||||
|
## Author
|
||||||
|
|
||||||
|
[aibot777](https://git.sensey24.ru/aibot777)
|
||||||
|
|||||||
10
build.bat
Normal file
10
build.bat
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
@echo off
|
||||||
|
REM Build script for Windows
|
||||||
|
REM Usage: build.bat
|
||||||
|
|
||||||
|
cd /d "%~dp0"
|
||||||
|
|
||||||
|
pip install -r requirements.txt pyinstaller >nul 2>&1
|
||||||
|
python build.py %*
|
||||||
|
|
||||||
|
pause
|
||||||
115
build.py
Normal file
115
build.py
Normal file
@@ -0,0 +1,115 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
"""
|
||||||
|
Build script — creates platform-specific executables via PyInstaller.
|
||||||
|
Run on the target OS to build for that platform.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
python build.py # build for current platform
|
||||||
|
python build.py --clean # clean build artifacts first
|
||||||
|
"""
|
||||||
|
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
import shutil
|
||||||
|
import platform
|
||||||
|
|
||||||
|
# Add project root
|
||||||
|
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
||||||
|
from version import __version__, __app_name__
|
||||||
|
|
||||||
|
PROJECT_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
DIST_DIR = os.path.join(PROJECT_DIR, "dist")
|
||||||
|
BUILD_DIR = os.path.join(PROJECT_DIR, "build")
|
||||||
|
RELEASES_DIR = os.path.join(PROJECT_DIR, "releases")
|
||||||
|
|
||||||
|
|
||||||
|
def get_platform_tag() -> str:
|
||||||
|
system = platform.system().lower()
|
||||||
|
machine = platform.machine().lower()
|
||||||
|
|
||||||
|
arch_map = {
|
||||||
|
"x86_64": "x64", "amd64": "x64",
|
||||||
|
"x86": "x32", "i686": "x32", "i386": "x32",
|
||||||
|
"aarch64": "arm64", "arm64": "arm64",
|
||||||
|
"armv7l": "arm",
|
||||||
|
}
|
||||||
|
arch = arch_map.get(machine, machine)
|
||||||
|
|
||||||
|
os_map = {"windows": "win", "linux": "linux", "darwin": "mac"}
|
||||||
|
os_tag = os_map.get(system, system)
|
||||||
|
|
||||||
|
return f"{os_tag}-{arch}"
|
||||||
|
|
||||||
|
|
||||||
|
def clean():
|
||||||
|
for d in [DIST_DIR, BUILD_DIR]:
|
||||||
|
if os.path.exists(d):
|
||||||
|
shutil.rmtree(d)
|
||||||
|
for f in os.listdir(PROJECT_DIR):
|
||||||
|
if f.endswith(".spec"):
|
||||||
|
os.remove(os.path.join(PROJECT_DIR, f))
|
||||||
|
print("Cleaned build artifacts")
|
||||||
|
|
||||||
|
|
||||||
|
def build():
|
||||||
|
tag = get_platform_tag()
|
||||||
|
print(f"Building {__app_name__} v{__version__} for {tag}...")
|
||||||
|
|
||||||
|
system = platform.system().lower()
|
||||||
|
|
||||||
|
# PyInstaller command
|
||||||
|
cmd_parts = [
|
||||||
|
sys.executable, "-m", "PyInstaller",
|
||||||
|
"--onefile",
|
||||||
|
"--windowed",
|
||||||
|
f"--name={__app_name__}",
|
||||||
|
"--add-data", f"config/servers.example.json{os.pathsep}config",
|
||||||
|
]
|
||||||
|
|
||||||
|
# Icon
|
||||||
|
icon_path = os.path.join(PROJECT_DIR, "assets", "icon.ico")
|
||||||
|
if os.path.exists(icon_path):
|
||||||
|
cmd_parts.extend(["--icon", icon_path])
|
||||||
|
|
||||||
|
# Hidden imports for customtkinter
|
||||||
|
cmd_parts.extend([
|
||||||
|
"--hidden-import", "customtkinter",
|
||||||
|
"--hidden-import", "PIL",
|
||||||
|
"--collect-all", "customtkinter",
|
||||||
|
])
|
||||||
|
|
||||||
|
cmd_parts.append("main.py")
|
||||||
|
|
||||||
|
os.chdir(PROJECT_DIR)
|
||||||
|
ret = os.system(" ".join(f'"{p}"' if " " in p else p for p in cmd_parts))
|
||||||
|
|
||||||
|
if ret != 0:
|
||||||
|
print(f"Build failed with code {ret}")
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
# Move to releases
|
||||||
|
os.makedirs(RELEASES_DIR, exist_ok=True)
|
||||||
|
|
||||||
|
if system == "windows":
|
||||||
|
src = os.path.join(DIST_DIR, f"{__app_name__}.exe")
|
||||||
|
dst = os.path.join(RELEASES_DIR, f"{__app_name__}-v{__version__}-{tag}.exe")
|
||||||
|
elif system == "darwin":
|
||||||
|
src = os.path.join(DIST_DIR, __app_name__)
|
||||||
|
dst = os.path.join(RELEASES_DIR, f"{__app_name__}-v{__version__}-{tag}")
|
||||||
|
else:
|
||||||
|
src = os.path.join(DIST_DIR, __app_name__)
|
||||||
|
dst = os.path.join(RELEASES_DIR, f"{__app_name__}-v{__version__}-{tag}")
|
||||||
|
|
||||||
|
if os.path.exists(src):
|
||||||
|
shutil.copy2(src, dst)
|
||||||
|
size_mb = os.path.getsize(dst) / (1024 * 1024)
|
||||||
|
print(f"\nBuild complete: {dst} ({size_mb:.1f} MB)")
|
||||||
|
else:
|
||||||
|
print(f"Build output not found: {src}")
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
if "--clean" in sys.argv:
|
||||||
|
clean()
|
||||||
|
build()
|
||||||
21
build.sh
Normal file
21
build.sh
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Build script for Linux / macOS
|
||||||
|
# Run on the target OS to build for that platform.
|
||||||
|
#
|
||||||
|
# Usage:
|
||||||
|
# chmod +x build.sh
|
||||||
|
# ./build.sh # build
|
||||||
|
# ./build.sh --clean # clean first
|
||||||
|
set -e
|
||||||
|
|
||||||
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
|
# Install deps if needed
|
||||||
|
pip install -r requirements.txt pyinstaller 2>/dev/null || pip3 install -r requirements.txt pyinstaller
|
||||||
|
|
||||||
|
if [ "$1" = "--clean" ]; then
|
||||||
|
rm -rf build dist *.spec
|
||||||
|
echo "Cleaned"
|
||||||
|
fi
|
||||||
|
|
||||||
|
python build.py "$@" || python3 build.py "$@"
|
||||||
BIN
releases/ServerManager-v1.0.0-win-x64.exe
Normal file
BIN
releases/ServerManager-v1.0.0-win-x64.exe
Normal file
Binary file not shown.
6
version.py
Normal file
6
version.py
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
"""Version info for ServerManager."""
|
||||||
|
|
||||||
|
__version__ = "1.0.0"
|
||||||
|
__app_name__ = "ServerManager"
|
||||||
|
__author__ = "aibot777"
|
||||||
|
__description__ = "Desktop GUI for managing remote servers"
|
||||||
Reference in New Issue
Block a user