ea3: remove verbose debug logs by default (#385)

## Link to GitHub Issue, if one exists
n/a

## Description of change
Recently distributed iidx data has this enabled in ea3-config.xml by
default, exposing people's PCBID in the logs.

Find the node in the XML and remove it on boot, unless user overrides it
with a new option.

## Testing
Tested using asphyxia.
This commit is contained in:
bicarus-dev
2025-09-28 20:31:48 -07:00
committed by GitHub
parent 7335d07e30
commit 61d79f76b2
5 changed files with 22 additions and 1 deletions
+6
View File
@@ -41,6 +41,7 @@ namespace avs {
int HTTP11 = -1; int HTTP11 = -1;
int URL_SLASH = -1; int URL_SLASH = -1;
int PCB_TYPE = -1; int PCB_TYPE = -1;
bool EA3_DEBUG_VERBOSE = false;
// handle // handle
std::string VERSION_STR = "unknown"; std::string VERSION_STR = "unknown";
@@ -412,6 +413,11 @@ namespace avs {
log_fatal("avs-ea3", "no PCBID set (try using -p to specify PCBID)"); log_fatal("avs-ea3", "no PCBID set (try using -p to specify PCBID)");
} }
// remove <debug> since it can expose pcbid in logged requests
if (!EA3_DEBUG_VERBOSE) {
avs::core::property_search_remove_safe(ea3_config, nullptr, "/ea3/debug/verbose");
}
// remember IDs // remember IDs
char pcbid_buffer[256] { 0 }; char pcbid_buffer[256] { 0 };
char accountid_buffer[256] { 0 }; char accountid_buffer[256] { 0 };
+1
View File
@@ -28,6 +28,7 @@ namespace avs {
extern int HTTP11; extern int HTTP11;
extern int URL_SLASH; extern int URL_SLASH;
extern int PCB_TYPE; extern int PCB_TYPE;
extern bool EA3_DEBUG_VERBOSE;
// handle // handle
extern std::string VERSION_STR; extern std::string VERSION_STR;
+3
View File
@@ -365,6 +365,9 @@ int main_implementation(int argc, char *argv[]) {
if (options[launcher::Options::VerboseAVSLogging].value_bool()) { if (options[launcher::Options::VerboseAVSLogging].value_bool()) {
hooks::avs::config::LOG = true; hooks::avs::config::LOG = true;
} }
if (options[launcher::Options::AllowEA3Verbose].value_bool()) {
avs::ea3::EA3_DEBUG_VERBOSE = true;
}
if (options[launcher::Options::spice2x_AutoOrientation].is_active()) { if (options[launcher::Options::spice2x_AutoOrientation].is_active()) {
GRAPHICS_ADJUST_ORIENTATION = GRAPHICS_ADJUST_ORIENTATION =
(graphics_orientation)options[launcher::Options::spice2x_AutoOrientation].value_uint32(); (graphics_orientation)options[launcher::Options::spice2x_AutoOrientation].value_uint32();
+11 -1
View File
@@ -1672,6 +1672,16 @@ static const std::vector<OptionDefinition> OPTION_DEFINITIONS = {
.type = OptionType::Bool, .type = OptionType::Bool,
.category = "Debug Log", .category = "Debug Log",
}, },
{
// AllowEA3Verbose
.title = "Allow EA3 Verbose Debug Logging",
.name = "ea3verbose",
.desc = "This option is only useful for network developers; leave this OFF.\n\n"
"By default, ea3/debug/verbose node is removed by spice to prevent exposing PCBID in the logs. "
"When this is enabled, ea3/debug/verbose node in the XML will be kept and exposed to the game",
.type = OptionType::Bool,
.category = "Debug Log",
},
{ {
.title = "Disable Colored Output", .title = "Disable Colored Output",
.name = "nocolor", .name = "nocolor",
@@ -2375,7 +2385,7 @@ static const std::vector<OptionDefinition> OPTION_DEFINITIONS = {
.type = OptionType::Bool, .type = OptionType::Bool,
.category = "Development", .category = "Development",
.disabled = true, .disabled = true,
}, }
}; };
const std::vector<std::string> &launcher::get_categories(Options::OptionsCategory category) { const std::vector<std::string> &launcher::get_categories(Options::OptionsCategory category) {
+1
View File
@@ -188,6 +188,7 @@ namespace launcher {
DebugCreateFile, DebugCreateFile,
VerboseGraphicsLogging, VerboseGraphicsLogging,
VerboseAVSLogging, VerboseAVSLogging,
AllowEA3Verbose,
DisableColoredOutput, DisableColoredOutput,
DisableACPHook, DisableACPHook,
DisableSignalHandling, DisableSignalHandling,