Draft: Cross platform support fixes

This MR includes a set of changes to ensure that Detective works properly across Linux and macOS.

Major included changes:

  • Switched to pathlib across the board instead of using the os.path module (keeps things consistent)
  • Switched to prompt_toolkit instead of Rich for prompting and printing. prompt_toolkit is a bit more uniform cross-platform and also fixes keybinds such as the arrow keys in prompts (normally we'd have to import readline for that, which is a big no-no being GPL)
  • Fixed some weird SSH quirks that were preventing Ansible from working properly on macOS hosts. Passing through keys with ssh-agent on macOS is pretty broken, and CloudStrike also tends to interfere a lot. The safer and easier method is just to use the user's .ssh directory which Ansible mounts in the container anyway. This requires us to launch the EE container using the UID of the user launching the frontend, but it seems to work much better.
    • Note: this means you no longer have to specify a key path when running the frontend. Instead, you will specify the name of the identity file. For example, a key /Users/sarah/.ssh/google_compute_engine would just be google_compute_engine.
    • Second note: this also means things like SSH aliases work, since we have the user's SSH config in the container now.

Marked as draft since I still need to test on WSL and Linux. NOTE: Ansible doesn't support running from a "regular" Windows host, so we can only support WSL, not Win32/64.

Merge request reports

Loading