GitHub - fastruby/audit: Audit my Gemfile.lock!
Repository navigation
auditPublic
About
Audit my Gemfile.lock!
audit.fastruby.ioTopics
bundler bundler-auditResources
Readme Activity Custom propertiesStars
11 starsWatchers
10 watchingForks
0 forks Report repositoryBranches
Tags
Go to Branches page Go to Tags page
Latest commit
History
329 Commits
View commit history for this file.
Folders and files
Repository files navigation
Audit
Audit is a Rails application that allows users to check for vulnerabilities in their Gemfiles in an efficient and secure manner.
You can see it working in https://audit.fastruby.io
Requirements
- Ruby version
4.0.10(see.ruby-version/.tool-versions) - Node version
24.18.0(see.tool-versions) - Docker + Docker Compose (recommended for local development)
Getting started (Docker)
First, run:
bin/docker/setup && \ BUNDLE_GEMFILE=Gemfile.next bin/docker/setup
This will build both sets of images for each version of Rails. Then, to start the containers:
# For the current version of Rails bin/docker/start # For the next version of Rails BUNDLE_GEMFILE=Gemfile.next bin/docker/start
Note that the web_next service starts on port 3001 and not 3000.
Getting started (without Docker)
./bin/setup
rails server
You should be able to go to http://localhost:3000 and see the landing page.
Running tests
Inside Docker:
bin/docker/run bin/rails test
Without Docker:
rails test
Also run before opening a PR:
bundle exec rubocop
bundle exec reek
Dual-boot Rails upgrades
This app uses the next_rails dual-boot pattern to upgrade Rails one minor version at a time. Gemfile.next is a symlink to Gemfile; the if next? check in Gemfile switches the Rails constraint when Bundler is invoked with BUNDLE_GEMFILE=Gemfile.next (e.g. web_next above, or CI).
The Rails 8.1 upgrade is complete, so both boots currently target the same version (>= 8.1.0, < 8.2.0) and the if next? branches are identical. The scaffold is deliberately kept intact so the next hop only needs to bump the next? branch to the newer constraint, verify it under web_next/CI, then flip the default over in a "make it the default" commit. Check git log --grep="the default" for examples of that pattern in this repo's history.
Deploying / production notes
The app runs on Heroku (bundler-audit-production, stack heroku-26). Two things worth knowing if you're touching deploy config:
Aptfile+ theheroku-community/aptbuildpack are required.heroku-26's runtime image does not shipgitat all (only the build image does). This app needsgitat runtime becauseconfig/initializers/bundler_audit.rb(vialib/bundler_audit_database_preparer.rb) shells out togit clone/git pullto keep the localruby-advisory-dbcheckout (used bybundler-auditto scan uploadedGemfile.locks) up to date on every boot. Without the apt buildpack vendoringgitinto the slug, that clone silently fails and every audit request 500s withArgumentError ("... is not a directory"). The buildpack must be ordered beforeheroku/ruby(heroku buildpacks:add --index 1 heroku-community/apt) sogitis available for the whole build+runtime lifecycle.- If
BundlerAuditDatabasePreparerlogs[bundler-audit] Could not prepare ruby-advisory-db ..., that's the underlyinggitfailure surfacing -- checkheroku logsfor the full error rather than just the generic 500.
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/fastruby/audit . This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
When Submitting a Pull Request:
-
If your PR closes any open GitHub issues, please include
Closes #XXXXin your comment -
Please include a summary of the change and which issue is fixed or which feature is introduced.
-
If changes to the behavior are made, clearly describe what changes.
-
If changes to the UI are made, please include screenshots of the before and after.
License
The gem is available as open source under the terms of the MIT License .
Code of Conduct
Everyone interacting in the Audit project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct .
Sponsorship
Audit is maintained and funded by FastRuby.io . The names and logos for FastRuby.io are trademarks of The Lean Software Boutique LLC.
About
Audit my Gemfile.lock!
audit.fastruby.io