Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,68 @@ cp wrangler.jsonc.example wrangler.jsonc
```


### Docker部署
#### 拉取镜像
```
docker pull openlistteam/openlist_api_server
```
or
```
docker pull ghcr.io/openlistteam/openlist_api_server:latest
```
#### 启动项目
```
docker run -d --name oplist-api-server \
-p 3000:3000 \
-e OPLIST_MAIN_URLS="api.example.com" \
-e OPLIST_ONEDRIVE_UID= `#optional` \
-e OPLIST_ONEDRIVE_KEY= `#optional` \
-e OPLIST_ALICLOUD_UID= `#optional` \
-e OPLIST_ALICLOUD_KEY= `#optional` \
-e OPLIST_BAIDUYUN_UID= `#optional` \
-e OPLIST_BAIDUYUN_KEY= `#optional` \
-e OPLIST_BAIDUYUN_EXT= `#optional` \
-e OPLIST_CLOUD115_UID= `#optional` \
-e OPLIST_CLOUD115_KEY= `#optional` \
-e OPLIST_GOOGLEUI_UID= `#optional` \
-e OPLIST_GOOGLEUI_KEY= `#optional` \
-e OPLIST_YANDEXUI_UID= `#optional` \
-e OPLIST_YANDEXUI_KEY= `#optional` \
-e OPLIST_DROPBOXS_UID= `#optional` \
-e OPLIST_DROPBOXS_KEY= `#optional` \
-e OPLIST_QUARKPAN_UID= `#optional` \
-e OPLIST_QUARKPAN_KEY= `#optional` \
openlistteam/openlist_api_server:latest
```
- 可以替换镜像为ghcr:
```
ghcr.io/openlistteam/openlist_api_server:latest
```
- **请务必根据下面的环境变量,修改你使用的环境变量**

#### 环境变量说明

| 变量名称 | 必要 | 变量类型 | 变量说明 |
| -------------- | ---- | -------- | --------------------------------- |
| `OPLIST_MAIN_URLS` | 是 | string | 绑定主域名,示例:api.example.com |
| `OPLIST_ONEDRIVE_UID` | 否 | string | OneDrive 客户端ID |
| `OPLIST_ONEDRIVE_KEY` | 否 | string | OneDrive 客户端密钥 |
| `OPLIST_ALICLOUD_UID` | 否 | string | 阿里云盘开发者AppID |
| `OPLIST_ALICLOUD_KEY` | 否 | string | 阿里云盘开发者AppKey |
| `OPLIST_BAIDUYUN_UID` | 否 | string | 百度网盘应用密钥AppKey |
| `OPLIST_BAIDUYUN_KEY` | 否 | string | 百度网盘应用密钥SecretKey |
| `OPLIST_BAIDUYUN_EXT` | 否 | string | 百度网盘应用ext |
| `OPLIST_CLOUD115_UID` | 否 | string | 115网盘应用ID |
| `OPLIST_CLOUD115_KEY` | 否 | string | 115网盘应用密钥 |
| `OPLIST_GOOGLEUI_UID` | 否 | string | 谷歌客户端ID |
| `OPLIST_GOOGLEUI_KEY` | 否 | string | 谷歌全局API Key |
| `OPLIST_YANDEXUI_UID` | 否 | string | Yandex应用ID |
| `OPLIST_YANDEXUI_KEY` | 否 | string | Yandex应用密钥 |
| `OPLIST_DROPBOXS_UID` | 否 | string | Dropboxx应用ID |
| `OPLIST_DROPBOXS_KEY` | 否 | string | Dropbox应用密钥 |
| `OPLIST_QUARKPAN_UID` | 否 | string | 夸克云盘x应用ID |
| `OPLIST_QUARKPAN_KEY` | 否 | string | 夸克云盘应用密钥 |


### 变量说明

Expand All @@ -77,6 +139,7 @@ cp wrangler.jsonc.example wrangler.jsonc
| `alicloud_key` | 否 | string | 阿里云盘开发者AppKey |
| `baiduyun_uid` | 否 | string | 百度网盘应用密钥AppKey |
| `baiduyun_key` | 否 | string | 百度网盘应用密钥SecretKey |
| `baiduyun_ext` | 否 | string | 百度网盘应用ext |
| `cloud115_uid` | 否 | string | 115网盘应用ID |
| `cloud115_key` | 否 | string | 115网盘应用密钥 |
| `googleui_uid` | 否 | string | 谷歌客户端ID |
Expand Down
10 changes: 5 additions & 5 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,18 @@ else
sed -i "s|\"baiduyun_ext\":.*|\"baiduyun_ext\": \"${OPLIST_BAIDUYUN_EXT}\",|" ./wrangler.jsonc
fi
#替换目录下wrangler文件中的cloud115_uid
if [ -z "${OPLIST_cloud115_uid}" ]; then
if [ -z "${OPLIST_CLOUD115_UID}" ]; then
echo "cloud115_uid is not set, skipping replacement."
else
echo "Replacing cloud115_uid in wrangler file..."
sed -i "s|\"cloud115_uid\":.*|\"cloud115_uid\": \"${OPLIST_cloud115_uid}\",|" ./wrangler.jsonc
sed -i "s|\"cloud115_uid\":.*|\"cloud115_uid\": \"${OPLIST_CLOUD115_UID}\",|" ./wrangler.jsonc
fi
#替换目录下wrangler文件中的115cloud_key
if [ -z "${OPLIST_115CLOUD_KEY}" ]; then
echo "115CLOUD_KEY is not set, skipping replacement."
if [ -z "${OPLIST_CLOUD115_KEY}" ]; then
echo "CLOUD_KEY115 is not set, skipping replacement."
else
echo "Replacing 115cloud_key in wrangler file..."
sed -i "s|\"115cloud_key\":.*|\"115cloud_key\": \"${OPLIST_115CLOUD_KEY}\",|" ./wrangler.jsonc
sed -i "s|\"cloud115_key\":.*|\"cloud115_key\": \"${OPLIST_CLOUD115_KEY}\",|" ./wrangler.jsonc
fi
#替换目录下wrangler文件中的googleui_uid
if [ -z "${OPLIST_GOOGLEUI_UID}" ]; then
Expand Down
Loading