Compare commits

..

249 Commits

Author SHA1 Message Date
微凉 c9bc8227bb 💚 switch back to techknowlogick/xgo 2022-01-12 11:50:26 +08:00
微凉 4ea9371c00 💚 fix release actions 2022-01-12 01:04:50 +08:00
微凉 326c74cdc6 📝 update readme 2022-01-12 01:00:18 +08:00
微凉 f11c2efa8c :bug: fix package download 2022-01-12 00:37:44 +08:00
微凉 6dd8102a82 :fire: Optimize delete cache 2022-01-11 23:45:12 +08:00
微凉 ddf6a4955f 🎇 139yun family support 2022-01-11 23:43:55 +08:00
微凉 602994e213 ✏️ fix typo 2022-01-10 21:14:26 +08:00
微凉 7c7306bf96 💚 Optimize github actions build 2022-01-10 19:48:11 +08:00
微凉 c24894b5de 💚 add go install version 2022-01-10 18:23:44 +08:00
微凉 e10412c530 💚 change xgo 2022-01-10 18:18:11 +08:00
微凉 5c2491b6c3 📝 change LICENSE 2022-01-10 18:11:14 +08:00
微凉 036373032c ✨ 139yun personal support 2022-01-09 22:44:43 +08:00
微凉 db58dabd31 ✨ local sort bring folders to the front 2022-01-09 19:28:48 +08:00
微凉 7ef98c05fa ✏️ fix typo 2022-01-09 17:22:55 +08:00
微凉 6351f43b9b :fire: Delete alist-proxy.js 2022-01-08 22:47:58 +08:00
微凉 6613c8a6c1 🎇 file delete 2022-01-08 22:09:27 +08:00
微凉 2b97882b42 🎇 Multiple file upload 2022-01-08 21:29:00 +08:00
微凉 925f386bed 🚧 remove customize head and body for manage 2022-01-08 21:10:34 +08:00
微凉 0fbbd54b0c 🔧 add required for teambition 2022-01-08 20:23:30 +08:00
微凉 12ba1fed00 🔧 add cookie required 2022-01-08 20:18:14 +08:00
微凉 2826bac53c 📝 update readme 2022-01-08 20:09:12 +08:00
微凉 3e7e9f354f 🎇 189cloud upload 2022-01-08 19:31:12 +08:00
微凉 86ff80885d :bug: fix 189 logged in but get error 2022-01-08 17:19:11 +08:00
微凉 be03e34406 :bug: fix proxy onlyLocal 2022-01-07 23:30:22 +08:00
微凉 83231becba 🎇 update config file while config struct changed 2022-01-07 20:29:20 +08:00
微凉 876ee49fb0 :bug: add range header for pdf.js 2022-01-07 20:28:58 +08:00
微凉 10bec31033 ✨ support flv preview 2022-01-06 19:26:19 +08:00
微凉 fc48f29575 🎇 finish MediaTrack upload 2022-01-06 19:23:55 +08:00
微凉 f0d9a452bb 🎇 finish MediaTrack upload 2022-01-06 19:21:13 +08:00
微凉 c03a4f83d1 🚧 give up 189 family cloud 2022-01-06 18:45:07 +08:00
微凉 10f06fde5c 🚧 MediaTrack support 2022-01-06 01:14:32 +08:00
微凉 36b533cb16 :bug: remove empty title folder 2022-01-05 23:25:21 +08:00
微凉 6ff2cdab98 🎇 teambition support 2022-01-05 22:03:28 +08:00
微凉 ef5cad1bf0 🎇 Pagination #257 2022-01-04 21:21:27 +08:00
微凉 b60c7ecd9e :bug: fix #281 set CHARSET=utf8mb4 2022-01-04 15:16:18 +08:00
微凉 68aaa8fee2 🚧 Pagination function 2022-01-03 23:30:57 +08:00
微凉 67bf14d428 🎨 Pull away link 2022-01-03 22:48:34 +08:00
微凉 c22ff77c89 🎨 use S3ForcePathStyle 2022-01-03 22:37:26 +08:00
微凉 84fc0ab1bd 🎇 123pan upload 2022-01-03 22:29:32 +08:00
微凉 beb06f2f7f :fire: replace encoding/json with jsoniter 2022-01-03 20:25:22 +08:00
微凉 7cf30836bf 🎨 Optimize code structure 2022-01-03 20:06:36 +08:00
微凉 e7ba289d06 :bug: fix upload delete cache 2022-01-02 18:17:04 +08:00
微凉 d255ff4fd0 :bug: fix home emoji type 2022-01-02 16:29:17 +08:00
微凉 bcf19f4f3e :bug: fix upload get wrong content-type 2022-01-02 14:51:27 +08:00
微凉 efeee0e276 :bug: fix alist path error 2022-01-02 14:44:14 +08:00
微凉 e789873eca 🚧 add home emoji setting 2022-01-02 14:38:24 +08:00
微凉 14b9b76e87 :bug: fix sidebar didn't auto unfold 2022-01-01 23:04:33 +08:00
微凉 38323fd24f 📝 update readme 2022-01-01 20:54:25 +08:00
微凉 366148a450 🎇 add root folder for s3 2022-01-01 20:54:11 +08:00
微凉 bc364cee0d 🚧 Change the location of the files and folders of the 189cloud 2022-01-01 19:48:59 +08:00
微凉 f433277227 :fire: delete markdown theme setting 2022-01-01 19:41:42 +08:00
微凉 35fc1c87d2 ✨ pikpak file upload 2022-01-01 00:08:58 +08:00
微凉 9da2af8c49 📝 Update readme features 2021-12-31 20:39:55 +08:00
微凉 103e049f22 ✨ web upload 2021-12-31 20:33:39 +08:00
微凉 cc217df924 🚧 change path api resp struct 2021-12-31 17:15:37 +08:00
微凉 939c9cd5ac 🚧 check upload file 2021-12-31 14:05:35 +08:00
微凉 6f0959a98e :bug: google drive upload api proxy 2021-12-31 00:28:50 +08:00
微凉 d71ed4d775 🎇 support webdav driver 2021-12-30 21:39:17 +08:00
微凉 0af3e95f1f 📝 update readme 2021-12-30 20:47:15 +08:00
微凉 582f7bbfee 🔧 Custom cache duration 2021-12-30 20:42:37 +08:00
微凉 cf2506901f 🎇 s3 support 2021-12-30 20:31:36 +08:00
微凉 db06b627cc 🎇 google drive thumbnail 2021-12-30 19:01:19 +08:00
微凉 5f2621eca9 :bug: fix pikpak and shandian account status 2021-12-30 17:59:35 +08:00
微凉 3331462229 ✨ local sort for no sort param driver 2021-12-30 16:15:57 +08:00
微凉 0f079827e5 ✨ support shandianpan #234 2021-12-29 22:07:26 +08:00
微凉 ba66e33913 🎇 add ico to image types 2021-12-29 22:06:07 +08:00
微凉 6a54ed87f3 🎨 change NeedSetLink to NoNeedSetLink 2021-12-29 19:47:47 +08:00
微凉 88a9edb90a 🎇 googledrive webdav write 2021-12-28 21:28:27 +08:00
微凉 606134f39c ✨ onedrive webdav write 2021-12-28 20:34:45 +08:00
Xhofe 3c03344ef1 📝 update readme 2021-12-28 17:15:30 +08:00
Xhofe 6f5914ae6f ✨ webdav visitor 2021-12-28 17:05:16 +08:00
Xhofe 4c00866249 ✨ grouping settings 2021-12-28 16:38:56 +08:00
微凉 04752f7473 💄 change default background color 2021-12-25 23:44:52 +08:00
Xhofe 26b4766da7 ✨ remove . and .. for FTP 2021-12-25 19:22:05 +08:00
Xhofe 12af9cb89f 🎇 support hide account 2021-12-25 17:53:46 +08:00
Xhofe 958d793725 🎇 add public folder router 2021-12-25 17:07:59 +08:00
Xhofe 36f07ee194 ✨ add no cors config 2021-12-25 16:44:32 +08:00
Xhofe 91c2c21522 🎇 support wav audio preview 2021-12-21 15:44:07 +08:00
Xhofe d6d2f52922 💄 change default color 2021-12-21 13:13:01 +08:00
Xhofe 9162e782a0 :bug: fix default customize head 2021-12-21 13:09:59 +08:00
微凉 dc41ceb99b :bug: fix initialization sequence 2021-12-21 00:32:09 +08:00
微凉 c5e274f52a 💚 fix mv web file 2021-12-21 00:15:43 +08:00
微凉 3781043c78 :bug: fix build web file 2021-12-20 23:59:55 +08:00
微凉 1485ab2677 🎇 add local config 2021-12-20 23:56:17 +08:00
微凉 337bf08cd3 :bug: fix pikpak refresh_token endless loop 2021-12-20 23:21:52 +08:00
微凉 22665aa19a 🎨 move default text types 2021-12-20 17:24:49 +08:00
微凉 1ab6b4e201 💄 change default customize head 2021-12-20 17:21:11 +08:00
微凉 d97afb691b ✨ support pikpak and google api proxy 2021-12-20 15:44:17 +08:00
微凉 b63e65880f 🚧 google drive api proxy 2021-12-20 01:00:53 +08:00
微凉 44cbe0522c ✨ support subtitle 2021-12-19 21:24:04 +08:00
微凉 fedab86c30 🚧 change some proxy 2021-12-19 20:55:29 +08:00
微凉 731dbf6c3a :bug: fix 123pan 403 2021-12-19 20:32:47 +08:00
微凉 d00f75c814 🎨 change link interface 2021-12-19 20:00:53 +08:00
微凉 f5b8815a84 🎨 abstract 123pan request 2021-12-19 17:54:28 +08:00
微凉 99d06c7449 ✨ support api proxy 2021-12-19 17:12:19 +08:00
微凉 8e7b2c5837 ✨ api proxy 2021-12-19 17:10:20 +08:00
微凉 3d3a97288a ✨ add webdav tips for browser 2021-12-18 15:23:32 +08:00
微凉 c2142cc03a 🎨 Optimize code structure 2021-12-18 15:22:56 +08:00
微凉 3ce94de823 :bug: fix FTP down 2021-12-17 12:14:27 +08:00
微凉 c64c003257 🎇 feat: pikpak support 2021-12-16 22:50:23 +08:00
微凉 1c65588b4a 🎇 webdav update delete cache 2021-12-16 22:02:45 +08:00
微凉 d49f92b542 ✨ ftp support 2021-12-16 18:03:58 +08:00
微凉 92a0453e00 🎨 change internal type 2021-12-16 15:44:18 +08:00
微凉 bd7d27efc7 :bug: onedrive retry refresh token 2021-12-16 15:25:49 +08:00
微凉 b2055777e0 :bug: fix empty refresh_token 2021-12-16 14:07:15 +08:00
微凉 fe79f9518b 🚧 123pan write 2021-12-11 17:44:33 +08:00
微凉 a7e9bb9e9a :bug: fix alist driver files 2021-12-11 14:01:03 +08:00
微凉 73d85d96f1 🎇 189cloud write 2021-12-10 22:25:09 +08:00
微凉 ff91d7a37d 🎇 delete cache 2021-12-10 22:24:55 +08:00
微凉 78f81ddc3b 🎨 add some debug log 2021-12-10 22:24:43 +08:00
微凉 2f8258053f ✨ support native proxy url 2021-12-10 15:55:21 +08:00
微凉 511efce624 📝 update readme 2021-12-10 00:06:50 +08:00
微凉 14ff3450ab 📝 update readme 2021-12-09 23:05:16 +08:00
微凉 bbba161d55 :bug: fix proxy sign mismatch 2021-12-09 23:01:52 +08:00
微凉 6b61f8e9cc :bug: fix alist root foler invalid 2021-12-09 21:56:28 +08:00
微凉 a295e7024a 🎨 change link interface 2021-12-09 19:24:34 +08:00
微凉 b36eaf08f0 🎨 abstract cache method 2021-12-08 22:58:44 +08:00
微凉 bb6e520ab5 🎨 delete useless code 2021-12-08 22:44:45 +08:00
微凉 9b64e2e045 :bug: fix cache bug 2021-12-08 22:41:30 +08:00
微凉 ee7c12c30f ✨ cf workers proxy 2021-12-08 21:40:20 +08:00
微凉 96d6d58910 :bug: fix alist driver cache 2021-12-08 21:39:35 +08:00
微凉 2bf235a5ac :bug: fix link req nil 2021-12-08 20:27:39 +08:00
微凉 236f9969c0 🚧 support proxy 2021-12-08 20:00:52 +08:00
微凉 09e63027d9 🎇 allow delete deprecated setting 2021-12-08 19:36:07 +08:00
微凉 a15dae291e ✨ support webm video preview 2021-12-08 14:43:38 +08:00
微凉 efaaeedfb8 :bug: fix can't get index.html 2021-12-08 10:35:18 +08:00
微凉 190c8001a5 🚧 support proxy url 2021-12-08 10:33:26 +08:00
微凉 b8698700ef ✨ support add another alist 2021-12-08 09:10:00 +08:00
微凉 985b81826f 🎇 support add another alist 2021-12-07 20:16:34 +08:00
微凉 74d8fa3919 :fire: remove useless remark 2021-12-07 16:34:20 +08:00
微凉 43e4928bb9 :bug: fix aliyundrive webdav delete and upload 2021-12-07 16:32:59 +08:00
微凉 03580fd76c 🎨 Improve the code structure 2021-12-07 15:56:43 +08:00
微凉 6e8d551420 🚧 aliyundrive webdav write 2021-12-06 22:14:32 +08:00
微凉 28998d6f8c 🚧 aliyundrive webdav write 2021-12-06 17:49:20 +08:00
微凉 1779617cb9 🎨 Improve the code structure 2021-12-06 15:55:05 +08:00
微凉 7dfe48339c 🚧 native webdav write 2021-12-05 16:09:39 +08:00
微凉 9c5627a382 🚧 webdav write interface 2021-12-05 15:22:19 +08:00
微凉 809850321a 🔧 change customize settings 2021-12-05 13:43:08 +08:00
微凉 bdc1f68746 📝 update readme 2021-12-04 18:37:26 +08:00
微凉 9aaef6c3a3 📝 update readme image 2021-12-03 11:24:43 +08:00
微凉 bb50c52d0e 📝 update readme 2021-12-02 23:01:54 +08:00
微凉 6041e5a0fa 🎇 Add ISSUE_TEMPLATE 2021-12-02 22:55:01 +08:00
微凉 308a86c36e 📝 update readme 2021-12-02 22:38:18 +08:00
微凉 ba7c4fc230 🎇 Create LICENSE 2021-12-02 22:37:56 +08:00
微凉 d81ec0637d 🎇 md5 and filename 2021-12-02 18:57:29 +08:00
微凉 1d7d37e642 :bug: fix onedrive sort 2021-12-01 11:25:33 +08:00
微凉 b62a716267 ✨ remove onedrive empty cache 2021-12-01 11:25:04 +08:00
微凉 944941db10 🎇 support https 2021-12-01 00:19:06 +08:00
微凉 bd91acc5d0 :bug: fix lanzou webdav time error 2021-12-01 00:15:34 +08:00
微凉 cd50227835 🎇 support lanzou 2021-11-30 21:30:50 +08:00
微凉 50226f66e3 ✨ google default root folder 2021-11-30 19:10:27 +08:00
微凉 9dcaa9b07a 🎨 add types 2021-11-30 18:53:37 +08:00
微凉 fa6c0f78bc :bug: fix windows sharepoint path error 2021-11-30 16:45:08 +08:00
微凉 7f35dc6ade ✨ add onedrive thumbnail 2021-11-30 16:27:23 +08:00
微凉 5d6463b75a 🎨 move code 2021-11-30 10:00:06 +08:00
微凉 733b38b435 🎨 improve code structure 2021-11-30 09:37:51 +08:00
微凉 50a02a7af7 :fire: remove useless code 2021-11-29 21:30:52 +08:00
微凉 71b1517de7 :bug: fix windows check parent password 2021-11-29 21:09:16 +08:00
微凉 ffdd88ec66 ✨ webdav proxy 2021-11-29 16:42:46 +08:00
微凉 4ff2756572 :bug: fix 123pan webdav can't get 2021-11-29 16:06:49 +08:00
微凉 d955038ebc ✨ delete useless path unescape 2021-11-29 16:05:58 +08:00
微凉 72d5e4e691 ✨ delete useless log 2021-11-29 16:05:14 +08:00
微凉 b1e662cd34 :bug: fix onedrive slow response 2021-11-28 17:01:27 +08:00
微凉 0f0e1104a4 ✨ WebDAV auth 2021-11-28 16:18:09 +08:00
微凉 3041da35ab :bug: fix webdav proxy link auth 2021-11-28 16:05:41 +08:00
微凉 9eab54a7c8 ✨ webdav(view only) 2021-11-28 15:10:48 +08:00
微凉 0b8d3a0a2c :bug: fix can't get file 2021-11-28 15:10:06 +08:00
微凉 f9945a14a8 🎇 webdav unfinished 2021-11-28 00:12:04 +08:00
微凉 c39752ceb4 🎇 optimization googledrive 2021-11-27 20:40:03 +08:00
微凉 53b383d2cf 🔨 refactor driver: onedrive 2021-11-27 20:20:14 +08:00
微凉 e76fc3e616 🔨 refactor driver: native 2021-11-27 20:07:32 +08:00
微凉 eb21b87020 🔨 refactor driver: google 2021-11-27 19:52:38 +08:00
微凉 f577d82242 🔨 refactor driver: ali 2021-11-27 19:40:36 +08:00
微凉 98691b2aa8 🔨 refactor driver(123 and 189) 2021-11-27 18:55:09 +08:00
微凉 4fe6ed6c3e :bug: fix log 2021-11-26 20:23:33 +08:00
微凉 fe73ece57d ✨ change log 2021-11-26 20:20:32 +08:00
微凉 59b8f1084a :bug: fixed checking the parent folder when checked the password of the current folder 2021-11-25 16:24:39 +08:00
微凉 2f669ac45c 📝 update doc 2021-11-24 18:58:17 +08:00
微凉 d03d91d518 :bug: fix google drive root folder label 2021-11-24 13:34:15 +08:00
微凉 fe981f67ec :bug: fix windows check parent 2021-11-23 16:22:23 +08:00
微凉 8cfabfd0f5 ✨ resolved #170 native driver sort 2021-11-23 16:09:42 +08:00
微凉 163ee1159e ✨ change path interface 2021-11-23 15:58:03 +08:00
微凉 e31402e94f ✨ resolved #169 2021-11-23 15:46:10 +08:00
微凉 5500980d63 :bug: fix onedrive get files 2021-11-23 15:39:09 +08:00
微凉 b1695445e0 :bug: index add write header now 2021-11-22 18:10:09 +08:00
微凉 5db1ad4adf 🎇 resolved #160 2021-11-17 22:19:11 +08:00
微凉 725f5b0c55 ✨ support 123pan 2021-11-17 22:17:04 +08:00
微凉 87a74394b3 ✨ google client retry 2021-11-17 20:40:42 +08:00
微凉 a41c820525 :bug: fix debug output 2021-11-17 20:29:01 +08:00
微凉 cd53dc6d24 📝 update readme 2021-11-17 17:37:41 +08:00
微凉 cfe16b5ed2 ✨ add GoogleDrive 2021-11-17 17:21:11 +08:00
微凉 3d9746485d ✨ change proxy setting 2021-11-17 17:20:57 +08:00
微凉 0b7f2fee7d ✨ proxy add account 2021-11-17 16:37:12 +08:00
微凉 36d52e0b75 ✨ delete cache file 2021-11-17 16:25:32 +08:00
微凉 e4d254e4b0 ✨ simplify delete account when change name 2021-11-17 15:25:31 +08:00
微凉 e8d27a30b4 :bug: fix delete account when change name 2021-11-17 15:21:51 +08:00
微凉 69514668cc 🎇 replace title 2021-11-16 22:32:05 +08:00
微凉 e5f8f59c87 :bug: fix native account status 2021-11-16 18:23:59 +08:00
微凉 f87ee1ed9e :bug: fix 189 account status 2021-11-16 15:08:55 +08:00
微凉 07155cfd01 ✨ add show current password 2021-11-16 15:00:56 +08:00
微凉 5e982980dc :bug: fix determine gbk 2021-11-16 00:03:49 +08:00
微凉 8987958e26 :bug: fix 189 size and time 2021-11-15 20:31:44 +08:00
微凉 4466cb19a5 🎇 get 189 redirect url 2021-11-15 20:15:25 +08:00
微凉 da74e29b26 :bug: fix gbk garbled 2021-11-15 19:20:39 +08:00
微凉 82272fcbf5 :bug: fix windows onedrive path 2021-11-15 19:07:04 +08:00
微凉 74d86f8cc4 🎇 delete useless cookieJar 2021-11-15 19:06:44 +08:00
微凉 c03646dedf :bug: change text proxy 2021-11-15 19:06:10 +08:00
微凉 c0d1888e25 ✨ support 189cloud(login refer to PanIndex) 2021-11-15 18:00:43 +08:00
微凉 f4942e89bd :bug: fix account status 2021-11-15 15:01:14 +08:00
微凉 27e61c9eb8 :bug: fix change name error 2021-11-15 14:54:22 +08:00
微凉 aeb72320ca :bug: fix get error account 2021-11-15 14:53:32 +08:00
微凉 caddba05e9 💚 remove ppc64le docker 2021-11-14 14:53:23 +08:00
微凉 0dffb9aaa1 ✨ add customize style / script 2021-11-14 14:37:26 +08:00
微凉 0f93d2bfed :bug: fix version type 2021-11-14 00:30:15 +08:00
微凉 b785945210 :bug: fix add account 2021-11-13 19:31:35 +08:00
微凉 48a65784c7 :bug: fix can't delete and get meta 2021-11-13 17:10:44 +08:00
微凉 5f34b8ab80 ✨ account and meta add id 2021-11-13 16:49:03 +08:00
微凉 959ef620fb ✨ check parent folder password 2021-11-13 16:12:12 +08:00
微凉 a73501463f ✨ fix proxy 2021-11-13 16:02:19 +08:00
微凉 cf07b3921c 🔨 switch fiber to gin 2021-11-13 15:53:26 +08:00
微凉 65ec4e3611 ✨ dockerfile volume 2021-11-13 14:23:41 +08:00
微凉 7799c1f3bc 🎇 change default setting 2021-11-12 23:03:39 +08:00
微凉 e902c2ded7 ✨ add settings 2021-11-12 22:56:30 +08:00
微凉 2c675ae909 ✨ change settings 2021-11-12 19:39:01 +08:00
微凉 98c017730f ✨ resolved #155 2021-11-11 19:51:25 +08:00
微凉 f4affb2c69 ✨ add go proxy 2021-11-09 21:36:27 +08:00
微凉 17af21079f 💚 fix web path 2021-11-09 19:35:46 +08:00
微凉 f7d35ec925 💚 fix dockerfile 2021-11-09 18:12:36 +08:00
微凉 a8730e82b5 💚 fix dockerfile 2021-11-09 18:02:15 +08:00
微凉 6275e27d1b 💚 fix dockerfile 2021-11-09 17:54:38 +08:00
微凉 e70353704f 💚 fix dockerfile 2021-11-09 17:22:58 +08:00
微凉 be5b1e42d4 💚 fix dockerfile 2021-11-09 16:51:30 +08:00
微凉 7d08cbc4a9 🚧 build docker 2021-11-09 16:46:03 +08:00
微凉 1542878d66 🎨 format code 2021-11-09 16:03:04 +08:00
微凉 ac8f5d5737 :bug: file name contains + 2021-11-07 23:05:50 +08:00
微凉 9ed5b6e581 :bug: file name contains + 2021-11-07 22:12:52 +08:00
微凉 db7bff2d61 :bug: fix: #151 2021-11-07 14:04:54 +08:00
微凉 7970e737f0 ✨ add markdown theme setting 2021-11-06 17:33:00 +08:00
微凉 d4523d52ee :bug: delete timed task 2021-11-06 17:25:07 +08:00
微凉 ac8476702c :bug: refer to https://github.com/ad-m/github-push-action/issues/44#issuecomment-581706892 2021-11-05 20:52:50 +08:00
微凉 12f68eaed9 💚 fix upload asserts 2021-11-05 19:47:02 +08:00
微凉 6a51f02845 💚 mv build.sh 2021-11-05 19:11:39 +08:00
微凉 e7071e1093 ✨ release asserts files cdn 2021-11-05 19:03:54 +08:00
微凉 11b141b190 ✨ update onedrive account status 2021-11-05 16:32:20 +08:00
微凉 7e099b39cf ✨ cache len(files)=0: request 2021-11-05 16:30:50 +08:00
微凉 b46bf0dfc9 :bug: delete beta1 meta 2021-11-04 23:25:53 +08:00
微凉 91f64161b2 💚 change back to ubuntu 2021-11-04 22:38:08 +08:00
微凉 8255ef4346 💚 print md5 2021-11-04 21:34:52 +08:00
微凉 254b6c6f79 ✨ print build version 2021-11-04 18:42:27 +08:00
114 changed files with 18292 additions and 1660 deletions
+39
View File
@@ -0,0 +1,39 @@
name: "Bug report"
description: Bug report
labels: [pending triage]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
- type: input
id: version
attributes:
label: Alist Version / Alist 版本
description: What version of our software are you running?
placeholder: v2.0.0
validations:
required: true
- type: textarea
id: bug-description
attributes:
label: Describe the bug / 问题描述
validations:
required: true
- type: textarea
id: reproduction
attributes:
label: Reproduction / 复现链接
description: |
Please provide a link to a repo that can reproduce the problem you ran into.
请提供能复现此问题的链接
validations:
required: false
- type: textarea
id: logs
attributes:
label: 日志 / Logs
description: |
Please copy and paste any relevant log output.
请复制粘贴错误日志,或者截图
render: shell
+5
View File
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Questions & Discussions & Feature request
url: https://github.com/Xhofe/alist/discussions
about: Use GitHub discussions for message-board style questions and discussions or feature request.
+43 -22
View File
@@ -10,7 +10,7 @@ jobs:
build:
strategy:
matrix:
platform: [macos-latest]
platform: [ubuntu-latest]
go-version: [1.17]
name: Build
runs-on: ${{ matrix.platform }}
@@ -25,43 +25,64 @@ jobs:
with:
node-version: '16'
- name: Setup docker
uses: docker-practice/actions-setup-docker@master
- name: Checkout
uses: actions/checkout@v2
with:
ref: v2
path: alist
- name: Checkout web repo
uses: actions/checkout@v2
with:
repository: Xhofe/alist-web
ref: v2
path: alist-web
- name: Set up xgo
run: |
docker pull techknowlogick/xgo:latest
go install src.techknowlogick.com/xgo@latest
brew install upx
- name: Build web
run: |
cd alist-web
yarn
yarn build
cd ..
sudo apt install upx
- name: Build
run: |
cd alist
bash build.sh
cd ..
mv alist/build.sh .
bash build.sh web
mv dist/* alist/public
bash build.sh build
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: artifact
path: alist/build
docker:
name: Docker
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: xhofe/alist
- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: '16'
- name: Build web
run: |
bash build.sh web
mv dist/* public
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: xhofe
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/386,linux/arm/v6,linux/s390x
+45 -27
View File
@@ -9,7 +9,7 @@ jobs:
release:
strategy:
matrix:
platform: [macos-latest]
platform: [ubuntu-latest]
go-version: [1.17]
name: Release
runs-on: ${{ matrix.platform }}
@@ -19,47 +19,65 @@ jobs:
with:
go-version: ${{ matrix.go-version }}
- name: Setup docker
uses: docker-practice/actions-setup-docker@master
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '16'
- name: Checkout
uses: actions/checkout@v2
with:
ref: v2
path: alist
- name: Checkout web repo
uses: actions/checkout@v2
with:
repository: Xhofe/alist-web
ref: v2
path: alist-web
persist-credentials: false
fetch-depth: 0
- name: Set up xgo
run: |
docker pull techknowlogick/xgo:latest
go install src.techknowlogick.com/xgo@latest
brew install upx
- name: Build web
run: |
cd alist-web
yarn
yarn build
cd ..
sudo apt install upx
- name: Build
run: |
cd alist
mv alist/build.sh .
bash build.sh cdn
mv dist/* alist/public
bash build.sh release
cd ..
- name: Release
uses: softprops/action-gh-release@v1
with:
files: alist/build/compress/*
files: alist/build/compress/*
docker:
name: Docker
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: xhofe/alist
- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: '16'
- name: Build web
run: |
bash build.sh cdn
mv dist/* public
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: xhofe
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/386,linux/arm/v6,linux/s390x
+4 -2
View File
@@ -21,7 +21,9 @@ dist/
# Dependency directories (remove the comment below to include it)
# vendor/
bin/*
alist
/alist
*.json
public/index.html
public/assets/
public/assets/
public/public/
data/
+14
View File
@@ -0,0 +1,14 @@
FROM alpine:edge as builder
LABEL stage=go-builder
WORKDIR /app/
COPY ./ ./
RUN apk add --no-cache bash git go gcc musl-dev; \
sh build.sh docker
FROM alpine:edge
LABEL MAINTAINER="i@nn.ci"
VOLUME /opt/alist/data/
WORKDIR /opt/alist/
COPY --from=builder /app/bin/alist ./
EXPOSE 5244
CMD [ "./alist" ]
+661
View File
File diff suppressed because it is too large Load Diff
Regular → Executable
+55 -23
View File
@@ -1,43 +1,75 @@
<h2 align="center">Alist</h2>
<p align="center">
<a href="https://github.com/Xhofe/alist/releases"><img src="https://img.shields.io/github/release/Xhofe/alist?style=flat-square" alt="Release version"></a>
<div align="center">
<h3><a href="https://alist.nn.ci">Alist</a></h3>
<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>
<a href="https://github.com/Xhofe/alist/actions?query=workflow%3ABuild"><img src="https://img.shields.io/github/workflow/status/Xhofe/alist/build?style=flat-square" alt="Build status"></a>
<a href="https://github.com/Xhofe/alist/releases"><img src="https://img.shields.io/github/downloads/Xhofe/alist/total?style=flat-square" alt="Downloads"></a>
<a href="https://github.com/Xhofe/alist/blob/main/LICENSE"><img src="https://img.shields.io/github/license/Xhofe/alist?style=flat-square" alt="License"></a>
<a href="https://github.com/Xhofe/alist/releases"><img src="https://img.shields.io/github/downloads/Xhofe/alist/total?style=flat-square&color=%239F7AEA" alt="Downloads"></a>
<a href="https://github.com/Xhofe/alist/blob/v2/LICENSE"><img src="https://img.shields.io/github/license/Xhofe/alist?style=flat-square" alt="License"></a>
<a href="https://pay.xhofe.top">
<img src="https://img.shields.io/badge/%24-donate-ff69b4.svg?style=flat-square" alt="donate">
</a>
</p>
</div>
---
### 这是什么?
English | [中文](./README_cn.md)
一款支持多种存储的目录文件列表程序,后端基于`go-fiber`,前端使用`react`。
## Features
### 前端项目地址
- [x] Multiple storage
- [x] Local storage
- [x] [Aliyundrive](https://www.aliyundrive.com/)
- [x] OneDrive / Sharepoint ([global](https://www.office.com/), [cn](https://portal.partner.microsoftonline.cn),de,us)
- [x] [189cloud](https://cloud.189.cn)
- [x] [GoogleDrive](https://drive.google.com/)
- [x] [123pan](https://www.123pan.com/)
- [x] [Lanzou](https://pc.woozooo.com/)
- [x] [Alist](https://github.com/Xhofe/alist)
- [x] FTP
- [x] [PikPak](https://www.mypikpak.com/)
- [x] [ShandianPan](https://shandianpan.com/)
- [x] [S3](https://aws.amazon.com/s3/)
- [x] WebDav
- [x] Teambition([China](https://www.teambition.com/ ),[International](https://us.teambition.com/ ))
- [x] [Mediatrack](https://www.mediatrack.cn/)
- [x] [139yun](https://yun.139.com/) (Personal, Family)
- [x] Easy to deploy and out-of-the-box
- [x] File preview (PDF, markdown, code, plain text, ...)
- [x] Image preview in gallery mode
- [x] Video and audio preview (mp4, mp3, ...)
- [x] Office documents preview (docx, pptx, xlsx, ...)
- [x] `README.md` preview rendering
- [x] File permalink copy and direct file download
- [x] Dark mode
- [x] I18n
- [x] Protected routes (password protection and authentication)
- [x] WebDav (see https://alist-doc.nn.ci/en/docs/webdav for details)
- [x] [Docker Deploy](https://hub.docker.com/r/xhofe/alist)
- [x] Cloudflare workers proxy
- [x] File/Folder package download
- [x] Support video list playback and subtitles(ass,srt,vtt)
- [x] Web upload(Can allow visitors to upload) and delete
- https://github.com/Xhofe/alist-web
## Discussion
### 演示地址
Please go to our [discussion forum](https://github.com/Xhofe/alist/discussions) for general questions, **issues are for bug reports only.**
- https://alist.nn.ci
## Demo
### 预览
Available at: <https://alist.nn.ci>.
<a href="https://alist.nn.ci/"><img src="https://store.heytapimage.com/cdo-portal/feedback/202111/03/695ef77854a144e928518efde38db97a.png"></a>
![demo](https://inews.gtimg.com/newsapp_ls/0/14256614096/0)
### 支持的存储
## Document
- 本地存储
- 阿里云盘
- Onedrive
- ...
<https://alist-doc.nn.ci/en/>
### 如何使用
## License
- https://www.nn.ci/archives/alist.html
The `AList` is open-source software licensed under the AGPL-3.0 license.
### License
---
The `AList` is open-source software licensed under the MIT license.
> [@Blog](https://www.nn.ci/) · [@GitHub](https://github.com/Xhofe)
+74
View File
@@ -0,0 +1,74 @@
<div align="center">
<h3><a href="https://alist.nn.ci">Alist</a></h3>
<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>
<a href="https://github.com/Xhofe/alist/actions?query=workflow%3ABuild"><img src="https://img.shields.io/github/workflow/status/Xhofe/alist/build?style=flat-square" alt="Build status"></a>
<a href="https://github.com/Xhofe/alist/releases"><img src="https://img.shields.io/github/downloads/Xhofe/alist/total?style=flat-square&color=%239F7AEA" alt="Downloads"></a>
<a href="https://github.com/Xhofe/alist/blob/v2/LICENSE"><img src="https://img.shields.io/github/license/Xhofe/alist?style=flat-square" alt="License"></a>
<a href="https://pay.xhofe.top">
<img src="https://img.shields.io/badge/%24-donate-ff69b4.svg?style=flat-square" alt="donate">
</a>
</div>
---
[English](./README.md) | 中文
## 支持
- [x] 多种存储
- [x] 本地存储
- [x] [阿里云盘](https://www.aliyundrive.com/)
- [x] OneDrive / Sharepoint([国际版](https://www.office.com/), [世纪互联](https://portal.partner.microsoftonline.cn),de,us)
- [x] [天翼云盘](https://cloud.189.cn)
- [x] [GoogleDrive](https://drive.google.com/)
- [x] [123云盘](https://www.123pan.com/)
- [x] [蓝奏云](https://pc.woozooo.com/)
- [x] [Alist](https://github.com/Xhofe/alist)
- [x] FTP
- [x] [PikPak](https://www.mypikpak.com/)
- [x] [闪电盘](https://shandianpan.com/)
- [x] [S3](https://aws.amazon.com/cn/s3/)
- [x] WebDav
- [x] Teambition([中国](https://www.teambition.com/ ),[国际](https://us.teambition.com/ ))
- [x] [分秒帧](https://www.mediatrack.cn/)
- [x] [和彩云](https://yun.139.com/) (个人云, 家庭云)
- [x] 部署方便,开箱即用
- [x] 文件预览(PDF、markdown、代码、纯文本……)
- [x] 画廊模式下的图像预览
- [x] 视频和音频预览(mp4、mp3 等)
- [x] Office 文档预览(docx、pptx、xlsx、...)
- [x] `README.md` 预览渲染
- [x] 文件永久链接复制和直接文件下载
- [x] 黑暗模式
- [x] 国际化
- [x] 受保护的路由(密码保护和身份验证)
- [x] WebDav(具体见https://alist-doc.nn.ci/docs/webdav )
- [x] [Docker 部署](https://hub.docker.com/r/xhofe/alist)
- [x] Cloudflare workers 中转
- [x] 文件/文件夹打包下载
- [x] 支持视频列表播放和字幕(ass,srt,vtt)
- [x] 网页上传(可以允许访客上传),删除
## 讨论
一般问题请到[讨论论坛](https://github.com/Xhofe/alist/discussions) ,**issue仅针对错误报告。**
## 演示
<https://alist.nn.ci>。
![演示](https://inews.gtimg.com/newsapp_ls/0/14256614096/0)
## 文档
<https://alist-doc.nn.ci/>
## 许可
`AList` 是在 AGPL-3.0 许可下许可的开源软件。
---
> [@Blog](https://www.nn.ci/) · [@GitHub](https://github.com/Xhofe)
+35 -24
View File
@@ -1,47 +1,58 @@
package main
import (
"flag"
"fmt"
"github.com/Xhofe/alist/bootstrap"
"github.com/Xhofe/alist/conf"
"github.com/Xhofe/alist/public"
_ "github.com/Xhofe/alist/drivers"
"github.com/Xhofe/alist/model"
"github.com/Xhofe/alist/server"
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/filesystem"
"github.com/gin-gonic/gin"
log "github.com/sirupsen/logrus"
"net/http"
)
func init() {
flag.StringVar(&conf.ConfigFile, "conf", "config.json", "config file")
flag.BoolVar(&conf.Debug, "debug", false, "start with debug mode")
flag.BoolVar(&conf.Version, "version", false, "print version info")
flag.Parse()
}
func Init() {
bootstrap.InitLog()
func Init() bool {
//bootstrap.InitLog()
bootstrap.InitConf()
bootstrap.InitCron()
bootstrap.InitModel()
if conf.Password {
pass, err := model.GetSettingByKey("password")
if err != nil {
log.Errorf(err.Error())
return false
}
log.Infof("current password: %s", pass.Value)
return false
}
server.InitIndex()
bootstrap.InitSettings()
bootstrap.InitAccounts()
bootstrap.InitCache()
return true
}
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\n", conf.BuiltAt, conf.GoVersion, conf.GitAuthor, conf.GitCommit, conf.GitTag)
return
}
Init()
app := fiber.New()
server.InitApiRouter(app)
app.Use("/", filesystem.New(filesystem.Config{
Root: http.FS(public.Public),
NotFoundFile: "index.html",
}))
log.Info("starting server")
err := app.Listen(fmt.Sprintf(":%d", conf.Conf.Port))
if !Init() {
return
}
if !conf.Debug {
gin.SetMode(gin.ReleaseMode)
}
r := gin.Default()
server.InitApiRouter(r)
base := fmt.Sprintf("%s:%d", conf.Conf.Address, conf.Conf.Port)
log.Infof("start server @ %s", base)
var err error
if conf.Conf.Scheme.Https {
err = r.RunTLS(base, conf.Conf.Scheme.CertFile, conf.Conf.Scheme.KeyFile)
} else {
err = r.Run(base)
}
if err != nil {
log.Errorf("failed to start: %s", err.Error())
}
+30
View File
@@ -0,0 +1,30 @@
package bootstrap
import (
"github.com/Xhofe/alist/conf"
"github.com/Xhofe/alist/drivers/base"
"github.com/Xhofe/alist/model"
log "github.com/sirupsen/logrus"
)
func InitAccounts() {
log.Infof("init accounts...")
var accounts []model.Account
if err := conf.DB.Find(&accounts).Error; err != nil {
log.Fatalf("failed sync init accounts")
}
for i, account := range accounts {
model.RegisterAccount(account)
driver, ok := base.GetDriver(account.Type)
if !ok {
log.Errorf("no [%s] driver", account.Type)
} else {
err := driver.Save(&accounts[i], nil)
if err != nil {
log.Errorf("init account [%s] error:[%s]", account.Name, err.Error())
} else {
log.Infof("success init account: %s, type: %s", account.Name, account.Type)
}
}
}
}
+5 -1
View File
@@ -12,7 +12,11 @@ import (
// InitCache init cache
func InitCache() {
log.Infof("init cache...")
goCacheClient := goCache.New(60*time.Minute, 120*time.Minute)
c := conf.Conf.Cache
if c.Expiration == 0 {
c.Expiration, c.CleanupInterval = 60, 120
}
goCacheClient := goCache.New(time.Duration(c.Expiration)*time.Minute, time.Duration(c.CleanupInterval)*time.Minute)
goCacheStore := store.NewGoCache(goCacheClient, nil)
conf.Cache = cache.New(goCacheStore)
}
+14 -2
View File
@@ -1,7 +1,6 @@
package bootstrap
import (
"encoding/json"
"github.com/Xhofe/alist/conf"
"github.com/Xhofe/alist/utils"
log "github.com/sirupsen/logrus"
@@ -13,6 +12,10 @@ func InitConf() {
log.Infof("reading config file: %s", conf.ConfigFile)
if !utils.Exists(conf.ConfigFile) {
log.Infof("config file not exists, creating default config file")
_, err := utils.CreatNestedFile(conf.ConfigFile)
if err != nil {
log.Fatalf("failed to create config file")
}
conf.Conf = conf.DefaultConfig()
if !utils.WriteToJson(conf.ConfigFile, conf.Conf) {
log.Fatalf("failed to create default config file")
@@ -24,9 +27,18 @@ func InitConf() {
log.Fatalf("reading config file error:%s", err.Error())
}
conf.Conf = new(conf.Config)
err = json.Unmarshal(config, conf.Conf)
err = utils.Json.Unmarshal(config, conf.Conf)
if err != nil {
log.Fatalf("load config error: %s", err.Error())
}
log.Debugf("config:%+v", conf.Conf)
// update config.json struct
confBody, err := utils.Json.Marshal(conf.Conf)
if err != nil {
log.Fatalf("marshal config error:%s", err.Error())
}
err = ioutil.WriteFile(conf.ConfigFile, confBody, 0777)
if err != nil {
log.Fatalf("update config struct error: %s", err.Error())
}
}
+12 -1
View File
@@ -1,11 +1,12 @@
package bootstrap
import (
"flag"
"github.com/Xhofe/alist/conf"
log "github.com/sirupsen/logrus"
)
// initLog init log
// InitLog init log
func InitLog() {
if conf.Debug {
log.SetLevel(log.DebugLevel)
@@ -18,4 +19,14 @@ func InitLog() {
TimestampFormat: "2006-01-02 15:04:05",
FullTimestamp: true,
})
log.Infof("init log...")
}
func init() {
flag.StringVar(&conf.ConfigFile, "conf", "data/config.json", "config file")
flag.BoolVar(&conf.Debug, "debug", false, "start with debug mode")
flag.BoolVar(&conf.Version, "version", false, "print version info")
flag.BoolVar(&conf.Password, "password", false, "print current password")
flag.Parse()
InitLog()
}
+8 -111
View File
@@ -3,7 +3,6 @@ package bootstrap
import (
"fmt"
"github.com/Xhofe/alist/conf"
"github.com/Xhofe/alist/drivers"
"github.com/Xhofe/alist/model"
log "github.com/sirupsen/logrus"
"gorm.io/driver/mysql"
@@ -20,6 +19,7 @@ import (
func InitModel() {
log.Infof("init model...")
var err error
databaseConfig := conf.Conf.Database
newLogger := logger.New(
log2.New(os.Stdout, "\r\n", log2.LstdFlags),
@@ -72,117 +72,14 @@ func InitModel() {
default:
log.Fatalf("not supported database type: %s", databaseConfig.Type)
}
log.Infof("auto migrate model")
err := conf.DB.AutoMigrate(&model.SettingItem{}, &model.Account{}, &model.Meta{})
log.Infof("auto migrate model...")
if databaseConfig.Type == "mysql" {
err = conf.DB.Set("gorm:table_options", "ENGINE=InnoDB CHARSET=utf8mb4").
AutoMigrate(&model.SettingItem{}, &model.Account{}, &model.Meta{})
} else {
err = conf.DB.AutoMigrate(&model.SettingItem{}, &model.Account{}, &model.Meta{})
}
if err != nil {
log.Fatalf("failed to auto migrate")
}
// TODO init filetype
initAccounts()
initSettings()
}
func initAccounts() {
log.Infof("init accounts...")
var accounts []model.Account
if err := conf.DB.Find(&accounts).Error; err != nil {
log.Fatalf("failed sync init accounts")
}
for _, account := range accounts {
model.RegisterAccount(account)
driver, ok := drivers.GetDriver(account.Type)
if !ok {
log.Errorf("no [%s] driver", driver)
} else {
err := driver.Save(&account, nil)
if err != nil {
log.Errorf("init account [%s] error:[%s]", account.Name, err.Error())
}
}
}
}
func initSettings() {
log.Infof("init settings...")
version := model.SettingItem{
Key: "version",
Value: conf.GitTag,
Description: "version",
Group: model.CONST,
}
_ = model.SaveSetting(version)
settings := []model.SettingItem{
{
Key: "title",
Value: "Alist",
Description: "title",
Group: model.PUBLIC,
},
{
Key: "password",
Value: "alist",
Description: "password",
Group: model.PRIVATE,
},
{
Key: "logo",
Value: "https://store.heytapimage.com/cdo-portal/feedback/202110/30/d43c41c5d257c9bc36366e310374fb19.png",
Description: "logo",
Group: model.PUBLIC,
},
{
Key: "favicon",
Value: "https://store.heytapimage.com/cdo-portal/feedback/202110/30/d43c41c5d257c9bc36366e310374fb19.png",
Description: "favicon",
Group: model.PUBLIC,
},
{
Key: "icon color",
Value: "teal.300",
Description: "icon's color",
Group: model.PUBLIC,
},
{
Key: "text types",
Value: "txt,htm,html,xml,java,properties,sql,js,md,json,conf,ini,vue,php,py,bat,gitignore,yml,go,sh,c,cpp,h,hpp",
Description: "text type extensions",
},
{
Key: "readme file",
Value: "hide",
Description: "hide readme file? (show/hide)",
},
{
Key: "music cover",
Value: "https://store.heytapimage.com/cdo-portal/feedback/202110/30/d43c41c5d257c9bc36366e310374fb19.png",
Description: "music cover image",
Group: model.PUBLIC,
},
{
Key: "site beian",
Description: "chinese beian info",
Group: model.PUBLIC,
},
{
Key: "home readme url",
Description: "when have multiple, the readme file to show",
Group: model.PUBLIC,
},
}
for _, v := range settings {
_, err := model.GetSettingByKey(v.Key)
if err == gorm.ErrRecordNotFound {
err = model.SaveSetting(v)
if err != nil {
log.Fatalf("failed write setting: %s", err.Error())
}
}
}
textTypes, err := model.GetSettingByKey("text types")
if err == nil {
conf.TextTypes = strings.Split(textTypes.Value, ",")
}
}
File diff suppressed because it is too large Load Diff
+85 -38
View File
@@ -1,18 +1,51 @@
#!/bin/bash
appName="alist"
builtAt="$(date +'%F %T %z')"
goVersion=$(go version | sed 's/go version //')
gitAuthor=$(git show -s --format='format:%aN <%ae>' HEAD)
gitCommit=$(git log --pretty=format:"%h" -1)
# 构建前端,在当前目录产生一个dist文件夹
BUILD_WEB() {
git clone https://github.com/alist-org/alist-web.git
cd alist-web
yarn
yarn build
mv dist ..
cd ..
rm -rf alist-web
}
if [ "$1" == "release" ]; then
gitTag=$(git describe --abbrev=0 --tags)
else
gitTag=$(git describe --abbrev=0 --tags)-next
fi
CDN_WEB() {
curl -L https://github.com/alist-org/alist-web/releases/latest/download/dist.tar.gz -o dist.tar.gz
tar -zxvf dist.tar.gz
rm -f dist.tar.gz
}
ldflags="\
# 在DOCKER中构建
BUILD_DOCKER() {
appName="alist"
builtAt="$(date +'%F %T %z')"
goVersion=$(go version | sed 's/go version //')
gitAuthor=$(git show -s --format='format:%aN <%ae>' HEAD)
gitCommit=$(git log --pretty=format:"%h" -1)
gitTag=$(git describe --long --tags --dirty --always)
ldflags="\
-w -s \
-X 'github.com/Xhofe/alist/conf.BuiltAt=$builtAt' \
-X 'github.com/Xhofe/alist/conf.GoVersion=$goVersion' \
-X 'github.com/Xhofe/alist/conf.GitAuthor=$gitAuthor' \
-X 'github.com/Xhofe/alist/conf.GitCommit=$gitCommit' \
-X 'github.com/Xhofe/alist/conf.GitTag=$gitTag' \
"
go build -o ./bin/alist -ldflags="$ldflags" -tags=jsoniter alist.go
}
BUILD() {
cd alist
appName="alist"
builtAt="$(date +'%F %T %z')"
goVersion=$(go version | sed 's/go version //')
gitAuthor=$(git show -s --format='format:%aN <%ae>' HEAD)
gitCommit=$(git log --pretty=format:"%h" -1)
gitTag=$(git describe --long --tags --dirty --always)
echo "build version: $gitTag"
ldflags="\
-w -s \
-X 'github.com/Xhofe/alist/conf.BuiltAt=$builtAt' \
-X 'github.com/Xhofe/alist/conf.GoVersion=$goVersion' \
@@ -21,33 +54,47 @@ ldflags="\
-X 'github.com/Xhofe/alist/conf.GitTag=$gitTag' \
"
cp -R ../alist-web/dist/* public
if [ "$1" == "release" ]; then
xgo -out "$appName" -ldflags="$ldflags" -tags=jsoniter .
else
xgo -targets=linux/amd64,windows/amd64 -out alist -ldflags="$ldflags" -tags=jsoniter .
fi
mkdir "build"
mv alist-* build
cd build
upx -9 ./*
find . -type f -print0 | xargs -0 md5sum >md5.txt
cat md5.txt
cd ../..
}
if [ "$1" == "release" ]; then
xgo -out alist -ldflags="$ldflags" .
RELEASE() {
cd alist/build
mkdir compress
mv md5.txt compress
for i in $(find . -type f -name "$appName-linux-*"); do
tar -czvf compress/"$i".tar.gz "$i"
done
for i in $(find . -type f -name "$appName-darwin-*"); do
tar -czvf compress/"$i".tar.gz "$i"
done
for i in $(find . -type f -name "$appName-windows-*"); do
zip compress/$(echo $i | sed 's/\.[^.]*$//').zip "$i"
done
cd ../..
}
if [ "$1" = "web" ]; then
BUILD_WEB
elif [ "$1" = "cdn" ]; then
CDN_WEB
elif [ "$1" = "docker" ]; then
BUILD_DOCKER
elif [ "$1" = "build" ]; then
BUILD build
elif [ "$1" = "release" ]; then
BUILD release
RELEASE
else
xgo -targets=linux/amd64,windows/amd64,darwin/amd64 -out alist -ldflags="$ldflags" .
echo -e "${RED_COLOR} 错误的命令${RES}"
fi
mkdir "build"
mv alist-* build
cd build || exit
upx -9 ./*
find . -type f -print0 | xargs -0 md5sum > md5.txt
# compress file (release)
if [ "$1" == "release" ]; then
mkdir compress
mv md5.txt compress
for i in `find . -type f -name "$appName-linux-*"`
do
tar -czvf compress/"$i".tar.gz "$i"
done
for i in `find . -type f -name "$appName-darwin-*"`
do
tar -czvf compress/"$i".tar.gz "$i"
done
for i in `find . -type f -name "$appName-windows-*"`
do
zip compress/$(echo $i | sed 's/\.[^.]*$//').zip "$i"
done
fi
+23 -8
View File
@@ -10,10 +10,25 @@ type Database struct {
TablePrefix string `json:"table_prefix"`
DBFile string `json:"db_file"`
}
type Scheme struct {
Https bool `json:"https"`
CertFile string `json:"cert_file"`
KeyFile string `json:"key_file"`
}
type CacheConfig struct {
Expiration int64 `json:"expiration"`
CleanupInterval int64 `json:"cleanup_interval"`
}
type Config struct {
Address string `json:"address"`
Port int `json:"port"`
Database Database `json:"database"`
Address string `json:"address"`
Port int `json:"port"`
Local bool `json:"local"`
Database Database `json:"database"`
Scheme Scheme `json:"scheme"`
Cache CacheConfig `json:"cache"`
}
func DefaultConfig() *Config {
@@ -22,13 +37,13 @@ func DefaultConfig() *Config {
Port: 5244,
Database: Database{
Type: "sqlite3",
User: "",
Password: "",
Host: "",
Port: 0,
Name: "",
TablePrefix: "x_",
DBFile: "data.db",
DBFile: "data/data.db",
},
Cache: CacheConfig{
Expiration: 60,
CleanupInterval: 120,
},
}
}
+65 -5
View File
@@ -5,6 +5,7 @@ import (
"github.com/eko/gocache/v2/cache"
"github.com/robfig/cron/v3"
"gorm.io/gorm"
"strconv"
)
var (
@@ -12,7 +13,7 @@ var (
GoVersion string
GitAuthor string
GitCommit string
GitTag string
GitTag string = "dev"
)
var (
@@ -20,6 +21,7 @@ var (
Conf *Config
Debug bool
Version bool
Password bool
DB *gorm.DB
Cache *cache.Cache
@@ -28,9 +30,67 @@ var (
)
var (
TextTypes = []string{"txt", "go", "md"}
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"}
OfficeTypes = []string{"doc", "docx", "xls", "xlsx", "ppt", "pptx", "pdf"}
VideoTypes = []string{"mp4", "mkv", "avi", "mov", "rmvb"}
AudioTypes = []string{"mp3", "flac", "ogg"}
ImageTypes = []string{"jpg", "tiff", "jpeg", "png", "gif", "bmp", "svg"}
VideoTypes = []string{"mp4", "mkv", "avi", "mov", "rmvb", "webm", "flv"}
AudioTypes = []string{"mp3", "flac", "ogg", "m4a", "wav"}
ImageTypes = []string{"jpg", "tiff", "jpeg", "png", "gif", "bmp", "svg", "ico"}
)
var settingsMap = make(map[string]string, 0)
func Set(key string, value string) {
settingsMap[key] = value
}
func GetStr(key string) string {
value, ok := settingsMap[key]
if !ok {
return ""
}
return value
}
func GetBool(key string) bool {
value, ok := settingsMap[key]
if !ok {
return false
}
return value == "true"
}
func GetInt(key string, defaultV int) int {
value, ok := settingsMap[key]
if !ok {
return defaultV
}
v, err := strconv.Atoi(value)
if err != nil {
return defaultV
}
return v
}
var (
LoadSettings = []string{
"check parent folder", "check down link", "WebDAV username", "WebDAV password",
"Visitor WebDAV username", "Visitor WebDAV password",
"default page size", "load type",
}
)
var (
RawIndexHtml string
ManageHtml string
IndexHtml string
Token string
//CheckParent bool
//CheckDown bool
//DavUsername string
//DavPassword string
//VisitorDavUsername string
//VisitorDavPassword string
)
+230
View File
File diff suppressed because it is too large Load Diff

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