GithubHelp home page GithubHelp logo

mozilla / dinobuildr Goto Github PK

View Code? Open in Web Editor NEW
25.0 25.0 24.0 231.48 MB

A macOS deployment utility developed by Mozilla IT

License: Mozilla Public License 2.0

Shell 42.59% Python 57.41%
deployment macos mozilla

dinobuildr's People

Contributors

ctbfourone avatar dgluhovski avatar geraltofpython avatar jlin avatar luciusbono avatar missterclean avatar mythmon avatar n3philim avatar partyonmarz avatar tristanthomas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dinobuildr's Issues

Feature: Build Tests

Some rudimentary build tests would save us a lot of headaches. Build tests would make sure that any merges to master have:

  • branch variables set to master
  • File hashes all match what is in the manifest / config

Feature: Change default screensaver to be less personally identifiable

This is an optional feature that I'm logging as a discussion point. Currently, the screensaver displays the username of the logged in user that dinobuildr was run on (as well as a portion of the serial number). While no mention of the company associated with the account is visible, it may make sense to not display a form of the user's name on a screen that might be visible in a public place.

Feature: Automate Filevault 2 Enrollment

We need to kick off filevault in our build, as this is currently a manual step.

First iteration will likely involve techs manually escrowing the fv recovery keys, but we have some ideas about how to safely automate the escrow.

Feature: Local development mode

We need a "local" development mode that lets us hack on scripts locally without having to commit changes to Github, wait, test, and repeat.

Crashplan Postinstall Times Out

The very hacky way that we get around Crashplan autolaunching (without messing with the installer package) is timing out. It is, strangely, totally doing it's job still.

Executing: Crashplan PostInstall
*** Waiting for Crashplan to launch and then quitting it...
*** 0:20: execution error: CrashPlan got an error: AppleEvent timed out. (-1712)

Feature: Offset update frequency by +x days from update release

Currently, our non-canary corsica devices update on the 1st and 15th of every month in order to, hopefully, give us a little time to intervene if an update breaks our canary devices. This falls down if the updates are released on, say, the 14th or the 31st, since the devices will just grab updates on those dates.

What we need is a mechanism that waits X amount of days after an update is available (unless it's interrupted by informant of course)

Feature: Disable audio

Investigate whether it's possible to disable audio (over HDMI) in our Corsica builds.

Feature: Logging

This is a bug to track work on the future logging we will add to Dinobuildr.

Data we would like to capture:

  • Date / time of build
  • Commit hash of build
  • Full stdout of script execution
  • Elapsed time to complete

Bug: Fix newlines in script output

The bash script executer isn't putting a newline down at the end so the output of the main config scrip is wonk'd. Need 2 fix.

Executing: Check macOS Version
*** You are running macOS 10.13.2, which meets the minimum requirements.
Downloading: Configure ComputerName
/var/tmp/dinobuildr/set-computername.sh is 1126 bytes.
The hash for /var/tmp/dinobuildr/set-computername.sh match the manifest file
Executing: Configure ComputerName
*** Setting LocalHostName and ComputerName to vagrant-ia5mat
Downloading: Install Crashplan
/var/tmp/dinobuildr/CrashPlanPROe_4.5.2_Mac.dmg is 87687680 bytes.
The hash for /var/tmp/dinobuildr/CrashPlanPROe_4.5.2_Mac.dmg match the manifest file
/var/tmp/dinobuildr/CrashPlanPROe_4.5.2_Mac.dmg
Install CrashPlan PROe.pkg

Downloading: Crashplan PostInstall
/var/tmp/dinobuildr/crashplan-postinstall.sh is 581 bytes.
The hash for /var/tmp/dinobuildr/crashplan-postinstall.sh match the manifest file
Executing: Crashplan PostInstall
*** Waiting for Crashplan to launch and then quitting it...

Feature: Minimum OS version check

The first step in our build should be a minimum OS version check. If the machine being built doesn't meet the minimum version, the build should fail in a classy way.

Stop using code in other repos

We do two sketchy things in our build. We pull down python scripts from forked repos, pin their commit hashes and execute them via curl:

dockutil=$(curl -fsSL https://raw.githubusercontent.com/mozilla/dockutil/26b13d380f67dc79251cf0ea6280dbaa603308be/scripts/dockutil)
if [ $(echo "$dockutil" | shasum -a 256 | awk {'print $1'}) == $hash ]; then # if the hashes match then proceed
echo "Executing dockutil - hash matches expected value."
python -c "$dockutil" --remove all --no-restart
python -c "$dockutil" --add "/Applications/Launchpad.app" --position beginning --no-restart
python -c "$dockutil" --add "/Applications/Firefox.app" --after Launchpad --no-restart
python -c "$dockutil" --add "/Applications/VidyoDesktop.app" --after Firefox --no-restart
python -c "$dockutil" --add "/Applications/CrashPlan.app" --after VidyoDesktop --no-restart
python -c "$dockutil" --add "~/Downloads" --view fan --display stack --section others --no-restart
python -c "$dockutil" --add "/Applications/System Preferences.app" --position end

WALLPAPER_SH=$(curl -sc - https://raw.githubusercontent.com/mozilla/macos-desktop/abfb607953e0c789bb8e853ec28f545e89ddebbe/set-desktop-mojave.sh)
HASH="50b049f9cf9a57582fa83f411b66c61fed854f553102c05ca91cbd249cdb9ac8" # change only after thorough testing
if [ $(echo "$WALLPAPER_SH" | shasum -a 256 | awk {'print $1'}) == $HASH ]; then # if the hashes match then proceed
echo "We're on Mojave (or newer) so we're going to use the new way to set the wallpaper."
/bin/bash -c "$WALLPAPER_SH" -s "/Users/Shared/$WALLPAPER_FILENAME"

While this is "safe" enough for our purposes, since the repos are forked and we hash pin, we should stop doing this altogether because we can't lint these scripts.

Of course, we also can't lint binaries that we pull down for our build, but this seems like a thing we could stop doing and it would make the build easier to understand. I believe the best solution is to simply pull these scripts into dinobuildr, and make dinobuildr understand how to natively execute python.

Feature: Set Hostname

We should probably be setting the hostname of the machine to something other than the default.

Documentation: Document Build Components

This is a ticket that will track work documenting the components of the build in an easy to understand format. The manifest is human-readable but not easy to understand, we need a "this is what's in the build" overview document that gets updated when the manifest is updated.

Test: Power Loss / Reboot Recovery Reliability

Our corsica endpoints are intended to work as "kiosk" style appliances. We need to understanding the following scenarios:

  • What happens when the endpoint loses power
  • What happens when the endpoint is told to reboot via Casper MDM commands
  • What happens when macOS OS updates are queued for install
  • What happens when Firefox updates and the endpoint is restarted

Stop using heredocs

Because we want to get serious about linting our code, heredocs are a no-no from here on out. In order to get away from heredocs, we should probably write a way for dinobuildr to natively write LaunchAgents and LaunchDaemons since those make up the bulk of our heredocs.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.