Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions controller/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,26 @@ all: generate build
generate:
protoc --go_out=. --go_opt=paths=source_relative \
--go-grpc_out=. --go-grpc_opt=paths=source_relative \
$(PROTO_DIR)/file_service/file_service.proto \
$(PROTO_DIR)/admin_service/admin_service.proto \
$(PROTO_DIR)/communication/communication.proto

build: generate
mkdir -p $(BIN_DIR)
go build -o $(BIN_DIR)/grpc_server ./$(GRPC_SERVER)
go build -o $(BIN_DIR)/manager ./$(MANAGER)

build-riscv:
bazel build --platforms=@rules_go//go/toolchain:linux_riscv64 //cmd/grpc_server:grpc_server
mkdir -p $(BIN_DIR)
cp -f bazel-bin/cmd/grpc_server/grpc_server_/grpc_server $(BIN_DIR)/grpc_server 2>/dev/null || cp -f bazel-bin/cmd/grpc_server/grpc_server $(BIN_DIR)/grpc_server

clean:
rm -rf $(BIN_DIR)
rm -f $(PROTO_DIR)/communication/*.pb.go
rm -f $(PROTO_DIR)/file_service/*.pb.go
rm -f $(PROTO_DIR)/admin_service/*.pb.go

run-server: build
./$(BIN_DIR)/grpc_server

run-manager: build
./$(BIN_DIR)/manager

2 changes: 1 addition & 1 deletion controller/internal/service/.env_example
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
KASPERSKY_API_KEY=<YOUR_KEY>
VIRUSTOTAL_API_KEY=<YOUR_KEY>
VIRUSTOTAL_API_KEY=<YOUR_KEY>
5 changes: 3 additions & 2 deletions controller/internal/service/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,19 @@ func (s *Service) Check(checkValue string, endpointName string) ([]int, error) {
continue
}

resp.Body.Close()

if resp.StatusCode != http.StatusOK {
resp.Body.Close()
log.Printf("Provider %s returned %s", providerName, resp.Status)
continue
}

var data map[string]interface{}
if err := json.NewDecoder(resp.Body).Decode(&data); err != nil {
resp.Body.Close()
log.Printf("Error parsing response from %s: %v", providerName, err)
continue
}
resp.Body.Close()

categoryPath := provider.Endpoints[endpointName].Categories
actual, err := s.jsonParser.ExtractCategories(data, categoryPath)
Expand Down
2 changes: 0 additions & 2 deletions controller/service/.env_example

This file was deleted.

74 changes: 0 additions & 74 deletions controller/service/README.md

This file was deleted.

45 changes: 0 additions & 45 deletions controller/service/config/README.md

This file was deleted.

103 changes: 0 additions & 103 deletions controller/service/config/categories.json

This file was deleted.

90 changes: 0 additions & 90 deletions controller/service/config/providers.json

This file was deleted.

3 changes: 0 additions & 3 deletions controller/service/go.mod

This file was deleted.

Loading
Loading