Files
qing 34cd295005 feat(core): mgmt 接入 core 进程管理 + 管理员认证
- gateway 新增 POST /admin/verify 验签接口,供内部服务校验管理员 Token
- core 的 /list /exec /kill 接入管理员认证(调用 gateway 验签,fail-closed)
- gateway 代理 opened 白名单加入 core:5200
- mgmt 管理页显示当前用户与角色,进程页接入 core 进程管理接口
2026-08-04 20:00:24 +08:00

89 lines
2.1 KiB
Makefile

VERSION := 0.0.4
APP_NAME := nidus
INSTL_DIRS := /usr/local/bin
CONF_NAME := init.txt
CONF_DIR := /etc/Nidus
SRV_NAME := Nidus.service
SRV_DIR := /etc/systemd/system
CPP:= g++
INCS:= -I include/
MY_LIBS := -L/usr/lib -lus_th -lus_http -lus_httpclient -lcurl
LIBS := -lpthread -lssl -lcrypto -lboost_program_options -lboost_json -lboost_thread -lboost_filesystem
CPPFLAGS := --std=c++20 -O3 -pipe #-Wall -Werror
BUILD_DIR = build
$(shell mkdir -p $(BUILD_DIR))
#--------
all: ${APP_NAME}.out
${APP_NAME}.out: $(BUILD_DIR)/main.o $(BUILD_DIR)/PPool.o $(BUILD_DIR)/ProcessTask.o $(BUILD_DIR)/HttpTask.o $(BUILD_DIR)/Tttask.o $(BUILD_DIR)/pmc_mtd.o $(BUILD_DIR)/subsys_call.o
$(CPP) $^ $(MY_LIBS) $(LIBS) -o $@
$(BUILD_DIR)/main.o: src/main.cpp
$(CPP) $(CPPFLAGS) -c $^ $(INCS) -o $@
$(BUILD_DIR)/PPool.o: src/main/PPool.cpp
$(CPP) $(CPPFLAGS) -c $^ $(INCS) -o $@
$(BUILD_DIR)/ProcessTask.o: src/main/ProcessTask.cpp
$(CPP) $(CPPFLAGS) -c $^ $(INCS) -o $@
$(BUILD_DIR)/Tttask.o: src/main/Tttask.cpp
$(CPP) $(CPPFLAGS) -c $^ $(INCS) -o $@
$(BUILD_DIR)/HttpTask.o: src/main/HttpTask.cpp
$(CPP) $(CPPFLAGS) -c $^ $(INCS) -o $@
$(BUILD_DIR)/pmc_mtd.o: src/main/pmc_mtd.cpp
$(CPP) $(CPPFLAGS) -c $^ $(INCS) -o $@
$(BUILD_DIR)/subsys_call.o: src/main/subsys_call.cpp
$(CPP) $(CPPFLAGS) -c $^ $(INCS) -o $@
install: $(APP_NAME).out
@echo "正在安装 $(APP_NAME) 到$(INSTL_DIRS)"
@
#@mkdir -p $(INSTL_DIRS)
@cp -f $(APP_NAME).out $(INSTL_DIRS)/$(APP_NAME)
#@chmod 755 $(INSTL_DIRS)/pmcd
@
@echo "正在配置 $(APP_NAME)"
@mkdir -p $(CONF_DIR)
@cp $(CONF_NAME) $(CONF_DIR)/$(CONF_NAME)
@cp $(SRV_NAME) $(SRV_DIR)/$(SRV_NAME)
@systemctl daemon-reload
@systemctl enable $(SRV_NAME)
@systemctl restart $(SRV_NAME)
@
@echo "安装完成!"
uninstall:
@echo "正在从 $(INSTL_DIRS) 卸载 $(APP_NAME)"
@
@rm -f $(INSTL_DIRS)/$(APP_NAME)
@rm -f $(CONF_DIRS)/$(CONF_NAME)
@rm -f -d ${CONF_DIRS}
@
@systemctl stop $(SRV_NAME)
@systemctl disable $(SRV_NAME)
@rm -f $(SRV_DIRS)/$(SRV_NAME)
@systemctl daemon-reload
@
@echo "卸载完成!"
clear:
@rm -rvf $(BUILD_DIR)
@rm -vf *.out