Отпечаток сервера для сервера лицензий: internal/hwid (machine-id, UUID платформы через /etc/bj/hw-id от установщика, MAC), передаётся при активации и продлении

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014FsEKyJrYF69Cj9ZXzFLRi
This commit is contained in:
zuevav
2026-09-25 00:19:15 +03:00
parent 5ddea22b30
commit d67324e943
3 changed files with 84 additions and 1 deletions
+2
View File
@@ -13,6 +13,7 @@ import (
"encoding/json"
"errors"
"fmt"
"git.zetit.ru/zuevav/Bridge-and-Join-s/internal/hwid"
"io"
"log"
"net/http"
@@ -78,6 +79,7 @@ type licenseReply struct {
func licenseCall(ctx context.Context, path string, body map[string]string) (*licenseReply, error) {
host, _ := os.Hostname()
body["hostname"], body["version"], body["machine"] = host, BuildVersion, machineHash()
body["board"], body["mac"] = hwid.Board(), hwid.MAC() // отпечаток сервера: хэши, без самих значений
b, _ := json.Marshal(body)
req, err := http.NewRequestWithContext(ctx, http.MethodPost, licenseServer+path, bytes.NewReader(b))
if err != nil {