-
Notifications
You must be signed in to change notification settings - Fork 3
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
Example properties have been added for local development #10
base: main
Are you sure you want to change the base?
Conversation
β¦inks and credentials
β¦links and credentials into common_example
WalkthroughThis pull request updates the Changes
Possibly related PRs
Poem
π Recent review detailsConfiguration used: CodeRabbit UI π Files selected for processing (1)
β Files skipped from review due to trivial changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? πͺ§ TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
π Outside diff range comments (1)
src/main/environment/common_example.properties (1)
Line range hint
43-44
: Security: Debug logging should not be enabled in properties file.Debug logging for Spring and Flyway can expose sensitive information and impact performance.
Remove these debug configurations from the properties file. Instead:
- Enable debug logging only during development via command line:
-Dlogging.level.org.springframework=DEBUG
- Document this in README.md for developers
- Consider using a separate
application-dev.properties
for development-specific configs-logging.level.org.flywaydb=DEBUG -logging.level.org.springframework=DEBUG
π§Ή Nitpick comments (2)
src/main/environment/common_example.properties (2)
19-38
: Configuration: Consider datasource-specific connection pool settings.While global Tomcat connection pool settings are defined, each datasource might benefit from specific tuning.
Consider adding datasource-specific connection pool parameters:
# Example for dbiemr datasource spring.datasource.dbiemr.tomcat.initial-size=5 spring.datasource.dbiemr.tomcat.max-active=20 spring.datasource.dbiemr.tomcat.max-idle=10
Line range hint
1-44
: Best Practice: Restructure configuration management.Since this is an example properties file, it should serve as a template with clear placeholders and documentation.
Recommendations:
- Rename file to
application.properties.example
- Add comments explaining each property's purpose
- Use environment variables for environment-specific values
- Create separate profiles for different environments (dev, test, prod)
- Document the configuration setup process in README.md
Example structure:
# Database Configuration - IEMR # Replace these values with your environment-specific configuration spring.datasource.dbiemr.url=jdbc:mysql://${IEMR_DB_HOST:localhost}:${IEMR_DB_PORT:3306}/${IEMR_DB_NAME:db_iemr} spring.datasource.dbiemr.username=${IEMR_DB_USER} # Required: Database username with minimal privileges spring.datasource.dbiemr.password=${IEMR_DB_PASSWORD} # Required: Strong password
spring.datasource.dbiemr.url=jdbc:mysql://localhost:3306/db_iemr | ||
spring.datasource.dbiemr.username=root | ||
spring.datasource.dbiemr.password=1234 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Security: Avoid using root user and weak passwords in database configurations.
The current configuration has several security concerns:
- Using the
root
user for all databases grants excessive privileges - Using the same simple password "1234" across all databases is a security risk
- Hardcoding credentials in properties files is not recommended
Consider these improvements:
- Create dedicated database users with minimal required privileges for each datasource
- Use environment variables or external configuration management for sensitive data
- In example properties, use descriptive placeholders instead of actual values
Example format:
spring.datasource.dbiemr.url=jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:db_iemr}
spring.datasource.dbiemr.username=${DB_USER}
spring.datasource.dbiemr.password=${DB_PASSWORD}
Also applies to: 25-27, 31-33, 36-38
Quality Gate passedIssues Measures |
π Description
The key values of the database connections are set to the default port being used by the Docker container, which is exposed there(refer Amrit-DevOps)!
β Type of Change
Summary by CodeRabbit