diff --git a/.env.versions b/.env.versions index 6b17219..e0eab44 100644 --- a/.env.versions +++ b/.env.versions @@ -1,5 +1,5 @@ # 本项目版本 -PROJECT_VERSION=0.7.0 +PROJECT_VERSION=0.7.1 #=== start === gui-base images ========================== @@ -7,10 +7,10 @@ PROJECT_VERSION=0.7.0 GUI_BASE_VERSION=0.4.0 # `stainless403/mdcx-builtin-gui-base`镜像版本 -GUI_BASE_MDCX_BUILTIN_VERSION=120231219 +GUI_BASE_MDCX_BUILTIN_VERSION=120231226 # `stainless403/mdcx-src-gui-base`镜像版本 -GUI_BASE_MDCX_SRC_VERSION=0.2.0 +GUI_BASE_MDCX_SRC_VERSION=0.2.1 #=== end === gui-base images ========================== @@ -21,10 +21,10 @@ GUI_BASE_MDCX_SRC_VERSION=0.2.0 WEBTOP_BASE_VERSION=0.1.2 # `stainless403/mdcx-builtin-webtop-base`镜像版本 -WEBTOP_BASE_MDCX_BUILTIN_VERSION=120231219 +WEBTOP_BASE_MDCX_BUILTIN_VERSION=120231226 # `stainless403/mdcx-src-webtop-base`镜像版本 -WEBTOP_BASE_MDCX_SRC_VERSION=0.2.0 +WEBTOP_BASE_MDCX_SRC_VERSION=0.2.1 #=== end === webtop-base images ========================== @@ -35,10 +35,10 @@ WEBTOP_BASE_MDCX_SRC_VERSION=0.2.0 BUILD_MDCX_BASE_VERSION=0.4.0 # `stainless403/build-mdcx`镜像版本 -BUILD_MDCX_VERSION=120231219 +BUILD_MDCX_VERSION=120231226 #=== end === build-mdcx images ========================== # MDCx最新版本 -MDCX_APP_VERSION=120231219 \ No newline at end of file +MDCX_APP_VERSION=120231226 \ No newline at end of file diff --git a/README.md b/README.md index 20af10f..fe4dca5 100644 --- a/README.md +++ b/README.md @@ -246,7 +246,4 @@ docker run -d --name mdcx \ ## FAQ -请查看 [FAQ](https://github.com/northsea4/mdcx-docker/blob/main/FAQ.md) - -## TODOs -- [ ] 更新部署文档 \ No newline at end of file +请查看 [FAQ](https://github.com/northsea4/mdcx-docker/blob/main/FAQ.md) \ No newline at end of file diff --git a/gui-base/mdcx-builtin.md b/gui-base/mdcx-builtin.md index 6f80005..f7e47bd 100644 --- a/gui-base/mdcx-builtin.md +++ b/gui-base/mdcx-builtin.md @@ -121,6 +121,8 @@ mkdir -p $MDCX_DOCKER_DIR && cd $MDCX_DOCKER_DIR mkdir -p mdcx-config logs data # 必须:配置文件目录标记文件 echo "/mdcx-config/config.ini" > mdcx-config/MDCx.config +# 确保有config.ini文件 +touch mdcx-config/config.ini docker run -d --name mdcx \ -p 5800:5800 `#Web访问端口` \ diff --git a/gui-base/mdcx-src.md b/gui-base/mdcx-src.md index 378bd5a..4d9bcc0 100644 --- a/gui-base/mdcx-src.md +++ b/gui-base/mdcx-src.md @@ -5,8 +5,6 @@ > 优点是`轻量`,缺点是只支持通过网页查看,且没有文件管理。 -> ⚠️ 请注意,因为上游项目已删库,所以已不支持部署`mdcx-src-gui-base`镜像。 - ## 1. mdcx-src示例 @@ -48,15 +46,12 @@ bash -c "$(wget https://raw.githubusercontent.com/northsea4/mdcx-docker/main/ins ``` mdcx-docker |-- app ------应用源码目录 - |-- Data - |-- Function - |-- Getter - |-- Img - |-- LICENSE - |-- MDCx_Main.py + |-- libs + |-- resources + |-- src + |-- main.py |-- requirements.txt |-- setup.py - |-- Ui ... |-- data ------容器系统数据 ... diff --git a/gui-base/update-src.sh b/gui-base/update-src.sh index a668613..adf6cc3 100755 --- a/gui-base/update-src.sh +++ b/gui-base/update-src.sh @@ -107,6 +107,20 @@ compareVersion () { return 0 } +# 从`appPath/config.ini.default`获取应用版本 +# [modified_time] +# modified_time = 2023-12-19 23:53:41 +# version = 120231219 +getAppVersionFromConfig () { + local configPath="$1" + if [[ -f "$configPath" ]]; then + local version=$(cat $configPath | grep -oi 'version\s*=\s*[0-9]\+' | grep -oi '[0-9]\+$') + echo $version + else + echo 0 + fi +} + appPath=$(echo "$appPath" | sed 's:/*$::') isEmpty=0 @@ -115,14 +129,13 @@ if [[ -n "${appPath}" ]]; then echo "⚠️ $appPath 不存在,现在创建" mkdir -p $appPath else - if [[ -f "$appPath/setup.py" ]]; then - # 'CFBundleShortVersionString': "20230201", - appVersion=$(cat $appPath/setup.py | grep -oi 'CFBundleShortVersionString.: "[a-z0-9]\+' | grep -oi '[a-z0-9]\+$') - echo "ℹ️ 从 $appPath/setup.py 检测到应用版本为 $appVersion" - else + appConfigPath="$appPath/config.ini.default" + appVersion=$(getAppVersionFromConfig "$appConfigPath") + if [[ $appVersion == 0 ]]; then isEmpty=1 - appVersion=0 echo "ℹ️ 本地应用版本: $appVersion" + else + echo "ℹ️ 从 $appConfigPath 检测到应用版本为 $appVersion" fi fi else diff --git a/webtop-base/mdcx-builtin.md b/webtop-base/mdcx-builtin.md index db70993..0474d10 100644 --- a/webtop-base/mdcx-builtin.md +++ b/webtop-base/mdcx-builtin.md @@ -131,6 +131,8 @@ mkdir -p $MDCX_DOCKER_DIR && cd $MDCX_DOCKER_DIR mkdir -p mdcx-config logs data # 必须:配置文件目录标记文件 echo "/mdcx-config/config.ini" > mdcx-config/MDCx.config +# 确保有config.ini文件 +touch mdcx-config/config.ini docker run -d --name mdcx \ -p 3000:3000 `#Web访问端口` \ diff --git a/webtop-base/mdcx-src.md b/webtop-base/mdcx-src.md index e8ad87e..e8585af 100644 --- a/webtop-base/mdcx-src.md +++ b/webtop-base/mdcx-src.md @@ -5,8 +5,6 @@ > 优点是`远程桌面`、`文件管理`和`浏览器`,缺点是资源占用相对高一些,上手难度也稍高。 -> ⚠️ 请注意,因为上游项目已删库,所以已不支持部署`mdcx-src-webtop-base`镜像。 - ## 1. mdcx-src示例 @@ -46,15 +44,12 @@ bash -c "$(wget https://raw.githubusercontent.com/northsea4/mdcx-docker/main/ins ``` mdcx-docker |-- app ------应用源码目录 - |-- Data - |-- Function - |-- Getter - |-- Img - |-- LICENSE - |-- MDCx_Main.py + |-- libs + |-- resources + |-- src + |-- main.py |-- requirements.txt |-- setup.py - |-- Ui ... |-- data ------容器系统数据 ... diff --git a/webtop-base/rootfs-src/app-assets/scripts/update-src.sh b/webtop-base/rootfs-src/app-assets/scripts/update-src.sh index d69f357..aba3be5 100755 --- a/webtop-base/rootfs-src/app-assets/scripts/update-src.sh +++ b/webtop-base/rootfs-src/app-assets/scripts/update-src.sh @@ -105,16 +105,30 @@ compareVersion () { return 0 } +# 从`appPath/config.ini.default`获取应用版本 +# [modified_time] +# modified_time = 2023-12-19 23:53:41 +# version = 120231219 +getAppVersionFromConfig () { + local configPath="$1" + if [[ -f "$configPath" ]]; then + local version=$(cat $configPath | grep -oi 'version\s*=\s*[0-9]\+' | grep -oi '[0-9]\+$') + echo $version + else + echo 0 + fi +} + appPath=$(echo "$appPath" | sed 's:/*$::') -if [[ -f "$appPath/setup.py" ]]; then - # 'CFBundleShortVersionString': "20230201", - appVersion=$(cat $appPath/setup.py | grep -oi 'CFBundleShortVersionString.: "[a-z0-9]\+' | grep -oi '[a-z0-9]\+$') - echo "ℹ️ 从 $appPath/setup.py 检测到应用版本为 $appVersion" +appConfigPath="$appPath/config.ini.default" +appVersion=$(getAppVersionFromConfig "$appConfigPath") +if [[ $appVersion == 0 ]]; then + isEmpty=1 + echo "ℹ️ 本地应用版本: $appVersion" else - echo "⚠️ 应用源码目录下没有setup.py文件!" - appVersion=0 + echo "ℹ️ 从 $appConfigPath 检测到应用版本为 $appVersion" fi _url="https://api.github.com/repos/sqzw-x/mdcx/releases/latest" diff --git a/webtop-base/update-src.sh b/webtop-base/update-src.sh index 4c7f1fd..4cac9f7 100755 --- a/webtop-base/update-src.sh +++ b/webtop-base/update-src.sh @@ -107,6 +107,20 @@ compareVersion () { return 0 } +# 从`appPath/config.ini.default`获取应用版本 +# [modified_time] +# modified_time = 2023-12-19 23:53:41 +# version = 120231219 +getAppVersionFromConfig () { + local configPath="$1" + if [[ -f "$configPath" ]]; then + local version=$(cat $configPath | grep -oi 'version\s*=\s*[0-9]\+' | grep -oi '[0-9]\+$') + echo $version + else + echo 0 + fi +} + appPath=$(echo "$appPath" | sed 's:/*$::') isEmpty=0 @@ -115,14 +129,13 @@ if [[ -n "${appPath}" ]]; then echo "⚠️ $appPath 不存在,现在创建" mkdir -p $appPath else - if [[ -f "$appPath/setup.py" ]]; then - # 'CFBundleShortVersionString': "20230201", - appVersion=$(cat $appPath/setup.py | grep -oi 'CFBundleShortVersionString.: "[a-z0-9]\+' | grep -oi '[a-z0-9]\+$') - echo "ℹ️ 从 $appPath/setup.py 检测到应用版本为 $appVersion" - else + appConfigPath="$appPath/config.ini.default" + appVersion=$(getAppVersionFromConfig "$appConfigPath") + if [[ $appVersion == 0 ]]; then isEmpty=1 - appVersion=0 echo "ℹ️ 本地应用版本: $appVersion" + else + echo "ℹ️ 从 $appConfigPath 检测到应用版本为 $appVersion" fi fi else