完成基础功能

This commit is contained in:
Krcia 2025-12-03 09:54:45 +08:00
parent baefb77dea
commit 6d49237a52
5 changed files with 93 additions and 2 deletions

View File

@ -1,5 +1,24 @@
#!/bin/bash #!/bin/bash
### This script is called after the user installs the application. ### This script is called after the user installs the application.
DELETE_CMD="${TRIM_APPDEST}/certimate superuser delete admin@certimate.fun"
CREATE_CMD="${TRIM_APPDEST}/certimate superuser add ${cer_user} ${cer_pwd}"
echo "正在创建新的管理员账户..."
$DELETE_CMD
if [ $? -eq 0 ]; then
echo "新管理员创建成功"
else
echo "错误:创建新管理员失败"
exit 1 # 如果创建失败,退出并返回错误码
fi
$CREATE_CMD
if [ $? -eq 0 ]; then
echo "新管理员创建成功"
else
echo "错误:创建新管理员失败"
exit 1 # 如果创建失败,退出并返回错误码
fi
exit 0 exit 0

View File

@ -4,7 +4,7 @@ LOG_FILE="${TRIM_PKGVAR}/info.log"
PID_FILE="${TRIM_PKGVAR}/app.pid" PID_FILE="${TRIM_PKGVAR}/app.pid"
# write the command to start your program here # write the command to start your program here
CMD="" CMD="${TRIM_APPDEST}/certimate -serve ${server_address}:8090 --dir ./pb_data"
log_msg() { log_msg() {
echo "$(date '+%Y-%m-%d %H:%M:%S') - $1" >> ${LOG_FILE} echo "$(date '+%Y-%m-%d %H:%M:%S') - $1" >> ${LOG_FILE}

View File

@ -4,7 +4,7 @@ display_name = Certimate
desc = 证书自动化部署方案 desc = 证书自动化部署方案
arch = x86_64 arch = x86_64
source = thirdparty source = thirdparty
maintainer = Krcia maintainer = certimate
distributor = Krcia distributor = Krcia
desktop_uidir = ui desktop_uidir = ui
desktop_applaunchname = certimate.Application desktop_applaunchname = certimate.Application

72
wizard/install.json Normal file
View File

@ -0,0 +1,72 @@
[
{
"stepTitle": "创建管理员",
"items": [
{
"type": "text",
"field": "cer_user",
"label": "邮箱",
"initValue": "admin",
"rules": [
{
"required": true,
"message": "请输入管理员邮箱"
},
{
"pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$",
"message": "邮箱格式错误"
}
]
},
{
"type": "password",
"field": "cer_pwd",
"label": "管理员密码",
"rules": [
{
"required": true,
"message": "请输入管理员密码"
},
{
"min": 8,
"message": "密码长度不能少于8位"
}
]
},
{
"type": "password",
"field": "wizard_admin_password_confirm",
"label": "确认密码",
"rules": [
{
"required": true,
"message": "请确认密码"
}
]
}
]
},
{
"stepTitle": "请选择访问范围",
"type": "select",
"field": "server_address",
"label": "访问范围",
"initValue": "127.0.0.1",
"options": [
{
"label": "127.0.0.1",
"value": "127.0.0.1"
},
{
"label": "0.0.0.0",
"value": "0.0.0.0"
}
],
"rules": [
{
"required": true,
"message": "请选择访问范围"
}
]
}
]