{"id":25806018,"url":"https://github.com/alipsa/munin","last_synced_at":"2026-04-06T06:02:23.718Z","repository":{"id":43289910,"uuid":"305184859","full_name":"Alipsa/munin","owner":"Alipsa","description":"This is a spring boot reporting server for reports created in Groovy, markdown etc.","archived":false,"fork":false,"pushed_at":"2025-09-27T12:16:13.000Z","size":3126,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-28T17:49:11.158Z","etag":null,"topics":["analytics","groovy","reporting","spring-boot"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Alipsa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["Alipsa"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2020-10-18T19:56:20.000Z","updated_at":"2025-09-27T12:16:16.000Z","dependencies_parsed_at":"2025-01-15T15:14:18.843Z","dependency_job_id":"f9c6c763-ef0b-4773-90a5-c89ac0770ed9","html_url":"https://github.com/Alipsa/munin","commit_stats":null,"previous_names":["pernyfelt/munin"],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/Alipsa/munin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alipsa%2Fmunin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alipsa%2Fmunin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alipsa%2Fmunin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alipsa%2Fmunin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Alipsa","download_url":"https://codeload.github.com/Alipsa/munin/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alipsa%2Fmunin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31461534,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T21:22:52.476Z","status":"online","status_checked_at":"2026-04-06T02:00:07.287Z","response_time":112,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["analytics","groovy","reporting","spring-boot"],"created_at":"2025-02-27T19:52:40.753Z","updated_at":"2026-04-06T06:02:23.652Z","avatar_url":"https://github.com/Alipsa.png","language":"JavaScript","funding_links":["https://github.com/sponsors/Alipsa"],"categories":[],"sub_categories":[],"readme":"# Munin\nThis is a report server for reports created in either Journo based on [Freemarker](https://freemarker.apache.org/) or [Groovy](https://groovy-lang.org/) \n. It is an application on [Spring Boot](https://spring.io/projects/spring-boot).\nThe name comes from the one of Odin's ravens who he sent out every day to scout the world and bring him back reports. \n\n![example report](docs/viewSampleReport.png)\n# Overview\nMunin is a reporting server that can run and display reports, created in Freemarker or Groovy, on the web.\n\nCurrently, it supports:\n- [Groovy reports](docs/groovy-reports.md) where the Groovy code returns html\n- [gmd reports](docs/gmd-reports.md) (markdown with support for groovy code - more on that further down)\n- [Journo (Freemarker) reports](docs/journo-reports.md) Groovy code handles the parameters to a Freemarker template\n\n[Gade](https://github.com/Alipsa/gade) support the Munin Groovy and gmd report formats natively,\nso you can use Gade to create and edit Munin reports.\n\n\n## Parameterized reports\nWhen publishing a report you can optionally add report parameters in the form of\nhtml form content, e.g:\n```html\n\u003cdiv class=\"form-group\"\u003e\n\u003clabel for=\"firstName\"\u003eFirst name\u003c/label\u003e\n\u003cinput id=\"firstName\" name=\"firstName\"\u003e\n\u003c/div\u003e\n\n\u003cdiv class=\"form-group\"\u003e\n\u003cselect name=\"dataSet\"\u003e\n   \u003coption value=\"mtcars\"\u003eMotor Trend Car Road Tests\u003c/option\u003e\n   \u003coption value=\"iris\"\u003e3 species of iris flowers\u003c/option\u003e\n\u003c/select\u003e\n\u003c/div\u003e\n```\n\nIf you want numeric values, you need to convert the parameter to a number.\n\n\nNote that, in order to be able to schedule a parameterized report, you must provide default parameters in the groovy code\ne.g. by using `binding.hasVariable()`. Let's say the parameter is the name of the dataset to use i.e.  \n```html\n\u003cdiv class=\"form-group\"\u003e\n\u003cselect name=\"dataSet\"\u003e\n   \u003coption value=\"mtcars\"\u003eMotor Trend Car Road Tests\u003c/option\u003e\n   \u003coption value=\"iris\"\u003e3 species of iris flowers\u003c/option\u003e\n\u003c/select\u003e\n\u003c/div\u003e\n```\nThen you can provide a default value for it as follows:\n```groovy\nif (binding.hasVariable('dataSet')) {\n  dataSet = se.alipsa.matrix.datasets.Dataset.iris()\n}\n```\n\n# Styling\nBootstrap is available, so you can use bootstrap classes to style the form.\nIf you are using the htmlcreator package, the html.add() functions takes a list of attributes as \nan optional parameter. This way you can add attributes such as id and class like this:\n```groovy\nhtml = new se.alipsa.groovy.gmd.Html()\nhtml.add(se.alipsa.matrix.datasets.Dataset.mtcars(), [\"id\":\"mtcars-table\", \"class\": \"table table-striped\"])\n```\n\nYou can either upload a common stylesheet (using the \"common resources\" button) that you can reference in your reports e.g.\n```groovy\n// import the uploaded stylesheet mystyle.css\nhtml.add(\"\u003clink rel='stylesheet' href='/common/resources/mystyle.css' /\u003e\")\n```\n\nor, to put it in the head section ([should only be needed](https://html.spec.whatwg.org/multipage/links.html#link-type-stylesheet) if your viewers have very old browsers):\n```groovy\n// import the uploaded stylesheet mystyle.css\nhtml.add('''\n  \u003cscript\u003e   \n    const cssLink = document.createElement(\"link\");\n    cssLink.href = \"/common/resources/mystyle.css\";\n    cssLink.rel=\"stylesheet\";\n    document.head.appendChild(cssLink);\n  \u003c/script\u003e\n''')\n```\n\n...and you can of course also add stylesheets inline, e.g.\n```groovy\n// add a style class to adjust the font size of table text:\nhtml.add(\"\"\"\n  \u003cstyle\u003e\n    .table-font-size {\n      font-size: 14px;\n    }\n  \u003c/style\u003e\n\"\"\")\n```\nthen \n```groovy\n// reference the class together with some bootstrap classes when rendering a table:\nhtml.add(mtcars, [\"class\": \"table table-striped table-font-size\"])\n```\n\n# Installing\nThere are a few different ways to install Munin.\n\n1. Simple:\n    - Download the munin-[version].jar file from https://github.com/perNyfelt/munin/releases/latest\n    - Copy the jar to a directory of your choice\n    - create an application-prod.properties file and override whatever default config you need\n    - run the application with `java -Dspring.profiles.active=prod -jar munin-[version]-exec.jar`\n      See production config for info on how to make it a service.\n      \n2. Customized:\n   This is appropriate if you want to do more involved customization.\n   - Create a new maven (of Gradle or whatever) project and set munin as the parent project:\n   \n   ```xml\n   \u003cparent\u003e\n       \u003cartifactId\u003emunin\u003c/artifactId\u003e\n       \u003cgroupId\u003ese.alipsa\u003c/groupId\u003e\n       \u003cversion\u003e2.0.0\u003c/version\u003e\n   \u003c/parent\u003e\n   ```\n3. Customized alternative:\nFork the project on [github](https://github.com/perNyfelt/munin) and make any changes you want.\nCreate the executable jar with `mvn clean package` and copy it from your target dir.   \n\n# Demo\nThe release jar is in \"demo\" mode meaning it comes with a few user accounts preinstalled, and uses \na file base h2 database for persistence. \nYou start it by simply doing `java -jar munin-[version]-exec.jar`.\nThe application will be available on http://localhost:8088\n\nSee [here](docs/screenshots.md) for some screenshots.\n\n## Admin\nThe default admin user name / password is admin / adminpwd.\nIf you log in as admin you will see an \"Administration\" button on the main page (http://localhost:8088).\nThere are three predefined roles:\n- Viewer: someone who can only view reports. There is one predefined: test / testpwd\n- Analyst: someone who can view / add / edit and schedule reports. There is one predefined: analyst /analystpwd\n- Admin: someone who can do user/role administration. There is one predefined: admin / adminpwd\n\n## Sample reports\nThere a few example reports that might help you get going which you can download/copy and publish to the Munin server:\n- [Simple](https://github.com/perNyfelt/munin/blob/main/src/test/resources/sampleReport.R): This is a Simple report with a\nbarplot and a table with some styling.\n\n- [Parameterized](https://github.com/perNyfelt/munin/blob/main/src/test/resources/paramReport.R): This is report \nthat show how to do parameterized reports. The [parameters form](https://github.com/perNyfelt/munin/blob/main/src/test/resources/paramReportInput.html)\n  provides the input variables used in the report. \n  \n- [Pie Chart with External Image](https://github.com/perNyfelt/munin/blob/main/src/test/resources/pieChartWithExternalImage.R):\nThis reports requires you to upload an external image first (this is to show the use of \n  common content). Download the [iris.jpg](https://github.com/perNyfelt/munin/raw/main/src/test/resources/iris.jpg)\n  and upload the content using the \"common resources\" button you can see if you are logged in as admin or analyst.\n  Then you can upload the [pieChartWithExternalImage.R](https://github.com/perNyfelt/munin/blob/main/src/test/resources/pieChartWithExternalImage.R)\n  script and publish the report. \n  \n- [Table with external CSS](https://github.com/perNyfelt/munin/blob/main/src/test/resources/tableWithExternalCss.R):\nThis report requires you to upload an external css (another typical us of common content).\n  Download the [mystyle.css]((https://github.com/perNyfelt/munin/raw/main/src/test/resources/mystyle.css)\n  and upload the content using the \"common resources\" as described above. You can then create the report\n  based on the [tableWithExternalCss.R](https://github.com/perNyfelt/munin/blob/main/src/test/resources/tableWithExternalCss.R)\n  script.\n\n# Production config \nYou can do any customization by adding an application-prod.properties file next to the jar.\nThen start the server with `-Dspring.profiles.active=prod` set e.g.\n`java -Dspring.profiles.active=prod -jar munin-[version]-exec.jar`\nThis will override any default config with your specific config.\n\n## application-prod.properties variables\nSee application.properties for settings to override. Typically, you will change the following \n\n### Web port\nSet the property `server.port` to something else e.g. `server.port=8080` to listen for\nweb requests on port 8080 instead of the default 8088.\n\n### Database\nThe database stores the reports and user config. \nDefault config is a file based H2 database (`jdbc:h2:file:./munindb;DATABASE_TO_LOWER=TRUE`) \nTo change the underlying database config, set the spring.datasource.xxx parameters \nas you see fit.\n\nThere is a braking change between the h2 database used prior to munin version 1.2.0 (i.e. h2 1.4.x) and the h2 \nversion used in version from 1.20 and later (h2 version 2.1.x). To upgrade the database you need to export the old database \nto SQL and then import in the new version. Essentially you need to the following steps\n\n1. Download the 1.4.200 h2 from https://repo1.maven.org/maven2/com/h2database/h2/1.4.200/h2-1.4.200.jar\n2. Backup using `java -cp h2-1.4.200.jar org.h2.tools.Script -url jdbc:h2:file:./munindb -user sa -script test.zip -options compression zip`\n3. rename ./munindb.* to ./oldmunindb.*\n4. Download 2.210 from https://repo1.maven.org/maven2/com/h2database/h2/2.1.210/h2-2.1.210.jar\n5. Restore using `java -cp h2-2.1.210.jar org.h2.tools.RunScript -url jdbc:h2:file:./munindb -user sa -script test.zip -options compression zip FROM_1X`\n\nSee the [Upgrade, Backup, and Restore](https://h2database.com/html/tutorial.html#upgrade_backup_restore)\nsection of the h2 documentation for details. There is also a simple [database migration script](migrateDb.sh) you can use \n(edit credentials etc. appropriately first). For 2.1 to 2.2 upgrade. use the upgradeH2.sh script instead.\n\nNote that if you want another database other than H2, you need to make sure spring boot can access\nthe jdbc driver jar. This can be done by setting the loader.path, e.g:\n\n1. create a lib folder where your spring boot jar resides\n2. copy the additional jar to the lib folder\n3. add the path to the folder when starting spring boot:\n`java -Dloader.path=file:lib/ -Dspring.profiles.active=prod -jar munin-[version]-exec.jar`\n\n### Mail\nMail is used to email passwords when users are created as well as mailing out scheduled reports.\nSet spring.mail.xxx properties (host, port, username, password) as suitable for your mail server.\nThe \"from\" address is controlled by the property `munin.email.from`\n\n### Monitoring\nPerhaps not something you would typically override, but you likely want to set up some kind of integration\nwith whatever health monitoring tool you are using at your business.\n\nActuator is included with default settings which means that a network monitoring tool can\ncheck for availability by querying `http://your-host-name:8088/actuator/health` which will return the\njson string `{\"status\":\"UP\"}` if everything is normal.\n\n\n## Run Munin as a service\nTo run munin as a service, create a [service starter script](https://github.com/perNyfelt/munin/blob/main/src/bin/munin.service)\nand make it run as a [Linux service](https://linuxconfig.org/how-to-create-systemd-service-unit-in-linux).\nEssentially:\n1. Edit the [service starter script](https://github.com/perNyfelt/munin/blob/main/src/bin/munin.service)\n1. Copy the script to /etc/systemd/system\n1. start the service `sudo systemctl start munin.service`\n1. Make sure the service is running `systemctl is-active munin.service`\n\nFor a [Windows service](https://github.com/perNyfelt/munin/blob/main/src/bin/munin-windows.xml) see [winsw](https://github.com/winsw/winsw).\nEssentially you do:\n1. Take WinSW.NET4.exe (or WinSW.NETCore31.x64.exe if you do not have .NET installed) from the [distribution](https://github.com/winsw/winsw/releases/latest), and rename it to munin-windows.exe.\n1. Edit [munin-windows.xml](https://github.com/perNyfelt/munin/blob/main/src/bin/munin-windows.xml) to match your file locations.\n1. Place those two files side by side.\n1. Run `munin-windows.exe install` to install the service.\n1. Run `munin-windows.exe start` to start the service.\n\nSee the [Spring documentation](https://docs.spring.io/spring-boot/docs/current/reference/html/deployment.html#deployment-service)\nfor more info.\n\n## Other configuration tasks\nThe first thing you should probably do after setting up a database and providing the necessary config overrides \nis to change / remove the three predefined users using the admin interface mentioned in the demo section above.\nIf you want to keep the admin user, begin by assigning your email to it and then log out and reset the password -\n a new password will then be emailed to you.\n\n# Integration\nMunin provides a REST api for integration with other applications. It is described [here](api.md).\n\n# Reusing code\nYou might notice that you have code snippets that you want to centralize and reuse. The standard approach\nto that is to formulate those code snippets into classes that you include in a library that you publish to a Nexus \nserver and include in your script using @Grab.\n\nAn alternative way is to upload the groovy code into the common resource area and source it from the report e.g.\n```groovy\ndef utils = evaluate(\"$muninBaseUrl/common/resources/utils.groovy\".toURL().text)\n```\n\n# 3:rd party dependencies\n\n### [Renjin](https://github.com/bedatadriven/renjin)\n- R interpreter for the JVM; used to execute reports\n- License: GNU General Public License v2.0\n\n### [Spring boot](https://github.com/spring-projects/spring-boot)\n- The application server framework providing most of the functionality\n- License: Apache License 2.0\n\n### [renjin-spring-boot-starter](https://github.com/perNyfelt/renjin-spring-boot-starter)\n- Integration of Renjin with Spring boot\n- License: MIT\n\n### [htmlcreator](https://github.com/perNyfelt/htmlcreator)\n- renjin extension (package) to create html from R objects (data.frames, images etc)\n- License: MIT\n\n### [mdr2html](https://github.com/perNyfelt/mdr2html)\n- renjin extension (package) to create html from mdr files / content\n- License: MIT\n\n### [commons-io](https://commons.apache.org/proper/commons-io/)\n- Various IO stuff\n- License: Apache License 2.0\n\n### [commons-collections4](https://commons.apache.org/proper/commons-collections/)\n- Used to handle various collection transformations\n- License: Apache License 2.0\n\n### [cron-utils](https://github.com/jmrozanec/cron-utils)\n- Used to parse cron expressions to provide \"plain english\" descriptions for them.\n- License: Apache License 2.0\n\n### [webjars-locator](http://webjars.org)\n- Simplifies web resource locations\n- License: MIT\n\n### [webjars bootstrap](http://webjars.org)\n- Pretty web pages\n- License: Apache License 2.0\n\n### [webjars jquery](http://webjars.org)\n- More convenient javascripts\n- License: MIT\n\n### [webjars codemirror](http://webjars.org)\n- Syntax highlighting for R and html code\n- License: MIT\n\n### [highlightjs](https://highlightjs.org/)\n- Syntax highlighting for mdr reports\n- License: BSD 3-Clause\n\nSee the [pom.xml](https://github.com/perNyfelt/munin/blob/main/pom.xml) for more details...\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falipsa%2Fmunin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falipsa%2Fmunin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falipsa%2Fmunin/lists"}