diff --git a/README.md b/README.md index 5ad2403c4..875b3e36a 100644 --- a/README.md +++ b/README.md @@ -12,11 +12,8 @@ English | **[中文文档](./README_CN.md)** ## 📍 Migration from 0.x to 1.x - Please ensure to back up your data before upgrading! -- Change `DB_HOST="${APP_IPPR}.5"` to `DB_HOST=mariadb` in the `.env` file. -- Change `REDIS_HOST="${APP_IPPR}.4"` to `REDIS_HOST=redis` in the `.env` file. -- If you have enabled SSL certificates, change `/etc/nginx/conf.d/site/` to `/var/www/docker/nginx/site/` in the `docker/nginx/site/{xxx}.conf` file. - If the upgrade fails, try running `./cmd update` multiple times. -- If you encounter "Container xxx not found" during upgrade, run `./cmd up` and then execute `./cmd update`. +- If you encounter "Container xxx not found" during upgrade, run `./cmd reup` and then execute `./cmd update`. - If you see a 502 error after upgrading, run `./cmd reup` to restart the services. - If you encounter "Application 'xxx' not installed" after upgrading, log in with the admin account and install the relevant applications from the App Store. diff --git a/README_CN.md b/README_CN.md index bbc7d52c5..682892d5a 100644 --- a/README_CN.md +++ b/README_CN.md @@ -12,11 +12,8 @@ ## 📍 0.x 迁移到 1.x - 升级时请务必备份好数据! -- 将 `.env` 文件的 `DB_HOST="${APP_IPPR}.5"` 改为 `DB_HOST=mariadb`。 -- 将 `.env` 文件的 `REDIS_HOST="${APP_IPPR}.4"` 改为 `REDIS_HOST=redis`。 -- 如果你已经开启了ssl证书,将 `docker/nginx/site/{xxx}.conf` 文件内容 `/etc/nginx/conf.d/site/` 改成 `/var/www/docker/nginx/site/`。 - 如果升级失败请尝试执行 `./cmd update` 重试几次。 -- 如果升级中出现 `没有找到 xxx 容器` 的提示,请运行 `./cmd up` 后再执行 `./cmd update`。 +- 如果升级中出现 `没有找到 xxx 容器` 的提示,请运行 `./cmd reup` 后再执行 `./cmd update`。 - 如果升级后出现502错误请运行 `./cmd reup` 重启服务即可。 - 如果升级后出现 `应用「xxx」未安装` 的提示,请使用管理员账号进入应用商店安装相关应用。 diff --git a/cmd b/cmd index 8e3627154..70959821c 100755 --- a/cmd +++ b/cmd @@ -375,6 +375,11 @@ env_init() { if [ -z "$(env_get APP_IPPR)" ]; then env_set APP_IPPR "10.$(rand 50 100).$(rand 100 200)" fi + if [ -z "$(env_get UPDATE_TIME)" ]; then + env_set DB_HOST "mariadb" + env_set REDIS_HOST "redis" + docker run -it --rm -v ${WORK_DIR}:/www nginx:alpine sh -c "sed -i 's|/etc/nginx/conf.d/site/|/var/www/docker/nginx/site/|g' /www/docker/nginx/site/*.conf &> /dev/null" + fi } # 获取命令参数 @@ -633,6 +638,7 @@ handle_update() { exec_judge "$COMPOSE up -d" "重启服务失败" fi + env_set UPDATE_TIME "$(date +%s)" success "更新完成" } diff --git a/docker-compose.yml b/docker-compose.yml index 3949dd4b8..f1d73e9e5 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -96,7 +96,7 @@ services: appstore: container_name: "dootask-appstore-${APP_ID}" privileged: true - image: "dootask/appstore:0.0.3" + image: "dootask/appstore:0.0.4" volumes: - shared_data:/usr/share/dootask - /var/run/docker.sock:/var/run/docker.sock