From 9711b2386cb4bb8a2a6e374a20bc8ef3d400df3a Mon Sep 17 00:00:00 2001 From: Meng Sen Date: Thu, 17 Jul 2025 18:59:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=BA=94=E7=94=A8=20MaxKB=20?= =?UTF-8?q?=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Meng Sen --- .github/renovate.json | 12 ++++++++++++ apps/maxkb/2.0.0/data.yml | 17 +++++++++++++++++ apps/maxkb/2.0.0/docker-compose.yml | 21 +++++++++++++++++++++ apps/maxkb/2.0.0/envs/default.env | 2 ++ apps/maxkb/2.0.0/envs/global.env | 2 ++ apps/maxkb/2.0.0/scripts/init.sh | 17 +++++++++++++++++ apps/maxkb/2.0.0/scripts/uninstall.sh | 10 ++++++++++ apps/maxkb/2.0.0/scripts/upgrade.sh | 17 +++++++++++++++++ 8 files changed, 98 insertions(+) create mode 100644 apps/maxkb/2.0.0/data.yml create mode 100644 apps/maxkb/2.0.0/docker-compose.yml create mode 100644 apps/maxkb/2.0.0/envs/default.env create mode 100644 apps/maxkb/2.0.0/envs/global.env create mode 100644 apps/maxkb/2.0.0/scripts/init.sh create mode 100644 apps/maxkb/2.0.0/scripts/uninstall.sh create mode 100644 apps/maxkb/2.0.0/scripts/upgrade.sh diff --git a/.github/renovate.json b/.github/renovate.json index c87130d69..6ea483fff 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -256,6 +256,18 @@ "apps/ani-rss/2.*.*/*.yml" ], "allowedVersions": ">=2.0" + }, + { + "matchFileNames": [ + "apps/maxkb/1.*.*/*.yml" + ], + "allowedVersions": "<2.0" + }, + { + "matchFileNames": [ + "apps/maxkb/2.*.*/*.yml" + ], + "allowedVersions": ">=2.0" } ], "prCreation": "immediate" diff --git a/apps/maxkb/2.0.0/data.yml b/apps/maxkb/2.0.0/data.yml new file mode 100644 index 000000000..2c48000c3 --- /dev/null +++ b/apps/maxkb/2.0.0/data.yml @@ -0,0 +1,17 @@ +additionalProperties: + formFields: + - default: "/home/maxkb" + edit: true + envKey: MAXKB_ROOT_PATH + labelZh: 数据持久化路径 + labelEn: Data persistence path + required: true + type: text + - default: 8080 + edit: true + envKey: PANEL_APP_PORT_HTTP + labelZh: WebUI 端口 + labelEn: WebUI port + required: true + rule: paramPort + type: number diff --git a/apps/maxkb/2.0.0/docker-compose.yml b/apps/maxkb/2.0.0/docker-compose.yml new file mode 100644 index 000000000..8a479f365 --- /dev/null +++ b/apps/maxkb/2.0.0/docker-compose.yml @@ -0,0 +1,21 @@ +networks: + 1panel-network: + external: true +services: + maxkb: + image: 1panel/maxkb:v2.0.0 + container_name: ${CONTAINER_NAME} + labels: + createdBy: "Apps" + restart: always + networks: + - 1panel-network + ports: + - ${PANEL_APP_PORT_HTTP}:8080 + env_file: + - ${GLOBAL_ENV_FILE:-/etc/1panel/envs/global.env} + - ${ENV_FILE:-/etc/1panel/envs/default.env} + volumes: + - ${MAXKB_ROOT_PATH}/data:/var/lib/postgresql/data + - ${MAXKB_ROOT_PATH}/python-packages:/opt/maxkb/app/sandbox/python-packages + - ${MAXKB_ROOT_PATH}/local_embedding:/opt/maxkb/model/local_embedding diff --git a/apps/maxkb/2.0.0/envs/default.env b/apps/maxkb/2.0.0/envs/default.env new file mode 100644 index 000000000..cd05f46e6 --- /dev/null +++ b/apps/maxkb/2.0.0/envs/default.env @@ -0,0 +1,2 @@ +# copyright© 2024 XinJiang Ms Studio +ENV_FILE=.env diff --git a/apps/maxkb/2.0.0/envs/global.env b/apps/maxkb/2.0.0/envs/global.env new file mode 100644 index 000000000..e10989fe4 --- /dev/null +++ b/apps/maxkb/2.0.0/envs/global.env @@ -0,0 +1,2 @@ +# copyright© 2024 XinJiang Ms Studio +TZ=Asia/Shanghai diff --git a/apps/maxkb/2.0.0/scripts/init.sh b/apps/maxkb/2.0.0/scripts/init.sh new file mode 100644 index 000000000..07fb8c3fe --- /dev/null +++ b/apps/maxkb/2.0.0/scripts/init.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +if [ -f .env ]; then + source .env + + # setup-1 add default values + CURRENT_DIR=$(pwd) + sed -i '/^ENV_FILE=/d' .env + sed -i '/^GLOBAL_ENV_FILE=/d' .env + echo "ENV_FILE=${CURRENT_DIR}/.env" >> .env + echo "GLOBAL_ENV_FILE=${CURRENT_DIR}/envs/global.env" >> .env + + echo "Check Finish." + +else + echo "Error: .env file not found." +fi diff --git a/apps/maxkb/2.0.0/scripts/uninstall.sh b/apps/maxkb/2.0.0/scripts/uninstall.sh new file mode 100644 index 000000000..c86c4fbca --- /dev/null +++ b/apps/maxkb/2.0.0/scripts/uninstall.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +if [ -f .env ]; then + source .env + + echo "Check Finish." + +else + echo "Error: .env file not found." +fi diff --git a/apps/maxkb/2.0.0/scripts/upgrade.sh b/apps/maxkb/2.0.0/scripts/upgrade.sh new file mode 100644 index 000000000..07fb8c3fe --- /dev/null +++ b/apps/maxkb/2.0.0/scripts/upgrade.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +if [ -f .env ]; then + source .env + + # setup-1 add default values + CURRENT_DIR=$(pwd) + sed -i '/^ENV_FILE=/d' .env + sed -i '/^GLOBAL_ENV_FILE=/d' .env + echo "ENV_FILE=${CURRENT_DIR}/.env" >> .env + echo "GLOBAL_ENV_FILE=${CURRENT_DIR}/envs/global.env" >> .env + + echo "Check Finish." + +else + echo "Error: .env file not found." +fi