sublime-security / sublime-platform

A free and open platform for detecting and preventing email attacks like BEC, malware, and credential phishing. Gain visibility and control, hunt for advanced threats, collaborate with the community, and write detections-as-code.
https://sublime.security
MIT License
159 stars 14 forks source link

Make install script more portable: Part I #77

Closed madirey closed 1 year ago

madirey commented 1 year ago

Summary

This PR is broken up into many commits for easier testing and review. This also gives us some capability to cherry-pick a number of commits if we don't want all the changes, though there is still risk of conflicts.

The changes are focused on maximizing portability of the install script. Major considerations are:

  1. Using POSIX-compliant tools whenever possible
  2. Using /bin/sh shebang to promote maximum portability
  3. Combining the install scripts into a single file. This is done for multiple reasons; namely, it ensures users get everything they need for bootstrapping in a single download, and it eliminates our reliance on curl (maybe they downloaded the script using a different tool and it's not available) and bash-specific constructs such as "here strings".
  4. Detecting, prompting, and/or informing the user when a tool is NOT available in their environment
  5. Using shellcheck on everything

Local Testing

  1. cd to a directory outside of sublime-platform
  2. run cat <path-to-sublime-platform>/install-and-launch.sh | sh (bash also still works)

Platform Testing

https://docs.google.com/spreadsheets/d/1Mv04s9MBQfyZwyIXaLO2CaZUKd11MgeTFWiZdSaio-s/edit?usp=sharing

Important Commits

TODO / Future PR

Screenshots

Fedora 37 (ignore script name, copied file):

image

Continued...

image

No openssl:

image