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

Merge to master #80

Open
wants to merge 187 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
187 commits
Select commit Hold shift + click to select a range
df1e45d
add /dmsghttp config to config bootstrap
mrpalide Jun 20, 2023
7709699
fix images
mrpalide Jun 30, 2023
b2703ea
fix integration env configs
mrpalide Jun 30, 2023
bfaaae2
update docker-compose
mrpalide Jun 30, 2023
ddd00c2
add monitors to env_test values
mrpalide Jun 30, 2023
04ed26f
remove useless config
mrpalide Jun 30, 2023
daf59cb
update logic of reading config of vpn and public-visor monitors
mrpalide Jun 30, 2023
2e08766
fix docker-compose config
mrpalide Jun 30, 2023
0cb9232
export RootCmd(s)
0pcom Jul 10, 2023
ca68f28
update go.mod & vendor
0pcom Jul 10, 2023
10242db
fix build docker images for pods
mrpalide Jul 11, 2023
e144bd2
update Makefile
mrpalide Jul 11, 2023
67c413e
merge develop
0pcom Jul 11, 2023
cce4087
update go.mod go.sum vendor
0pcom Jul 11, 2023
beaa4e9
update go.mod with skywire & skywire-utilities v1.3.11
0pcom Jul 11, 2023
3fc4b94
Merge branch 'develop' into fix/build-docker-images-on-macos
mrpalide Jul 11, 2023
13a3e7a
fix images
mrpalide Jul 11, 2023
21d01b1
fix docker_build.sh script
mrpalide Jul 11, 2023
99f9460
fix Makefile
mrpalide Jul 11, 2023
f6e7912
fix Makefile
mrpalide Jul 11, 2023
5db03ef
fix merge conflicts
0pcom Jul 12, 2023
16664e3
Merge pull request #25 from 0pcom/export-RootCmds
jdknives Jul 20, 2023
ce97006
Fix CI test workflow
jdknives Aug 30, 2023
b50480b
Bump base image Go version for Go
jdknives Aug 30, 2023
fbd7706
Merge branch 'develop' of https://github.com/skycoin/skywire-services…
jdknives Aug 30, 2023
8d0d50d
Vendor
jdknives Aug 30, 2023
3dfbd3a
fix transport setup keys missing on dmsg-monitor and network-monitor …
mrpalide Oct 13, 2023
22fc18d
change reading config logic of vpn-monitor and public-visor-monitor
mrpalide Oct 13, 2023
84ce8cc
upgrade golangci-lint to 1.52.1
mrpalide Oct 13, 2023
11a37b5
upgrade golang:alpine to 3.19
mrpalide Oct 13, 2023
30d6c03
upgrade golang:alpine to 3.17
mrpalide Oct 13, 2023
eabcfb0
update dmsg for use dmsgcurl instead dmsgget
mrpalide Oct 18, 2023
f2b804f
Merge pull request #16 from mrpalide/feat/add-dmsghttp-to-config-service
jdknives Nov 18, 2023
115d627
Merge pull request #30 from mrpalide/fix/improve-monitor-logic
jdknives Nov 20, 2023
0a5d597
update dmsg and skywire at develop | go mod tidy | go mod vendor
mrpalide Nov 20, 2023
a1a4b7a
update go to 1.21.*
mrpalide Nov 20, 2023
22696f8
update go in docker build to 1.21
mrpalide Nov 20, 2023
6bd4ba9
update config-bootstrapper Dockerfile
mrpalide Nov 20, 2023
532ae91
tiny dummy update on config-bootstrapper for checking issue
mrpalide Nov 20, 2023
fa83303
tiny dummy update on config-bootstrapper for checking issue 2
mrpalide Nov 20, 2023
6729f56
fix .test workflow
mrpalide Nov 20, 2023
88db660
add changes for test
mrpalide Nov 20, 2023
a5ecfbd
do tiny changes on docker_build.sh script
mrpalide Nov 20, 2023
463e443
update skywire-utilities
mrpalide Nov 20, 2023
754d428
update skywier@develop
mrpalide Nov 20, 2023
651e13c
update skywire and dmsg @ develop
mrpalide Nov 20, 2023
f93d1f9
update skywire-utilities
mrpalide Nov 20, 2023
09600fb
upgrade golang to 1.21
mrpalide Nov 20, 2023
5313cd5
Merge branch 'develop' into fix/update-dmsg
mrpalide Nov 20, 2023
8152349
fix visor configs
mrpalide Nov 20, 2023
bb1ea9d
Merge pull request #31 from mrpalide/fix/update-dmsg
jdknives Nov 20, 2023
3398e83
improve `/health` endpoint informations (#33)
mrpalide Dec 10, 2023
64f8647
add dmsghttp access (#34)
mrpalide Dec 10, 2023
3212895
Update dependencies (#37)
mrpalide Dec 21, 2023
c989efd
fix wrong url on tpd deregister
mrpalide Jan 8, 2024
8363b52
fix typo
mrpalide Jan 8, 2024
7519e90
Merge pull request #39 from mrpalide/fix/improve-network-monitor
mrpalide Jan 8, 2024
3badf7f
improve error log on tpd monitor
mrpalide Jan 8, 2024
61e6d5c
Merge branch 'develop' into fix/improve-error-log-on-tpd-monitor
mrpalide Jan 8, 2024
d99c5e9
Merge pull request #40 from mrpalide/fix/improve-error-log-on-tpd-mon…
mrpalide Jan 8, 2024
addb4c2
move deregister endpoint out of nonce needed scope
mrpalide Jan 8, 2024
318dafd
Merge pull request #41 from mrpalide/fix/move-tpd-deregister-out-of-n…
mrpalide Jan 8, 2024
a816b7a
add whitelisted pks to tpd
mrpalide Jan 8, 2024
6b5dc72
Merge pull request #42 from mrpalide/fix/add-missing-part-of-monitor-…
mrpalide Jan 8, 2024
c06d2b1
fix linting issue
mrpalide Jan 8, 2024
3b74615
Merge pull request #43 from mrpalide/fix/fix-checking-error
mrpalide Jan 8, 2024
1a9e9ae
add shuffle on entries list of dmsg monitor
mrpalide Jan 9, 2024
81d54f1
Merge branch 'develop' into fix/add-shuffle-on-entries-list-of-dmsg-m…
mrpalide Jan 9, 2024
4a53cab
fix shuffle comment
mrpalide Jan 9, 2024
c66f356
Merge pull request #44 from mrpalide/fix/add-shuffle-on-entries-list-…
mrpalide Jan 9, 2024
b713db9
revert to old vpn-lite-client implementation
mrpalide Jan 9, 2024
2ce79fd
change oldApps logic on read config on vpn-monitor | remove unnecessa…
mrpalide Jan 9, 2024
21e3801
add shuffle on vpn list
mrpalide Jan 9, 2024
44d439d
Merge pull request #45 from mrpalide/fix/fix-vpn-monitor-issue
mrpalide Jan 9, 2024
132d8ee
fix route setup pks
mrpalide Jan 10, 2024
65a41ff
add tpsetuppks and surveywhitelistpks
mrpalide Jan 10, 2024
701233d
Merge branch 'develop' into fix/fix-wrong-keys-on-whitelistedPKs-dmsg…
mrpalide Jan 10, 2024
34cb3f3
Merge pull request #46 from mrpalide/fix/fix-wrong-keys-on-whiteliste…
mrpalide Jan 10, 2024
be7bf2c
Skysocks Monitor (#47)
mrpalide Jan 27, 2024
1b3cd00
Merge branch 'develop' into fix/monitors
mrpalide Jan 30, 2024
b2035f1
fix make check errors
mrpalide Jan 30, 2024
78c46f5
update docker-compose config
mrpalide Jan 30, 2024
869707f
udpate docker configs
mrpalide Jan 30, 2024
05b428b
Merge pull request #21 from mrpalide/fix/monitors
mrpalide Jan 30, 2024
3ad0f72
fix conflict
mrpalide Feb 1, 2024
7343026
fix some little issues
mrpalide Feb 1, 2024
afdfdf9
revert changes on dockerfiles
mrpalide Feb 1, 2024
27de6c8
fix little issues
mrpalide Feb 1, 2024
344d58e
fix vpn-test after recent changes on skywire vpn commands
mrpalide Feb 1, 2024
fbd8087
fix sd address for test
mrpalide Feb 1, 2024
b10c45c
fix sd address for test 2
mrpalide Feb 1, 2024
a84c785
fix ut address for test
mrpalide Feb 1, 2024
fda0ab7
disable skywire-cli vpn list command tests
mrpalide Feb 1, 2024
cb87a6e
Merge pull request #26 from mrpalide/fix/build-docker-images-on-macos
mrpalide Feb 1, 2024
68305a6
downgrade wireguard
mrpalide Feb 6, 2024
38eb4ba
fix VisorTpRm test command
mrpalide Feb 6, 2024
ebee734
Merge pull request #50 from mrpalide/fix/upgrade-wireguard-version
mrpalide Feb 7, 2024
e0f7b5c
upgrade skywire-utilities@develop
mrpalide Feb 8, 2024
0fb0916
add reward system pks to dmsg monitor whitelisted keys
mrpalide Feb 8, 2024
1f5d698
Merge pull request #51 from mrpalide/fix/add-reward-system-pk-to-dmsg…
mrpalide Feb 8, 2024
c8b53f2
disable node visualizer on docker build/push/clean steps, temporary
mrpalide Feb 26, 2024
a98e7a5
update dmsg@develop skywire@develop
mrpalide Feb 26, 2024
c3dfca9
- increase gap between two deregistation from 10 to 60 minutes
mrpalide Feb 26, 2024
7775a17
Merge branch 'develop' into fix/update-dmsg-monitor-logic-based-on-ne…
mrpalide Feb 26, 2024
0247e83
update skywire-utilities@develop"
mrpalide Feb 26, 2024
111c691
update configs of integraion and e2e tests
mrpalide Feb 26, 2024
be57550
update visor config file on e2e-test
mrpalide Feb 26, 2024
7288d44
fix visor configs on integration/e2e test
mrpalide Feb 26, 2024
f4e2916
fix visors configs
mrpalide Feb 26, 2024
a5fce66
add nocash to create e2e-image of visor"
mrpalide Feb 27, 2024
cca6a43
revert cash on dockerfile skywire visors
mrpalide Feb 27, 2024
e2b85b1
minor cli interface refactor (#53)
0pcom Feb 27, 2024
70aad53
fix skymessage ci issue
mrpalide Feb 29, 2024
b8740f9
update skywire@develop
mrpalide Feb 29, 2024
1ea5461
Merge branch 'develop' into fix/update-dmsg-monitor-logic-based-on-ne…
mrpalide Feb 29, 2024
5e5d9bc
add skysocks-monitor to e2e
mrpalide Feb 29, 2024
ccf4676
fix skysock monitor issue on e2e
mrpalide Feb 29, 2024
c9e98dd
Merge pull request #52 from mrpalide/fix/update-dmsg-monitor-logic-ba…
mrpalide Feb 29, 2024
177c854
Improve help menus (#54)
0pcom Mar 6, 2024
60e846f
delete syslog from whole of the repo
mrpalide Mar 16, 2024
662954c
fix ar issue on help menu
mrpalide Mar 16, 2024
0498a90
Merge pull request #57 from mrpalide/fix/remove-syslog-codes
mrpalide Mar 16, 2024
239cff8
add newTUNDevice to windows
mrpalide Mar 16, 2024
caaa6f3
Merge pull request #58 from mrpalide/fix/add-newTUNDevice-for-windows
mrpalide Mar 16, 2024
e87c29e
move back UT from own repo here
mrpalide Mar 25, 2024
ef7df7b
udpate db config for other services like UT
mrpalide Mar 25, 2024
e1c6bc4
fix tidy & vendor
mrpalide Mar 25, 2024
ba88986
update skywire dockerfile and configs
mrpalide Mar 25, 2024
7ed4c26
update skywire dockerfile and configs 2
mrpalide Mar 25, 2024
61e352d
remove wrong commands
mrpalide Mar 25, 2024
551d3da
fix ut docker file
mrpalide Mar 25, 2024
1961a1d
fix ENTRYPOINT of skywire
mrpalide Mar 25, 2024
bfc5e01
fix docker compose command
mrpalide Mar 25, 2024
a3a26ac
fix env_test commands
mrpalide Mar 25, 2024
e8e36b4
update visor configs
mrpalide Mar 25, 2024
c5b3252
update visor configs 2
mrpalide Mar 25, 2024
2fd1c10
update skywire@develop
mrpalide Mar 25, 2024
724b119
upgrade dsmg to v1.3.20
mrpalide Mar 25, 2024
58b8010
Merge pull request #62 from mrpalide/fix/move-ut-back-here
mrpalide Mar 26, 2024
50ccbbf
CLI for transport setup node (#65)
0pcom Apr 3, 2024
d0bc8fd
update dmsg dependency (#70)
0pcom Jun 23, 2024
7c26af2
Update deps (WIP) (#71)
0pcom Jun 24, 2024
87edf49
update deps (#72)
0pcom Jun 27, 2024
267759c
update deps (#73)
0pcom Jul 11, 2024
16c278a
dummy commit
mrpalide Aug 23, 2024
5712005
Merge pull request #74 from mrpalide/fix/dummy-pr-for-check-ci-process
mrpalide Aug 23, 2024
4d5ad8c
update dmsg, skywire, skywire-utilities to v1.3.25
mrpalide Aug 26, 2024
8eeac21
fix docker-compose command to docker compose
mrpalide Aug 26, 2024
23b8433
fix test command
mrpalide Aug 26, 2024
34a1aa8
fix test command on route
mrpalide Aug 26, 2024
457124f
disable route test, temporary
mrpalide Aug 26, 2024
c9a6650
fix issue on VisorTpAdd test
mrpalide Aug 26, 2024
c3c8c71
fix issue on VisorTpAdd test 2
mrpalide Aug 26, 2024
79409bf
fix issue on VisorTpAdd test 3
mrpalide Aug 26, 2024
119b8f8
fix issue on VisorTpAdd test 4
mrpalide Aug 26, 2024
61b7b7c
Merge pull request #75 from mrpalide/fix/update-skywire-dmsg-v1.3.25
mrpalide Aug 26, 2024
d4e955c
add --dmsg-server-type flag to ar
mrpalide Sep 9, 2024
08a943b
add --dmsg-server-type flag to conf
mrpalide Sep 9, 2024
50aa633
add --dmsg-server-type flag to rf
mrpalide Sep 9, 2024
e101467
add --dmsg-server-type flag to tpd
mrpalide Sep 9, 2024
b91b4d3
add --dmsg-server-type flag to ut
mrpalide Sep 9, 2024
53f1f2f
Merge pull request #76 from mrpalide/fix/improve-dmsghttp-handler-logic
mrpalide Sep 9, 2024
007d74e
update dmsg@develop to use updated methods on dmsghttp pkg
mrpalide Sep 10, 2024
bb2afc6
Merge pull request #77 from mrpalide/fix/another-improve-on-dmsghttp-…
mrpalide Sep 10, 2024
50d3139
remove hardcoded deployment defaults (#78)
0pcom Sep 23, 2024
cb6c2e8
Restructure cmd/skywire-services (#79)
0pcom Sep 24, 2024
f3eadba
update deps (#81)
0pcom Oct 4, 2024
0d76025
Update all code deps (#83)
0pcom Oct 19, 2024
b4869a3
remove node-visualizer from joint compilation of skywire-services (#85)
0pcom Nov 5, 2024
6269f3c
replace github.com/skycoin/skywire-utilities import & update vendor d…
0pcom Dec 17, 2024
0e3f3a7
update deps (#87)
0pcom Dec 18, 2024
826a2fa
refactor node visualizer to simple version
mrpalide Dec 22, 2024
3e5b966
change default port from 9081 to 9089 for nv
mrpalide Dec 22, 2024
3232b37
fix docker configs
mrpalide Dec 22, 2024
edf7d0b
fix Makefile
mrpalide Dec 22, 2024
da0a624
go mod tidy | go mod vendor
mrpalide Dec 22, 2024
4006a81
revert name from Skywire Network to Node Visualizer
mrpalide Dec 22, 2024
850a2a6
add nv to skywire-services root
mrpalide Dec 22, 2024
93f1aa4
add pr#84 changes - part 1
mrpalide Dec 22, 2024
f7c862e
add pr#84 changes - part 2
mrpalide Dec 22, 2024
f7f292a
fix node-visualizer dockerfile
mrpalide Dec 22, 2024
dbd2efe
improve test stage in CI
mrpalide Dec 22, 2024
8242103
improve test stage in CI ۲
mrpalide Dec 22, 2024
f8f8f3a
remove useless line in docker_build.sh script
mrpalide Dec 22, 2024
c6c97b6
Merge pull request #89 from mrpalide/feat/refactore-node-visualizer
mrpalide Dec 22, 2024
63329ee
remove tun_device_windows, was useless
mrpalide Dec 25, 2024
f0b7a58
Merge pull request #90 from mrpalide/fix/fix-wireguard-version
mrpalide Dec 25, 2024
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
Next Next commit
add /dmsghttp config to config bootstrap
  • Loading branch information
mrpalide committed Jun 20, 2023
commit df1e45dd41a22b3eedb2269e8cfa6f77aff96642
71 changes: 66 additions & 5 deletions pkg/config-bootstrapper/api/api.go
Original file line number Diff line number Diff line change
@@ -3,6 +3,8 @@ package api

import (
"encoding/json"
"fmt"
"io"
"net/http"
"strings"
"sync"
@@ -29,6 +31,9 @@ type API struct {

services *visorconfig.Services

dmsghttpConf httputil.DMSGHTTPConf
dmsghttpConfTs time.Time

closeOnce sync.Once
closeC chan struct{}
}
@@ -75,10 +80,11 @@ func New(log *logging.Logger, conf Config, domain string) *API {
}

api := &API{
log: log,
startedAt: time.Now(),
services: services,
closeC: make(chan struct{}),
log: log,
startedAt: time.Now(),
services: services,
dmsghttpConfTs: time.Now().Add(-5 * time.Minute),
closeC: make(chan struct{}),
}

r := chi.NewRouter()
@@ -90,6 +96,7 @@ func New(log *logging.Logger, conf Config, domain string) *API {
r.Use(httputil.SetLoggerMiddleware(log))
r.Get("/health", api.health)
r.Get("/", api.config)
r.Get("/dmsghttp", api.dmsghttp)

api.Handler = r

@@ -116,7 +123,6 @@ func (a *API) health(w http.ResponseWriter, r *http.Request) {
}

func (a *API) config(w http.ResponseWriter, r *http.Request) {

a.writeJSON(w, r, http.StatusOK, a.services)
}

@@ -137,3 +143,58 @@ func (a *API) writeJSON(w http.ResponseWriter, r *http.Request, code int, object
a.logger(r).WithError(err).Errorf("failed to write json response")
}
}

func (a *API) dmsghttp(w http.ResponseWriter, r *http.Request) {
if time.Now().Add(-5 * time.Minute).After(a.dmsghttpConfTs) {
a.dmsghttpConf = a.dmsghttpConfGen()
a.dmsghttpConfTs = time.Now()
}
a.writeJSON(w, r, http.StatusOK, a.dmsghttpConf)
}

func (a *API) dmsghttpConfGen() httputil.DMSGHTTPConf {
var dmsghttpConf httputil.DMSGHTTPConf
dmsghttpConf.DMSGServers = fetchDMSGServers(a.services.DmsgDiscovery)
dmsghttpConf.AddressResolver = fetchDMSGAddress(a.services.AddressResolver)
dmsghttpConf.DMSGDiscovery = fetchDMSGAddress(a.services.DmsgDiscovery)
dmsghttpConf.RouteFinder = fetchDMSGAddress(a.services.RouteFinder)
dmsghttpConf.ServiceDiscovery = fetchDMSGAddress(a.services.ServiceDiscovery)
dmsghttpConf.TranspordDiscovery = fetchDMSGAddress(a.services.TransportDiscovery)
dmsghttpConf.UptimeTracker = fetchDMSGAddress(a.services.UptimeTracker)

return dmsghttpConf
}

func fetchDMSGAddress(url string) string {
resp, err := http.Get(fmt.Sprintf("%s/health", url))
if err != nil {
return ""
}
body, err := io.ReadAll(resp.Body)
if err != nil {
return ""
}
var healthResponse httputil.HealthCheckResponse
err = json.Unmarshal(body, &healthResponse)
if err != nil {
return ""
}
return healthResponse.DmsgAddr
}

func fetchDMSGServers(url string) []httputil.DMSGServersConf {
var dmsgServersList []httputil.DMSGServersConf
resp, err := http.Get(fmt.Sprintf("%s/dmsg-discovery/all_servers", url))
if err != nil {
return dmsgServersList
}
body, err := io.ReadAll(resp.Body)
if err != nil {
return dmsgServersList
}
err = json.Unmarshal(body, &dmsgServersList)
if err != nil {
return dmsgServersList
}
return dmsgServersList
}
Loading