Compare commits

..

65 Commits

Author SHA1 Message Date
Xhofe 3ccf5ee620 fix: ipa plist key 2022-03-05 15:33:04 +08:00
Xhofe b44243c021 feat: ipa name decode 2022-03-05 15:13:19 +08:00
foxxorcat 4ae81b5a79 feat: aliyundrive fast upload (#652) 2022-03-05 13:14:57 +08:00
Xhofe 189f4c19a5 release: release v2.1.1 2022-03-04 21:00:39 +08:00
Xhofe 92a3d74af5 chore: Merge pull request #675 from Xhofe/all-contributors/add-vg-land [skip ci]
docs: add vg-land as a contributor for code
2022-03-04 20:16:17 +08:00
allcontributors[bot] bb73a10332 docs: update .all-contributorsrc [skip ci] 2022-03-04 12:14:55 +00:00
allcontributors[bot] 3baf1e8c7b docs: update README_cn.md [skip ci] 2022-03-04 12:14:54 +00:00
allcontributors[bot] fdb49f5fb4 docs: update README.md [skip ci] 2022-03-04 12:14:53 +00:00
Xhofe 2eedcc1626 feat: opus preview (#638) 2022-03-04 10:05:15 +08:00
Xhofe 6faecbd5d8 feat: add cache for xunlei 2022-03-04 09:55:37 +08:00
Xhofe 34ed05c62f style: go mod tidy 2022-03-04 09:52:08 +08:00
Xhofe ce83d6eb40 build: fix dev build 2022-03-04 09:50:47 +08:00
Xhofe 2271cb6c7c docs: replace preview image [skip ci] 2022-03-03 23:30:45 +08:00
allcontributors[bot] a42b30c96e docs: update .all-contributorsrc [skip ci] 2022-03-03 23:28:37 +08:00
allcontributors[bot] ce25d16222 docs: update README_cn.md [skip ci] 2022-03-03 23:28:37 +08:00
allcontributors[bot] b392e093e3 docs: update README.md [skip ci] 2022-03-03 23:28:37 +08:00
allcontributors[bot] 0d5b7298db docs: update .all-contributorsrc [skip ci] 2022-03-03 23:27:19 +08:00
allcontributors[bot] 2063ebb74d docs: update README_cn.md [skip ci] 2022-03-03 23:27:19 +08:00
allcontributors[bot] 0408d7ab5d docs: update README.md [skip ci] 2022-03-03 23:27:19 +08:00
allcontributors[bot] d52451f9d2 docs: update .all-contributorsrc [skip ci] 2022-03-03 23:24:46 +08:00
allcontributors[bot] ca9f77006a docs: update README_cn.md [skip ci] 2022-03-03 23:24:46 +08:00
allcontributors[bot] e8e8d925f3 docs: update README.md [skip ci] 2022-03-03 23:24:46 +08:00
Xhofe 623aab4c28 docs: move all contributors 2022-03-03 23:17:13 +08:00
allcontributors[bot] 3bc81d471e docs: create .all-contributorsrc [skip ci] 2022-03-03 23:00:34 +08:00
allcontributors[bot] dfddb5cfa1 docs: update README.md [skip ci] 2022-03-03 23:00:34 +08:00
Xhofe 80f5bde0cb build: just upx linux/amd64 2022-03-03 19:44:13 +08:00
Xhofe 9de072161e docs: add xunlei cloud (#659) 2022-03-03 19:38:59 +08:00
Xhofe d08a7440bc 🎇 import uss 2022-03-03 19:33:40 +08:00
Xhofe 7a4bb2496d ✨ add welcome bot 2022-03-03 19:16:30 +08:00
Xhofe f68ab40d26 🔀 Merge pull request #659 from foxxorcat/dev
✨ xunleicloud support
2022-03-03 17:03:23 +08:00
Xhofe 796d490fb7 :bug: fix #658 onedrive file/folder judge 2022-03-03 16:01:24 +08:00
foxxorcat 2964d5a6db xunleicloud support 2022-03-03 15:45:33 +08:00
Xhofe 90b57dacee 🎇 remove set Content-Type for native 2022-03-02 19:27:40 +08:00
Xhofe 6af17e2509 🔒 fix #645 xss vulnerability 2022-03-01 20:09:25 +08:00
Xhofe 5193b2aa7d 🎨 fix some warning 2022-02-27 20:28:42 +08:00
Xhofe 3f644f07db ✏️ fix readme logo 2022-02-27 20:26:05 +08:00
Xhofe d988f98b81 💚 fix upx 2022-02-26 00:12:00 +08:00
Xhofe 10634c7b77 👷 add build for macos 2022-02-25 23:59:27 +08:00
Xhofe 135d505192 ⏪ back to cgo sqlite3 2022-02-25 23:55:57 +08:00
Xhofe 3f2be8a6ca 🔧 change default assets path 2022-02-25 22:08:12 +08:00
Xhofe 79bef09ee7 🔀 Merge branch 'feature/upyun' into dev 2022-02-25 21:06:49 +08:00
Xhofe 3534f6afac 💚 fix cal md5 2022-02-24 23:07:35 +08:00
Xhofe 106c1d069c 💚 change build platform 2022-02-24 22:55:50 +08:00
Xhofe 8ed0afe80d 🎇 add unupx version 2022-02-24 22:42:15 +08:00
Xhofe 6a6e3944d5 🔀 Merge branch 'feature/purego' into dev 2022-02-24 16:26:20 +08:00
Xhofe 94d5b5e47e ✨ direct but proxy types 2022-02-24 16:25:17 +08:00
Xhofe e61b0f8e34 :fire: remove cgo to pure go 2022-02-24 16:08:49 +08:00
Xhofe f7fbe1de6c 👷 build for all branch 2022-02-23 20:17:50 +08:00
Xhofe 01de01630e :fire: remove placeholder for uss 2022-02-23 20:16:57 +08:00
Xhofe f9f92e2198 ✏️ fix typo 2022-02-23 20:13:52 +08:00
Xhofe 7d5f50b04a 👷 build for all branch 2022-02-23 20:12:21 +08:00
Xhofe 72b5d25e4c ✏️ fix label typo 2022-02-23 20:07:45 +08:00
Xhofe cae7f36531 🎇 refresh one folder 2022-02-23 19:16:33 +08:00
Xhofe aa79f49e25 :bug: fix #600 aliyundrive move file 2022-02-23 14:56:17 +08:00
Xhofe b4ad301d53 :bug: fix #599 lanzou url without password 2022-02-23 11:18:51 +08:00
Xhofe 00ed54c4c9 ✨ upyun uss support 2022-02-23 11:07:19 +08:00
Xhofe ffa52794db 🍺 change login http method 2022-02-22 15:57:39 +08:00
Xhofe 24058d0c36 💚 fix dev build 2022-02-21 21:47:40 +08:00
Xhofe 641ca67671 💚 fix web replace 2022-02-21 20:31:01 +08:00
Xhofe 52ee2e0a8b :bug: close #581 teambition update time error 2022-02-21 17:20:05 +08:00
Xhofe 724fc7f37e 💚 fix build web 2022-02-20 16:46:47 +08:00
Xhofe 9d279b104b ✨ dynamic public path 2022-02-20 15:14:18 +08:00
Xhofe eb61f70164 :bug: fix show balance account 2022-02-20 13:06:59 +08:00
Xhofe b3a8201768 :bug: fix that only two accounts can be load balanced 2022-02-19 21:49:37 +08:00
Xhofe 185795954b 🔊 add reason of failed to auto migrate model 2022-02-19 17:25:50 +08:00
41 changed files with 1581 additions and 177 deletions
+54
View File
@@ -0,0 +1,54 @@
{
"files": [
"README.md",
"README_cn.md"
],
"imageSize": 100,
"commit": false,
"contributors": [
{
"login": "Xhofe",
"name": "Xhofe",
"avatar_url": "https://avatars.githubusercontent.com/u/36558727?v=4",
"profile": "http://nn.ci",
"contributions": [
"code",
"ideas",
"doc"
]
},
{
"login": "foxxorcat",
"name": "foxxorcat",
"avatar_url": "https://avatars.githubusercontent.com/u/95907542?v=4",
"profile": "https://github.com/foxxorcat",
"contributions": [
"code"
]
},
{
"login": "DaoChen6",
"name": "道辰",
"avatar_url": "https://avatars.githubusercontent.com/u/63903027?v=4",
"profile": "https://www.iflu.cf/",
"contributions": [
"doc"
]
},
{
"login": "vg-land",
"name": "vg-land",
"avatar_url": "https://avatars.githubusercontent.com/u/16739728?v=4",
"profile": "https://vg-land.github.io/",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 7,
"projectName": "alist",
"projectOwner": "Xhofe",
"repoType": "github",
"repoHost": "https://github.com",
"skipCi": true
}
+21
View File
@@ -0,0 +1,21 @@
# Configuration for welcome - https://github.com/behaviorbot/welcome
# Configuration for new-issue-welcome - https://github.com/behaviorbot/new-issue-welcome
# Comment to be posted to on first time issues
newIssueWelcomeComment: >
Thanks for opening your first issue here! Be sure to follow the issue template!
# Configuration for new-pr-welcome - https://github.com/behaviorbot/new-pr-welcome
# Comment to be posted to on PRs from first time contributors in your repository
newPRWelcomeComment: >
Thanks for opening this pull request! Please check out our contributing guidelines.
# Configuration for first-pr-merge - https://github.com/behaviorbot/first-pr-merge
# Comment to be posted to on pull requests merged by a first time user
firstPRMergeComment: >
Congrats on merging your first pull request! We here at behavior bot are proud of you!
# It is recommend to include as many gifs and emojis as possible
+3 -4
View File
@@ -2,9 +2,9 @@ name: build
on:
push:
branches: [ v2 ]
branches: [ '**' ]
pull_request:
branches: [ v2 ]
branches: [ '**' ]
jobs:
build:
@@ -28,10 +28,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
with:
ref: v2
path: alist
- name: Set up xgo
- name: Install upx
run: |
docker pull techknowlogick/xgo:latest
go install src.techknowlogick.com/xgo@latest
+1 -1
View File
@@ -27,7 +27,7 @@ jobs:
persist-credentials: false
fetch-depth: 0
- name: Set up xgo
- name: Install upx
run: |
docker pull techknowlogick/xgo:latest
go install src.techknowlogick.com/xgo@latest
+31 -5
View File
@@ -1,5 +1,5 @@
<div align="center">
<a href="https://alist.nn.ci"><img height="100px" alt="logo" src="https://cdn.jsdelivr.net/gh/alist-org/assets@main/logo.svg"/></a>
<a href="https://alist.nn.ci"><img height="100px" alt="logo" src="https://cdn.jsdelivr.net/gh/alist-org/logo@main/logo.svg"/></a>
<p><em>🗂️Another file list program that supports multiple storage, powered by Gin and React.</em></p>
<a href="https://github.com/Xhofe/alist/releases"><img src="https://img.shields.io/github/release/Xhofe/alist?style=flat-square" alt="latest version"></a>
<a href="https://github.com/Xhofe/alist/discussions"><img src="https://img.shields.io/github/discussions/Xhofe/alist?color=%23ED8936&style=flat-square" alt="discussions"></a>
@@ -11,12 +11,14 @@
</a>
</div>
---
English | [中文](./README_cn.md)
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-4-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->
## Features
- [x] Multiple storage
@@ -39,6 +41,7 @@ English | [中文](./README_cn.md)
- [x] [Yandex.Disk](https://disk.yandex.com/)
- [x] [Baidu Disk](http://pan.baidu.com/)
- [x] [Quark](https://pan.quark.cn)
- [x] [XunleiCloud](https://pan.xunlei.com/)
- [x] Easy to deploy and out-of-the-box
- [x] File preview (PDF, markdown, code, plain text, ...)
- [x] Image preview in gallery mode
@@ -64,16 +67,39 @@ Please go to our [discussion forum](https://github.com/Xhofe/alist/discussions)
Available at: <https://alist.nn.ci>.
![demo](https://inews.gtimg.com/newsapp_ls/0/14256614096/0)
![demo](https://store.heytapimage.com/cdo-portal/feedback/202202/20/b271627971e29f0c7c9d59935b6ef381.png)
## Document
<https://alist-doc.nn.ci/en/>
## Contributors ✨
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tr>
<td align="center"><a href="http://nn.ci"><img src="https://avatars.githubusercontent.com/u/36558727?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Xhofe</b></sub></a><br /><a href="https://github.com/Xhofe/alist/commits?author=Xhofe" title="Code">💻</a> <a href="#ideas-Xhofe" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/Xhofe/alist/commits?author=Xhofe" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/foxxorcat"><img src="https://avatars.githubusercontent.com/u/95907542?v=4?s=100" width="100px;" alt=""/><br /><sub><b>foxxorcat</b></sub></a><br /><a href="https://github.com/Xhofe/alist/commits?author=foxxorcat" title="Code">💻</a></td>
<td align="center"><a href="https://www.iflu.cf/"><img src="https://avatars.githubusercontent.com/u/63903027?v=4?s=100" width="100px;" alt=""/><br /><sub><b>道辰</b></sub></a><br /><a href="https://github.com/Xhofe/alist/commits?author=DaoChen6" title="Documentation">📖</a></td>
<td align="center"><a href="https://vg-land.github.io/"><img src="https://avatars.githubusercontent.com/u/16739728?v=4?s=100" width="100px;" alt=""/><br /><sub><b>vg-land</b></sub></a><br /><a href="https://github.com/Xhofe/alist/commits?author=vg-land" title="Code">💻</a></td>
</tr>
</table>
<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
<!-- ALL-CONTRIBUTORS-LIST:END -->
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
## License
The `AList` is open-source software licensed under the AGPL-3.0 license.
---
> [@Blog](https://www.nn.ci/) · [@GitHub](https://github.com/Xhofe)
> [@Blog](https://www.nn.ci/) · [@GitHub](https://github.com/Xhofe) · [@TelegramGroup](https://t.me/alist_chat) · [@QQGroup](https://jq.qq.com/?_wv=1027&k=OVPJcv2b)
+31 -4
View File
@@ -1,5 +1,5 @@
<div align="center">
<a href="https://alist.nn.ci"><img height="100px" alt="logo" src="https://cdn.jsdelivr.net/gh/alist-org/assets@main/logo.svg"/></a>
<a href="https://alist.nn.ci"><img height="100px" alt="logo" src="https://cdn.jsdelivr.net/gh/alist-org/logo@main/logo.svg"/></a>
<p><em>🗂️一个支持多存储的文件列表程序,使用 Gin 和 React 。</em></p>
<a href="https://github.com/Xhofe/alist/releases"><img src="https://img.shields.io/github/release/Xhofe/alist?style=flat-square" alt="latest version"></a>
<a href="https://github.com/Xhofe/alist/discussions"><img src="https://img.shields.io/github/discussions/Xhofe/alist?color=%23ED8936&style=flat-square" alt="discussions"></a>
@@ -11,11 +11,14 @@
</a>
</div>
---
[English](./README.md) | 中文
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-4-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->
## 支持
- [x] 多种存储
@@ -38,6 +41,7 @@
- [x] [Yandex.Disk](https://disk.yandex.com/)
- [x] [百度网盘](http://pan.baidu.com/)
- [x] [夸克网盘](https://pan.quark.cn)
- [x] [迅雷云盘](https://pan.xunlei.com/)
- [x] 部署方便,开箱即用
- [x] 文件预览(PDF、markdown、代码、纯文本……)
- [x] 画廊模式下的图像预览
@@ -63,16 +67,39 @@
<https://alist.nn.ci>。
![演示](https://inews.gtimg.com/newsapp_ls/0/14256614096/0)
![演示](https://store.heytapimage.com/cdo-portal/feedback/202202/20/b271627971e29f0c7c9d59935b6ef381.png)
## 文档
<https://alist-doc.nn.ci/>
## Contributors ✨
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tr>
<td align="center"><a href="http://nn.ci"><img src="https://avatars.githubusercontent.com/u/36558727?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Xhofe</b></sub></a><br /><a href="https://github.com/Xhofe/alist/commits?author=Xhofe" title="Code">💻</a> <a href="#ideas-Xhofe" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/Xhofe/alist/commits?author=Xhofe" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/foxxorcat"><img src="https://avatars.githubusercontent.com/u/95907542?v=4?s=100" width="100px;" alt=""/><br /><sub><b>foxxorcat</b></sub></a><br /><a href="https://github.com/Xhofe/alist/commits?author=foxxorcat" title="Code">💻</a></td>
<td align="center"><a href="https://www.iflu.cf/"><img src="https://avatars.githubusercontent.com/u/63903027?v=4?s=100" width="100px;" alt=""/><br /><sub><b>道辰</b></sub></a><br /><a href="https://github.com/Xhofe/alist/commits?author=DaoChen6" title="Documentation">📖</a></td>
<td align="center"><a href="https://vg-land.github.io/"><img src="https://avatars.githubusercontent.com/u/16739728?v=4?s=100" width="100px;" alt=""/><br /><sub><b>vg-land</b></sub></a><br /><a href="https://github.com/Xhofe/alist/commits?author=vg-land" title="Code">💻</a></td>
</tr>
</table>
<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
<!-- ALL-CONTRIBUTORS-LIST:END -->
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
## 许可
`AList` 是在 AGPL-3.0 许可下许可的开源软件。
---
> [@Blog](https://www.nn.ci/) · [@GitHub](https://github.com/Xhofe)
> [@Blog](https://www.nn.ci/) · [@GitHub](https://github.com/Xhofe) · [@TelegramGroup](https://t.me/alist_chat) · [@QQGroup](https://jq.qq.com/?_wv=1027&k=OVPJcv2b)
+2 -1
View File
@@ -34,7 +34,8 @@ func Init() bool {
func main() {
if conf.Version {
fmt.Printf("Built At: %s\nGo Version: %s\nAuthor: %s\nCommit ID: %s\nVersion: %s\n", conf.BuiltAt, conf.GoVersion, conf.GitAuthor, conf.GitCommit, conf.GitTag)
fmt.Printf("Built At: %s\nGo Version: %s\nAuthor: %s\nCommit ID: %s\nVersion: %s\nWebVersion: %s\n",
conf.BuiltAt, conf.GoVersion, conf.GitAuthor, conf.GitCommit, conf.GitTag, conf.WebTag)
return
}
if !Init() {
+1 -1
View File
@@ -12,7 +12,7 @@ func InitLog() {
log.SetLevel(log.DebugLevel)
log.SetReportCaller(true)
}
if conf.Password {
if conf.Password || conf.Version {
log.SetLevel(log.WarnLevel)
}
log.SetFormatter(&log.TextFormatter{
+1 -1
View File
@@ -79,6 +79,6 @@ func InitModel() {
err = conf.DB.AutoMigrate(&model.SettingItem{}, &model.Account{}, &model.Meta{})
}
if err != nil {
log.Fatalf("failed to auto migrate")
log.Fatalf("failed to auto migrate: %s", err.Error())
}
}
+8 -7
View File
@@ -65,13 +65,14 @@ func InitSettings() {
Description: "text type extensions",
Group: model.FRONT,
},
//{
// Key: "hide readme file",
// Value: "true",
// Type: "bool",
// Description: "hide readme file? ",
// Group: model.FRONT,
//},
{
Key: "d_proxy types",
Value: strings.Join(conf.DProxyTypes, ","),
Type: "string",
Description: "/d but proxy",
Access: model.PRIVATE,
Group: model.BACK,
},
{
Key: "hide files",
Value: "/\\/README.md/i",
+20 -9
View File
@@ -6,8 +6,11 @@ BUILD_WEB() {
cd alist-web
yarn
yarn build
sed -i -e "s/\/CDN_URL\//\//g" dist/index.html
sed -i -e "s/assets/\/assets/g" dist/index.html
rm -f dist/index.html-e
mv dist ..
cd ..
cd .. || exit
rm -rf alist-web
}
@@ -25,6 +28,7 @@ BUILD_DOCKER() {
gitAuthor=$(git show -s --format='format:%aN <%ae>' HEAD)
gitCommit=$(git log --pretty=format:"%h" -1)
gitTag=$(git describe --long --tags --dirty --always)
webTag=$(wget -qO- -t1 -T2 "https://api.github.com/repos/alist-org/alist-web/releases/latest" | grep "tag_name" | head -n 1 | awk -F ":" '{print $2}' | sed 's/\"//g;s/,//g;s/ //g')
ldflags="\
-w -s \
-X 'github.com/Xhofe/alist/conf.BuiltAt=$builtAt' \
@@ -32,6 +36,7 @@ BUILD_DOCKER() {
-X 'github.com/Xhofe/alist/conf.GitAuthor=$gitAuthor' \
-X 'github.com/Xhofe/alist/conf.GitCommit=$gitCommit' \
-X 'github.com/Xhofe/alist/conf.GitTag=$gitTag' \
-X 'github.com/Xhofe/alist/conf.WebTag=$webTag' \
"
go build -o ./bin/alist -ldflags="$ldflags" -tags=jsoniter alist.go
}
@@ -44,6 +49,7 @@ BUILD() {
gitAuthor=$(git show -s --format='format:%aN <%ae>' HEAD)
gitCommit=$(git log --pretty=format:"%h" -1)
gitTag=$(git describe --long --tags --dirty --always)
webTag=$(wget -qO- -t1 -T2 "https://api.github.com/repos/alist-org/alist-web/releases/latest" | grep "tag_name" | head -n 1 | awk -F ":" '{print $2}' | sed 's/\"//g;s/,//g;s/ //g')
echo "build version: $gitTag"
ldflags="\
-w -s \
@@ -52,23 +58,25 @@ BUILD() {
-X 'github.com/Xhofe/alist/conf.GitAuthor=$gitAuthor' \
-X 'github.com/Xhofe/alist/conf.GitCommit=$gitCommit' \
-X 'github.com/Xhofe/alist/conf.GitTag=$gitTag' \
-X 'github.com/Xhofe/alist/conf.WebTag=$webTag' \
"
if [ "$1" == "release" ]; then
xgo -out "$appName" -ldflags="$ldflags" -tags=jsoniter .
else
xgo -targets=linux/amd64,windows/amd64 -out "$appName" -ldflags="$ldflags" -tags=jsoniter .
xgo -targets=linux/amd64,windows/amd64,darwin/amd64 -out "$appName" -ldflags="$ldflags" -tags=jsoniter .
fi
mkdir -p "build"
mv alist-* build
if [ "$1" != "release" ]; then
cd build
upx -9 ./*
upx -9 ./alist-linux*
upx -9 ./alist-windows*
find . -type f -print0 | xargs -0 md5sum >md5.txt
cat md5.txt
cd ..
cd .. || exit
fi
cd ..
cd .. || exit
}
BUILD_MUSL() {
@@ -86,6 +94,7 @@ BUILD_MUSL() {
gitAuthor=$(git show -s --format='format:%aN <%ae>' HEAD)
gitCommit=$(git log --pretty=format:"%h" -1)
gitTag=$(git describe --long --tags --dirty --always)
webTag=$(wget -qO- -t1 -T2 "https://api.github.com/repos/alist-org/alist-web/releases/latest" | grep "tag_name" | head -n 1 | awk -F ":" '{print $2}' | sed 's/\"//g;s/,//g;s/ //g')
ldflags="\
-w -s \
-X 'github.com/Xhofe/alist/conf.BuiltAt=$builtAt' \
@@ -93,6 +102,7 @@ BUILD_MUSL() {
-X 'github.com/Xhofe/alist/conf.GitAuthor=$gitAuthor' \
-X 'github.com/Xhofe/alist/conf.GitCommit=$gitCommit' \
-X 'github.com/Xhofe/alist/conf.GitTag=$gitTag' \
-X 'github.com/Xhofe/alist/conf.WebTag=$webTag' \
"
OS_ARCHES=(linux-musl-amd64 linux-musl-arm64 linux-musl-arm linux-musl-mips linux-musl-mips64 linux-musl-mips64le linux-musl-mipsle linux-musl-ppc64le linux-musl-s390x)
CGO_ARGS=(x86_64-linux-musl-gcc aarch64-linux-musl-gcc arm-linux-musleabihf-gcc mips-linux-musl-gcc mips64-linux-musl-gcc mips64el-linux-musl-gcc mipsel-linux-musl-gcc powerpc64le-linux-musl-gcc s390x-linux-musl-gcc)
@@ -106,12 +116,13 @@ BUILD_MUSL() {
export CGO_ENABLED=1
go build -o ./build/$appName-$os_arch -ldflags="$ldflags" -tags=jsoniter alist.go
done
cd ..
cd .. || exit
}
RELEASE() {
cd alist/build
upx -9 ./*
upx -9 ./alist-linux-amd64
upx -9 ./alist-windows*
find . -type f -print0 | xargs -0 md5sum >md5.txt
cat md5.txt
mkdir compress
@@ -125,7 +136,7 @@ RELEASE() {
for i in $(find . -type f -name "$appName-windows-*"); do
zip compress/$(echo $i | sed 's/\.[^.]*$//').zip "$i"
done
cd ../..
cd ../.. || exit
}
if [ "$1" = "web" ]; then
@@ -142,4 +153,4 @@ elif [ "$1" = "release" ]; then
RELEASE
else
echo -e "${RED_COLOR} Parameter error ${RES}"
fi
fi
+1 -1
View File
@@ -37,7 +37,7 @@ func DefaultConfig() *Config {
return &Config{
Address: "0.0.0.0",
Port: 5244,
Assets: "jsdelivr",
Assets: "https://npm.elemecdn.com/alist-web@$version/dist",
TempDir: "data/temp",
Database: Database{
Type: "sqlite3",
+3 -1
View File
@@ -14,6 +14,7 @@ var (
GitAuthor string
GitCommit string
GitTag string = "dev"
WebTag string
)
var (
@@ -33,9 +34,10 @@ var (
TextTypes = []string{"txt", "htm", "html", "xml", "java", "properties", "sql",
"js", "md", "json", "conf", "ini", "vue", "php", "py", "bat", "gitignore", "yml",
"go", "sh", "c", "cpp", "h", "hpp", "tsx", "vtt", "srt", "ass"}
DProxyTypes = []string{"m3u8"}
OfficeTypes = []string{"doc", "docx", "xls", "xlsx", "ppt", "pptx", "pdf"}
VideoTypes = []string{"mp4", "mkv", "avi", "mov", "rmvb", "webm", "flv"}
AudioTypes = []string{"mp3", "flac", "ogg", "m4a", "wav"}
AudioTypes = []string{"mp3", "flac", "ogg", "m4a", "wav", "opus"}
ImageTypes = []string{"jpg", "tiff", "jpeg", "png", "gif", "bmp", "svg", "ico", "swf", "webp"}
)
+6 -4
View File
@@ -8,9 +8,9 @@ import (
"github.com/Xhofe/alist/model"
"github.com/Xhofe/alist/utils"
"github.com/go-resty/resty/v2"
jsoniter "github.com/json-iterator/go"
log "github.com/sirupsen/logrus"
"path/filepath"
"strings"
"time"
)
@@ -190,7 +190,7 @@ func (driver AliDrive) rename(fileId, name string, account *model.Account) error
return fmt.Errorf("%+v", resp)
}
func (driver AliDrive) batch(srcId, dstId string, account *model.Account) error {
func (driver AliDrive) batch(srcId, dstId string, url string, account *model.Account) error {
var e AliRespError
res, err := aliClient.R().SetError(&e).
SetHeader("authorization", "Bearer\t"+account.AccessToken).
@@ -208,6 +208,7 @@ func (driver AliDrive) batch(srcId, dstId string, account *model.Account) error
"to_drive_id": account.DriveId,
"to_parent_file_id": dstId,
},
"url": url,
},
},
"resource": "file",
@@ -222,12 +223,13 @@ func (driver AliDrive) batch(srcId, dstId string, account *model.Account) error
return err
} else {
_ = model.SaveAccount(account)
return driver.batch(srcId, dstId, account)
return driver.batch(srcId, dstId, url, account)
}
}
return fmt.Errorf("%s", e.Message)
}
if strings.Contains(res.String(), `"status":200`) {
status := jsoniter.Get(res.Body(), "status").ToInt()
if status < 400 && status >= 100 {
return nil
}
return errors.New(res.String())
File diff suppressed because it is too large Load Diff
+2
View File
@@ -19,7 +19,9 @@ import (
_ "github.com/Xhofe/alist/drivers/s3"
_ "github.com/Xhofe/alist/drivers/shandian"
_ "github.com/Xhofe/alist/drivers/teambition"
_ "github.com/Xhofe/alist/drivers/uss"
_ "github.com/Xhofe/alist/drivers/webdav"
_ "github.com/Xhofe/alist/drivers/xunlei"
_ "github.com/Xhofe/alist/drivers/yandex"
log "github.com/sirupsen/logrus"
"strings"
+4 -1
View File
@@ -118,7 +118,10 @@ func (driver *Lanzou) GetFilesByUrl(account *model.Account) ([]LanZouFile, error
uid := regexp.MustCompile(`'uid':'(.+?)',`).FindStringSubmatch(res.String())[1]
rep := regexp.MustCompile(`'rep':'(.+?)',`).FindStringSubmatch(res.String())[1]
up := regexp.MustCompile(`'up':(.+?),`).FindStringSubmatch(res.String())[1]
ls := regexp.MustCompile(`'ls':(.+?),`).FindStringSubmatch(res.String())[1]
ls := ""
if account.Password != "" {
ls = regexp.MustCompile(`'ls':(.+?),`).FindStringSubmatch(res.String())[1]
}
tName := regexp.MustCompile(`'t':(.+?),`).FindStringSubmatch(res.String())[1]
kName := regexp.MustCompile(`'k':(.+?),`).FindStringSubmatch(res.String())[1]
t := regexp.MustCompile(`var ` + tName + ` = '(.+?)';`).FindStringSubmatch(res.String())[1]
+1 -1
View File
@@ -175,7 +175,7 @@ func (driver Onedrive) Link(args base.Args, account *model.Account) (*base.Link,
if err != nil {
return nil, err
}
if file.File.MimeType == "" {
if file.File == nil {
return nil, base.ErrNotFile
}
link := base.Link{
+2 -2
View File
@@ -120,7 +120,7 @@ type OneFile struct {
Size int64 `json:"size"`
LastModifiedDateTime *time.Time `json:"lastModifiedDateTime"`
Url string `json:"@microsoft.graph.downloadUrl"`
File struct {
File *struct {
MimeType string `json:"mimeType"`
} `json:"file"`
Thumbnails []struct {
@@ -157,7 +157,7 @@ func (driver Onedrive) FormatFile(file *OneFile) *model.File {
if len(file.Thumbnails) > 0 {
f.Thumbnail = file.Thumbnails[0].Medium.Url
}
if file.File.MimeType == "" {
if file.File == nil {
f.Type = conf.FOLDER
} else {
f.Type = utils.GetFileType(filepath.Ext(file.Name))
+2 -2
View File
@@ -98,7 +98,7 @@ func (driver Teambition) GetFiles(parentId string, account *model.Account) ([]mo
Size: 0,
Type: conf.FOLDER,
Driver: driver.Config().Name,
UpdatedAt: &collection.Updated,
UpdatedAt: collection.Updated,
})
}
}
@@ -126,7 +126,7 @@ func (driver Teambition) GetFiles(parentId string, account *model.Account) ([]mo
Size: work.FileSize,
Type: utils.GetFileType(path.Ext(work.FileName)),
Driver: driver.Config().Name,
UpdatedAt: &work.Updated,
UpdatedAt: work.Updated,
Thumbnail: work.Thumbnail,
Url: work.DownloadURL,
})

Some files were not shown because too many files have changed in this diff Show More