Skip to content

Security, optimizations, and README improvements - #9

Merged
buzzkillb merged 12 commits into
mainfrom
dev
Mar 10, 2026
Merged

Security, optimizations, and README improvements#9
buzzkillb merged 12 commits into
mainfrom
dev

Conversation

@buzzkillb

@buzzkillb buzzkillb commented Mar 10, 2026

Copy link
Copy Markdown
Owner

Security: bind health to localhost, fix unwraps
Optimizations: parallel Discord guild updates, batch database cleanup, 48h cleanup interval
Cleanup: simplify docker-compose with env_file
Documentation: add architecture diagram, setup instructions, bot commands, Discord intents requirements

Note

Medium Risk

Overview
This pull request introduces security, performance, and documentation improvements to the codebase. Security enhancements include binding the health endpoint to localhost and removing unsafe unwrap calls. Performance optimizations implement parallel Discord guild updates, batch database cleanup, and extend the cleanup interval to 48 hours. The docker-compose configuration is simplified using env_file, and the removed db_query.rs file is cleaned up. Documentation is expanded with an architecture diagram, setup instructions, bot commands, and Discord intents requirements, while also adding CONTRIBUTING.md and LICENSE files.

Written by Gitzilla for commit 42dd612. This will update automatically on new runs. Configure in the Gitzilla dashboard.

@gitzillabot gitzillabot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Gitzilla has reviewed your changes and found 1 potential issue.

Autofix is OFF. To automatically fix reported issues, enable autofix in the Gitzilla dashboard.

Comment thread .dockerignore
# Docker
Dockerfile*
docker-compose*.yml
# Dockerfile and docker-compose are needed for building!

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Docker build would fail due to excluded Dockerfile

High Severity

The previous .dockerignore excluded Dockerfile and docker-compose*.yml with glob patterns. This would cause docker build to fail with "COPY failed: file not found" errors because the Dockerfile wouldn't be available in the build context. The patterns have been removed so these files are now properly included.

Suggested fix: This is the fix - the old exclusion patterns have been correctly removed. Verify builds work after this change.

@gitzillabot gitzillabot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Gitzilla has reviewed your changes and found 1 potential issue.

Autofix is OFF. To automatically fix reported issues, enable autofix in the Gitzilla dashboard.

Comment thread .dockerignore
# Docker
Dockerfile*
docker-compose*.yml
# Dockerfile and docker-compose are needed for building!

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Docker build fails because Dockerfile is excluded from build context

High Severity

The Dockerfile was excluded from the Docker build context by the .dockerignore file, causing docker build to fail with "COPY failed: file not found in build context" when trying to copy the Dockerfile. This was a critical build-breaking issue.

Suggested fix: Remove the comment "# Dockerfile and docker-compose are needed for building!" and ensure both files are NOT in .dockerignore (the current change fixes this)

@buzzkillb
buzzkillb merged commit 77952db into main Mar 10, 2026
0 of 3 checks passed

@gitzillabot gitzillabot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Gitzilla has reviewed your changes and found 1 potential issue.

Autofix is OFF. To automatically fix reported issues, enable autofix in the Gitzilla dashboard.

Comment thread src/utils.rs
Comment on lines +131 to +135
assert!(validate_crypto_name("BTC!").is_err());
assert!(validate_crypto_name("BTC-USDT").is_err());
}

#[test]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Test expects validate_price(0.0) to fail but implementation allows it

High Severity

The test test_validate_price_invalid in src/utils.rs incorrectly asserts that validate_price(0.0) should return an error. However, the actual implementation only rejects negative prices (price < 0.0), not zero. This causes the test to fail, blocking the PR. Additionally, there is an inconsistency: validate_price() allows 0.0 but the database's save_price() rejects prices <= 0.0. Either the test should expect Ok(()) for 0.0, or validate_price should be updated to reject 0.0 to match the database behavior.

Suggested fix: Change test to: assert!(validate_price(0.0).is_ok()); OR update validate_price to reject 0.0: if price <= 0.0 { return Err(...); }

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.

1 participant