mpv icon indicating copy to clipboard operation
mpv copied to clipboard

Ease submision of log files by obfuscating personal information

Open forthrin opened this issue 3 months ago • 4 comments

Expected behavior of the wanted feature

The infamous barrier of including log files in issues seems the implicit exposure of personal information (assumed limited to file paths ATOW), which are irrelevant to addressing the issue.

Thus proposing a simple obfuscation feature that eliminates this unease. This can be implemented in two ways:

A) Have logger recognize and obfuscate paths in string formatting arguments B) Post-process log file (more intricate and unreliable)

Side note: This could also pave the way for more automated and complete reporting, where the issue template is prefilled with system information and log files. (A separate future issue, if so.)

To obfuscate or not to obfuscate

  • System and config files are impersonal and safe to replicate as-is
  • Files in the home directory and on external volumes are candidates for obfuscation
/Users/taylor -> ~
/Volumes/4TBMONSTER/Videos/Holiday/France/Paris.mp4 -> FOO.mp4

Have written a preliminary Ruby script that can serve as a starting point for implementation.

Issues to be adressed

Slash-less paths

User path args may not start with a slash, requiring specific handling of these

  # [cplayer] Command line options: 'DISK/'
  # [file] Opening 'DISK/'
  # [file] Opening 'DISK/Video.mp4'
  # [find_files] Loading external files in 'USBDISK/'

Non-standardized quoting

Most paths are single quoted when logged, but several are not, making them slightly harder to pick out of post-processing is to be an alternative.

diff --git a/common/av_log.c b/common/av_log.c
-    mp_msg(log, v, "FFmpeg version: %s", FFMPEG_VERSION);
+    mp_msg(log, v, "FFmpeg version: '%s'", FFMPEG_VERSION);
diff --git a/input/input.c b/input/input.c
-        MP_VERBOSE(ictx, "Parsing input config file %s\n", file);
+        MP_VERBOSE(ictx, "Parsing input config file '%s'\n", file);
-        MP_VERBOSE(ictx, "Input config file %s parsed: %d binds\n", file, num);
+        MP_VERBOSE(ictx, "Input config file '%s' parsed: %d binds\n", file, num);
diff --git a/options/parse_configfile.c b/options/parse_configfile.c
-    MP_VERBOSE(config, "Reading config file %s\n", conffile);
+    MP_VERBOSE(config, "Reading config file '%s'\n", conffile);
diff --git a/player/external_files.c b/player/external_files.c
-    mp_verbose(log, "Loading external files in %.*s\n", BSTR_P(path));
+    mp_verbose(log, "Loading external files in '%.*s'\n", BSTR_P(path));
diff --git a/player/lua.c b/player/lua.c
-    MP_DBG(ctx, "loading file %s\n", fname);
+    MP_DBG(ctx, "loading file '%s'\n", fname);
diff --git a/player/lua/ytdl_hook.lua b/player/lua/ytdl_hook.lua
-                msg.verbose("Found youtube-dl at: " .. ytdl_cmd)
+                msg.verbose("Found youtube-dl at: '" .. ytdl_cmd .. "'")
diff --git a/player/scripting.c b/player/scripting.c
-    MP_DBG(arg, "Loading %s script %s...\n", backend->name, arg->filename);
+    MP_DBG(arg, "Loading %s script '%s'\n", backend->name, arg->filename);
diff --git a/stream/stream.c b/stream/stream.c
-    MP_VERBOSE(s, "Opening %s\n", url);
+    MP_VERBOSE(s, "Opening '%s'\n", url);

Alternative behavior of the wanted feature

Integrate with some third-party tool, but seems overkill as required core obfuscation might be just a dozen LoC.

Log File

N/A

Sample Files

N/A

forthrin avatar Nov 19 '25 09:11 forthrin

i don't think this is a viable option. obfuscating files or file paths might also obfuscate the source of certain problems. invalid chars, obviously read/write permission problems, decomposed/precomposed strings, different normalisation, just to name a few.

Akemi avatar Nov 19 '25 12:11 Akemi

Compared to the benefit of getting automated or willingly submitted logs with all reports, these doubts seem like edge cases easily addressable by asking for clear-text the few times needed. Developer interest is always a determining factor, though.

https://en.wikipedia.org/wiki/Data_masking https://duckduckgo.com/?q=Log+Redaction https://developer.apple.com/documentation/os/oslogprivacy

forthrin avatar Nov 19 '25 15:11 forthrin

you won't get automated uploads of log files, because github doesn't support it. only if logs would be inlined as text or uploaded to a third party added as link. also uploading logs from within mpv would yield a not complete log (without exit) or is impossible in a the case of crash issue or similar. so that point is kinda moot.

any question we have to ask is wasted time on our end. i personally just want the info we ask for in the first place and don't want to play ping-pong.

thanks for the links, though i am (and i think all the other devs) are able to use search engines and *pedias fine without help. if we even need it in this case.

Akemi avatar Nov 19 '25 18:11 Akemi

Well, what you could do:

$ mpv --issue
[B]ug
[C]rash
[F]eature Request
$ C
Most recent log file will be uploaded to not-github.com. Obfuscate personal information (Y/N)? Y
Upload done. Opening GitHub issue in your default browser prefilled with version information and link to log file.
$

If no devs or users have an issue with sharing of personal information in log files, the topic can be rounded off. At any rate, whether you may want more logs, or less background information, it doesn't hurt to be friendly about it.

forthrin avatar Nov 19 '25 18:11 forthrin