Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

fix uploads dir

aichy126407e29f63dfc
diff --git a/.gitignore b/.gitignore
index 5f313528..84af0c17 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,7 +9,7 @@
/.fleet
/.vscode/*.log
/cmd/answer/*.sh
-/cmd/answer/upfiles/*
+/cmd/answer/uploads/*
/cmd/logs
/configs/config-dev.yaml
/go.work*
diff --git a/Dockerfile b/Dockerfile
index 8b55d58f..ac06839a 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -29,7 +29,7 @@ RUN apk --no-cache add build-base git \
&& make clean build \
&& cp answer /usr/bin/answer
-RUN mkdir -p /data/upfiles && chmod 777 /data/upfiles \
+RUN mkdir -p /data/uploads && chmod 777 /data/uploads \
&& mkdir -p /data/i18n && cp -r i18n/*.yaml /data/i18n
# stage3 copy the binary and resource files into fresh container
diff --git a/INSTALL.md b/INSTALL.md
index 0d3969d2..7bc307b5 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -91,7 +91,7 @@ swaggerui:
service_config:
secret_key: "answer" #encryption key
web_host: "http://127.0.0.1" #Page access using domain name address
- upload_path: "./upfiles" #upload directory
+ upload_path: "./uploads" #upload directory
```
## Compile the image
@@ -100,4 +100,4 @@ If you have modified the source files and want to repackage the image, you can u
docker build -t answer:v1.0.0 .
```
## common problem
- 1. The project cannot be started: the main program startup depends on proper configuraiton of the configuration file, `config.yaml`, as well as the internationalization translation directory (`i18n`), and the upload file storage directory (`upfiles`). Ensure that the configuration file is loaded when the project starts, such as when using `answer run -c config.yaml` and that the `config.yaml` correctly specifies the i18n and upfiles directories.
+ 1. The project cannot be started: the main program startup depends on proper configuraiton of the configuration file, `config.yaml`, as well as the internationalization translation directory (`i18n`), and the upload file storage directory (`uploads`). Ensure that the configuration file is loaded when the project starts, such as when using `answer run -c config.yaml` and that the `config.yaml` correctly specifies the i18n and uploads directories.
diff --git a/INSTALL_CN.md b/INSTALL_CN.md
index 300851a2..ec855e94 100644
--- a/INSTALL_CN.md
+++ b/INSTALL_CN.md
@@ -94,7 +94,7 @@ swaggerui:
service_config:
secret_key: "answer" #加密key
web_host: "http://127.0.0.1" #页面访问使用域名地址
- upload_path: "./upfiles" #上传目录
+ upload_path: "./uploads" #上传目录
```
## 编译镜像
@@ -103,4 +103,4 @@ service_config:
docker build -t answer:v1.0.0 .
```
## 常见问题
- 1. 项目无法启动,answer 主程序启动依赖配置文件 config.yaml 、国际化翻译目录 /i18n 、上传文件存放目录 /upfiles,需要确保项目启动时加载了配置文件 answer run -c config.yaml 以及在 config.yaml 正确的指定 i18n 和 upfiles 目录的配置项
+ 1. 项目无法启动,answer 主程序启动依赖配置文件 config.yaml 、国际化翻译目录 /i18n 、上传文件存放目录 /uploads answer run -c config.yaml 以及在 config.yaml 正确的指定 i18n 和 uploads 目录的配置项
diff --git a/configs/config.yaml b/configs/config.yaml
index 6830048f..8032deed 100644
--- a/configs/config.yaml
+++ b/configs/config.yaml
@@ -17,4 +17,4 @@ swaggerui:
service_config:
secret_key: "answer"
web_host: "http://127.0.0.1:9080"
- upload_path: "/data/upfiles"
+ upload_path: "/data/uploads"
diff --git a/internal/cli/install.go b/internal/cli/install.go
index 8c8ee64f..28b9966e 100644
--- a/internal/cli/install.go
+++ b/internal/cli/install.go
@@ -17,7 +17,7 @@ const (
var (
ConfigFilePath = "/conf/"
- UploadFilePath = "/upfiles/"
+ UploadFilePath = "/uploads/"
I18nPath = "/i18n/"
)