Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
G
go-ipfs
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
jihao
go-ipfs
Commits
ffc74391
提交
ffc74391
authored
7月 25, 2018
作者:
Łukasz Magiera
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
move version.go to top level package
License: MIT Signed-off-by:
Łukasz Magiera
<
magik6k@gmail.com
>
上级
d52091fa
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
25 行增加
和
21 行删除
+25
-21
sysdiag.go
core/commands/sysdiag.go
+3
-3
version.go
core/commands/version.go
+3
-3
core.go
core/core.go
+4
-1
commands.go
core/corehttp/commands.go
+4
-4
gateway.go
core/corehttp/gateway.go
+2
-2
gateway_test.go
core/corehttp/gateway_test.go
+2
-1
option_test.go
core/corehttp/option_test.go
+3
-3
releases.md
docs/releases.md
+1
-1
windows.md
docs/windows.md
+1
-1
version.go
version.go
+2
-2
没有找到文件。
core/commands/sysdiag.go
浏览文件 @
ffc74391
...
...
@@ -5,8 +5,8 @@ import (
"path"
"runtime"
version
"github.com/ipfs/go-ipfs"
cmds
"github.com/ipfs/go-ipfs/commands"
"github.com/ipfs/go-ipfs/repo"
manet
"gx/ipfs/QmV6FjemM1K8oXjrvuq3wuVWWoU2TLDPmNnKrxHzY3v6Ai/go-multiaddr-net"
sysi
"gx/ipfs/QmZRjKbHa6DenStpQJFiaPcEwkZqrx7TH6xTf342LDU3qM/go-sysinfo"
...
...
@@ -57,8 +57,8 @@ Prints out information about your computer to aid in easier debugging.
return
}
info
[
"ipfs_version"
]
=
repo
.
CurrentVersionNumber
info
[
"ipfs_commit"
]
=
repo
.
CurrentCommit
info
[
"ipfs_version"
]
=
version
.
CurrentVersionNumber
info
[
"ipfs_commit"
]
=
version
.
CurrentCommit
res
.
SetOutput
(
info
)
},
}
...
...
core/commands/version.go
浏览文件 @
ffc74391
...
...
@@ -6,9 +6,9 @@ import (
"runtime"
"strings"
version
"github.com/ipfs/go-ipfs"
cmds
"github.com/ipfs/go-ipfs/commands"
e
"github.com/ipfs/go-ipfs/core/commands/e"
repo
"github.com/ipfs/go-ipfs/repo"
fsrepo
"github.com/ipfs/go-ipfs/repo/fsrepo"
"gx/ipfs/QmdE4gMduCKCGAcczM2F5ioYDfdeKuPix138wrES1YSr7f/go-ipfs-cmdkit"
...
...
@@ -36,8 +36,8 @@ var VersionCmd = &cmds.Command{
},
Run
:
func
(
req
cmds
.
Request
,
res
cmds
.
Response
)
{
res
.
SetOutput
(
&
VersionOutput
{
Version
:
repo
.
CurrentVersionNumber
,
Commit
:
repo
.
CurrentCommit
,
Version
:
version
.
CurrentVersionNumber
,
Commit
:
version
.
CurrentCommit
,
Repo
:
fmt
.
Sprint
(
fsrepo
.
RepoVersion
),
System
:
runtime
.
GOARCH
+
"/"
+
runtime
.
GOOS
,
//TODO: Precise version here
Golang
:
runtime
.
Version
(),
...
...
core/core.go
浏览文件 @
ffc74391
...
...
@@ -20,6 +20,7 @@ import (
"strings"
"time"
version
"github.com/ipfs/go-ipfs"
rp
"github.com/ipfs/go-ipfs/exchange/reprovide"
filestore
"github.com/ipfs/go-ipfs/filestore"
mount
"github.com/ipfs/go-ipfs/fuse/mount"
...
...
@@ -44,6 +45,8 @@ import (
logging
"gx/ipfs/QmRREK2CAZ5Re2Bd9zZFG6FeYDppUWt5cMgsoUEp3ktgSr/go-log"
floodsub
"gx/ipfs/QmRXefkwjreRT6XfYh3Ag4hsVnWBbpcUicGJPcg8TWbhBK/go-libp2p-floodsub"
goprocess
"gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess"
bitswap
"gx/ipfs/QmNQQEYL3Vpj4beteqyeRpVpivuX1wBP6Q5GZMdBPPTV3S/go-bitswap"
bsnet
"gx/ipfs/QmNQQEYL3Vpj4beteqyeRpVpivuX1wBP6Q5GZMdBPPTV3S/go-bitswap/network"
mamask
"gx/ipfs/QmSMZwvs3n4GBikZ7hKzT17c3bk65FmyZo2JqtJ16swqCv/multiaddr-filter"
mafilter
"gx/ipfs/QmSW4uNHbvQia8iZDXzbwjiyHQtnyo9aFqfQAMasj3TJ6Y/go-maddr-filter"
libp2p
"gx/ipfs/QmUDzeFgYrRmHL2hUB6NZmqcBVQtUzETwmFRUc9onfSSHr/go-libp2p"
...
...
@@ -94,7 +97,7 @@ const (
)
func
init
()
{
identify
.
ClientVersion
=
"go-ipfs/"
+
repo
.
CurrentVersionNumber
+
"/"
+
repo
.
CurrentCommit
identify
.
ClientVersion
=
"go-ipfs/"
+
version
.
CurrentVersionNumber
+
"/"
+
version
.
CurrentCommit
}
// IpfsNode is IPFS Core module. It represents an IPFS instance.
...
...
core/corehttp/commands.go
浏览文件 @
ffc74391
...
...
@@ -9,10 +9,10 @@ import (
"strconv"
"strings"
version
"github.com/ipfs/go-ipfs"
oldcmds
"github.com/ipfs/go-ipfs/commands"
core
"github.com/ipfs/go-ipfs/core"
"github.com/ipfs/go-ipfs/core"
corecommands
"github.com/ipfs/go-ipfs/core/commands"
repo
"github.com/ipfs/go-ipfs/repo"
path
"gx/ipfs/QmPqCBrmkm7jNfYi7xFS7mUZsrN6DEumBMrxLnL7axNJx1/go-path"
cmds
"gx/ipfs/QmbWGdyATxHpmbDC2z7zMNnmPmiHCRXS5f2vyxBfgz8bVb/go-ipfs-cmds"
...
...
@@ -78,7 +78,7 @@ func addHeadersFromConfig(c *cmdsHttp.ServerConfig, nc *config.Config) {
for
h
,
v
:=
range
nc
.
API
.
HTTPHeaders
{
c
.
Headers
[
h
]
=
v
}
c
.
Headers
[
"Server"
]
=
[]
string
{
"go-ipfs/"
+
repo
.
CurrentVersionNumber
}
c
.
Headers
[
"Server"
]
=
[]
string
{
"go-ipfs/"
+
version
.
CurrentVersionNumber
}
}
func
addCORSDefaults
(
c
*
cmdsHttp
.
ServerConfig
)
{
...
...
@@ -153,7 +153,7 @@ func CommandsROOption(cctx oldcmds.Context) ServeOption {
// CheckVersionOption returns a ServeOption that checks whether the client ipfs version matches. Does nothing when the user agent string does not contain `/go-ipfs/`
func
CheckVersionOption
()
ServeOption
{
daemonVersion
:=
repo
.
ApiVersion
daemonVersion
:=
version
.
ApiVersion
return
ServeOption
(
func
(
n
*
core
.
IpfsNode
,
l
net
.
Listener
,
parent
*
http
.
ServeMux
)
(
*
http
.
ServeMux
,
error
)
{
mux
:=
http
.
NewServeMux
()
...
...
core/corehttp/gateway.go
浏览文件 @
ffc74391
...
...
@@ -5,9 +5,9 @@ import (
"net"
"net/http"
version
"github.com/ipfs/go-ipfs"
core
"github.com/ipfs/go-ipfs/core"
coreapi
"github.com/ipfs/go-ipfs/core/coreapi"
repo
"github.com/ipfs/go-ipfs/repo"
id
"gx/ipfs/QmUDzeFgYrRmHL2hUB6NZmqcBVQtUzETwmFRUc9onfSSHr/go-libp2p/p2p/protocol/identify"
)
...
...
@@ -41,7 +41,7 @@ func GatewayOption(writable bool, paths ...string) ServeOption {
func
VersionOption
()
ServeOption
{
return
func
(
_
*
core
.
IpfsNode
,
_
net
.
Listener
,
mux
*
http
.
ServeMux
)
(
*
http
.
ServeMux
,
error
)
{
mux
.
HandleFunc
(
"/version"
,
func
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
fmt
.
Fprintf
(
w
,
"Commit: %s
\n
"
,
repo
.
CurrentCommit
)
fmt
.
Fprintf
(
w
,
"Commit: %s
\n
"
,
version
.
CurrentCommit
)
fmt
.
Fprintf
(
w
,
"Client Version: %s
\n
"
,
id
.
ClientVersion
)
fmt
.
Fprintf
(
w
,
"Protocol Version: %s
\n
"
,
id
.
LibP2PVersion
)
})
...
...
core/corehttp/gateway_test.go
浏览文件 @
ffc74391
...
...
@@ -11,6 +11,7 @@ import (
"testing"
"time"
version
"github.com/ipfs/go-ipfs"
core
"github.com/ipfs/go-ipfs/core"
coreunix
"github.com/ipfs/go-ipfs/core/coreunix"
namesys
"github.com/ipfs/go-ipfs/namesys"
...
...
@@ -545,7 +546,7 @@ func TestGoGetSupport(t *testing.T) {
}
func
TestVersion
(
t
*
testing
.
T
)
{
repo
.
CurrentCommit
=
"theshortcommithash"
version
.
CurrentCommit
=
"theshortcommithash"
ns
:=
mockNamesys
{}
ts
,
_
:=
newTestServerAndNode
(
t
,
ns
)
...
...
core/corehttp/option_test.go
浏览文件 @
ffc74391
...
...
@@ -7,7 +7,7 @@ import (
"net/http/httptest"
"testing"
"github.com/ipfs/go-ipfs/repo
"
version
"github.com/ipfs/go-ipfs
"
)
type
testcasecheckversion
struct
{
...
...
@@ -20,7 +20,7 @@ type testcasecheckversion struct {
func
(
tc
testcasecheckversion
)
body
()
string
{
if
!
tc
.
shouldHandle
&&
tc
.
responseBody
==
""
{
return
fmt
.
Sprintf
(
"%s (%s != %s)
\n
"
,
errAPIVersionMismatch
,
repo
.
ApiVersion
,
tc
.
userAgent
)
return
fmt
.
Sprintf
(
"%s (%s != %s)
\n
"
,
errAPIVersionMismatch
,
version
.
ApiVersion
,
tc
.
userAgent
)
}
return
tc
.
responseBody
...
...
@@ -30,7 +30,7 @@ func TestCheckVersionOption(t *testing.T) {
tcs
:=
[]
testcasecheckversion
{
{
"/go-ipfs/0.1/"
,
APIPath
+
"/test/"
,
false
,
""
,
http
.
StatusBadRequest
},
{
"/go-ipfs/0.1/"
,
APIPath
+
"/version"
,
true
,
"check!"
,
http
.
StatusOK
},
{
repo
.
ApiVersion
,
APIPath
+
"/test"
,
true
,
"check!"
,
http
.
StatusOK
},
{
version
.
ApiVersion
,
APIPath
+
"/test"
,
true
,
"check!"
,
http
.
StatusOK
},
{
"Mozilla Firefox/no go-ipfs node"
,
APIPath
+
"/test"
,
true
,
"check!"
,
http
.
StatusOK
},
{
"/go-ipfs/0.1/"
,
"/webui"
,
true
,
"check!"
,
http
.
StatusOK
},
}
...
...
docs/releases.md
浏览文件 @
ffc74391
...
...
@@ -30,7 +30,7 @@ will be allowed up to release day.
-
[
]
publish gx version with
`gx release`
, as per
[
gx release guidelines
](
https://github.com/whyrusleeping/gx#publishing-and-releasing
)
## Post-Release
-
[
]
b
ump version string in
`repo/version.go`
to
`vX.Y.Z-dev`
-
[
]
B
ump version string in
`repo/version.go`
to
`vX.Y.Z-dev`
-
[
]
Upload the final release to the github releases page: https://github.com/ipfs/go-ipfs/releases
-
Communication
-
[
]
Create the release issue
...
...
docs/windows.md
浏览文件 @
ffc74391
...
...
@@ -130,7 +130,7 @@ We need the `git` commit hash to be included in our build so that in the extreme
Finally, we'll build and test
`ipfs`
itself.
```
go install -ldflags="-X "github.com/ipfs/go-ipfs
/repo
".CurrentCommit=%SHA%"
go install -ldflags="-X "github.com/ipfs/go-ipfs".CurrentCommit=%SHA%"
%GOPATH%\bin\ipfs.exe version --all
```
You can check that the ipfs output versions match with
`go version`
and
`git rev-parse --short HEAD`
.
...
...
repo/
version.go
→
version.go
浏览文件 @
ffc74391
package
repo
package
ipfs
// CurrentCommit is the current git commit, this is set as a ldflag in the Makefile
var
CurrentCommit
string
// CurrentVersionNumber is the current application's version literal
const
CurrentVersionNumber
=
"0.4.1
7
-dev"
const
CurrentVersionNumber
=
"0.4.1
8
-dev"
const
ApiVersion
=
"/go-ipfs/"
+
CurrentVersionNumber
+
"/"
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论