Comments (7)
因为没 oss2 的测试环境,所以我先猜猜这样说不定可以,参考:https://blog.csdn.net/libing_thinking/article/details/79664059
- 配置环境变量
OSS_ENDPOINT
或者代码里设置megfile.s3.endpoint_url = 'http://oss-cn-hangzhou.aliyuncs.com'
这里的 endpoint_url 我不太确定应该填啥 - 用 awscli 配置一下
aws configure set s3.addressing_style virtual
from megfile.
@ae86208 感觉 endpoint 通过环境变量或者代码来配置还是有点麻烦的,所以讨论了下,也准备放在配置文件里,之前的代码配置或者环境变量配置也依然生效
实现上参考 https://github.com/wbingli/awscli-plugin-endpoint
支持在 ~/.aws/config
里配置 s3.endpoint_url 来配置 endpoint
例如:
$ cat ~/.aws/config
[default]
s3 =
addressing_style = virtual
endpoint_url = http://oss-cn-hangzhou.aliyuncs.com
配置时可以直接编辑这个文件,或者 aws configure set s3.endpoint_url http://oss-cn-hangzhou.aliyuncs.com
注:仅对 megfile 0.0.8+ 生效,awscli 如果使用这个功能,需要加上 https://github.com/wbingli/awscli-plugin-endpoint 这个插件,配置方法参考它的 readme
PR: #46
from megfile.
很强,可以用了
from megfile.
@bbtfr Is there any chance Megfile includes automatic detection of the cloud environment and gives a more user-friendly message to set up virtual addressing style in case of access 403 failure?
from megfile.
可能需要验证一下我们是不是支持在 .aws/config 里配置 endpoint_url
from megfile.
注:仅对 refile 生效
应该是megfile吧
from megfile.
注:仅对 refile 生效
应该是megfile吧
漏嘴了
from megfile.
Related Issues (20)
- 提供一种更快速的获得文件、文件夹哈希值的方法 HOT 1
- 支持 python 3.10 HOT 1
- smart_save_image 类似 imwrite HOT 1
- megfile 重构优化 HOT 1
- ValueError: unacceptable mode: 'w+b' HOT 2
- 没有对删除失败的文件进行处理 HOT 1
- s3, fs, http, stdio 将 functions 挪到 class,并自动生成 function
- sync, mv, cp, remove 忽略掉过程中被删除的文件 HOT 1
- smart_get_md5 可以传入 List[str] 对多个 path 做 md5 的 md5
- Path 类与 pathlib 中的行为对其 HOT 2
- v1.0.0执行smart_copy报错 HOT 1
- smart_getmd5_by_paths 排序 paths,使文件一样 md5 就一样
- 对更多错误进行 retry HOT 1
- 需要设计一下,每个 s3 的方法支持单独指定 endpoint HOT 4
- is_file提示没有参数followlinks HOT 4
- megfile.smart_scandir(".") 返还结果不支持 with 操作 HOT 1
- 请求实现官方版本 smart_lstat HOT 3
- smart_stat 返回的对象的 st_mode 是 None HOT 3
- megfile sync 不能同步文件夹 HOT 2
- smart_copy 报错 TypeError: stat() got an unexpected keyword argument 'follow_symlinks' HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from megfile.