Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add integrity check to validate installation #218

Merged
merged 2 commits into from
Feb 24, 2023
Merged

Add integrity check to validate installation #218

merged 2 commits into from
Feb 24, 2023

Conversation

rkusa
Copy link
Collaborator

@rkusa rkusa commented Feb 23, 2023

To help debug issues caused by incomplete installations / updates, this PR adds an integrity check to the Lua files. It works as follows:

  • Automatically embed hashes for all Lua files on build-time
  • Validate existence and hash of all Lua files on runtime (when server is started)
  • Additionally, compare version number of Lua files and DLL and make sure both match.

Example error:

2023-02-23 18:48:21.166 ERROR   SCRIPTING (Main): Mission script error: [string "M:\Development\DCS-gRPC\rust-server\lua\DCS-gRPC\grpc.lua"]:12: integrity check failed (hash mismatch of `M:\Development\DCS-gRPC\rust-server\lua\DCS-gRPC\grpc.lua`), DCS-gRPC is not started, please check your installation
stack traceback:
  [C]: ?
  [C]: in function 'assert'
  [string "M:\Development\DCS-gRPC\rust-server\lua\DCS-gRPC\grpc.lua"]:12: in function 'f'
  [string "M:\Development\DCS-gRPC\rust-server\lua\DCS-gRPC\grpc-mission.lua"]:59: in function 'load'
  [string "GRPC.load()"]:1: in main chunk

src/lib.rs Show resolved Hide resolved
Copy link
Contributor

@rurounijones rurounijones left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. Thank you.

@rkusa rkusa merged commit 921bc53 into main Feb 24, 2023
@rkusa rkusa deleted the integrity branch February 24, 2023 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants