Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mac installer #889

Merged
merged 57 commits into from
Oct 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
aecb284
Merge remote-tracking branch 'upstream/develop' into develop
alexadhy Sep 21, 2021
822ca01
macos installer
alexadhy Sep 23, 2021
cc3c681
fixes install and run
alexadhy Sep 23, 2021
fac1cf2
added installation package for arm64 / m1
alexadhy Sep 23, 2021
38caf2d
fixes create_installer
alexadhy Sep 23, 2021
363561a
add arm64 to Distribution
alexadhy Sep 23, 2021
6796436
fixes update
alexadhy Sep 23, 2021
0871f45
changes directory to defaults in macOS
alexadhy Sep 23, 2021
25b24dc
fixes icon loading, changes default confPath for skywire-visor
alexadhy Sep 23, 2021
6ba2d8f
added docs
alexadhy Sep 23, 2021
b3bfe51
formatting
alexadhy Sep 23, 2021
106b3b8
revert change to default config name
alexadhy Sep 23, 2021
9ffb369
fixes config loading
alexadhy Sep 24, 2021
49b4e88
Merge remote-tracking branch 'upstream/develop' into mac-installer
alexadhy Sep 24, 2021
4945356
more cleanup for makefile
alexadhy Sep 24, 2021
fd1e370
adds vpn link button to the systray
alexadhy Sep 27, 2021
119c50b
adds status to the url
alexadhy Sep 27, 2021
71174c1
fixes chown
alexadhy Sep 27, 2021
61e7f67
fixes arg
alexadhy Sep 28, 2021
1ad7366
scripts: remove sudo
alexadhy Sep 28, 2021
c59c2ba
privileged app
alexadhy Sep 28, 2021
f085d63
installer add vpn link
alexadhy Sep 28, 2021
68638fe
changes default directory of default apps
alexadhy Sep 28, 2021
af38109
various checks and fixes for mac installer
alexadhy Sep 28, 2021
3ffbbd4
formatting
alexadhy Sep 28, 2021
597f840
added version string
alexadhy Sep 28, 2021
71aecd1
Merge remote-tracking branch 'upstream/develop' into mac-installer
alexadhy Sep 29, 2021
f873127
launcher configs adjustment for darwin / windows
alexadhy Sep 29, 2021
62e4c52
vpn link adjustment
alexadhy Sep 29, 2021
196da31
also terminate vpn-client
alexadhy Sep 29, 2021
ca03537
fixes blurry icon
alexadhy Sep 29, 2021
ed95534
avoid showing dock icon
alexadhy Sep 29, 2021
29307b0
Update postinstall
alexadhy Sep 29, 2021
a8e4217
Update postinstall
alexadhy Sep 29, 2021
bfd4e9b
update docs
alexadhy Sep 29, 2021
cbafcb5
adds check if the user accidentally nukes the Skywire dir
alexadhy Sep 29, 2021
dabadc0
modifies vpn ui button and advanced button
alexadhy Sep 30, 2021
bf807f3
disable enable_auth
alexadhy Oct 1, 2021
ef18d89
enable signing
alexadhy Oct 1, 2021
860531a
added codesign (optional)
alexadhy Oct 1, 2021
4890b35
merge upstream, merge embedded icons
alexadhy Oct 2, 2021
520dc71
edit bundle name
alexadhy Oct 3, 2021
1410606
added check for skywireBuild.keychain
alexadhy Oct 4, 2021
ef5cce7
fixes check existence of said keychain logic
alexadhy Oct 4, 2021
26fd253
fixes keychains
alexadhy Oct 5, 2021
0d535e5
user should import the certificate from apple himself, also added col…
alexadhy Oct 7, 2021
58458bf
Merge remote-tracking branch 'upstream/develop' into mac-installer
alexadhy Oct 7, 2021
0e76f17
fixes makefile quoting
alexadhy Oct 7, 2021
4058677
uses productsign and codesign
alexadhy Oct 12, 2021
32118df
Merge remote-tracking branch 'upstream/develop' into mac-installer
alexadhy Oct 12, 2021
bd2b457
fixes colors
alexadhy Oct 12, 2021
ee13997
fixes makefile
alexadhy Oct 12, 2021
6a8d57e
Merge remote-tracking branch 'upstream/develop' into mac-installer
alexadhy Oct 15, 2021
ec1e7dd
TODO: fixes application not loading
alexadhy Oct 15, 2021
bd42eb1
fixes installer not running
alexadhy Oct 16, 2021
862f6ba
requested changes: configs, and dont' pass around visor in gui
alexadhy Oct 16, 2021
cd325bf
documentation makefile
alexadhy Oct 16, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,10 @@ static/skywire-manager-src/dist/*
/dist-linux
/dist
Char
/scripts/mac_installer/IconsSkycoin.tar.gz
/scripts/mac_installer/icon_128x128.png
/scripts/mac_installer/[email protected]
/mac_build
/SkywireInstaller*.pkg
*.dmg
/scripts/mac_installer/icon.iconset/
13 changes: 8 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ BUILD_OPTS_DEPLOY?="-ldflags=$(BUILDINFO) -w -s"

check: lint test ## Run linters and tests

check-windows-appveyor: lint-windows-appveyor test ## Run linters and tests on appveyor windows image

build: host-apps bin ## Install dependencies, build apps and binaries. `go build` with ${OPTS}

build-systray: host-apps-systray bin-systray ## Install dependencies, build apps and binaries `go build` with ${OPTS}, with CGO and systray

build-static: host-apps-static bin-static ## Build apps and binaries. `go build` with ${OPTS}

installer: mac-installer ## Builds MacOS installer for skywire-visor

install-generate: ## Installs required execs for go generate.
${OPTS} go install github.com/mjibson/esc
${OPTS} go install github.com/vektra/mockery/cmd/mockery
Expand All @@ -74,9 +74,6 @@ install-static: ## Install `skywire-visor`, `skywire-cli`, `setup-node`
lint: ## Run linters. Use make install-linters first
${OPTS} golangci-lint run -c .golangci.yml ./...

lint-windows-appveyor:
C:\Users\appveyor\go\bin\golangci-lint run -c .golangci.yml ./...

test: ## Run tests
-go clean -testcache &>/dev/null
${OPTS} go test ${TEST_OPTS} ./internal/...
Expand Down Expand Up @@ -174,5 +171,11 @@ build-ui: install-deps-ui ## Builds the UI
mkdir ${MANAGER_UI_BUILT_DIR}
cp -r ${MANAGER_UI_DIR}/dist/. ${MANAGER_UI_BUILT_DIR}

mac-installer: ## Create signed and notarized application, run make mac-installer-help for more
./scripts/mac_installer/create_installer.sh -s -n

mac-installer-help: ## Show installer creation help
./scripts/mac_installer/create_installer.sh -h

help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
9 changes: 4 additions & 5 deletions cmd/skywire-cli/commands/config/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"github.com/skycoin/skycoin/src/util/logging"
"github.com/spf13/cobra"

"github.com/skycoin/skywire/pkg/skyenv"
"github.com/skycoin/skywire/pkg/visor/visorconfig"
)

Expand Down Expand Up @@ -62,12 +63,10 @@ var genConfigCmd = &cobra.Command{

//set output for package and skybian configs
if packageConfig {
if hypervisor {
output = "/opt/skywire/skywire.json"
} else {
output = "/opt/skywire/skywire-visor.json"
}
configName := "skywire-config.json"
output = filepath.Join(skyenv.PackageSkywirePath(), configName)
}

if skybianConfig {
output = "/etc/skywire-config.json"
}
Expand Down
22 changes: 8 additions & 14 deletions cmd/skywire-visor/commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
_ "net/http/pprof" // nolint:gosec // https://golang.org/doc/diagnostics.html#profiling
"os"
"os/exec"
"runtime"
"path/filepath"
"strings"
"sync"
"syscall"
Expand All @@ -25,6 +25,7 @@ import (
"github.com/toqueteos/webbrowser"

"github.com/skycoin/skywire/pkg/restart"
"github.com/skycoin/skywire/pkg/skyenv"
"github.com/skycoin/skywire/pkg/syslog"
"github.com/skycoin/skywire/pkg/visor"
"github.com/skycoin/skywire/pkg/visor/logstore"
Expand Down Expand Up @@ -73,6 +74,7 @@ func init() {
}

func runVisor(args []string) {
var ok bool
log := initLogger(tag, syslogAddr)
store, hook := logstore.MakeStore(runtimeLogMaxEntries)
log.AddHook(hook)
Expand Down Expand Up @@ -129,29 +131,25 @@ func runVisor(args []string) {

conf := initConfig(log, args, confPath)

v, ok := visor.NewVisor(conf, restartCtx)
vis, ok := visor.NewVisor(conf, restartCtx)
if !ok {
log.Errorln("Failed to start visor.")
quitSystray()
return
}
v.SetLogstore(store)
vis.SetLogstore(store)

if launchBrowser {
runBrowser(conf, log)
}

ctx, cancel := cmdutil.SignalContext(context.Background(), log)
setStopFunction(log, cancel, v.Close)

defer cancel()
setStopFunction(log, cancel, vis.Close)

// Wait.
<-ctx.Done()

if err = v.Close(); err != nil {
log.Error("Error closing visor: ", err)
}
stopVisorFn()
}

// Execute executes root CLI command.
Expand Down Expand Up @@ -239,11 +237,7 @@ func initConfig(mLog *logging.MasterLogger, args []string, confPath string) *vis
}

if confPath == "" {
if runtime.GOOS == "darwin" {
confPath = os.Getenv("HOME") + "/Skywire/" + defaultConfigName
} else {
confPath = "/opt/skywire/" + defaultConfigName
}
confPath = filepath.Join(skyenv.PackageSkywirePath(), defaultConfigName)
}

fallthrough
Expand Down
10 changes: 7 additions & 3 deletions cmd/skywire-visor/commands/systray.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,20 @@ func runApp(args ...string) {

}

func setStopFunction(log *logging.MasterLogger, cancel context.CancelFunc, stopVisorFn func() error) {
func setStopFunction(log *logging.MasterLogger, cancel context.CancelFunc, fn func() error) {
stopVisorWg.Add(1)
defer stopVisorWg.Done()

gui.SetStopVisorFn(func() {
if err := stopVisorFn(); err != nil {
stopVisorFn = func() {
if err := fn(); err != nil {
log.WithError(err).Error("Visor closed with error.")
}
cancel()
stopVisorWg.Wait()
}

gui.SetStopVisorFn(func() {
stopVisorFn()
})
}

Expand Down
31 changes: 31 additions & 0 deletions docs/mac_install.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# MacOS

## Installation

### Developer

Prequisites:

- Xcode
- MacOS Host

Run `make mac-installer` on the root of the `skywire` directory

It should output two installer for `amd64 (Intel Mac)` and `arm64 (M1 Macs)` so install one that depends on your CPU
arch / ISA.

### End User

- Download the pkg / dmg for your machine, depends on your CPU arch / ISA.
- Install it.

## Running

### Directory Layout

- Skywire's config directory is in `/Users/${USER}/Library/Application\ Support/Skywire`
- Runtime logs is in `/Users/${USER}/Library/Logs/Skywire/visor.log`

## Updating

Same as Installation, choose the `Update` option.
2 changes: 1 addition & 1 deletion docs/systray-builds.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ $ gnome-extensions enable [email protected]

#### Mac / Darwin

You need to have an icon defined in `/Applications/Skywire.app/Contents/Resources/tray_icon.png`
You need to have an icon defined in `/Applications/Skywire.app/Contents/Resources/icon.tiff`

#### Windows

Expand Down
Loading