├── .gitmodules ├── Dockerfile ├── README.md └── config_default.php /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "munkireport-php"] 2 | path = munkireport-php 3 | url = https://github.com/munkireport/munkireport-php.git 4 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:7-apache 2 | 3 | RUN apt-get update && \ 4 | apt-get install --no-install-recommends -y libldap2-dev \ 5 | libcurl4-openssl-dev \ 6 | libxml2-dev && \ 7 | apt-get clean && \ 8 | rm -rf /var/lib/apt/lists/* 9 | 10 | RUN docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ && \ 11 | docker-php-ext-install -j$(nproc) curl pdo_mysql soap ldap 12 | 13 | RUN mkdir /var/www/munkireport 14 | 15 | WORKDIR /var/www/munkireport 16 | 17 | RUN curl -L -o ./munkireport-php.tar.gz https://github.com/munkireport/munkireport-php/archive/v2.14.0.tar.gz 18 | RUN tar -zxvf munkireport-php.tar.gz --strip-components=1 19 | RUN rm munkireport-php.tar.gz 20 | 21 | RUN mkdir -p app/db && \ 22 | touch app/db/db.sqlite && \ 23 | chmod -R 777 app/db 24 | 25 | RUN ln -s /var/www/munkireport/index.php /var/www/html && \ 26 | ln -s /var/www/munkireport/assets /var/www/html && \ 27 | ln -s /var/www/munkireport/.htaccess /var/www/html 28 | 29 | COPY ./config_default.php /var/www/munkireport/config.php 30 | 31 | RUN a2enmod rewrite 32 | 33 | 34 | EXPOSE 80 35 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | macadmins/munkireport-php 2 | ========================= 3 | 4 | 5 | Autobuild repository for [https://github.com/bruienne/macadmins-munkireport-php/](https://github.com/bruienne/macadmins-munkireport-php) 6 | 7 | Contains Dockerfile and other needed files to create a munkireport-php image. 8 | 9 | The main munkireport-php repository is here: [https://github.com/munkireport/munkireport-php](https://github.com/munkireport/munkireport-php) 10 | 11 | Part of the Macadmins Docker project: [https://registry.hub.docker.com/u/macadmins](https://registry.hub.docker.com/u/macadmins) 12 | 13 | Run instructions 14 | ================ 15 | 16 | Start the MR-PHP container as follows: 17 | 18 | `docker run -d -v /var/html/app/db -p 80:80 macadmins/munkireport-php` 19 | 20 | This will create a persistent storage volume on your Docker host and in the MR-PHP container. The database will be created there and persist after the container is stopped or removed. 21 | 22 | The default login/password is admin/admin - this can be changed by volume-binding your own config.php with a different admin password hash: 23 | 24 | `docker run -d -v /var/html/app/db -v /path/to/your/config.php:/var/html/app/config.php -p 80:80 macadmins/munkireport-php` 25 | 26 | The line to add looks like this (this is the password hash in the image): 27 | 28 | `$auth_config['admin'] = '$P$BDnkPOMPV0BMGL7YROrT9ITzwk3ZWz/';` 29 | 30 | The config_default.php file is sourced for initial settings. The above method will also apply if you wish to provide your own configuration for the MR-PHP application. Simply bind-mount the config.php file with your modifications. 31 | 32 | Environment Variables 33 | ===================== 34 | 35 | The following variables are exposed for configuration via environment: 36 | 37 | - `SITENAME`: The name of your site, displayed in the title. 38 | - `ADMIN_PASSWORD`: If you are using local authentication ONLY, the password hash for the *admin* account. Default is 39 | the password `admin`. 40 | - `MODULES`: A comma delimited list of enabled modules. 41 | - `IP_RANGES`: A comma delimited list of ip ranges to show in the network module. 42 | - `ALLOW_MIGRATIONS`: Set to `TRUE` to allow database schema migrations (upgrades). 43 | - `ENABLE_BUSINESS_UNITS`: Set to `TRUE` to enable business unit functionality. 44 | - `CLIENT_PASSPHRASES`: A comma delimited list of accepted passphrases. 45 | - `APPS_TO_TRACK`: A comma delimited list of application names to display on the applications report. 46 | 47 | Active Directory Authentication 48 | ------------------------------- 49 | 50 | - `AUTH_AD_DOMAIN_CONTROLLERS`: A comma delimited list of domain controllers to contact for authentication. 51 | - `AUTH_AD_ACCOUNT_SUFFIX`: The UPN suffix eg. `@domain.local`. 52 | - `AUTH_AD_BASE_DN`: The base DN for binding, eg. `DC=domain,DC=local`. If not set will be auto detected. 53 | - `AUTH_AD_ADMIN_USERNAME`: The username to use if unauthenticated queries are not allowed. 54 | - `AUTH_AD_ADMIN_PASSWORD`: The password to use if unauthenticated queries are not allowed. 55 | - `AUTH_AD_ALLOWED_USERS`: A comma delimited list of users who are allowed access. 56 | - `AUTH_AD_ALLOWED_GROUPS`: A comma delimited list of AD groups who are allowed access. 57 | -------------------------------------------------------------------------------- /config_default.php: -------------------------------------------------------------------------------- 1 | 5, 'warning' => 10); 509 | 510 | /* 511 | |=============================================== 512 | | App settings 513 | |=============================================== 514 | | 515 | | If the webapp is in a different directory as index.php, adjust 516 | | the variables below. For enhanced security it is advised to put the 517 | | webapp in a directory that is not visible to the internet. 518 | */ 519 | 520 | // Path to system folder, with trailing slash 521 | $conf['system_path'] = APP_ROOT.'/system/'; 522 | 523 | // Path to app folder, with trailing slash 524 | $conf['application_path'] = APP_ROOT.'/app/'; 525 | 526 | // Path to view directory, with trailing slash 527 | $conf['view_path'] = $conf['application_path'].'views/'; 528 | 529 | // Path to controller directory, with trailing slash 530 | $conf['controller_path'] = $conf['application_path'].'controllers/'; 531 | 532 | // Path to modules directory, with trailing slash 533 | $conf['module_path'] = $conf['application_path'] . "modules/"; 534 | 535 | 536 | 537 | // Routes 538 | $conf['routes'] = array(); 539 | $conf['routes']['module(/.*)?'] = "module/load$1"; 540 | 541 | 542 | /* 543 | |=============================================== 544 | | PDO Datasource 545 | |=============================================== 546 | | 547 | | Specify dsn, username, password and options 548 | | Supported engines: sqlite and mysql 549 | | Mysql example: 550 | | $conf['pdo_dsn'] = 'mysql:host=localhost;dbname=munkireport'; 551 | | $conf['pdo_user'] = 'munki'; 552 | | $conf['pdo_pass'] = 'munki'; 553 | | $conf['pdo_opts'] = array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'); 554 | | 555 | */ 556 | $conf['pdo_dsn'] = 'sqlite:'.$conf['application_path'].'db/db.sqlite'; 557 | $conf['pdo_user'] = ''; 558 | $conf['pdo_pass'] = ''; 559 | $conf['pdo_opts'] = array(); 560 | 561 | /* 562 | |=============================================== 563 | | Create table options 564 | |=============================================== 565 | | 566 | | For MySQL, define the default table and charset 567 | | 568 | */ 569 | $conf['mysql_create_tbl_opts'] = 'ENGINE=InnoDB DEFAULT CHARSET=utf8'; 570 | 571 | /* 572 | |=============================================== 573 | | Timezone 574 | |=============================================== 575 | | 576 | | See http://www.php.net/manual/en/timezones.php for valid values 577 | | 578 | */ 579 | $conf['timezone'] = @date_default_timezone_get(); 580 | 581 | /* 582 | |=============================================== 583 | | Custom css and js 584 | |=============================================== 585 | | 586 | | If you want to override the default css or default js 587 | | you can specify a custom file that will be included 588 | | in the header (css) and footer (js) 589 | | 590 | */ 591 | //$conf['custom_css'] = '/custom.css'; 592 | //$conf['custom_js'] = '/custom.js'; 593 | 594 | 595 | /* 596 | |=============================================== 597 | | Debugging 598 | |=============================================== 599 | | 600 | | If set to TRUE, will deliver debugging messages in the page. Set to 601 | | FALSE in a production environment 602 | */ 603 | $conf['debug'] = FALSE; 604 | --------------------------------------------------------------------------------