Skip to content

Commit

Permalink
更新配置
Browse files Browse the repository at this point in the history
  • Loading branch information
jianyun8023 committed Aug 5, 2024
1 parent 4abafa0 commit ea96ea8
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 51 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ ENV CALIBRE_STATIC_DIR=/app/static

WORKDIR /app
COPY --from=build /calibre-api ./calibre-api
COPY config.yaml ./config-example.yaml
COPY config.yaml ./config.yaml

COPY --from=app /app/dist/ /app/static

Expand Down
45 changes: 6 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,36 +91,14 @@ curl -X "POST" "http://localhost:8080/index/update" -H 'Content-Type: applicatio
```yaml
address: :8080
debug: false
staticDir: "/app/static"
tmpDir: ".files"
content:
server: https://lib.pve.icu
search:
host: http://127.0.0.1:7700
apikey:
index: books
trimPath: /data/book/calibre/library
storage:
## 选择文件存储的位置 webdav\local\minio
use: webdav
tmpdir: ".files"
## webdav配置
webdav:
host: http://xxxxxx:2344
user: xxxxx
password: "xxxxxxxxxxxxx"
path: /book/calibre/library
## 本地路径
local:
path: /book/calibre/library
## minio s3或者s3兼容存储
minio:
endpoint: xxx
accessKeyID: xxx
secretAccessKey: xxxx
useSSL: true
bucketName: bucket
path: /book/calibre/library




```
### 环境变量
Expand All @@ -130,24 +108,13 @@ storage:
```text
CALIBRE_ADDRESS
CALIBRE_DEBUG
CALIBRE_STATIC_DIR
CALIBRE_TEMPLATE_DIR
CALIBRE_STATICDIR
CALIBRE_TMP_DIR

## search
CALIBRE_SEARCH_HOST
CALIBRE_SEARCH_APIKEY
CALIBRE_SEARCH_INDEX
CALIBRE_SEARCH_TRIMPATH
## storage
CALIBRE_STORAGE_USE
CALIBRE_STORAGE_TMPDIR
## webdav
CALIBRE_STORAGE_WEBDAV_HOST
CALIBRE_STORAGE_WEBDAV_USER
CALIBRE_STORAGE_WEBDAV_PASSWORD
CALIBRE_STORAGE_WEBDAV_PATH
```

## 适配阅读书源
Expand Down
18 changes: 8 additions & 10 deletions docker-compose-yaml → docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,33 +1,31 @@
services:
# main service
calibre-api:
# build:
# context: .
# dockerfile: Dockerfile
restart: unless-stopped
container_name: calibre-api
image: ghcr.io/jianyun8023/calibre-api:latest
volumes:
- /book/calibre/library:/book/calibre/library
ports:
- "8080:8080"
environment:
- TZ=Asia/Shanghai
- CALIBRE_DEBUG=true
- CALIBRE_STATIC_DIR=/app/static
- CALIBRE_TEMPLATE_DIR=/app/templates
- CALIBRE_CONTENT_SERVER=https://lib.pve.icu
- CALIBRE_SEARCH_HOST=http://meilisearch:7700
#- CALIBRE_SEARCH_APIKEY=
- CALIBRE_SEARCH_INDEX=books
- CALIBRE_SEARCH_TRIMPATH=/data/calibre/library
- CALIBRE_STORAGE_USE=local
- CALIBRE_STORAGE_TMPDIR=/tmp
- CALIBRE_STORAGE_LOCAL_PATH=/book/calibre/library
- CALIBRE_TMPDIR=/tmp
depends_on:
- meilisearch
meilisearch:
restart: unless-stopped
container_name: meilisearch
image: getmeili/meilisearch:v1.9
volumes:
- ./meili_data:/meili_data
- meili_data:/meili_data
ports:
- "7700:7700"

volumes:
meili_data:
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func initConfig() *calibre.Config {
viper.AddConfigPath(".")
viper.SetDefault("address", ":8080")
viper.SetDefault("staticDir", "./static")
viper.SetDefault("tmpDir", "./static")
viper.SetDefault("tmpDir", "/tmp")
viper.SetEnvPrefix("CALIBRE")
viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))
viper.AutomaticEnv()
Expand Down

0 comments on commit ea96ea8

Please sign in to comment.