-
-
Notifications
You must be signed in to change notification settings - Fork 555
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* compile client under freebsd (#1620) Compile netbird client under freebsd and now support netstack and userspace modes. Refactoring linux specific code to share same code with FreeBSD, move to *_unix.go files. Not implemented yet: Kernel mode not supported DNS probably does not work yet Routing also probably does not work yet SSH support did not tested yet Lack of test environment for freebsd (dedicated VM for github runners under FreeBSD required) Lack of tests for freebsd specific code info reporting need to review and also implement, for example OS reported as GENERIC instead of FreeBSD (lack of FreeBSD icon in management interface) Lack of proper client setup under FreeBSD Lack of FreeBSD port/package * Add DNS routes (#1943) Given domains are resolved periodically and resolved IPs are replaced with the new ones. Unless the flag keep_route is set to true, then only new ones are added. This option is helpful if there are long-running connections that might still point to old IP addresses from changed DNS records. * Add process posture check (#1693) Introduces a process posture check to validate the existence and active status of specific binaries on peer systems. The check ensures that files are present at specified paths, and that corresponding processes are running. This check supports Linux, Windows, and macOS systems. Co-authored-by: Evgenii <mail@skillcoder.com> Co-authored-by: Pascal Fischer <pascal@netbird.io> Co-authored-by: Zoltan Papp <zoltan.pmail@gmail.com> Co-authored-by: Viktor Liu <17948409+lixmal@users.noreply.github.com> Co-authored-by: Bethuel Mmbaga <bethuelmbaga12@gmail.com>
- Loading branch information
1 parent
95299be
commit 4fec709
Showing
149 changed files
with
6,410 additions
and
2,611 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package errors | ||
|
||
import ( | ||
"fmt" | ||
"strings" | ||
|
||
"github.com/hashicorp/go-multierror" | ||
) | ||
|
||
func formatError(es []error) string { | ||
if len(es) == 0 { | ||
return fmt.Sprintf("0 error occurred:\n\t* %s", es[0]) | ||
} | ||
|
||
points := make([]string, len(es)) | ||
for i, err := range es { | ||
points[i] = fmt.Sprintf("* %s", err) | ||
} | ||
|
||
return fmt.Sprintf( | ||
"%d errors occurred:\n\t%s", | ||
len(es), strings.Join(points, "\n\t")) | ||
} | ||
|
||
func FormatErrorOrNil(err *multierror.Error) error { | ||
if err != nil { | ||
err.ErrorFormat = formatError | ||
} | ||
return err.ErrorOrNil() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package dns | ||
|
||
const ( | ||
fileUncleanShutdownResolvConfLocation = "/var/db/netbird/resolv.conf" | ||
fileUncleanShutdownManagerTypeLocation = "/var/db/netbird/manager" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
//go:build !android | ||
|
||
package dns | ||
|
||
const ( | ||
fileUncleanShutdownResolvConfLocation = "/var/lib/netbird/resolv.conf" | ||
fileUncleanShutdownManagerTypeLocation = "/var/lib/netbird/manager" | ||
) |
2 changes: 1 addition & 1 deletion
2
client/internal/dns/dbus_linux.go → client/internal/dns/dbus_unix.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
//go:build !android | ||
//go:build (linux && !android) || freebsd | ||
|
||
package dns | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
client/internal/dns/file_parser_linux.go → client/internal/dns/file_parser_unix.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
//go:build !android | ||
//go:build (linux && !android) || freebsd | ||
|
||
package dns | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
...nt/internal/dns/file_parser_linux_test.go → client/internal/dns/file_parser_unix_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
//go:build !android | ||
//go:build (linux && !android) || freebsd | ||
|
||
package dns | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
client/internal/dns/file_repair_linux.go → client/internal/dns/file_repair_unix.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
//go:build !android | ||
//go:build (linux && !android) || freebsd | ||
|
||
package dns | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
...nt/internal/dns/file_repair_linux_test.go → client/internal/dns/file_repair_unix_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
//go:build !android | ||
//go:build (linux && !android) || freebsd | ||
|
||
package dns | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
client/internal/dns/file_linux.go → client/internal/dns/file_unix.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
//go:build !android | ||
//go:build (linux && !android) || freebsd | ||
|
||
package dns | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
client/internal/dns/file_linux_test.go → client/internal/dns/file_unix_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
//go:build !android | ||
//go:build (linux && !android) || freebsd | ||
|
||
package dns | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
client/internal/dns/network_manager_linux.go → client/internal/dns/network_manager_unix.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
//go:build !android | ||
//go:build (linux && !android) || freebsd | ||
|
||
package dns | ||
|
||
|
Oops, something went wrong.