Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Juicedata
JuiceFS
提交
70b53b06
JuiceFS
项目概览
Juicedata
/
JuiceFS
通知
10
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
JuiceFS
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
70b53b06
编写于
1月 04, 2021
作者:
D
Davies Liu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add --no-https to disable HTTPS
上级
e5c3b3d6
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
13 addition
and
4 deletion
+13
-4
config/config.go
config/config.go
+1
-0
main.go
main.go
+12
-4
未找到文件。
config/config.go
浏览文件 @
70b53b06
...
...
@@ -23,6 +23,7 @@ type Config struct {
Manager
string
Workers
[]
string
BWLimit
int
NoHTTPS
bool
Verbose
bool
Quiet
bool
}
...
...
main.go
浏览文件 @
70b53b06
...
...
@@ -4,6 +4,7 @@ package main
import
(
"fmt"
"net"
"net/http"
_
"net/http/pprof"
"net/url"
...
...
@@ -32,9 +33,13 @@ func supportHTTPS(name, endpoint string) bool {
return
!
(
strings
.
Contains
(
endpoint
,
".vpc100-oss"
)
||
strings
.
Contains
(
endpoint
,
"internal.aliyuncs.com"
))
case
"jss"
:
return
false
default
:
return
true
case
"s3"
:
ps
:=
strings
.
SplitN
(
endpoint
,
"."
,
2
)
if
len
(
ps
)
>
1
&&
net
.
ParseIP
(
ps
[
1
])
!=
nil
{
return
false
}
}
return
true
}
func
createStorage
(
uri
string
,
conf
*
config
.
Config
)
(
object
.
ObjectStorage
,
error
)
{
...
...
@@ -85,7 +90,7 @@ func createStorage(uri string, conf *config.Config) (object.ObjectStorage, error
if
name
==
"file"
{
endpoint
=
u
.
Path
}
else
if
name
==
"hdfs"
{
}
else
if
supportHTTPS
(
name
,
endpoint
)
{
}
else
if
!
conf
.
NoHTTPS
&&
supportHTTPS
(
name
,
endpoint
)
{
endpoint
=
"https://"
+
endpoint
}
else
{
endpoint
=
"http://"
+
endpoint
...
...
@@ -221,9 +226,12 @@ func main() {
},
&
cli
.
IntFlag
{
Name
:
"bwlimit"
,
Value
:
0
,
Usage
:
"limit bandwidth in Mbps (default: unlimited)"
,
},
&
cli
.
BoolFlag
{
Name
:
"no-https"
,
Usage
:
"donot use HTTPS"
,
},
&
cli
.
BoolFlag
{
Name
:
"verbose"
,
Aliases
:
[]
string
{
"v"
},
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录