跳转到内容

Remote URI

添加或修改 remote:

Terminal window
graft remote add origin <uri>
graft remote set-url origin <uri>
URI用途
memory测试和临时 remote。
fs:///absolute/path本地或挂载文件系统。
s3://bucket/prefixAWS S3-style object storage。
s3_compatible://bucket/prefixR2、MinIO 等 S3-compatible storage。
s3_compatible://bucket/prefix?endpoint=https://...带自定义 endpoint 的 S3-compatible storage。
https://host/org/space规范的 Git 风格 Graft remote service URL。
graft+https://host/org/space显式 Graft-over-HTTPS 兼容形式。
graft+http://127.0.0.1:8787/org/space本地 HTTP remote 开发。
Terminal window
export AWS_ACCESS_KEY_ID="..."
export AWS_SECRET_ACCESS_KEY="..."
export AWS_REGION="auto"
graft remote add origin 's3_compatible://my-bucket/prod/app?endpoint=https://account.r2.cloudflarestorage.com'

credential 不写入 .graft/config.toml,也不放在 URI 中。使用环境变量或标准 AWS config files。

当前 URI query 只接受 endpoint

Terminal window
export GRAFT_REMOTE_TOKEN='grt_...'
graft remote add origin 'https://example.com/acme/archive'

graft+https://example.com/acme/archive 仍作为兼容 alias 接受,两种形式使用同一 remote service protocol。

自定义 token 环境变量:

Terminal window
export GRAFT_ARCHIVE_TOKEN='grt_...'
graft remote add origin 'https://example.com/acme/archive?token_env=GRAFT_ARCHIVE_TOKEN'

HTTP remote 以 bearer token 发送访问密钥。wire contract 见 Remote Service 协议