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

Systray launcher #761

Merged
merged 117 commits into from
Sep 9, 2021
Merged
Show file tree
Hide file tree
Changes from 59 commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
8b28da9
Modify `gen-config` command to generate app configs optionally
Darkren Dec 28, 2020
5adabdc
Add debug log
Darkren Jan 4, 2021
0fa39d0
Revert debug log
Darkren Jan 4, 2021
288ce20
Add debug logs
Darkren Jan 4, 2021
00f9919
Change debug logs
Darkren Jan 4, 2021
cacec13
Change debug logs
Darkren Jan 4, 2021
ba35916
Change debug log
Darkren Jan 4, 2021
998b5f8
Change debug logs
Darkren Jan 4, 2021
919bb7d
Change debug logs
Darkren Jan 4, 2021
fc19daa
Change debug logs
Darkren Jan 4, 2021
47fd0e9
Add draft systray app which opens hypervisor
Darkren Jan 6, 2021
fb84b01
Implement systray app for Linux and OSX
Darkren Jan 7, 2021
47ce909
Add draft uninstall function
Darkren Jan 10, 2021
a9daf07
Add separate deinstaller cmd
Darkren Jan 11, 2021
b590f40
Setuid only for needed script lines
Darkren Jan 11, 2021
3b17069
Change deinstallation routine
Darkren Jan 11, 2021
3e1b385
Merge systray app and visor binaries, remove deinstaller cmd
Darkren Jan 13, 2021
3217293
Add debug logs
Darkren Jan 14, 2021
8a4027f
More debug logs
Darkren Jan 14, 2021
1f1ec65
Change sys tray icon path
Darkren Jan 14, 2021
c16c158
Make hypervisor have `enable_tls` false by default for `-p` flag in c…
Darkren Jan 14, 2021
73e1524
Make hypervisor button enabled in the background
Darkren Jan 14, 2021
4b3ba5e
Make `dmsg.ErrEntityClosed` being handled properly
Darkren Jan 14, 2021
c785f6c
Change deinstaller path
Darkren Jan 14, 2021
7abc15c
Fix deinstaller location
Darkren Jan 14, 2021
90cf5f1
Make systray app quit on os signal
Darkren Jan 15, 2021
f447a6d
Add debug logs
Darkren Jan 15, 2021
517f6cc
Fix shutdown sequence
Darkren Jan 15, 2021
86f8430
Add debug logs
Darkren Jan 15, 2021
9b64765
Add debug log
Darkren Jan 15, 2021
b112340
Refactor code, remove debugging logs
Darkren Jan 18, 2021
a20eeb4
Change default skywire path to $HOME/Skywire for OSX
Darkren Jan 18, 2021
8f8ba97
Change default skywire path for OSX
Darkren Jan 18, 2021
a05ddd6
Add debug logs
Darkren Jan 19, 2021
e4ff01c
More debug logs
Darkren Jan 19, 2021
5687a13
More debug logs
Darkren Jan 19, 2021
9887d36
Remove debug logs
Darkren Jan 19, 2021
528a5bf
Change tray icon extension to `.tiff`
Darkren Jan 27, 2021
14913dd
Change browser opening lib
Darkren Jan 29, 2021
5f95af3
Make linter happy
Darkren Jan 29, 2021
405b1a4
Merge branch 'develop' of github.com:skycoin/skywire into feature/mac…
Darkren Feb 18, 2021
59e27dd
Merge branch 'develop' of github.com:skycoin/skywire into feature/mac…
Darkren Mar 16, 2021
cc1519c
Fix travis
Darkren Mar 16, 2021
88e645c
Fix travis
Darkren Mar 16, 2021
007a94e
Fix travis
Darkren Mar 16, 2021
9b54d86
Fix travis
Darkren Mar 16, 2021
cc98403
update vendor dependencies
alexadhy May 5, 2021
6922e1a
fixes build for arm64 darwin (apple silicon)
alexadhy May 6, 2021
a0868b9
crossbuild
alexadhy May 7, 2021
973f279
Merge remote-tracking branch 'upstream/develop' into feature/systray
alexadhy May 8, 2021
bceb8bb
separate darwin goreleaser
alexadhy May 8, 2021
d2b920f
fixes travis build
alexadhy May 8, 2021
d6572b9
makefile: use bash to fix travis build
alexadhy May 8, 2021
4f48749
Makefile: fixes
alexadhy May 8, 2021
2708675
Merge branch 'feature/systray' of github.com-alexadhy:alexadhy/skywir…
alexadhy May 8, 2021
da5a00b
fixes makefile syntax error
alexadhy May 8, 2021
5a375fc
goreleaser build all from one docker image
alexadhy May 12, 2021
e1fe495
Merge remote-tracking branch 'upstream/develop' into feature/systray
alexadhy May 12, 2021
896e119
comment out make tidy in goreleaser
alexadhy May 12, 2021
24cca12
Merge remote-tracking branch 'upstream/develop' into feature/systray
alexadhy Jun 11, 2021
d456b14
added systray icon location
alexadhy Jun 11, 2021
c00d323
Merge remote-tracking branch 'upstream/develop' into feature/systray
alexadhy Jun 19, 2021
d3390f6
added systray build tag
alexadhy Jun 19, 2021
454bcd0
added docs for building systray
alexadhy Jun 19, 2021
38a9d2e
WIP: goreleaser for now, appveyor once the whole thing is tested
alexadhy Jun 19, 2021
c157518
fixes loading systray
alexadhy Jun 19, 2021
363c463
fixes build tag
alexadhy Jun 19, 2021
aff0fd1
TODO: remove goreleaser systray
Jun 19, 2021
a80651e
fixes linting
Jun 19, 2021
10f2c09
removed snapshot generating
alexadhy Jun 19, 2021
a215760
fix config loading when systray flag is specified
alexadhy Jul 6, 2021
3932152
added documentation to install gnome-extensions-appindicator on linux
alexadhy Jul 6, 2021
284937e
docs, added extra instruction
alexadhy Jul 6, 2021
deca488
fixes conflicts
alexadhy Jul 6, 2021
de00696
Merge remote-tracking branch 'upstream/develop' into feature/systray
alexadhy Jul 8, 2021
823028c
uninstaller, prompt for user interaction first
alexadhy Jul 8, 2021
c79e0bd
dialog switch dependencies
alexadhy Jul 8, 2021
bbf0af0
uses polkit for linux
alexadhy Jul 9, 2021
a4fdbc4
uses polkit for linux
alexadhy Jul 9, 2021
68d8bf1
Merge remote-tracking branch 'upstream/develop' into feature/systray
alexadhy Aug 3, 2021
5424634
added polkit generation script
alexadhy Aug 5, 2021
249bdfe
fix script
alexadhy Aug 5, 2021
65bd318
fixes polkit pkexec
alexadhy Aug 5, 2021
d5d0897
added pkexec and sudo to the vpnEnvMaker
alexadhy Aug 8, 2021
3f2103a
init linux
alexadhy Aug 10, 2021
920c515
run elevated
alexadhy Aug 10, 2021
0404ca2
fixes build dep
alexadhy Aug 10, 2021
a90b719
fixes osutil run
alexadhy Aug 11, 2021
35fad65
os_linux_gui run with elevated permission
alexadhy Aug 13, 2021
8feb9ee
Makefile: run vpn-client and server with systray tag
alexadhy Aug 13, 2021
73aec24
Makefile: run vpn-client and server with systray tag (2)
alexadhy Aug 13, 2021
b815850
app config / proc config, added sudo required
alexadhy Aug 13, 2021
4d4db01
pkexec envs append
alexadhy Aug 13, 2021
cfcb684
Merge remote-tracking branch 'upstream/develop' into feature/systray
alexadhy Aug 13, 2021
e63682b
update docs
alexadhy Aug 13, 2021
977bc0b
fixes vendoring
alexadhy Aug 13, 2021
d2944f3
added ways to stop application when running as sudo
alexadhy Aug 20, 2021
cf34db7
fixes docs
alexadhy Aug 20, 2021
f2404e2
removed sudo required config
alexadhy Aug 22, 2021
8b3163d
update vpn status
alexadhy Aug 22, 2021
0abbf96
requested changes, removed files
alexadhy Aug 23, 2021
f4489dd
gui darwin: tiff image conversion on init
alexadhy Aug 23, 2021
1d6ffb7
requested changes from mrpalide
alexadhy Aug 24, 2021
d80ce2b
requested changes
alexadhy Aug 24, 2021
d6e8436
fixes docs, and build
alexadhy Aug 24, 2021
170f5d6
fix linters
alexadhy Aug 24, 2021
2bfecf6
fixes shutdown
alexadhy Aug 24, 2021
3f95d4b
rename stopSystray => stopVisor
alexadhy Aug 24, 2021
a5d85a6
fixes shutdown
alexadhy Aug 26, 2021
bd4a795
Merge remote-tracking branch 'upstream/develop' into feature/systray
alexadhy Aug 26, 2021
8a79220
travis remove musl tools
alexadhy Aug 26, 2021
a79d1a6
Merge remote-tracking branch 'upstream/develop' into feature/systray
alexadhy Sep 2, 2021
6a83feb
update makefile
alexadhy Sep 2, 2021
ea82673
systray: uses skywire-sysroot
alexadhy Sep 3, 2021
fefba85
Merge remote-tracking branch 'upstream/develop' into feature/systray
alexadhy Sep 8, 2021
dcde465
hide uninstall on non-packaged install
alexadhy Sep 9, 2021
acb58f4
fixes gui_linux import
alexadhy Sep 9, 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
10 changes: 4 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,9 @@ pkg/visor/foo/
go.mod-e

