Skip to content

Commit

Permalink
0.9.9.16
Browse files Browse the repository at this point in the history
#####
1. 更新脚本

#####
  • Loading branch information
Xingsandesu committed Jan 21, 2024
1 parent cf2b8fb commit 8475628
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
3 changes: 0 additions & 3 deletions .shell/get-taichi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1031,12 +1031,9 @@ echo "9. 使用Docker安装(AMD64, ARM64 如果遇到没有对应glibc库,使用
echo "10. 源码安装(适用于所有架构, 推荐)"
echo "11. 源码更新"
echo "12. 查看状态"
echo "13. [DEBUG]更改Docker路径配置"
echo "14. 群晖或者OpenWRT等应用安装路径错误修复"
echo "========================"
echo "优先使用源码安装"
echo "群晖或者OpenWRT使用Docker安装"
echo "群晖或者OpenWRT使用Docker安装注册完成后使用14更新路径"
echo "========================"

read -p "请输入你的选择(1-12):" operation
Expand Down
11 changes: 9 additions & 2 deletions async_app/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,19 @@
import tornado.web
from aiodocker import Docker

from core.config import SOURCE_URL, DOCKER_DATA_PATH
from core.config import SOURCE_URL
from core.models import client

CODE_YES = 200 # 操作成功的响应码
CODE_NO = 400 # 操作失败的响应码

# 获取 Docker 数据路径
def get_docker_data_path():
docker_info = client.info()
return docker_info.get('DockerRootDir')

# 使用 Docker 数据路径
docker_data_path = get_docker_data_path()

def create_api_response(handler: tornado.web.RequestHandler, code: int, errmsg: any = '', data: any = None):
"""
Expand Down Expand Up @@ -129,7 +136,7 @@ async def post(self, id):
image,
name=name,
ports={k: (None, v) for k, v in ports.items()},
volumes={f"{DOCKER_DATA_PATH}/volumes/{v}/_data{details['bind']}": {'bind': details['bind'],
volumes={f"{docker_data_path}/volumes/{v}/_data{details['bind']}": {'bind': details['bind'],
'mode': details['mode']} for v, details
in volumes.items()} if volumes else {},
restart_policy=restart_policy,
Expand Down
7 changes: 4 additions & 3 deletions core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
# 构造 config.json 文件的完整路径
config_path = os.path.join(os.path.dirname(argv[0]), 'config.json')



# 定义默认值
default_data = {
'source_url': 'https://app.kookoo.top',
'docker_data_path':'/var/lib/docker',
'docker_download_url': 'https://download.docker.com/linux/static/stable/x86_64/docker-24.0.7.tgz',
'docker_service_config': (
"[Unit]\n"
Expand Down Expand Up @@ -59,7 +60,7 @@
DOCKER_DOWNLOAD_URL = data['docker_download_url']
DOCKER_SERVICE_CONFIG = data['docker_service_config']
GET_DOCKER_SHELL_COMMAND = data['get_docker_shell_command']
DOCKER_DATA_PATH = data['docker_data_path']

# @/file 配置文件
HOME_PATH = os.path.abspath('/') # 将路径转化为标准绝对路径
HOME_NAME = os.path.basename(HOME_PATH) # 根目录的名字
Expand Down Expand Up @@ -105,7 +106,7 @@
"""

TAICHI_OS_WELCOME_MESSAGE = ("\n"
"版本 : 0.9.9.12-DEV\n"
"版本 : 0.9.9.16-DEV\n"
"GITHUB : https://github.com/Xingsandesu\n")
# # @/command 配置文件
# commands = {
Expand Down

0 comments on commit 8475628

Please sign in to comment.