-
Notifications
You must be signed in to change notification settings - Fork 0
Security fixes #98
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
base: main
Are you sure you want to change the base?
Security fixes #98
Changes from all commits
d84843c
e1e68a6
10d9d48
b5d1845
cdece52
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,7 +22,7 @@ | |
| /> | ||
| <target xsi:type="Database" | ||
| name="dbTarget" | ||
| connectionString="Data Source=WTHMCLBILL;Initial Catalog=NLog;Integrated Security=true;Encrypt=false;Trust Server Certificate=true" | ||
| connectionString="Data Source=${LOG_DB_SERVER};Initial Catalog=${LOG_DB_NAME};Integrated Security=true;Encrypt=false;Trust Server Certificate=true" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: NLog Environment Variable Syntax ErrorNLog configurations use an incorrect syntax for environment variables, like Additional Locations (3)
|
||
| commandText="INSERT INTO Logs(CreatedOn,Message,Level,Exception,StackTrace,Logger,HostName,Username,CallingSite,CallingSiteLineNumber,AppVersion) VALUES (@datetime,@msg,@level,@exception,@trace,@logger,@hostname,@user,@callsite,@lineno,@version)"> | ||
| <parameter name="@datetime" layout="${date}" /> | ||
| <parameter name="@msg" layout="${message}" /> | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,8 +23,8 @@ private static bool MainMenuPanel() | |
|
|
||
| StringBuilder dbSelect = new(); | ||
| dbSelect.AppendLine("Select Database:\n\n"); | ||
| dbSelect.AppendLine("1) LabBillingProd"); | ||
| dbSelect.AppendLine("2) LabBillingTest (WTMCLBILL)"); | ||
| dbSelect.AppendLine("1) Production Database"); | ||
| dbSelect.AppendLine("2) Test Database"); | ||
| dbSelect.AppendLine("0) Exit"); | ||
|
|
||
| var panel1 = new Panel(dbSelect.ToString()); | ||
|
|
@@ -45,19 +45,24 @@ private static bool MainMenuPanel() | |
| return ValidationResult.Error("Invalid selection."); | ||
| })); | ||
|
|
||
| serverName = "WTHMCLBILL"; | ||
| // Get server and database names from environment variables or use defaults | ||
| string defaultServer = Environment.GetEnvironmentVariable("DB_SERVER") ?? "${DB_SERVER}"; | ||
| string prodDbName = Environment.GetEnvironmentVariable("PROD_DB_NAME") ?? "${PROD_DB_NAME}"; | ||
| string testDbName = Environment.GetEnvironmentVariable("TEST_DB_NAME") ?? "${TEST_DB_NAME}"; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Environment Variable Fallback Uses Placeholder StringsWhen environment variables are not set, the fallback logic uses literal placeholder strings (e.g., |
||
|
|
||
| serverName = defaultServer; | ||
|
|
||
| switch (menuSelect) | ||
| { | ||
| case 0: | ||
| return false; | ||
| case 1: | ||
| databaseName = "LabBillingProd"; | ||
| serverName = "WTHMCLBILL"; | ||
| databaseName = prodDbName; | ||
| serverName = defaultServer; | ||
| break; | ||
| case 2: | ||
| databaseName = "LabBillingTest"; | ||
| serverName = "WTHMCLBILL"; | ||
| databaseName = testDbName; | ||
| serverName = defaultServer; | ||
| break; | ||
| default: | ||
| return true; | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
The environment variable
${LOG_DB_SERVER}is inconsistent with other logging configurations that use${DB_SERVER}. This inconsistency could lead to configuration errors. Consider using${DB_SERVER}to match the pattern used in other NLog.config files.