OneList是萌咖大佬做的一个非常简洁的OneDrive目录程序!没有视频在线播放,没有图片预览等!非常不错的开源代码!
本文主要介绍一下如何利用IBM Cloud Lite(轻量套餐)来部署我们的程序!这样降低我们的门槛~不用VPS哦~~
同样的方法支持我们部署OneIndex,Pyone 等等相似的开源程序!同时也能搭建**,本文不多做介绍!
关于免费的IBM Cloud Lite博主历史文章中有详细的介绍!
请依次参考:
免费申请使用IBM Cloud Lite(轻量套餐) 详细教程指南
免费版IBM Cloud Kubernetes Service(集群容器) 申请/部署
开源代码
原作者开源地址:https://github.com/0oVicero0/OneList/
博主修改地址:https://github.com/malaohu/OneList–
主要修改了以下几点:
1)不使用Redis存储(博主发布文章时原作者代码也已经支持内存存储)。
2)优化网页后退按钮。
3)博主新增了分支【AWS-Cloud-Foundry】 专门针对AWS部署使用!
准备工作
1)Office 账号(不支持个人版微软账号)
2)IBM Cloud Lite或者一台VPS
3)域名一个(可选)
申请Token
1)点击访问下面的地址,登录账号!授权许可!
https://login.microsoftonline.com/common/oauth2/authorize?response_type=code&client_id=ea2b36f6-b8ad-40be-bc0f-e5e4a4a7d4fa&redirect_uri=https://api.moeclub.org/onedrive-login
2)然后页面会输出TOKEN!!复制保存内容!
VPS部署
这里介绍使用VPS服务器来部署原版的OneList!!这部分内容转载自:https://www.moerats.com/archives/906/
博主做了一些修改,因为OneList现在不需要Redis也能运行了!
1、安装依赖
CenOS 6
系统:
1 2 3 4 5 6 7 |
#安装EPEL rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm #安装Python3 yum install python34 git -y #安装pip3 wget https://bootstrap.pypa.io/get-pip.py python3 get-pip.py |
CenOS 7
系统:
1 2 3 4 5 6 7 8 9 |
#安装EPEL rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm #安装Python3 yum install python36 git -y #配置Python3软链接 ln -s /usr/bin/python3.6 /usr/bin/python3 #安装pip3 wget https://bootstrap.pypa.io/get-pip.py python3 get-pip.py |
Debian
/Ubuntu
系统:
1 2 3 |
#安装pip3和Redis apt update apt install python3-pip git -y |
2、安装OneList
1 2 3 4 |
#拉取源码 git clone https://github.com/0oVicero0/OneList.git #安装依赖 cd OneList && pip3 install -r requirements.txt |
接下来在OneList
目录新建config.json
配置文件。
1 |
nano config.json |
将以下内容复制进去:
1 2 3 4 5 6 7 8 9 10 11 |
#将下面refresh_token替换成你获取到的字段 { "token": "<refresh_token>", "location_path": "/", "start_directory": "/", "threads": 3, "diff_seconds": 480, "refresh_seconds": 720, "metadata_cached_seconds": 768, "structure_cached_seconds": 840 } |
再使用ctrl+x
、y
保存退出。
开始运行:
1 |
gunicorn app:app -b 0.0.0.0:8888 -D |
此时访问地址为IP:8888
。
IBM部署
这里是利用免费的IBM Cloud Lite部署!这个才是本文的重点!!这里谢谢@屁屁虾大佬提供的技术指导!
1)新建Python Web应用程序
访问链接:https://cloud.ibm.com/catalog 搜索 python
然后点击Python Web应用程序
2)名称随便,主机名随便!域最好选择 us-south.cf.appdomain.cloud (其他域名貌似被Q)!点击创建!
3)接下来我们配置GITHUB!
点击创建过后,点击【概述】 – 右下角在【持续交付】中点击【启用】
4)在新窗口中往下拉,有一个源存储库URL。直接将我们的GITHUB地址粘贴进去!
https://github.com/malaohu/OneList–
启动问题 和 跟踪代码更改部署 勾选去掉!
点击【创建】会提示你创建API密钥,点击创建即可!
5)创建成果后,点击【GIT】方块,会前往一个GIT管理平台。
我们到那个平台修改我们的TOKEN!
6)首先我们切换到【AWS-Cloud-Foundry】分支!
7)修改config.json文件。将 <refresh_token> 替换成你的 token。然后点击提交记录!
详细操作看图!!
8)接下来我们配置一下部署的分支!
点击【持续交付】中点击【查看工具箱】~~
9)点击【Delivery Pipeline】方块!
10)点击齿轮 – 配置暂存区 !
然后代码分支选择:【AWS-Cloud-Foundry】 保存!
11)然后点击启动按钮,等待启动完成吧!!!
12)如上图则完成启动!点击访问应用程序URL ~ 即可访问啦!!!
绑定域名
1)回到资源管理界面,【路径】 – 【管理域】!
2)点击【···】 – 【域】!
3)点击添加域!输入我们想要绑定的域名!
如图:onelist.somecolor.cc 点击【添加】!
证书可以不上传!!现在免费的证书有好多!!
4)将onelist.somecolor.cc 域名解析到 onelist-ruyo.us-south.cf.appdomain.cloud (提醒注意替换你红色部分名称)!
5)点击【路径】 – 【编辑路径】选择刚刚绑定的域名 onelist.somecolor.cc 主机名可以为空!
然后就大功告成啦!!!
演示地址:http://onelist.somecolor.cc
大佬这个咋回事啊
No start command specified by buildpack or via Procfile.
App will not start unless a command is provided at runtime.
Exit status 0
Uploading droplet, build artifacts cache...
Uploading droplet...
Uploading build artifacts cache...
Uploaded build artifacts cache (49.2M)
Uploaded droplet (50.1M)
Uploading complete
Cell b58ccdc5-7684-4251-8982-298940e800d1 stopping instance 5f9084d3-0db4-465a-8830-b9e10d48399e
Cell b58ccdc5-7684-4251-8982-298940e800d1 destroying container for instance 5f9084d3-0db4-465a-8830-b9e10d48399e
Cell b58ccdc5-7684-4251-8982-298940e800d1 successfully destroyed container for instance 5f9084d3-0db4-465a-8830-b9e10d48399e
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 crashed
FAILED
Error restarting application: Start unsuccessful
TIP: use 'cf logs onedx --recent' for more information
Finished: FAILED
API过期了,现在用Graph的API了
看看同性交友网站,我修改的马甲的库OneListUseMsGraph,修改onedrive py 文件
谢谢777大佬,问题解决了!
用了777大佬的git仍然报错,咋回事啊
大佬麻烦帮看下这是咋了
-----> Python Buildpack version 1.7.12
-----> Supplying Python
-----> Installing python 3.6.10
Download [https://buildpacks.cloudfoundry.org/dependencies/python/python-3.6.10-linux-x64-cflinuxfs3-3bb086eb.tgz]
-----> Installing pip-pop 0.1.4
Copy [/tmp/cache/final/dependencies/3b86fb2cd9c13268f8858fd0ccb2f9eaf11295a51804b7075fe38d7e2a471191/pip-pop-0.1.4-0a3b0f1b.tar.gz]
-----> Running Pip Install
Collecting Flask==1.0.2 (from -r /tmp/app/requirements.txt (line 1))
Using cached https://files.pythonhosted.org/packages/7f/e7/08578774ed4536d3242b14dacb4696386634607af824ea997202cd0edb4b/Flask-1.0.2-py2.py3-none-any.whl
Collecting schedule==0.6.0 (from -r /tmp/app/requirements.txt (line 2))
Using cached https://files.pythonhosted.org/packages/57/22/3a709462eb02412bd1145f6e53604f36bba191e3e4e397bea4a718fec38c/schedule-0.6.0-py2.py3-none-any.whl
Collecting gunicorn==19.9.0 (from -r /tmp/app/requirements.txt (line 3))
Using cached https://files.pythonhosted.org/packages/8c/da/b8dd8deb741bff556db53902d4706774c8e1e67265f69528c14c003644e6/gunicorn-19.9.0-py2.py3-none-any.whl
Collecting python-dateutil==2.8.0 (from -r /tmp/app/requirements.txt (line 4))
Collecting diskcache==3.1.1 (from -r /tmp/app/requirements.txt (line 5))
Using cached https://files.pythonhosted.org/packages/41/17/c62faccbfbd163c7f57f3844689e3a78bae1f403648a6afb1d0866d87fbb/python_dateutil-2.8.0-py2.py3-none-any.whl
Using cached https://files.pythonhosted.org/packages/6b/92/eef5c59a4cec01277cbc12cb6c7946bdb4e135a13fd5a390949817bf2921/diskcache-3.1.1-py2.py3-none-any.whl
Using cached https://files.pythonhosted.org/packages/76/ae/44b03b253d6fade317f32c24d100b3b35c2239807046a4c953c7b89fa49e/itsdangerous-1.1.0-py2.py3-none-any.whl
Collecting itsdangerous>=0.24 (from Flask==1.0.2->-r /tmp/app/requirements.txt (line 1))
Collecting click>=5.1 (from Flask==1.0.2->-r /tmp/app/requirements.txt (line 1))
Using cached https://files.pythonhosted.org/packages/d2/3d/fa76db83bf75c4f8d338c2fd15c8d33fdd7ad23a9b5e57eb6c5de26b430e/click-7.1.2-py2.py3-none-any.whl
Collecting Werkzeug>=0.14 (from Flask==1.0.2->-r /tmp/app/requirements.txt (line 1))
Using cached https://files.pythonhosted.org/packages/cc/94/5f7079a0e00bd6863ef8f1da638721e9da21e5bacee597595b318f71d62e/Werkzeug-1.0.1-py2.py3-none-any.whl
Collecting Jinja2>=2.10 (from Flask==1.0.2->-r /tmp/app/requirements.txt (line 1))
Using cached https://files.pythonhosted.org/packages/30/9e/f663a2aa66a09d838042ae1a2c5659828bb9b41ea3a6efa20a20fd92b121/Jinja2-2.11.2-py2.py3-none-any.whl
Collecting six>=1.5 (from python-dateutil==2.8.0->-r /tmp/app/requirements.txt (line 4))
Using cached https://files.pythonhosted.org/packages/ee/ff/48bde5c0f013094d729fe4b0316ba2a24774b3ff1c52d924a8a4cb04078a/six-1.15.0-py2.py3-none-any.whl
Collecting MarkupSafe>=0.23 (from Jinja2>=2.10->Flask==1.0.2->-r /tmp/app/requirements.txt (line 1))
Using cached https://files.pythonhosted.org/packages/b2/5f/23e0023be6bb885d00ffbefad2942bc51a620328ee910f64abe5a8d18dd1/MarkupSafe-1.1.1-cp36-cp36m-manylinux1_x86_64.whl
Installing collected packages: itsdangerous, click, Werkzeug, MarkupSafe, Jinja2, Flask, schedule, gunicorn, six, python-dateutil, diskcache
The script flask is installed in '/tmp/contents278618342/deps/0/python/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
The scripts gunicorn and gunicorn_paster are installed in '/tmp/contents278618342/deps/0/python/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed Flask-1.0.2 Jinja2-2.11.2 MarkupSafe-1.1.1 Werkzeug-1.0.1 click-7.1.2 diskcache-3.1.1 gunicorn-19.9.0 itsdangerous-1.1.0 python-dateutil-2.8.0 schedule-0.6.0 six-1.15.0
You are using pip version 18.1, however version 20.2b1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
No start command specified by buildpack or via Procfile.
App will not start unless a command is provided at runtime.
Exit status 0
Uploading droplet, build artifacts cache...
Uploading droplet...
Uploading build artifacts cache...
Uploaded build artifacts cache (49.2M)
Uploaded droplet (50.1M)
Uploading complete
Cell ed5d0b2d-c820-4c84-bc5d-f7bfd7344949 stopping instance 3115294d-d074-4e04-8b4a-e25854a767aa
Cell ed5d0b2d-c820-4c84-bc5d-f7bfd7344949 destroying container for instance 3115294d-d074-4e04-8b4a-e25854a767aa
Cell ed5d0b2d-c820-4c84-bc5d-f7bfd7344949 successfully destroyed container for instance 3115294d-d074-4e04-8b4a-e25854a767aa
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 crashed
FAILED
Error restarting application: Start unsuccessful
TIP: use 'cf logs MyOneDrive --recent' for more information
Finished: FAILED
大佬们这咋解决啊
The script flask is installed in '/tmp/contents216527386/deps/0/python/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
The scripts gunicorn and gunicorn_paster are installed in '/tmp/contents216527386/deps/0/python/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
不会10天被删吗 需不需要在监控怎么操作有没有大佬教一下
为哈我最后提示了这个,然后就崩溃了
You are using pip version 18.1, however version 20.0.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
No start command specified by buildpack or via Procfile.
App will not start unless a command is provided at runtime.
Exit status 0
Uploading droplet, build artifacts cache...
Uploading droplet...
Uploading build artifacts cache...
Uploaded build artifacts cache (49.2M)
Uploaded droplet (50.1M)
Uploading complete
Cell eb1e1dfd-66ca-4f62-9618-ec53a3715b29 stopping instance 3af674f0-561b-4a26-9051-c046e1ab21a6
Cell eb1e1dfd-66ca-4f62-9618-ec53a3715b29 destroying container for instance 3af674f0-561b-4a26-9051-c046e1ab21a6
Cell eb1e1dfd-66ca-4f62-9618-ec53a3715b29 successfully destroyed container for instance 3af674f0-561b-4a26-9051-c046e1ab21a6
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 crashed
FAILED
Error restarting application: Start unsuccessful
TIP: use 'cf logs od-for-ibm --recent' for more information
Finished: FAILED
尝试在cf中部署失败 已修改aws分支下config与manifest
错误信息如下:
2020-03-15T09:41:56.20+0000 [APP/PROC/WEB/0] ERR Traceback (most recent call last):
2020-03-15T09:41:56.20+0000 [APP/PROC/WEB/0] ERR File "app.py", line 5, in <module>
2020-03-15T09:41:56.20+0000 [APP/PROC/WEB/0] ERR from process import od
2020-03-15T09:41:56.20+0000 [APP/PROC/WEB/0] ERR File "/home/vcap/app/process.py", line 79, in <module>
2020-03-15T09:41:56.20+0000 [APP/PROC/WEB/0] ERR Process.refresh_token()
2020-03-15T09:41:56.20+0000 [APP/PROC/WEB/0] ERR File "/home/vcap/app/process.py", line 25, in refresh_token
2020-03-15T09:41:56.20+0000 [APP/PROC/WEB/0] ERR od.get_resource()
2020-03-15T09:41:56.21+0000 [APP/PROC/WEB/0] ERR File "/home/vcap/app/onedrive.py", line 52, in get_resource
2020-03-15T09:41:56.21+0000 [APP/PROC/WEB/0] ERR 'https://api.office.com/discovery/v2.0/me/services')
2020-03-15T09:41:56.21+0000 [APP/PROC/WEB/0] ERR File "/home/vcap/app/onedrive.py", line 119, in _http_request
2020-03-15T09:41:56.21+0000 [APP/PROC/WEB/0] ERR url, method=method, data=data, headers=headers)).read().decode('utf-8'))
2020-03-15T09:41:56.21+0000 [APP/PROC/WEB/0] ERR File "/home/vcap/deps/0/python/lib/python3.6/urllib/request.py", line 223, in urlopen
2020-03-15T09:41:56.21+0000 [APP/PROC/WEB/0] ERR return opener.open(url, data, timeout)
2020-03-15T09:41:56.21+0000 [APP/PROC/WEB/0] ERR File "/home/vcap/deps/0/python/lib/python3.6/urllib/request.py", line 532, in open
2020-03-15T09:41:56.21+0000 [APP/PROC/WEB/0] ERR response = meth(req, response)
2020-03-15T09:41:56.21+0000 [APP/PROC/WEB/0] ERR File "/home/vcap/deps/0/python/lib/python3.6/urllib/request.py", line 642, in http_response
2020-03-15T09:41:56.21+0000 [APP/PROC/WEB/0] ERR 'http', request, response, code, msg, hdrs)
2020-03-15T09:41:56.21+0000 [APP/PROC/WEB/0] ERR File "/home/vcap/deps/0/python/lib/python3.6/urllib/request.py", line 570, in error
2020-03-15T09:41:56.21+0000 [APP/PROC/WEB/0] ERR return self._call_chain(*args)
2020-03-15T09:41:56.21+0000 [APP/PROC/WEB/0] ERR File "/home/vcap/deps/0/python/lib/python3.6/urllib/request.py", line 504, in _call_chain
2020-03-15T09:41:56.21+0000 [APP/PROC/WEB/0] ERR result = func(*args)
2020-03-15T09:41:56.21+0000 [APP/PROC/WEB/0] ERR File "/home/vcap/deps/0/python/lib/python3.6/urllib/request.py", line 650, in http_error_default
2020-03-15T09:41:56.21+0000 [APP/PROC/WEB/0] ERR raise HTTPError(req.full_url, code, msg, hdrs, fp)
2020-03-15T09:41:56.21+0000 [APP/PROC/WEB/0] ERR urllib.error.HTTPError: HTTP Error 403: Forbidden
2020-03-15T09:41:56.44+0000 [APP/PROC/WEB/0] OUT Exit status 1
找不到python?
Deploy Stage阶段失败了,提示如下,请问该怎么解决?
-----> Python Buildpack version 1.7.2
-----> Supplying Python
**ERROR** Could not install python: no match found for 3.6.6 in [2.7.16 2.7.17 3.4.9 3.4.10 3.5.7 3.5.9 3.6.8 3.6.9 3.7.4 3.7.5 3.8.0]
Failed to compile droplet: Failed to run all supply scripts: exit status 14
Exit status 223
Cell 154fe00e-3b87-48ad-886b-32335580a9f7 stopping instance 24302dda-07c5-4b27-b039-b0b8f22962f1
Cell 154fe00e-3b87-48ad-886b-32335580a9f7 destroying container for instance 24302dda-07c5-4b27-b039-b0b8f22962f1
Cell 154fe00e-3b87-48ad-886b-32335580a9f7 successfully destroyed container for instance 24302dda-07c5-4b27-b039-b0b8f22962f1
FAILED
Error restarting application: BuildpackCompileFailed
TIP: use 'cf logs axz --recent' for more information
Finished: FAILED
**ERROR** Could not install python: no match found for 3.6.6 in [2.7.16 2.7.17 3.4.9 3.4.10 3.5.7 3.5.9 3.6.8 3.6.9 3.7.4 3.7.5 3.8.0]
这个错误提示很明显哇。修改runtime.txt中的Python版本!
折腾好久还是不行,log里有这句有没有问题?但是manifest里最后不是已经有command:python app.py
No start command specified by buildpack or via Procfile
App will not start unless a command is provided at runtime
实在搞不懂,看着log里不对劲的地方咋修改最后都是上面这两句,然后奔溃中止
404 Not Found: Requested route ('onelist.somecolor.cc') does not exist.
为什么现在好像找不到python的那个应用了?
发现这个被放在 Cloud Foundry 的子类里了
```
4)在新窗口中往下拉,有一个源存储库URL。直接将我们的GITHUB地址粘贴进去!
https://github.com/malaohu/OneList–
启动问题 和 跟踪代码更改部署 勾选去掉!
点击【创建】会提示你创建API密钥,点击创建即
```
大佬这里链接写错了 后面是-- 才对
运行原作的OneList没成功,然后试了试你的,成功了哦耶,谢谢博主!!!
failed to make tcp connection to port 8080 connection refused,部署的时候到这一步卡着了,还没搞懂什么原因。
500好像是中文路径问题,建议拉取OneList最新代码,或者更新app.py和onedrive.py中两行
部署完成后打开url,网页返回500错误,暂时没找到哪里的问题。。
我的也挂了。这几天我查查原因!
全部域名不可用了,信用卡也没有,gg
国内教育邮箱申请的1T网盘是不是做不了onelist和oneindex
没问题的。直接注册的hotmail邮箱无法用onelist
同样是第二部deploy stage报错,错误日志和之前那位老兄是一样的,好像说
Installing python 3.6.6
Download [https://buildpacks.cloudfoundry.org/dependencies/python/python-3.6.6-linux-x64-cflinuxfs3-456731c7.tgz]
**WARNING** A newer version of python is available in this buildpack. Please adjust your app to use version 3.6.7 instead of version 3.6.6 as soon as possible. Old versions of python are only provided to assist in migrating to newer versions.
...我也遇到了,检查一下config.json,发现漏删了一个<,多删了一个",修改后通过。。。估计市用了翻译导致的
看的不是很懂,感觉一般吧。我还是继续用pyone和cuteone
oneindex挺好用的 目前不准备换,希望有长期免费的onedrive
博主,Deploy 第二步报错了,怎么办??
https://i.loli.net/2019/04/24/5cc0098d813aa.png
点击【查看日志和历史记录】看一下是什么样的错误
博主帮忙看一下;
https://nbcc3-my.sharepoint.com/:t:/g/personal/gerrardm_z1_tn/EWkgWbGO319On1JqpoAj38EBgWjG70jrkXSzuudXoYhufA?e=YNsebg
你的 config.json 修改的对吗?
对的哦,按照教程一步步来的;
https://i.loli.net/2019/04/25/5cc159c28b0e7.png
那还真不知道为什么了。。。
俺也一样,带哥最后解决了么
似乎不行啊,一步步来的,最后“访问应用程序 URL”500内部服务器错误
博主,图片看不到,嘿嘿。好麻烦的说
图片挂了??
可能新浪开启防盗链啥的了吧。。
不会啊,我站点的正常 你试试把你图片链接里的 mw690 改成 large
我在国外发现WX3开头的图片链接可以打开,WS4开头的图片挂了