foms_app/app/foms.py
yumoqing 594f02a49d feat: foms_app 纯伞(应用壳)— 组装与启动,无业务逻辑
业务全部在独立模块仓库(foms / dbbackup / filesync / hostwatch),
本仓只做:入口组装、build、conf、start/stop、首页、RBAC 权限注册。

内容:
  · app/foms.py        入口,按序 load 全部模块
  · app/global_func.py get_module_dbname(统一库 foms)
  · build.sh           clone+安装全部模块、生成 DDL/CRUD、挂载 wwwroot
  · conf/config.json   website.paths:foms 根路径 + 三模块前缀
  · init/data.yaml     全部 codes(含拆分后新增的 codes)
  · scripts/load_path.py  重写为新 URL 布局
  · wwwroot/index.ui   首页(指向各模块前缀路径)

从 foms 仓库迁出的应用层文件(app/build/conf/start/stop/index.ui/data.yaml/
init_rbac/load_path)在 foms 侧已删除。
2026-08-27 11:08:38 +08:00

46 lines
1.5 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env python3
"""FOMS_APP — 纯伞(应用壳)主入口。
本仓库只做组装与启动,业务逻辑全部在独立模块仓库:
· foms — 主备切换核心(集群/节点/切换编排/心跳/远程命令)
· dbbackup — 数据库备份 + 日志同步binlog 复制)
· filesync — 运行文件同步rsync
· hostwatch — 日志监控 + 日志分析 + 主机指标
"""
import os, sys
# Add root so sibling modules are importable
root_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, root_dir)
from bricks_for_python.init import load_pybricks
from ahserver.webapp import webapp
from ahserver.serverenv import ServerEnv
# Foundation modules
from rbac.init import load_rbac
from appbase.init import load_appbase
# Business modules核心 + 三个独立模块,均为独立仓库)
from foms.init import load_foms
from dbbackup.init import load_dbbackup
from filesync.init import load_filesync
from hostwatch.init import load_hostwatch
from app.global_func import set_globalvariable
def init():
set_globalvariable()
load_pybricks()
load_appbase()
load_rbac()
load_foms() # 核心:集群/节点/切换/心跳/远程命令
load_dbbackup() # 数据库备份 + 日志同步binlog 复制)
load_filesync() # 运行文件同步rsync
load_hostwatch() # 日志监控 + 日志分析 + 主机指标
if __name__ == '__main__':
webapp(init)