Skip to content

Commit

Permalink
Noble Numbat Images & New Release #patch (#324)
Browse files Browse the repository at this point in the history
## v0.3.11
Major change
* Image builder set to 24.04 base.
Key Fixes
* Plugin events from superd introduced a problem with older versions of docker, causing restart issues. now fixed in dev branch
* Fixed incorrect UI redirect when no devices with a MAC address were left
Improvements
* New Device view, faster, with sorting by IP, Time, Name, Tag & Group
* Rendered Devices are now clickable throughout the UI
* WiFi Channel selection fixed. It would hang on the wrong band when switching interfaces
* Moved version check into badge on top instead of popups
* Alerts view now categorizes by alert type and are searchable
* Simple field counts for the Alerts & Events views
* Container networking is now under a Containers Tab under System Info
* Arp under System Info -> Network Info Tab
* Supernetworks view is now "DHCP Settings"

---------

Co-authored-by: lts-po <po@longterm.io>
  • Loading branch information
lts-rad and lts-po committed May 10, 2024
1 parent a846f64 commit a66eebe
Show file tree
Hide file tree
Showing 68 changed files with 3,004 additions and 1,590 deletions.
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,16 @@ docker-compose up -d

## Useful Links

* Our website: https://www.supernetworks.org/
* API Docs https://www.supernetworks.org/pages/api/0
* Documentation Home: https://www.supernetworks.org/pages/docs/intro/
* Raspberry Pi 4 Setup https://www.supernetworks.org/pages/docs/pi4b
* General Setup Guide https://www.supernetworks.org/pages/docs/setup_run_spr
* FAQ https://www.supernetworks.org/pages/docs/faq
* Get the iOS App https://apps.apple.com/us/app/secure-programmable-router/id6443709201
* Join the Discord chat https://discord.gg/EUjTKJPPAX
* Virtual Setup Guide (Personal VPN): https://www.supernetworks.org/pages/docs/setup_guides/virtual_spr#setup-and-connect-to-vpn
* [supernetworks.org](https://www.supernetworks.org/)
* [API Docs](https://www.supernetworks.org/pages/api/0)
* [Documentation Home](https://www.supernetworks.org/pages/docs/intro)
* [Raspberry Pi 4 Setup Guide](https://www.supernetworks.org/pages/docs/setup_guides/pi4b)
* [General Setup Guide](https://www.supernetworks.org/pages/docs/setup_guides/setup_run_spr)
* [Virtual Setup Guide (Personal VPN)](https://www.supernetworks.org/pages/docs/setup_guides/virtual_spr)

* [FAQ](https://www.supernetworks.org/pages/docs/faq)
* [Get the iOS App](https://apps.apple.com/us/app/secure-programmable-router/id6443709201)
* [Join the Discord chat](https://discord.gg/EUjTKJPPAX)



17 changes: 17 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Secure Programmable Router (SPR) Release Notes

## v0.3.11
Major change
* Image builder set to 24.04 base.
Key Fixes
* Plugin events from superd introduced a problem with older versions of docker, causing restart issues. now fixed in dev branch
* Fixed incorrect UI redirect when no devices with a MAC address were left
Improvements
* New Device view, faster, with sorting by IP, Time, Name, Tag & Group
* Rendered Devices are now clickable throughout the UI
* WiFi Channel selection fixed. It would hang on the wrong band when switching interfaces
* Moved version check into badge on top instead of popups
* Alerts view now categorizes by alert type and are searchable
* Simple field counts for the Alerts & Events views
* Container networking is now under a Containers Tab under System Info
* Arp under System Info -> Network Info Tab
* Supernetworks view is now "DHCP Settings"

## v0.3.10
* Revert wpa2 behavior for wpa3 devices for now

Expand Down
2 changes: 1 addition & 1 deletion api/code/alerts.go
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ func processAction(notifyChan chan<- Alert, storeChan chan<- Alert, event_topic
fmt.Println("--- --- ---")
}

topic := "alert:" + action.StoreTopicSuffix
topic := "alert:" + event_topic + ":" + action.StoreTopicSuffix
Info := map[string]interface{}{}

Info["Topic"] = event_topic
Expand Down
128 changes: 102 additions & 26 deletions api/code/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -911,42 +911,54 @@ func releaseChannels(w http.ResponseWriter, r *http.Request) {
json.NewEncoder(w).Encode(reply)
}

// return "version" if <= 1 params else {"name": "version"}
func getContainerVersion(w http.ResponseWriter, r *http.Request) {
container := r.URL.Query().Get("plugin")
params := url.Values{}
params.Set("container", container)

req, err := http.NewRequest(http.MethodGet, "http://localhost/container_version?"+params.Encode(), nil)
if err != nil {
http.Error(w, fmt.Errorf("failed to make request for version "+container).Error(), 400)
return
}
var containers []string
r.ParseForm()
containers = r.Form["plugin"]
if len(containers) == 0 {
containers = append(containers, "superd")
}

containerVersions := make(map[string]string)
for _, container := range containers {
//TODO have superd support +1 params
//container := r.URL.Query().Get("plugin")
params := url.Values{}
params.Set("container", container)

data, statusCode, err := superdRequestMethod(http.MethodGet, "container_version", params, nil)
if err != nil || statusCode != http.StatusOK {
containerVersions[container] = ""
continue
}

c := getSuperdClient()
defer c.CloseIdleConnections()
version := ""
err = json.Unmarshal(data, &version)
if err != nil {
containerVersions[container] = ""
continue
}

resp, err := c.Do(req)
if err != nil {
http.Error(w, fmt.Errorf("failed to request version from superd "+container).Error(), 400)
return
containerVersions[container] = version
}

defer resp.Body.Close()
if len(containerVersions) == 1 {
for container, version := range containerVersions {
if version == "" {
http.Error(w, fmt.Errorf("failed to get version for %s", container).Error(), 400)
return
}

version := ""
err = json.NewDecoder(resp.Body).Decode(&version)
if err != nil {
http.Error(w, fmt.Errorf("failed to get version for %s", container).Error(), 400)
return
}
w.Header().Set("Content-Type", "application/json")
json.NewEncoder(w).Encode(version)

if resp.StatusCode != http.StatusOK {
http.Error(w, fmt.Errorf("failed to get version %s", container+" "+fmt.Sprint(resp.StatusCode)).Error(), 400)
return
return
}
}

w.Header().Set("Content-Type", "application/json")
json.NewEncoder(w).Encode(version)
json.NewEncoder(w).Encode(containerVersions)
}

func doConfigsBackup(w http.ResponseWriter, r *http.Request) {
Expand Down Expand Up @@ -2342,6 +2354,69 @@ func speedTest(w http.ResponseWriter, r *http.Request) {
}
}

func pingTest(w http.ResponseWriter, r *http.Request) {
iface := mux.Vars(r)["interface"]
address := mux.Vars(r)["address"]

if !isValidIface(iface) {
http.Error(w, "Invalid interface name", 400)
return
}

ief, err := net.InterfaceByName(iface)
if err != nil {
http.Error(w, "Invalid interface", 400)
return
}

ipAddr, err := net.ResolveIPAddr("ip", address)
if err != nil {
http.Error(w, "Invalid address", 400)
return
}

network := "ip4:icmp"
if ipAddr.IP.To4() == nil {
network = "ip6:ipv6-icmp"
}

result := []string{}

for i := 0; i < 4; i++ {
start := time.Now()

conn, err := net.ListenPacket(network, ief.Name)
if err != nil {
http.Error(w, "Failed to listen on interface", 400)
return
}
defer conn.Close()

_, err = conn.WriteTo([]byte{}, ipAddr)
if err != nil {
continue
}

err = conn.SetDeadline(time.Now().Add(time.Second * 1))
if err != nil {
http.Error(w, "Failed to set deadline", 400)
return
}

_, _, err = conn.ReadFrom(make([]byte, 1500))
if err != nil {
result = append(result, "timeout")
continue
}

duration := time.Since(start)
result = append(result, duration.String())
}

w.Header().Set("Content-Type", "application/json")
json.NewEncoder(w).Encode(result)
}

type SetupConfig struct {
SSID string
CountryCode string
Expand Down Expand Up @@ -2813,6 +2888,7 @@ func main() {

//Misc
external_router_authenticated.HandleFunc("/speedtest/{start:[0-9]+}-{end:[0-9]+}", speedTest).Methods("GET", "PUT", "OPTIONS")
external_router_authenticated.HandleFunc("/ping/{interface}/{address}", pingTest).Methods("PUT")
external_router_authenticated.HandleFunc("/status", getStatus).Methods("GET", "OPTIONS")
external_router_authenticated.HandleFunc("/restart", restart).Methods("PUT")
external_router_authenticated.HandleFunc("/backup", doConfigsBackup).Methods("PUT", "OPTIONS")
Expand Down
9 changes: 7 additions & 2 deletions api/code/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -434,8 +434,9 @@ func otpLoadLocked() (OTPSettings, error) {
}

type OTPStatus struct {
State string
AlwaysOn bool
State string
AlwaysOn bool
Confirmed bool
}

func otpStatus(w http.ResponseWriter, r *http.Request) {
Expand All @@ -452,7 +453,11 @@ func otpStatus(w http.ResponseWriter, r *http.Request) {
for _, entry := range settings.OTPUsers {
if entry.Name == user {
status.State = "registered"
if entry.Confirmed == false {
status.State = "not yet validated"
}
status.AlwaysOn = entry.AlwaysOn
status.Confirmed = entry.Confirmed
break
}
}
Expand Down
3 changes: 0 additions & 3 deletions api/code/firewall.go
Original file line number Diff line number Diff line change
Expand Up @@ -2874,9 +2874,6 @@ func dynamicRouteLoop() {
continue
}

if len(ident) < 20 {
log.Println("[-] Missing vmap entries for mac=", ident, "new_iface=", new_iface, meshDownlink)
}
}

//ex tinynet
Expand Down
2 changes: 1 addition & 1 deletion docker-compose-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ services:
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ${PWD}/configs/base/:/configs/base/
- ${PWD}/state/api/eventbus.sock:/state/api/eventbus.sock
- ${PWD}/state/api/:/state/api/
- ${PWD}/:/super/
dhcp:
container_name: superdhcp
Expand Down
10 changes: 9 additions & 1 deletion docker-compose-virt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ services:
build:
context: base
labels: *default-labels
restart: always
privileged: true
ports:
- "51280:51280/udp"
Expand All @@ -38,19 +39,21 @@ services:
build:
context: superd
labels: *default-labels
restart: always
privileged: true
logging: *default-logging
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ${PWD}/configs/base/:/configs/base/
- ${PWD}/state/api/eventbus.sock:/state/api/eventbus.sock
- ${PWD}/state/api/:/state/api/
- ${PWD}/:/super/
dhcp:
container_name: superdhcp
image: ghcr.io/spr-networks/super_dhcp:${RELEASE_VERSION:-latest}${RELEASE_CHANNEL:-}
build:
context: dhcp
labels: *default-labels
restart: always
network_mode: service:base
depends_on:
- "base"
Expand All @@ -67,6 +70,7 @@ services:
build:
context: dns
labels: *default-labels
restart: always
network_mode: service:base
logging: *default-logging
depends_on:
Expand All @@ -83,6 +87,7 @@ services:
build:
context: multicast_udp_proxy
labels: *default-labels
restart: always
network_mode: service:base
depends_on:
- "base"
Expand All @@ -97,6 +102,7 @@ services:
build:
context: wireguard
labels: *default-labels
restart: always
network_mode: service:base
cap_add:
- net_admin
Expand Down Expand Up @@ -163,6 +169,7 @@ services:
plugin-lookup:
container_name: superplugin-lookup
image: ghcr.io/spr-networks/super_plugin-lookup:${RELEASE_VERSION:-latest}${RELEASE_CHANNEL:-}
restart: always
build:
context: plugin-lookup
labels: *default-labels
Expand All @@ -183,6 +190,7 @@ services:
tags:
- ghcr.io/spr-networks/super_db:latest${RELEASE_CHANNEL:-}
- ghcr.io/spr-networks/super_db:${RELEASE_VERSION:-latest}${RELEASE_CHANNEL:-}
restart: always
network_mode: service:base
depends_on:
- "api"
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ services:
logging: *default-logging
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ${PWD}/state/api/eventbus.sock:/state/api/eventbus.sock
- ${PWD}/state/api/:/state/api/
- ${PWD}/configs/base/:/configs/base/
- ${PWD}/:/super/
dhcp:
Expand Down
4 changes: 2 additions & 2 deletions frontend/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/yoga"

SPEC CHECKSUMS:
boost: 57d2868c099736d80fcd648bf211b4431e51a558
boost: 7dcd2de282d72e344012f7d6564d024930a6a440
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54
FBLazyVector: f91d538f197fa71a7d5b77ec2069d49550c0eb96
Expand Down Expand Up @@ -756,4 +756,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: a5579f5f98226cbf04a4ce7bc4606969e6cd379f

COCOAPODS: 1.15.2
COCOAPODS: 1.14.3

0 comments on commit a66eebe

Please sign in to comment.