# goreleaser and frontend builds
dist

# release
*.deb

/sysroot
static/skywire-manager-src/dist/*

/visor/
/visor
/dist-linux
/dist
120 changes: 80 additions & 40 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,72 +11,124 @@ release:

draft: true

before:
hooks:
- go mod tidy
#before:
# hooks:
# - make tidy
builds:
- id: skywire-visor
- id: skywire-visor-darwin-amd64
binary: skywire-visor
goos:
- linux
- darwin
goarch:
- amd64
- 386
main: ./cmd/skywire-visor/
env:
- CGO_ENABLED=1
- CC=o64-clang
- CXX=o64-clang++
ldflags: -s -w -X github.com/skycoin/dmsg/buildinfo.version={{.Version}} -X github.com/skycoin/dmsg/buildinfo.commit={{.ShortCommit}} -X github.com/skycoin/dmsg/buildinfo.date={{.Date}}

- id: skywire-visor-darwin-arm64
binary: skywire-visor
goos:
- darwin
goarch:
- arm64
main: ./cmd/skywire-visor/
env:
- CGO_ENABLED=1
- CC=oa64-clang
- CXX=oa64-clang++
ldflags: -s -w -X github.com/skycoin/dmsg/buildinfo.version={{.Version}} -X github.com/skycoin/dmsg/buildinfo.commit={{.ShortCommit}} -X github.com/skycoin/dmsg/buildinfo.date={{.Date}}

- id: skywire-visor-linux-arm64
binary: skywire-visor
goos:
- linux
goarch:
- arm64
env:
- CGO_ENABLED=1
- CC=aarch64-linux-gnu-gcc
- CXX=aarch64-linux-gnu-g++
- CGO_FLAGS=--sysroot=/sysroot/arm64
- CGO_LDFLAGS=--sysroot=/sysroot/arm64
- PKG_CONFIG_SYSROOT_DIR=/sysroot/arm64
- PKG_CONFIG_PATH=/sysroot/arm64/usr/lib/aarch64-linux-gnu/pkgconfig:/sysroot/arm64/usr/lib/pkgconfig:/sysroot/arm64/usr/share/pkgconfig
main: ./cmd/skywire-visor/
ldflags: -s -w -X github.com/skycoin/dmsg/buildinfo.version={{.Version}} -X github.com/skycoin/dmsg/buildinfo.commit={{.ShortCommit}} -X github.com/skycoin/dmsg/buildinfo.date={{.Date}}

- id: skywire-visor-linux-amd64
binary: skywire-visor
goos:
- linux
goarch:
- amd64
env:
- CGO_ENABLED=1
- CC=gcc
- CXX=g++
- CGO_LDFLAGS=--sysroot=/sysroot/amd64
- PKG_CONFIG_SYSROOT_DIR=/sysroot/amd64
- PKG_CONFIG_PATH=/sysroot/amd64/usr/lib/x86_64-linux-gnu/pkgconfig:/sysroot/amd64/usr/lib/pkgconfig:/sysroot/amd64/usr/share/pkgconfig
main: ./cmd/skywire-visor/
ldflags: -s -w -X github.com/skycoin/dmsg/buildinfo.version={{.Version}} -X github.com/skycoin/dmsg/buildinfo.commit={{.ShortCommit}} -X github.com/skycoin/dmsg/buildinfo.date={{.Date}}

- id: skywire-visor-linux-armhf
binary: skywire-visor
goos:
- linux
goarch:
- arm
goarm:
- 6
- 7
ignore:
- goos: darwin
goarch: 386
- goos: darwin
alexadhy marked this conversation as resolved.
Show resolved Hide resolved
goarch: arm64
env:
- CGO_ENABLED=0
- CGO_ENABLED=1
- CC=arm-linux-gnueabihf-gcc
- CXX=arm-linux-gnueabihf-g++
- CGO_FLAGS=--sysroot=/sysroot/armhf
- CGO_LDFLAGS=--sysroot=/sysroot/armhf
- PKG_CONFIG_SYSROOT_DIR=/sysroot/armhf
- PKG_CONFIG_PATH=/sysroot/armhf/usr/lib/arm-linux-gnueabihf/pkgconfig:/sysroot/armhf/usr/lib/pkgconfig:/sysroot/armhf/usr/share/pkgconfig
main: ./cmd/skywire-visor/
ldflags: -s -w -X github.com/skycoin/dmsg/buildinfo.version={{.Version}} -X github.com/skycoin/dmsg/buildinfo.commit={{.ShortCommit}} -X github.com/skycoin/dmsg/buildinfo.date={{.Date}}

- id: skywire-cli
binary: skywire-cli
goos:
- linux
- darwin
goarch:
- amd64
- 386
- arm64
- arm
goarm:
- 6
- 7
ignore:
- goos: darwin
goarch: 386
- goos: darwin
goarch: arm64
goarch: arm
env:
- CGO_ENABLED=0
main: ./cmd/skywire-cli/
ldflags: -s -w -X github.com/skycoin/dmsg/buildinfo.version={{.Version}} -X github.com/skycoin/dmsg/buildinfo.commit={{.ShortCommit}} -X github.com/skycoin/dmsg/buildinfo.date={{.Date}}

- id: skychat
binary: apps/skychat
goos:
- linux
- darwin
goarch:
- amd64
- 386
- arm64
- arm
goarm:
- 6
- 7
ignore:
- goos: darwin
goarch: 386
- goos: darwin
goarch: arm64
goarch: arm
env:
- CGO_ENABLED=0
main: ./cmd/apps/skychat/
Expand All @@ -88,17 +140,14 @@ builds:
- darwin
goarch:
- amd64
- 386
- arm64
- arm
goarm:
- 6
- 7
ignore:
- goos: darwin
goarch: 386
- goos: darwin
goarch: arm64
goarch: arm
env:
- CGO_ENABLED=0
main: ./cmd/apps/skysocks/
Expand All @@ -110,17 +159,14 @@ builds:
- darwin
goarch:
- amd64
- 386
- arm64
- arm
goarm:
- 6
- 7
ignore:
- goos: darwin
goarch: 386
- goos: darwin
goarch: arm64
goarch: arm
env:
- CGO_ENABLED=0
main: ./cmd/apps/skysocks-client/
Expand All @@ -132,17 +178,14 @@ builds:
- darwin
goarch:
- amd64
- 386
- arm64
- arm
goarm:
- 6
- 7
ignore:
- goos: darwin
goarch: 386
- goos: darwin
goarch: arm64
goarch: arm
env:
- CGO_ENABLED=0
main: ./cmd/apps/vpn-server/
Expand All @@ -154,32 +197,29 @@ builds:
- darwin
goarch:
- amd64
- 386
- arm64
- arm
goarm:
- 6
- 7
ignore:
- goos: darwin
goarch: 386
- goos: darwin
goarch: arm64
goarch: arm
env:
- CGO_ENABLED=0
main: ./cmd/apps/vpn-client/
ldflags: -s -w -X github.com/skycoin/dmsg/buildinfo.version={{.Version}} -X github.com/skycoin/dmsg/buildinfo.commit={{.ShortCommit}} -X github.com/skycoin/dmsg/buildinfo.date={{.Date}}
archives:
- format: tar.gz
wrap_in_directory: false
name_template: 'skywire-v{{ .Version }}-{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
name_template: 'skywire-{{ .Version }}-{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
jdknives marked this conversation as resolved.
Show resolved Hide resolved
checksum:
name_template: 'checksums.txt'
name_template: 'checksums-linux.txt'
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
- '^docs:'
- '^test:'
7 changes: 7 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ addons:
packages:
# For building MUSL static builds on Linux.
- musl-tools
- libgtk-3-dev
- libappindicator3-dev
#- gcc-mingw-w64-i686
alexadhy marked this conversation as resolved.
Show resolved Hide resolved
#- g++-mingw-w64-i686
#- binutils-mingw-w64-i686
#- libsnmp-dev

matrix:
include:
Expand All @@ -39,6 +45,7 @@ script:
- make install-deps-ui
- make lint-ui
- make build-ui
- make snapshot

deploy:
- provider: script
Expand Down
40 changes: 38 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
.PHONY : docker-image docker-clean docker-network
.PHONY : docker-apps docker-bin docker-volume
.PHONY : docker-run docker-stop
.PHONY : sysroot sysroot-clean

SHELL := /bin/bash
VERSION := $(shell git describe)
#VERSION := v0.1.0 # for debugging updater

Expand All @@ -19,6 +21,7 @@ DMSG_BASE := github.com/skycoin/dmsg
OPTS?=GO111MODULE=on
STATIC_OPTS?= $(OPTS) CC=musl-gcc
MANAGER_UI_DIR = static/skywire-manager-src
GO_BUILDER_VERSION=v1.16.4
alexadhy marked this conversation as resolved.
Show resolved Hide resolved
MANAGER_UI_BUILT_DIR=cmd/skywire-visor/static

TEST_OPTS:=-cover -timeout=5m -mod=vendor
Expand Down Expand Up @@ -77,6 +80,9 @@ lint: ## Run linters. Use make install-linters first
${OPTS} golangci-lint run -c .golangci.yml ./...
# The govet version in golangci-lint is out of date and has spurious warnings, run it separately

lint-ci:
${OPTS} golangci-lint run --build-tags=musl -c .golangci.yml ./...

lint-extra: ## Run linters with extra checks.
${OPTS} golangci-lint run --no-config --enable-all ./...
# The govet version in golangci-lint is out of date and has spurious warnings, run it separately
Expand Down Expand Up @@ -104,6 +110,30 @@ format: tidy ## Formats the code. Must have goimports and goimports-reviser inst
dep: tidy ## Sorts dependencies
${OPTS} go mod vendor -v

snapshot: sysroot ## create snapshot release
docker run --rm --privileged \
-v $(CURDIR):/go/src/github.com/skycoin/skywire \
-v /var/run/docker.sock:/var/run/docker.sock \
-v $(GOPATH)/src:/go/src \
-v $(CURDIR)/sysroot:/sysroot \
-w /go/src/github.com/skycoin/skywire \
alexadhyatma/golang-cross:$(GO_BUILDER_VERSION) --snapshot --skip-publish --rm-dist

snapshot-clean: ## Cleans snapshot / release
rm -rf ./dist

sysroot:
mkdir -p ./sysroot
@echo "getting sysroot for cross compilation"
if [[ ! -f /tmp/snapshot-05-12-2021.tar.gz ]]; then \
curl -L -o /tmp/snapshot-05-12-2021.tar.gz "https://alexadhy-git.s3-ap-southeast-1.amazonaws.com/snapshot-05-12-2021.tar.gz"; \
jdknives marked this conversation as resolved.
Show resolved Hide resolved
fi
tar xf /tmp/snapshot-05-12-2021.tar.gz -C ./sysroot/

sysroot-clean:
@rm -rf ./sysroot
@rm -rf /tmp/sysroot-git

host-apps: ## Build app
${OPTS} go build ${BUILD_OPTS} -o ./apps/skychat ./cmd/apps/skychat
${OPTS} go build ${BUILD_OPTS} -o ./apps/skysocks ./cmd/apps/skysocks
Expand Down Expand Up @@ -138,8 +168,14 @@ build-deploy: ## Build for deployment Docker images
${OPTS} go build ${BUILD_OPTS_DEPLOY} -o /release/apps/skysocks ./cmd/apps/skysocks
${OPTS} go build ${BUILD_OPTS_DEPLOY} -o /release/apps/skysocks-client ./cmd/apps/skysocks-client

github-release: ## Create a GitHub release
goreleaser --rm-dist
github-release: sysroot ## Create a GitHub release
docker run --rm --privileged \
-v $(CURDIR):/go/src/github.com/skycoin/skywire \
-v /var/run/docker.sock:/var/run/docker.sock \
-v $(GOPATH)/src:/go/src \
-v $(CURDIR)/sysroot:/sysroot \
-w /go/src/github.com/skycoin/skywire \
alexadhyatma/golang-cross:$(GO_BUILDER_VERSION) --rm-dist

# Manager UI
install-deps-ui: ## Install the UI dependencies
Expand Down
Loading