Skip to content

Latest commit

 

History

2,017 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Strap

A script to bootstrap a minimal macOS development system. This does not assume you're doing Ruby/Rails/web development but installs the minimal set of software every macOS developer will want.

Motivation

Replacing Boxen in GitHub with a better tool. This post outlines the problems with Boxen and requirements for Strap and other tools used by GitHub: https://mikemcquaid.com/2016/06/15/replacing-boxen/

Features

  • Enables sudo using TouchID
  • Enables the macOS screensaver password immediately (for better security)
  • Enables the macOS application firewall (for better security)
  • Adds a Found this computer? message to the login screen (for machine recovery)
  • Enables full-disk encryption and saves the FileVault Recovery Key to the Desktop (for better security)
  • Installs the Xcode Command Line Tools (for compilers and Unix tools)
  • Agree to the Xcode license (for using compilers without prompts)
  • Installs Homebrew (for installing command-line software)
  • Installs the latest macOS software updates (for better security)
  • Installs dotfiles from a user's https://github.com/username/dotfiles repository. If they exist and are executable: runs script/setup to configure the dotfiles and script/strap-after-setup after setting up everything else.
  • Installs software from a user's Brewfile in their https://github.com/username/homebrew-brewfile repository or .Brewfile in their home directory.
  • Configures Git's name, email and GitHub access using optional local GitHub CLI login or environment variables
  • Idempotent

Out of Scope Features

  • Enabling any network services by default (instead enable them when needed)
  • Installing Homebrew formulae by default for everyone in an organisation (install them with Brewfiles in project repositories instead of mandating formulae for the whole organisation)
  • Opting-out of any macOS updates (Apple's security updates and macOS updates are there for a reason)
  • Disabling security features (these are a minimal set of best practises)
  • Add phone number to security screen message (want to avoid prompting users for information on installation)

Usage

Open https://strap.mikemcquaid.com/ in your web browser.

Instead, to run Strap locally run:

git clone https://github.com/MikeMcQuaid/strap
cd strap
bash bin/strap.sh # or bash bin/strap.sh --debug for more debugging output

Instead, to run the web application locally run:

git clone https://github.com/MikeMcQuaid/strap
cd strap
./script/bootstrap
./script/server

Strap is also available as a Docker image on Docker Hub (mikemcquaid/strap) and GitHub Packages (ghcr.io/mikemcquaid/strap).

Configuration Environment Variables and Flags

  • STRAP_GIT_NAME: override Git's name and the name in the login-screen recovery message (defaults to the existing Git name, then the authenticated GitHub profile name; empty values are ignored).
  • STRAP_GIT_EMAIL: override Git's email and the email in the login-screen recovery message (defaults to the existing Git email, then the authenticated GitHub account's primary verified email; empty values are ignored).
  • STRAP_GITHUB_USER: override Git's GitHub username and the owner of dotfiles and Brewfile repositories (defaults to the authenticated GitHub username; empty values are ignored).
  • GH_TOKEN or GITHUB_TOKEN: GitHub CLI credentials (GH_TOKEN takes precedence; defaults to an existing local login).
  • STRAP_DEBUG=1 or --debug: enable debugging output.
  • STRAP_NONINTERACTIVE=1, CI=1 or --non-interactive: run without interactive prompts; automatic without a TTY. Never starts a GitHub login and requires sudo access without a password prompt.
  • --help: print usage without changing your Mac.

Status

Stable and in active development.

Contact

Mike McQuaid

License

Licensed under the MIT License. The full license text is available in LICENSE.txt.

Fork me on GitHub Retina Ribbons are vendored in images and also licensed under the MIT License

About

👢 Bootstrap your macOS development system.

Topics

Resources

Stars

2.4k stars

Watchers

34 watching

Forks

Sponsor this project

Packages

Used by

Contributors

Languages