Skip to content

Server Configuration

Mike Solin edited this page Mar 17, 2022 · 49 revisions

Starting with MunkiReport v4.0.0 you have to configure the application using environment variables set in the web server or in a .env file in the root of the MunkiReport directory. Check .env.example for the syntax.


Note: Some configurations need to be set using a YAML file. Most notable are user accounts, dashboard layouts and module configurations.


Note: When upgrading from older versions: config.php is not used anymore, you need to convert your settings to .env


Get started .env

You can set the variables in .env by adding them line by line:

SITENAME="My Awesome MunkiReport Site"

Variables

Database

# SQLite
CONNECTION_DRIVER="sqlite"
CONNECTION_DATABASE="db/db.sqlite"
# MySQL
CONNECTION_DRIVER="mysql"
CONNECTION_HOST="127.0.0.1"
CONNECTION_PORT=3306
CONNECTION_DATABASE="munkireport"
CONNECTION_USERNAME="root"
CONNECTION_PASSWORD=""
CONNECTION_CHARSET="utf8mb4"
CONNECTION_COLLATION="utf8mb4_unicode_ci"
CONNECTION_STRICT=TRUE
CONNECTION_ENGINE="InnoDB"

Index page

Default is index.php? which is the most compatible form. You can leave it blank if you want nicer looking urls. You will need a server which honors .htaccess (Apache) or figure out how to rewrite urls in the server of your choice.

INDEX_PAGE="index.php?"

Uri protocol

$_SERVER variable that contains the correct request path, e.g. REQUEST_URI, QUERY_STRING, PATH_INFO, etc. Defaults to AUTO.

URI_PROTOCOL="AUTO"

HTTP host

The hostname of the webserver, by default automatically determined but if that does not work you can set it. No trailing slash.

WEBHOST="https://munkireport"

Subdirectory

Relative to the web root, with trailing slash. If you're running munkireport from a subdirectory of a website, enter subdir path here. E.g. if munkireport is accessible here: http://mysite/munkireport/ you should set subdirectory to '/munkireport/'

If you're using .htaccess to rewrite urls, you should change that too. The code tries to automagically determine your subdirectory, if it fails, just add the following to .env

SUBDIRECTORY="/your_sub_dir/"

Sitename

Will appear in the title bar of your browser and as heading on each webpage.

SITENAME="MunkiReport"

Hide Non-active Modules

When false, all modules will be shown in the interface, this setting defaults to true

HIDE_INACTIVE_MODULES=FALSE

Client Summary Tab

As of MunkiReport 5.1.0, the client summary tab is configurable. Please see Client Summary Tab for how to configure.

Authentication

Currently five authentication methods are supported.

Enabling authentication methods

Authentication providers are checked by specifying the type in the AUTH_METHODS array

AUTH_METHODS="SAML,NETWORK,AD"

You must specify an option with AUTH_METHODS to enable it!

reCaptcha

Enable reCaptcha Support on the Authentication Form Request API keys from https://www.google.com/recaptcha

RECAPTCHA_LOGIN_PUBLIC_KEY=""
RECAPTCHA_LOGIN_PRIVATE_KEY=""

Local directory

You can override the local directory location by setting

LOCAL_DIRECTORY_PATH="/path/to/local/directory/"

in your .env file. This allows you to keep your local configs separate from the MunkiReport files and optionally store them in your own versioning system.

Proxy support

If you are behind a proxy, MunkiReport may be unable to retrieve warranty and model information from Apple.

Note that there is only authenticated proxy support for basic authentication

PROXY_SERVER="proxy.yoursite.org" # Required
PROXY_USERNAME="proxyuser" # Optional
PROXY_PASSWORD="proxypassword" # Optional
PROXY_PORT=8888 # Optional, defaults to 8080

Role Based Authorization

Authorize actions by listing roles appropriate array. Don't change these unless you know what you're doing, these roles are also used by the Business Units.

AUTHORIZATION_DELETE_MACHINE="user1,user2"
AUTHORIZATION_GLOBAL="admin1,admin2"

Roles

Add users or groups to the appropriate roles array.

ROLES_ADMIN="*"

Local groups

Create local groups, add users to groups.

GROUPS_ADMIN_USERS="user1,user2"

Business Units

Set to TRUE to enable Business Units. For more information, see docs/business_units.md.

ENABLE_BUSINESS_UNITS=TRUE

Force secure connection when authenticating

Set this value to TRUE to force https when logging in. This is useful for sites that serve MR both via http and https.

AUTH_SECURE=TRUE

VNC and SSH links, optional links in the client detail view

If you want to have link that opens a screensharing or SSH connection to a client, enable these settings. If you don't want the links, set either to an empty string.

VNC_LINK="vnc://%s:5900"
SSH_LINK="ssh://adminuser@%s"

If you want the links to default to the username of the person logged into MunkiReport, use these instead:

VNC_LINK="vnc://%u@%s:5900"
SSH_LINK="ssh://%u@%s"

Curl

Define path to the curl binary and add options this is used by the installer script. Override to use custom path and add or remove options, some environments may need to add "--insecure" if the servercertificate is not to be checked.

CURL_CMD="/usr/bin/curl, --fail, --silent, --show-error, --insecure"

Apps to Track

Applications to track for the App Versions Report can be listed in the .env file as well. Note that a % wildcard can be used if the app comes in various name variations (i.e. Adobe Photoshop%). Example:

APPS_TO_TRACK="VMware Fusion, Safari, VMWare Horizon Client, Creative Cloud, Cisco Jabber, Google Chrome, Microsoft Outlook, Microsoft Word, Microsoft Excel, Adobe Lightroom, Lockdown Browser, Audacity, Keynote, Pages, Numbers, Adobe Acrobat, Adobe Photoshop%, Adobe InDesign%, VirtualBox, Microsoft Teams, Managed Software Center, FileMaker Pro"

Modules

By default munkireport will only install 3 basic reporting modules: munkireport, managed installs and disk_report. If you want the client to report on more items, visit:

http://example.com/index.php?/install/dump_modules/env

Paste the resulting MODULES="..." in your .env file. Remove items that you don't need reporting on from the array (e.g. servermetrics, certificate and service only make sense when installed on a client that runs Mac OS X server).

An empty list installs only the basic reporting modules, Machine and Reportdata.

MODULES='disk_report,munkireport,displays_info,network'

Custom Modules

A module search path can be configured to facilitate custom modules. Example:

MODULE_SEARCH_PATHS=/full/path/to/custom-modules

Help page URL

Display a help button. Example:

SHOW_HELP=TRUE
HELP_URL=https://your.help.url
Clone this wiki locally