- Notifications
You must be signed in to change notification settings - Fork57
go 运维平台,实现了隧道,命令分发,文件上传,webSSH
License
NotificationsYou must be signed in to change notification settings
ssbeatty/oms
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
本项目使用gin、gorm和ssh、sftp开发。旨在编写一个轻量,易用,多平台的运维项目。现阶段目的是做一个阉割版的xshell并简单的实现ansible或者saltstack的部分功能。
运行后访问http://127.0.0.1:9090/swagger/index.html
- 安装编译
# clonegit clone --recurse-submodules https://github.com/ssbeatty/oms.git# build frontendcd web/omsUIyarn&& yarn build# 打包 oms# linuxgo build -o oms cmd/omsd/main.go# wingo build -o oms.exe cmd/omsd/main.go
- 启动 创建config.yaml在可执行文件同级 运行即可
# configs/config.yaml.example# 支持mysql postgres sqlite(默认, 仅调试)app: name: oms addr: 127.0.0.1 port: 9090 mode: dev run_start:false# 是否在运行时打开浏览器 windows temp_date: 336h# 执行日志的保存时间 默认14天db: driver: postgres user: root password: 123456 dsn: 127.0.0.1:3306 db_name: oms
- 注册为服务
# 支持windows/linux/macosoms --action install --config config.yaml# 取消注册oms --action uninstall
注意注册为服务程序的运行目录会改变比如windows为C:/System32, 因此要修改配置中data_path为绝对路径。logger为相对路径时放在data_path下, 为绝对路径时在指定的路径。
- web界面omsUI
- 隧道, 类似
ssh
的-L
和-R
- cron任务和exec任务的管理
- ssh命令批量执行
- 文件批量的上传 流式传输支持大文件
- 基于
sftp
文件浏览器 - 基于novnc的vnc viewer
- 类似playbook的编排任务
ENV_SSH_DIAL_TIMEOUT = 30# ssh连接超时时间 单位秒ENV_SSH_RW_TIMEOUT = 20# ssh读写超时时间 单位秒ENV_SSH_CMD_TIMEOUT = 120# 执行命令时命令最长的超时时间 单位秒
docker-compose.yaml
version:'2.3'services:oms:image:ghcr.io/ssbeatty/oms/oms:v0.6.8restart:alwaysextra_hosts: -"host.docker.internal:host-gateway"ports: -"9090:9090"volumes: -./data:/opt/oms/data -./config:/etc/oms
- 修改依赖之后执行
go mod vendor
- 修改了swagger文档后执行
# docs/gen.gocd docsswag init -d ../internal/web/controllers --parseDependency -g api_v1.go -o ./swag init -d ../internal/web/controllers --parseDependency -g api_tool.go -o ./
About
go 运维平台,实现了隧道,命令分发,文件上传,webSSH