Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
number571 committed Oct 13, 2024
1 parent 4d210d4 commit b27339a
Show file tree
Hide file tree
Showing 16 changed files with 5,924 additions and 3,260 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# CHANGELOG

<!-- ... -->

## v1.6.22~

*??? ??, ????*

<!-- ... -->

## v1.6.21

*October 13, 2024*

### INIT
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,22 @@ The Hidden Lake is a `friend-to-friend` (F2F) network, which means building trus

<p align="center"><img src="test/result/coverage.svg" alt="coverage.svg"/></p>

## Releases

All cmd programs are compiled for {`amd64`, `arm64`} ARCH and {`windows`, `linux`, `darwin`} OS as pattern = `appname_arch_os`. In total, one application is compiled into six versions. The entire list of releases can be found here: [github.com/number571/hidden-lake/releases](https://github.com/number571/hidden-lake/releases "releases").

## Dependencies

> [!IMPORTANT]
> All dependencies are loaded into the hidden-lake project once using the `go mod vendor` command (for the Go language) or simply by installing (for other languages) and saved in it. This is done for security purposes, provided that dependency creators can modify the code in older versions.
1. Go library [go.etcd.io/bbolt](https://github.com/etcd-io/bbolt "bbolt") (used by `pkg/database`)
2. Go library [golang.org/x/net](https://golang.org/x/net "x/net") (used by `cmd/hidden_lake/applications/messenger`)
3. Go library [golang.org/x/crypto](https://golang.org/x/crypto "x/crypto") (used by `pkg/crypto/keybuilder`)
4. Go library [gopkg.in/yaml.v2](https://gopkg.in/yaml.v2 "yaml.v2") (used by `pkg/encoding`)
5. Go library [github.com/g8rswimmer/error-chain](https://github.com/g8rswimmer/error-chain "error-chain") (used by `pkg/utils`)
6. CSS/JS library [getbootstrap.com](https://getbootstrap.com "bootstrap") (used by `cmd/hidden_lake/applications/messenger|filesharer`)

## How it works

The anonymous Hidden Lake network is an `abstract` network. This means that regardless of the system in which it is located and regardless of the number of nodes, as well as their location, the HL network remains anonymous. This property is achieved due to a theoretically provable `queue-based` problem. Its algorithm can be described as follows.
Expand Down
4 changes: 2 additions & 2 deletions cmd/adapters/chatingar/cmd/chatingar/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"os/signal"
"syscall"

gopeer "github.com/number571/go-peer"
hiddenlake "github.com/number571/hidden-lake"
"github.com/number571/hidden-lake/cmd/adapters/chatingar/pkg/app"
"github.com/number571/hidden-lake/internal/flag"
)
Expand All @@ -18,7 +18,7 @@ func main() {
args := os.Args[1:]

if flag.GetBoolFlagValue(args, "version") {
fmt.Println(gopeer.CVersion)
fmt.Println(hiddenlake.CVersion)
return
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/adapters/common/cmd/common/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"os/signal"
"syscall"

gopeer "github.com/number571/go-peer"
hiddenlake "github.com/number571/hidden-lake"
"github.com/number571/hidden-lake/cmd/adapters/common/pkg/app"
"github.com/number571/hidden-lake/internal/flag"
)
Expand All @@ -18,7 +18,7 @@ func main() {
args := os.Args[1:]

if flag.GetBoolFlagValue(args, "version") {
fmt.Println(gopeer.CVersion)
fmt.Println(hiddenlake.CVersion)
return
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/applications/filesharer/cmd/hlf/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"os/signal"
"syscall"

gopeer "github.com/number571/go-peer"
hiddenlake "github.com/number571/hidden-lake"
"github.com/number571/hidden-lake/cmd/applications/filesharer/pkg/app"
"github.com/number571/hidden-lake/internal/flag"
)
Expand All @@ -18,7 +18,7 @@ func main() {
args := os.Args[1:]

if flag.GetBoolFlagValue(args, "version") {
fmt.Println(gopeer.CVersion)
fmt.Println(hiddenlake.CVersion)
return
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/applications/messenger/cmd/hlm/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"os/signal"
"syscall"

gopeer "github.com/number571/go-peer"
hiddenlake "github.com/number571/hidden-lake"
"github.com/number571/hidden-lake/cmd/applications/messenger/pkg/app"
"github.com/number571/hidden-lake/internal/flag"
)
Expand All @@ -20,7 +20,7 @@ func main() {
args := os.Args[1:]

if flag.GetBoolFlagValue(args, "version") {
fmt.Println(gopeer.CVersion)
fmt.Println(hiddenlake.CVersion)
return
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/applications/remoter/cmd/hlr/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"os/signal"
"syscall"

gopeer "github.com/number571/go-peer"
hiddenlake "github.com/number571/hidden-lake"
"github.com/number571/hidden-lake/cmd/applications/remoter/pkg/app"
"github.com/number571/hidden-lake/internal/flag"
)
Expand All @@ -18,7 +18,7 @@ func main() {
args := os.Args[1:]

if flag.GetBoolFlagValue(args, "version") {
fmt.Println(gopeer.CVersion)
fmt.Println(hiddenlake.CVersion)
return
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/composite/cmd/hlc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"os/signal"
"syscall"

gopeer "github.com/number571/go-peer"
hiddenlake "github.com/number571/hidden-lake"
"github.com/number571/hidden-lake/cmd/composite/pkg/app"
"github.com/number571/hidden-lake/internal/flag"
)
Expand All @@ -17,7 +17,7 @@ func main() {
args := os.Args[1:]

if flag.GetBoolFlagValue(args, "version") {
fmt.Println(gopeer.CVersion)
fmt.Println(hiddenlake.CVersion)
return
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/helpers/encryptor/cmd/hle/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"os/signal"
"syscall"

gopeer "github.com/number571/go-peer"
hiddenlake "github.com/number571/hidden-lake"
"github.com/number571/hidden-lake/cmd/helpers/encryptor/pkg/app"
"github.com/number571/hidden-lake/internal/flag"
)
Expand All @@ -18,7 +18,7 @@ func main() {
args := os.Args[1:]

if flag.GetBoolFlagValue(args, "version") {
fmt.Println(gopeer.CVersion)
fmt.Println(hiddenlake.CVersion)
return
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/helpers/loader/cmd/hll/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"os/signal"
"syscall"

gopeer "github.com/number571/go-peer"
hiddenlake "github.com/number571/hidden-lake"
"github.com/number571/hidden-lake/cmd/helpers/loader/pkg/app"
"github.com/number571/hidden-lake/internal/flag"
)
Expand All @@ -18,7 +18,7 @@ func main() {
args := os.Args[1:]

if flag.GetBoolFlagValue(args, "version") {
fmt.Println(gopeer.CVersion)
fmt.Println(hiddenlake.CVersion)
return
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/helpers/traffic/cmd/hlt/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"os/signal"
"syscall"

gopeer "github.com/number571/go-peer"
hiddenlake "github.com/number571/hidden-lake"
"github.com/number571/hidden-lake/cmd/helpers/traffic/pkg/app"
"github.com/number571/hidden-lake/internal/flag"
)
Expand All @@ -18,7 +18,7 @@ func main() {
args := os.Args[1:]

if flag.GetBoolFlagValue(args, "version") {
fmt.Println(gopeer.CVersion)
fmt.Println(hiddenlake.CVersion)
return
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/service/cmd/hls/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"os/signal"
"syscall"

gopeer "github.com/number571/go-peer"
hiddenlake "github.com/number571/hidden-lake"
"github.com/number571/hidden-lake/cmd/service/pkg/app"
"github.com/number571/hidden-lake/internal/flag"
)
Expand All @@ -18,7 +18,7 @@ func main() {
args := os.Args[1:]

if flag.GetBoolFlagValue(args, "version") {
fmt.Println(gopeer.CVersion)
fmt.Println(hiddenlake.CVersion)
return
}

Expand Down
5 changes: 5 additions & 0 deletions hidden-lake.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package hiddenlake

const (
CVersion = "v1.6.22~"
)
57 changes: 57 additions & 0 deletions hidden-lake_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
package hiddenlake

import (
"bytes"
_ "embed"
"regexp"
"strings"
"testing"
)

var (
//go:embed CHANGELOG.md
tgBinaryCHANGELOG []byte
)

func TestGoPeerVersion(t *testing.T) {
t.Parallel()

re := regexp.MustCompile(`##\s+(v\d+\.\d+\.\d+~?)\s+`)
match := re.FindAllStringSubmatch(string(tgBinaryCHANGELOG), -1)
if len(match) < 2 {
t.Error("versions not found")
return
}

if strings.HasSuffix(CVersion, "~") {
if match[0][1] != CVersion {
t.Error("the versions do not match")
return
}
} else {
// current version is always previous version in the changelog
if match[1][1] != CVersion {
t.Error("the versions do not match")
return
}
}

if match[0][1] == match[1][1] {
t.Error("the same versions inline")
return
}

for i := 0; i < len(match); i++ {
for j := i + 1; j < len(match)-1; j++ {
if match[i][1] == match[j][1] {
t.Errorf("found the same versions (i=%d, j=%d)", i, j)
return
}
}
}

if bytes.Count(tgBinaryCHANGELOG, []byte("*??? ??, ????*")) != 1 {
t.Error("is there no new version or more than one new version?")
return
}
}
2 changes: 1 addition & 1 deletion test/result/badge_codelines.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit b27339a

Please sign in to comment.