4.0 KiB
Contributing
Welcome, if you're looking to help, this document is a great place to start!
Finding Things That Need Help
If you're looking to help, this is a great place to start.
- Read through the MDM Protocol Reference on the Apple website. Having a deeper understanding of MDM can help with designing features and uncovering bugs.
- Follow the Quickstart guide and make edits if something doesn't look right.
- If you run into a problem that you're not sure how to fix, file a bug.
- Browse through the open issues. We try to tag issues as beginner friendly where appropriate.
Building the project
To build MicroMDM from source, you will need Go 1.8 or later installed.
If you have Go
MicroMDM uses the go lang dep tool for vendor management.
Use which dep to verify you have it installed and in your PATH.
If dep is not installed please review the If you're new to Go section for install steps.
go get github.com/micromdm/micromdmcd $GOPATH/src/github.com/micromdm/micromdmdep ensureinstall the necessary dependencies into /vendor foldergo buildorgo install
If you're new to Go
Go is a bit different from other languages in its requirements for how it expects its programmers to organize Go code on a system.
First, Go expects you to choose a folder, called a workspace (you can name it anything you'd like). The path to this folder must always be set in an environment variable - GOPATH (example: GOPATH=/Users/groob/code/go)
Your GOPATH must have thee subfolders - bin, pkg and src, and any code you create must live inside the src folder. It's also helpful to add $GOPATH/bin to your environment's PATH as that is where go install will place go binaries that you build.
Note: As of Go 1.8 the default GOPATH is set to $HOME/go.
A few helpful resources for getting started with Go.
- Writing, building, installing, and testing Go code
- Resources for new Go programmers
- How I start
- How to write Go code
- GOPATH - go wiki page
To build MicroMDM you will need to:
- Download and install
Go - Install
depviago get -u github.com/golang/dep/...Note thatdepis a very new project itself. If you're running trouble with thedep ensurecommand, ping @groob in the #micromdm channel on Slack. - Set the
GOPATHas explained above. mkdir -p $GOPATH/src/github.com/micromdmgit clonethe project into the above folder.
The repo must always be in the folder$GOPATH/src/github.com/micromdm/micromdmeven if you forked the project. Add a git remote to your fork.dep ensureThedepcommand will download and install all necessary dependencies for the project to compile.go buildorgo install- File an issue or a pull request if the instructions were unclear.
Important libraries and frameworks
MicroMDM is built using a few popular Go packages outside the standard libraries. It might be worth checking them out.
- Go Kit is a set of Go libraries used by MicroMDM to provide logging, and abstractions for building HTTP services. Its examples page is a good place to start.
- BoltDB is a key/value database used to provide persistant storage for many components of MicroMDM.
- gorilla/mux is used to provide routing for http handlers.