Отпечаток сервера для сервера лицензий: 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:
@@ -26,6 +26,7 @@ import (
|
||||
"errors"
|
||||
"flag"
|
||||
"fmt"
|
||||
"git.zetit.ru/zuevav/Bridge-and-Join-s/internal/hwid"
|
||||
"io"
|
||||
"io/fs"
|
||||
"math/big"
|
||||
@@ -385,7 +386,8 @@ func (in *installer) stepLicense() (string, error) {
|
||||
}
|
||||
host, _ := os.Hostname()
|
||||
body, _ := json.Marshal(map[string]string{"code": strings.TrimSpace(in.code), "install_id": installID,
|
||||
"hostname": host, "version": "bj-installer " + installerVersion, "machine": machineHash()})
|
||||
"hostname": host, "version": "bj-installer " + installerVersion, "machine": machineHash(),
|
||||
"board": hwid.Board(), "mac": hwid.MAC()})
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
|
||||
defer cancel()
|
||||
req, _ := http.NewRequestWithContext(ctx, http.MethodPost, in.server+"/v1/activate", bytes.NewReader(body))
|
||||
@@ -726,6 +728,7 @@ func (in *installer) stepValidata() (string, error) {
|
||||
}
|
||||
|
||||
func (in *installer) stepServices() (string, error) {
|
||||
_ = hwid.WriteCache(in.root) // хэш UUID платформы для bj (читается только root)
|
||||
var files []string
|
||||
err := fs.WalkDir(deploy.Files, ".", func(p string, d fs.DirEntry, err error) error {
|
||||
if err != nil || d.IsDir() {
|
||||
|
||||
Reference in New Issue
Block a user