Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
G
go-ipfs
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
jihao
go-ipfs
Commits
2514c747
提交
2514c747
authored
11月 25, 2017
作者:
Łukasz Magiera
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
config-patch: apply review suggestions
License: MIT Signed-off-by:
Łukasz Magiera
<
magik6k@gmail.com
>
上级
c573d3d0
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
59 行增加
和
9 行删除
+59
-9
config.go
core/commands/config.go
+3
-1
config.md
docs/config.md
+21
-8
profile.go
repo/config/profile.go
+1
-0
t0021-config.sh
test/sharness/t0021-config.sh
+34
-0
没有找到文件。
core/commands/config.go
浏览文件 @
2514c747
...
...
@@ -324,13 +324,14 @@ var configProfileApplyCmd = &cmds.Command{
res
.
SetError
(
err
,
cmdkit
.
ErrNormal
)
return
}
res
.
SetOutput
(
nil
)
},
}
var
configProfileRevertCmd
=
&
cmds
.
Command
{
Helptext
:
cmdkit
.
HelpText
{
Tagline
:
"Revert profile changes."
,
ShortDescription
:
`Reverts profile-related changes to the
config
.
ShortDescription
:
`Reverts profile-related changes to the
default values
.
Reverting some profiles may damage the configuration or not be possible.
Backing up the config before running this command is advised.`
,
...
...
@@ -350,6 +351,7 @@ Backing up the config before running this command is advised.`,
res
.
SetError
(
err
,
cmdkit
.
ErrNormal
)
return
}
res
.
SetOutput
(
nil
)
},
}
...
...
docs/config.md
浏览文件 @
2514c747
...
...
@@ -9,14 +9,27 @@ Configuration profiles allow to tweak configuration quickly. Profiles can be
applied with
`--profile`
flag to
`ipfs init`
or with
`ipfs config profile apply`
command.
-
`server`
profile
Recommended for nodes with public IPv4 address, disables host and content
discovery in local networks.
-
`test`
profile
Reduces external interference, useful for running ipfs in test environments.
Note that with these settings node won't be able to talk to the rest of the
network without manual bootstrap.
Available profiles:
-
`server`
Recommended for nodes with public IPv4 address, disables host and content
discovery in local networks.
-
`test`
Reduces external interference, useful for running ipfs in test environments.
Note that with these settings node won't be able to talk to the rest of the
network without manual bootstrap.
-
`badgerds`
Replaces default datastore configuration with experimental badger datastore.
If you apply this profile after
`ipfs init`
, you will need to convert your
datastore to the new configuration. You can do this using
[
ipfs-ds-convert
](
https://github.com/ipfs/ipfs-ds-convert
)
WARNING: badger datastore is experimantal. Make sure to backup your data
frequently
## Table of Contents
...
...
repo/config/profile.go
浏览文件 @
2514c747
...
...
@@ -64,6 +64,7 @@ var Profiles = map[string]*Profile{
c
.
Addresses
=
addressesConfig
()
c
.
Swarm
.
DisableNatPortMap
=
false
c
.
Discovery
.
MDNS
.
Enabled
=
true
return
nil
},
},
...
...
test/sharness/t0021-config.sh
浏览文件 @
2514c747
...
...
@@ -48,6 +48,32 @@ CONFIG_SET_JSON_TEST='{
}
}'
test_profile_apply_revert
()
{
profile
=
$1
test_expect_success
"save expected config"
'
ipfs config show >expected
'
test_expect_success
"'ipfs config profile apply
${
profile
}
' works"
'
ipfs config profile apply '
${
profile
}
'
'
test_expect_success
"profile
${
profile
}
changed something"
'
ipfs config show >actual &&
test_must_fail test_cmp expected actual
'
test_expect_success
"'ipfs config profile revert
${
profile
}
' works"
'
ipfs config profile revert '
${
profile
}
'
'
test_expect_success
"config is back to previous state after
${
profile
}
revert"
'
ipfs config show >actual &&
test_cmp expected actual
'
}
test_config_cmd
()
{
test_config_cmd_set
"beep"
"boop"
test_config_cmd_set
"beep1"
"boop2"
...
...
@@ -175,6 +201,14 @@ test_config_cmd() {
test $(cat actual_config | wc -l) = 1
'
test_profile_apply_revert server
# won't work as we already have this profile applied
# test_profile_apply_revert test
# won't work as it changes datastore definition, which makes ipfs not launch
# without converting first
# test_profile_apply_revert badgerds
}
test_init_ipfs
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论