work branch into the main #8

Merged
partisan merged 34 commits from work into main 2024-08-18 10:08:43 +00:00
3 changed files with 4 additions and 33 deletions
Showing only changes of commit e1b4f1393c - Show all commits

16
node.go
View file

@ -8,16 +8,13 @@ import (
"io/ioutil" "io/ioutil"
"log" "log"
"net/http" "net/http"
"sync"
"time" "time"
) )
var ( var (
authCode string authCode string
peers []string peers []string
authMutex sync.Mutex hostID string
authenticated = make(map[string]bool)
hostID string
) )
type Message struct { type Message struct {
@ -27,13 +24,6 @@ type Message struct {
VisitedNodes []string `json:"visitedNodes"` VisitedNodes []string `json:"visitedNodes"`
} }
type CrawlerConfig struct {
ID string
Host string
Port int
AuthCode string
}
func loadNodeConfig() { func loadNodeConfig() {
config := loadConfig() config := loadConfig()
authCode = config.AuthCode authCode = config.AuthCode

View file

@ -48,23 +48,3 @@ func logMessage(level string, format string, args ...interface{}) {
fmt.Printf("[%s] %s\n", timestamp, message) fmt.Printf("[%s] %s\n", timestamp, message)
} }
} }
/////////////
func printErrf(format string, args ...interface{}) {
if config.LogLevel >= 1 {
logMessage("ERROR", fmt.Sprintf(format, args...))
}
}
func printWarnf(format string, args ...interface{}) {
if config.LogLevel >= 2 {
logMessage("WARN", fmt.Sprintf(format, args...))
}
}
func printInfof(format string, args ...interface{}) {
if config.LogLevel >= 3 {
logMessage("INFO", fmt.Sprintf(format, args...))
}
}

View file

@ -1680,6 +1680,7 @@ body, h1, p, a, input, button {
margin-top: 0px; margin-top: 0px;
top: 0px; top: 0px;
left: 0px; left: 0px;
background-color: var(--search-bg);
} }
.mobile-none { .mobile-none {