{"id":13526711,"url":"https://github.com/puppetlabs/puppet-validator","last_synced_at":"2025-10-19T17:31:09.079Z","repository":{"id":56889644,"uuid":"51038171","full_name":"puppetlabs/puppet-validator","owner":"puppetlabs","description":"Puppet code validation as a service","archived":false,"fork":false,"pushed_at":"2023-08-24T16:55:59.000Z","size":775,"stargazers_count":7,"open_issues_count":5,"forks_count":10,"subscribers_count":135,"default_branch":"main","last_synced_at":"2025-01-30T00:23:14.378Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://validate.puppet.com","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/puppetlabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-02-03T23:24:00.000Z","updated_at":"2024-06-24T10:00:38.000Z","dependencies_parsed_at":"2024-01-18T23:05:00.122Z","dependency_job_id":"3b7b8512-8291-4127-8c30-7f6ce11ffcd7","html_url":"https://github.com/puppetlabs/puppet-validator","commit_stats":{"total_commits":103,"total_committers":2,"mean_commits":51.5,"dds":0.009708737864077666,"last_synced_commit":"86ea708f2a0fdb3add6e3c7f0940e29346ffd539"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/puppetlabs%2Fpuppet-validator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/puppetlabs%2Fpuppet-validator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/puppetlabs%2Fpuppet-validator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/puppetlabs%2Fpuppet-validator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/puppetlabs","download_url":"https://codeload.github.com/puppetlabs/puppet-validator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237181505,"owners_count":19268049,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-08-01T06:01:33.545Z","updated_at":"2025-10-19T17:31:08.719Z","avatar_url":"https://github.com/puppetlabs.png","language":"Ruby","readme":"# Puppet Validator:\n## Puppet Code Validation as a service\n\nPuppet Validator is a simple web service that accepts arbitrary code submissions\nand validates it the way `puppet parser validate` and `puppet-lint` would. For\nsimple and self-contained manifests, it can also show you a relationship graph.\n\nPuppet Validator is completely themeable, albeit rather primitively.\n\nSee an example running on https://validate.puppet.com\n\n### Usage:\n\n#### Running the service directly\n\n    puppet-validator [-p \u003cport\u003e] [-l [logfile]] [-t \u003cthemedir\u003e] [-d]\n     ↳ Runs the Puppet Validator code validation service.\n\nThis is the simplest way to run Puppet Validator. It has no external dependencies, other\nthan the handful of gems it uses. This command will start the service. It will\nnot daemonize itself, though a [`systemd` init script is provided](#running-standalone-with-systemd)\nthat will take care of that for you. It will default to running on port 9000,\nand will serve content directly out of its installation directory. You can\noverride and customize the web content by passing the `-t` or `--theme`\ncommand-line argument. See [Creating your own theme](#creating-your-own-theme) below.\n\nThis can load code from several popular paste services and can gist validated\ncode to https://gist.github.com. These gists include a `referer` link back so\nthe gisted code can be re-validated at any time. If you'd like the `referer`\ncheck to work properly, make sure to run this with a valid SSL certificate.\n\nOptions:\n\n    -d, --debug                      Display or log debugging messages\n        --disable DISABLED_CHECKS    Lint checks to disable. Either comma-separated list or filename.\n    -l, --logfile [LOGFILE]          Path to logfile. Defaults to no logging, or /var/log/puppet-validator if no filename is passed.\n    -p, --port PORT                  Port to listen on. Defaults to 9000.\n    -t, --theme THEMEDIR             Path to the theme directory.\n    -x, --csrf                       Protect from cross site request forgery. Requires code to be submitted for validation via the webpage.\n    -g, --graph                      Generate relationship graphs from validated code. Requires `graphviz` to be installed.\n        --ssl                        Run with SSL support. Autogenerates a self-signed certificates by default.\n        --ssl-cert FILE              Specify the SSL certificate you'd like use use. Pair with --ssl-key.\n        --ssl-key FILE               Specify the SSL key file you'd like use use. Pair with --ssl-cert.\n\n    -h, --help                       Displays this help\n\n\n#### Integrating with Middleware\n\nIf you plan to run this as a public service, then you may want to run it under\nmiddleware (such as Phusion Passenger, Puma, or Unicorn) for performance and\nscalability. The specific implementation will depend on your choice of webserver\nand middleware.\n\nTo configure Puppet Validator on Apache and Passenger, you'll need to\n\u003ca href=\"https://www.phusionpassenger.com/library/install/apache/install/oss/el7/\"\u003e\ninstall and configure the appropriate packages\u003c/a\u003e. Then you'll need to configure\na virtual host to contain the application.\n\n``` Apache\n# /etc/httpd/conf.d/puppet-validator.conf\nListen 9090\n\u003cVirtualHost *:9090\u003e\n    ServerName 54.201.129.11\n    DocumentRoot /etc/puppet-validator/public\n    \u003cDirectory /etc/puppet-validator/public\u003e\n        Require all granted\n        Allow from all\n        Options -MultiViews\n    \u003c/Directory\u003e\n\u003c/VirtualHost\u003e\n```\n\nThe `DocumentRoot` and `Directory` directives can point directly to the `public`\ndirectory *within the gem installation directory*, or it can point to the `public`\ndirectory of a custom theme you've created. See\n[Creating your own theme](#creating-your-own-theme) below. The two directives\nshould point to the same directory.\n\nIn the directory directly above the `public` directory referenced above, you\nshould have a `config.ru` file. This file will actually bootstrap and start the\napplication. An example file exists in the root of the gem installation directory.\nIt looks similar to the file below and may be customized to pass in any options\nyou'd like.\n\n``` Ruby\n# /etc/puppet-validator/config.ru\nrequire 'rubygems'\nrequire 'puppet-validator'\n\nlogger       = Logger.new('/var/log/puppet-validator')\nlogger.level = Logger::WARN\n\nPuppetValidator.set :root, File.dirname(__FILE__)\nPuppetValidator.set :logger, logger\n\n# List out the lint checks you want disabled. By default, this will enable\n#   all installed checks. puppet-lint --help will list known checks.\n#\nPuppetValidator.set :disabled_lint_checks, ['80chars']\n\n# Protect from cross site request forgery. With this set, code may be\n#   submitted for validation by the website only.\n#\nPuppetValidator.set :csrf, false\n\n# Provide the option to generate relationship graphs from validated code.\n#   This requires that the `graphviz` package be installed.\n#\nPuppetValidator.set :graph, false\n\nrun PuppetValidator\n```\n\n#### Creating your own theme\n\nCreating a Puppet Validator theme is as simple as copying the content files to a directory\nand customizing them. The `init` subcommand will do this for you. Note that the\ncommand *will overwrite* existing files, but it will warn you before it does so.\n\n    root@master:~ # mkdir /etc/puppet-validator\n    root@master:~ # cd /etc/puppet-validator/\n    root@master:/etc/puppet-validator # puppet-validator init\n    Initializing directory as new Puppet Validator theme...\n    root@master:/etc/puppet-validator # tree -L 2\n    .\n    ├── LICENSE\n    ├── README.md\n    ├── config.ru\n    ├── public\n    │   ├── font-awesome-4.7.0\n    │   ├── gist.png\n    │   ├── relationships.html\n    │   ├── scripts.js\n    │   ├── styles.css\n    │   ├── testing.html\n    │   └── validation.js\n    └── views\n        ├── index.erb\n        └── result.erb\n\nOnce you've created your theme, you can start the Puppet Validator service using the `-t`\nor `--theme` command line arguments to tell Puppet Validator where to find your content.\n\n    root@master:~ # puppet-validator --theme /etc/puppet-validator/\n\nAlternatively, you can edit your webserver virtual host configuration to point\nto the *public* directory within your new theme, as in the example shown above.\n\n#### Disabling `puppet-lint` checks\n\nPuppet-lint is an incredibly valuable tool. That said, some of the checks it runs\nmay not apply to your environment. It's easy to disable these checks, either on\nthe command-line, or in the `config.ru` file. By default, Puppet Validator will just run\nall available checks.\n\nChecks can be disabled either as a comma-separated list of checks:\n\n    root@master:~ # puppet-validator --disable 80chars,double_quoted_strings\n\nOr in a file with one check per line.\n\n    root@master:~ # puppet-validator --disable /etc/puppet-validator/disabled_checks\n    root@master:~ # cat /etc/puppet-validator/disabled_checks\n    80chars\n    double_quoted_strings\n\nThis can also be done in your `config.ru`. Specifying a list would look like this:\n\n``` Ruby\nPuppetValidator.set :disabled_lint_checks, ['80chars', 'double_quoted_strings']\n\n```\n\nAnd loading the disabled checks from a file would look like:\n\n``` Ruby\nPuppetValidator.set :disabled_lint_checks, '/etc/puppet-validator/disabled_checks'\n\n```\n\n#### Validating code against multiple Puppet versions\n\nPuppet Validator runs a new process to validate each submission. This means that\nit can lazy-load the requested Puppet version on demand. Simply `gem install` all\nthe versions you want and they'll be visible in the drop-down selector.\n\n    # Installing a specific version\n    root@master:~ # gem install puppet -v 5.3.3\n\n    # Installing several versions at once\n    root@master:~ # gem install puppet:3.8.8 puppet:4.10.0 puppet:5.3.3\n\nIf you use the `puppet_validator` module, simply specify the versions you want\nas an array,\n\n#### Running standalone with `systemd`\n\nA simple `systemd` init script might look something like:\n\n    # /usr/lib/systemd/system/puppet-validator.service\n    [Unit]\n    Description=Puppet Validator\n    After=network.target\n\n    [Service]\n    ExecStart=puppet-validator\n    Restart=on-failure\n    KillSignal=SIGINT\n\n    [Install]\n    WantedBy=multi-user.target\n\nCustomize the command line as needed. You might include a `--theme` or `--port`\nargument, or you might provide the full path to an `rvm` installed gem.\n\n### Bookmarklet\n\nIf you just want to validate Puppet code you see on a website, follow the\ninstructions on http://binford2k.com/content/2016/06/puppetlinter-dot-com\n\n","funding_links":[],"categories":["Softwares"],"sub_categories":["Linters"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpuppetlabs%2Fpuppet-validator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpuppetlabs%2Fpuppet-validator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpuppetlabs%2Fpuppet-validator/lists"}