GithubHelp home page GithubHelp logo

Comments (7)

bbtfr avatar bbtfr commented on August 15, 2024 2

因为没 oss2 的测试环境,所以我先猜猜这样说不定可以,参考:https://blog.csdn.net/libing_thinking/article/details/79664059

  1. 配置环境变量 OSS_ENDPOINT 或者代码里设置 megfile.s3.endpoint_url = 'http://oss-cn-hangzhou.aliyuncs.com'
    这里的 endpoint_url 我不太确定应该填啥
  2. 用 awscli 配置一下 aws configure set s3.addressing_style virtual

from megfile.

bbtfr avatar bbtfr commented on August 15, 2024 1

@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.

ae86208 avatar ae86208 commented on August 15, 2024

很强,可以用了

from megfile.

xyb avatar xyb commented on August 15, 2024

@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.

bbtfr avatar bbtfr commented on August 15, 2024

可能需要验证一下我们是不是支持在 .aws/config 里配置 endpoint_url

from megfile.

ae86208 avatar ae86208 commented on August 15, 2024

注:仅对 refile 生效

应该是megfile吧

from megfile.

bbtfr avatar bbtfr commented on August 15, 2024

注:仅对 refile 生效

应该是megfile吧

漏嘴了

from megfile.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.