forked from tailscale/tailscale
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
illumos/solaris support rebased onto 1.58.0
- Loading branch information
Showing
21 changed files
with
500 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: illumos-Cross | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- 'illumos-*' | ||
pull_request: | ||
branches: | ||
- '*' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
if: "!contains(github.event.head_commit.message, '[ci skip]')" | ||
|
||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version-file: 'go.mod' | ||
check-latest: true | ||
id: go | ||
|
||
- name: SunOS build script | ||
run: bash -x build.sh |
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,39 @@ | ||
--- | ||
name: "tagged-release" | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*-sunos" | ||
|
||
jobs: | ||
tagged-release: | ||
name: "SunOS Tagged Release" | ||
runs-on: "ubuntu-latest" | ||
|
||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version-file: 'go.mod' | ||
check-latest: true | ||
id: go | ||
|
||
- name: SunOS build script | ||
run: bash -x build.sh | ||
|
||
- name: Create Release | ||
uses: "marvinpinto/action-automatic-releases@latest" | ||
with: | ||
repo_token: "${{ secrets.GITHUB_TOKEN }}" | ||
prerelease: false | ||
files: | | ||
cmd/tailscaled/tailscale.xml | ||
sha256sums | ||
tailscaled-illumos | ||
tailscaled-solaris |
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 |
---|---|---|
|
@@ -15,3 +15,4 @@ | |
# company that owns the rights to your contribution. | ||
|
||
Tailscale Inc. | ||
Nahum Shalman <[email protected]> |
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 @@ | ||
#!/bin/bash | ||
|
||
set -o xtrace | ||
set -o errexit | ||
|
||
export TS_USE_TOOLCHAIN=true | ||
# This prevents illumos libc from leaking into Solaris binaries when built on illumos | ||
export CGO_ENABLED=0 | ||
|
||
fix_osabi () { | ||
if [[ $(uname -s) == SunOS ]]; then | ||
/usr/bin/elfedit \ | ||
-e "ehdr:ei_osabi ELFOSABI_SOLARIS" \ | ||
-e "ehdr:ei_abiversion EAV_SUNW_CURRENT" \ | ||
"${1?}" | ||
else | ||
elfedit --output-osabi "Solaris" --output-abiversion "1" "${1?}" | ||
fi | ||
} | ||
|
||
for GOOS in illumos solaris; do | ||
export GOOS | ||
bash -x ./build_dist.sh --box ./cmd/tailscaled | ||
fix_osabi tailscaled | ||
mv tailscaled{,-${GOOS}} | ||
done | ||
|
||
ln cmd/tailscaled/tailscale.xml . | ||
shasum -a 256 tailscaled-* tailscale.xml >sha256sums | ||
rm ./tailscale.xml |
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,36 @@ | ||
<?xml version='1.0'?> | ||
<!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'> | ||
<service_bundle type='manifest' name='export'> | ||
<service name='vpn/tailscale' type='service' version='0'> | ||
<create_default_instance enabled='true'/> | ||
<single_instance/> | ||
<dependency name='network' grouping='require_all' restart_on='error' type='service'> | ||
<service_fmri value='svc:/milestone/network:default'/> | ||
</dependency> | ||
<dependency name='filesystem' grouping='require_all' restart_on='error' type='service'> | ||
<service_fmri value='svc:/system/filesystem/local'/> | ||
</dependency> | ||
<method_context> | ||
<method_credential group='root' user='root'/> | ||
</method_context> | ||
<exec_method name='start' type='method' exec='/opt/local/sbin/tailscaled' timeout_seconds='60'> | ||
<method_context> | ||
<method_environment> | ||
<envvar name='SSL_CERT_FILE' value='/opt/tools/share/mozilla-rootcerts/cacert.pem'/> | ||
</method_environment> | ||
</method_context> | ||
</exec_method> | ||
<exec_method name='stop' type='method' exec=':kill' timeout_seconds='60'/> | ||
<property_group name='application' type='application'/> | ||
<property_group name='startd' type='framework'> | ||
<propval name='duration' type='astring' value='child'/> | ||
<propval name='ignore_error' type='astring' value='core,signal'/> | ||
</property_group> | ||
<stability value='Evolving'/> | ||
<template> | ||
<common_name> | ||
<loctext xml:lang='C'>Tailscale</loctext> | ||
</common_name> | ||
</template> | ||
</service> | ||
</service_bundle> |
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 @@ | ||
<?xml version='1.0'?> | ||
<!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'> | ||
<service_bundle type='manifest' name='export'> | ||
<service name='vpn/tailscale' type='service' version='0'> | ||
<create_default_instance enabled='true'/> | ||
<single_instance/> | ||
<dependency name='network' grouping='require_all' restart_on='error' type='service'> | ||
<service_fmri value='svc:/milestone/network:default'/> | ||
</dependency> | ||
<dependency name='filesystem' grouping='require_all' restart_on='error' type='service'> | ||
<service_fmri value='svc:/system/filesystem/local'/> | ||
</dependency> | ||
<method_context> | ||
<method_credential group='root' user='root'/> | ||
</method_context> | ||
<exec_method name='start' type='method' exec='/usr/local/sbin/tailscaled' timeout_seconds='60'/> | ||
<exec_method name='stop' type='method' exec=':kill' timeout_seconds='60'/> | ||
<property_group name='application' type='application'/> | ||
<property_group name='startd' type='framework'> | ||
<propval name='duration' type='astring' value='child'/> | ||
<propval name='ignore_error' type='astring' value='core,signal'/> | ||
</property_group> | ||
<stability value='Evolving'/> | ||
<template> | ||
<common_name> | ||
<loctext xml:lang='C'>Tailscale</loctext> | ||
</common_name> | ||
</template> | ||
</service> | ||
</service_bundle> |
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
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,12 @@ | ||
// Copyright (c) Tailscale Inc & AUTHORS | ||
// SPDX-License-Identifier: BSD-3-Clause | ||
|
||
package dns | ||
|
||
import ( | ||
"tailscale.com/types/logger" | ||
) | ||
|
||
func NewOSConfigurator(logf logger.Logf, _ string) (OSConfigurator, error) { | ||
return newDirectManager(logf), nil | ||
} |
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,45 @@ | ||
// Copyright (c) Tailscale Inc & AUTHORS | ||
// SPDX-License-Identifier: BSD-3-Clause | ||
|
||
package router | ||
|
||
import ( | ||
"strings" | ||
|
||
"github.com/tailscale/wireguard-go/tun" | ||
"tailscale.com/types/logger" | ||
"tailscale.com/net/netmon" | ||
) | ||
|
||
// For now this router only supports the userspace WireGuard implementations. | ||
|
||
func newUserspaceRouter(logf logger.Logf, tundev tun.Device, linkMon *netmon.Monitor) (Router, error) { | ||
return newUserspaceSunosRouter(logf, tundev, linkMon) | ||
} | ||
|
||
func cleanup(logf logger.Logf, interfaceName string) { | ||
ipadm := []string{"ipadm", "show-addr", "-p", "-o", "addrobj"} | ||
out, err := cmd(ipadm...).Output() | ||
if err != nil { | ||
logf("ipadm show-addr: %v\n%s", err, out) | ||
} | ||
for _, a := range strings.Fields(string(out)) { | ||
s := strings.Split(a, "/") | ||
if len(s) > 1 && strings.Contains(s[1], "tailscale") { | ||
ipadm = []string{"ipadm", "down-addr", "-t", a} | ||
cmdVerbose(logf, ipadm) | ||
ipadm = []string{"ipadm", "delete-addr", a} | ||
cmdVerbose(logf, ipadm) | ||
ipadm = []string{"ipadm", "delete-if", s[0]} | ||
cmdVerbose(logf, ipadm) | ||
} | ||
} | ||
ifcfg := []string{"ifconfig", interfaceName, "unplumb"} | ||
if out, err := cmd(ifcfg...).CombinedOutput(); err != nil { | ||
logf("ifconfig unplumb: %v\n%s", err, out) | ||
} | ||
ifcfg = []string{"ifconfig", interfaceName, "inet6", "unplumb"} | ||
if out, err := cmd(ifcfg...).CombinedOutput(); err != nil { | ||
logf("ifconfig inet6 unplumb: %v\n%s", err, out) | ||
} | ||
} |
Oops, something went wrong.