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

Integrity checking system #3159

Merged
merged 21 commits into from
Apr 22, 2023
Merged

Integrity checking system #3159

merged 21 commits into from
Apr 22, 2023

Conversation

Derkades
Copy link
Member

@Derkades Derkades commented Jan 8, 2023

The problem

Many user reported issues are caused by missing files, extra files, modified files, files from different Nameless versions, or corrupt in some other way.

The solution

Ship a checksums file with NamelessMC, so the integrity of files can be verified. Files that are expected to change or be edited (e.g. cache, uploads, custom templates and modules) are ignored.

Workflow

Run php -f dev/scripts/generate_checksums.php to generate the checksums file to be included in a release

Run php -f dev/scripts/verify_checksums.php to verify checksums using the checksums file (after preparing the release, so removing directories like node_modules, .git, etc.)

Ideally StaffCP would also run this with a cache, and display a warning in the "Server compatibility" section if there are issues. I did not implement that for now.

@Derkades Derkades added this to the 2.1.0 milestone Jan 8, 2023
@Derkades
Copy link
Member Author

Derkades commented Jan 8, 2023

I don't know how to fix (or ignore?) the "undefined constant ROOT_PATH" issue phpstan is reporting

core/classes/Misc/IntegrityChecker.php Outdated Show resolved Hide resolved
@Derkades Derkades mentioned this pull request Jan 15, 2023
@Derkades
Copy link
Member Author

I have no idea why phpstan is failing, it works locally...
image

@Derkades
Copy link
Member Author

I think phpstan itself is crashing. It does not say problems were found with the code, it says that it itself crashed with a link to create a bug report. That also explains why ignoring the line doesn't help.

@tadhgboyle
Copy link
Member

I really like this idea, and it would be cool to push it out eventually.
Since we want to display this information to users in StaffCP, I think it would take up a lot of space so it would not work well in the Server Compatibility widget - could we consider making a more general "Website Health" page (name can be hashed out)?

@samerton samerton modified the milestones: 2.1.0, 2.2.0 Apr 14, 2023
@samerton samerton modified the milestones: 2.2.0, 2.1.0 Apr 14, 2023
@samerton samerton merged commit c204903 into develop Apr 22, 2023
@samerton samerton deleted the feat/integrity-check branch April 22, 2023 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants