Refactor configuration and update handling:

- Modify .luarc.json to include global Lua scripts.
- Update Makefile to include LDFLAGS for versioning.
- Enhance node.go to implement version checking and update handling.
- Refactor Lua global variables in _globals.lua and echo.lua to use new structures.
- Remove deprecated http.lua and update config.yaml for TLS and update settings.
- Introduce new update.go for version management and update checking.
- Add tests for version comparison in update_test.go.
- Improve error handling in various server methods.
This commit is contained in:
alex
2025-07-03 22:38:05 +03:00
parent 96fb13e3c7
commit d442871950
19 changed files with 527 additions and 143 deletions

View File

@@ -2,6 +2,7 @@ APP_NAME := node
BIN_DIR := bin
GOPATH := $(shell go env GOPATH)
export CONFIG_PATH := ./config.yaml
LDFLAGS := -X 'github.com/akyaiy/GoSally-mvp/core/config.NodeVersion=version0.0.1-dev'
CGO_CFLAGS := -I/usr/local/include
CGO_LDFLAGS := -L/usr/local/lib -llua5.1 -lm -ldl
.PHONY: all build run runq test fmt vet lint check clean
@@ -24,9 +25,10 @@ setup: lint-setup goimports-setup golicenses-setup
build:
@echo "Building..."
@echo "CGO_CFLAGS is: '$(CGO_CFLAGS)'"
@echo "CGO_LDFLAGS is: '$(CGO_LDFLAGS)'"
CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" go build -o $(BIN_DIR)/$(APP_NAME) ./cmd/$(APP_NAME)
@# @echo "CGO_CFLAGS is: '$(CGO_CFLAGS)'"
@# @echo "CGO_LDFLAGS is: '$(CGO_LDFLAGS)'"
@# CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)"
go build -ldflags "$(LDFLAGS)" -o $(BIN_DIR)/$(APP_NAME) ./cmd/$(APP_NAME)
run: build
@echo "Running!"
@@ -56,4 +58,7 @@ licenses:
@echo "Licenses have been exported to third_party/licenses"
clean:
@rm -rf bin
@rm -rf bin
help:
@echo "Available commands: $$(cat Makefile | grep -E '^[a-zA-Z_-]+:.*?' | grep -v -- '-setup:' | sed 's/:.*//g' | sort | uniq | tr '\n' ' ')"