Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
173 commits
Select commit Hold shift + click to select a range
6147073
first commit
MatheusFontoura Sep 3, 2026
e3e8ae5
chore: scaffold Rails 8.1 app on Ruby 4.0
MatheusFontoura Sep 3, 2026
08e1d26
chore: extend RuboCop omakase with metrics and the Rails cops
MatheusFontoura Sep 3, 2026
71d69b5
test: parallelize, and merge SimpleCov results per worker
MatheusFontoura Sep 3, 2026
ebdcddc
ci: run scans, lint and the full suite on pull requests
MatheusFontoura Sep 3, 2026
817ca7b
chore: add a Docker Compose development environment
MatheusFontoura Sep 3, 2026
b323d1a
feat: add `rails generate authentication` output, unmodified
MatheusFontoura Sep 3, 2026
1f05636
feat: add full_name, role and an encrypted email to users
MatheusFontoura Sep 3, 2026
24ac863
feat: extract a Tailwind component layer for forms and buttons
MatheusFontoura Sep 3, 2026
36e9e08
feat: gate /admin and route each role to its landing page
MatheusFontoura Sep 3, 2026
506ae2f
refactor: use params.expect for the login form
MatheusFontoura Sep 3, 2026
e4b57bb
feat: let visitors register as plain users
MatheusFontoura Sep 3, 2026
56be315
fix: report the real validation error on a failed password reset
MatheusFontoura Sep 3, 2026
75d76ed
test: cover authentication, roles and self-registration
MatheusFontoura Sep 3, 2026
d1ac03c
fix: point Solid Cache at the cache database in development
MatheusFontoura Sep 3, 2026
ef39e92
chore: install Active Storage tables
MatheusFontoura Sep 3, 2026
c476ff4
feat: attach an avatar image to users
MatheusFontoura Sep 3, 2026
f2c6a0e
feat: add admin user CRUD, search, filter and role toggle
MatheusFontoura Sep 3, 2026
14affab
fix: centre signed-out screens in the viewport
MatheusFontoura Sep 3, 2026
c8b1a80
test: cover admin user management, role changes and pagination
MatheusFontoura Sep 3, 2026
341faa4
fix: never seed demo users outside development
MatheusFontoura Sep 3, 2026
ab46f45
fix: pin the name column while the users table scrolls on a phone
MatheusFontoura Sep 3, 2026
40865f5
refactor: use params.expect for the password reset too
MatheusFontoura Sep 3, 2026
e838bf1
ci: run system tests in bin/ci as well
MatheusFontoura Sep 3, 2026
e48262f
docs: add CLAUDE.md
MatheusFontoura Sep 3, 2026
2c804e2
feat: update the dashboard counters over Solid Cable
MatheusFontoura Sep 3, 2026
23bde4d
test: prove the dashboard counters update without a reload
MatheusFontoura Sep 3, 2026
2d90342
feat: add the SpreadsheetImport model and row reader
MatheusFontoura Sep 3, 2026
a40f4e1
feat: import users from a spreadsheet in the background
MatheusFontoura Sep 3, 2026
1615cad
feat: add the import upload form and live progress page
MatheusFontoura Sep 3, 2026
be4cb65
test: cover the spreadsheet import end to end
MatheusFontoura Sep 3, 2026
85a2a4f
feat: let a user edit and delete their own profile
MatheusFontoura Sep 3, 2026
59ef268
test: cover the profile a user manages themselves
MatheusFontoura Sep 3, 2026
526e1a3
chore: make config/deploy.yml deployable
MatheusFontoura Sep 3, 2026
3251cd9
perf: measure ZJIT against YJIT before enabling either
MatheusFontoura Sep 3, 2026
022e436
docs: write the README
MatheusFontoura Sep 3, 2026
41f1d6a
fix: eager-load avatars in the admin list
MatheusFontoura Sep 3, 2026
cf5c67a
fix: pace dashboard refreshes during an import
MatheusFontoura Sep 3, 2026
21a6d97
feat: disable submit buttons while the request is in flight
MatheusFontoura Sep 3, 2026
85007be
test: guard the regressions this review round turned up
MatheusFontoura Sep 3, 2026
794e456
docs: correct the debounce claim
MatheusFontoura Sep 3, 2026
fc1d4e5
fix: move the Stimulus value onto the controller element
MatheusFontoura Sep 3, 2026
8e8e2ad
docs: update the test counts
MatheusFontoura Sep 3, 2026
2236d39
fix: keep the last admin through every route that could remove one
MatheusFontoura Sep 3, 2026
276113e
fix: keep one bad row from aborting the whole import
MatheusFontoura Sep 3, 2026
01faaf9
refactor: replace the submit controller with data-turbo-submits-with
MatheusFontoura Sep 3, 2026
41f21de
feat: enforce a content security policy, and test XSS and CSRF
MatheusFontoura Sep 3, 2026
cfe88ec
test: replace two tests that could not fail
MatheusFontoura Sep 3, 2026
d1dd4c0
docs: fix the counts, the setup order and stale CLAUDE.md claims
MatheusFontoura Sep 3, 2026
07538db
fix: the CSP was blocking the import bar's inline width
MatheusFontoura Sep 4, 2026
b973984
fix: build pagination links from the filters, not the query string
MatheusFontoura Sep 4, 2026
7c0fb2f
fix: block self-demotion through the admin edit form too
MatheusFontoura Sep 4, 2026
75fa123
fix: mailer host, Puma workers, and the parallel-test lock timeout
MatheusFontoura Sep 4, 2026
138c199
test: cover the uniqueness race, blank rows and the rate limit
MatheusFontoura Sep 4, 2026
0bc6c47
docs: record the CSP and the url_for trap
MatheusFontoura Sep 4, 2026
0cb6b7b
fix: remove a retry_on that never runs
MatheusFontoura Sep 4, 2026
d1b80ee
chore: cut comments that narrate the code
MatheusFontoura Sep 4, 2026
5628ad5
chore: drop RuboCop config the project does not use
MatheusFontoura Sep 5, 2026
7c178b2
feat: show validation errors beside the field, and allow removing an …
MatheusFontoura Sep 5, 2026
03a9453
Merge pull request #1 from MatheusFontoura/feat/authentication
MatheusFontoura Sep 5, 2026
8307697
Merge the remaining phases into the task branch
MatheusFontoura Sep 5, 2026
4f4fb90
fix: take the rubyzip path traversal fix (CVE-2026-85396)
MatheusFontoura Sep 5, 2026
224ff7e
test: say why sign-in failed when the system helper times out
MatheusFontoura Sep 5, 2026
f9e8ae2
Merge pull request #7 from MatheusFontoura/feature/user-management
MatheusFontoura Sep 5, 2026
9b9e4a1
chore(deps): bump actions/checkout from 6 to 7
dependabot[bot] Sep 5, 2026
a07c7aa
chore(deps): bump actions/upload-artifact from 4 to 7
dependabot[bot] Sep 5, 2026
3037db4
chore(deps): bump actions/cache from 4 to 6
dependabot[bot] Sep 5, 2026
05cba06
fix: answer malformed input with a 4xx instead of a 500
MatheusFontoura Sep 5, 2026
ffbbff2
fix: check an avatar's bytes, not the name it arrived with
MatheusFontoura Sep 5, 2026
5828a6f
fix: say so when a spreadsheet has no email column
MatheusFontoura Sep 5, 2026
0295cad
test: cover the malformed input that used to raise
MatheusFontoura Sep 5, 2026
c963823
docs: fix the three traps in the deployment instructions
MatheusFontoura Sep 5, 2026
3a51f28
style: apply RuboCop autocorrect
MatheusFontoura Sep 5, 2026
9f4ad73
Merge pull request #12 from MatheusFontoura/feature/user-management
MatheusFontoura Sep 5, 2026
b4dc3d8
test: guard the avatar bytes, and put the sniffed stream back
MatheusFontoura Sep 5, 2026
b73a5e8
Merge pull request #13 from MatheusFontoura/feature/user-management
MatheusFontoura Sep 5, 2026
cf4937f
Merge pull request #8 from MatheusFontoura/dependabot/github_actions/…
MatheusFontoura Sep 5, 2026
aa2000e
Merge pull request #9 from MatheusFontoura/dependabot/github_actions/…
MatheusFontoura Sep 5, 2026
3c3992d
Merge pull request #10 from MatheusFontoura/dependabot/github_actions…
MatheusFontoura Sep 5, 2026
6330d3b
feat: deliver password reset mail for real
MatheusFontoura Sep 5, 2026
4879f87
fix: point reset links at the port the app actually serves
MatheusFontoura Sep 6, 2026
d9a2040
fix: stop the navbar pushing every signed-in page off a phone
MatheusFontoura Sep 6, 2026
80caf2b
fix: make form feedback consistent across every form
MatheusFontoura Sep 6, 2026
62fe47e
test: fail when a page is wider than the phone it is on
MatheusFontoura Sep 6, 2026
e84e09d
docs: update counts and note the responsive test
MatheusFontoura Sep 6, 2026
b635fed
Merge pull request #14 from MatheusFontoura/feature/user-management
MatheusFontoura Sep 6, 2026
ab7a6c0
fix: let an admin reach every row action on a phone
MatheusFontoura Sep 6, 2026
77dcb7c
fix: give status badges a colour that means something
MatheusFontoura Sep 6, 2026
a1a6605
fix: show each validation error once, next to the field that caused it
MatheusFontoura Sep 6, 2026
754dec9
docs: update the test counts
MatheusFontoura Sep 6, 2026
36e6d23
Merge pull request #15 from MatheusFontoura/feature/user-management
MatheusFontoura Sep 6, 2026
2693ade
fix: sign other browsers out when a password changes
MatheusFontoura Sep 6, 2026
c3eb437
perf: hash the import placeholder at bcrypt's minimum cost
MatheusFontoura Sep 6, 2026
5294da4
fix: stop listing row errors past two hundred
MatheusFontoura Sep 6, 2026
312e15f
perf: index users on full_name
MatheusFontoura Sep 6, 2026
a3d2932
docs: record the import cap, the session rules and the browser floor
MatheusFontoura Sep 6, 2026
ca86a95
Merge pull request #16 from MatheusFontoura/feature/user-management
MatheusFontoura Sep 6, 2026
1958639
fix: deliver development mail to the Mailpit container
MatheusFontoura Sep 6, 2026
5ac84ef
fix: keep the card surface under the scrolling table
MatheusFontoura Sep 6, 2026
3cf744a
fix: name the email field for password managers
MatheusFontoura Sep 6, 2026
12a17bc
fix: tie the import copy to the state it describes
MatheusFontoura Sep 6, 2026
bf0af6a
chore: balance the user filter bar
MatheusFontoura Sep 6, 2026
43d6f2d
test: give five assertions the power to fail
MatheusFontoura Sep 6, 2026
b1eb435
refactor: inline the uploaded-file constant
MatheusFontoura Sep 6, 2026
8a9d7f5
fix: line up the filter controls, the page label and the field errors
MatheusFontoura Sep 6, 2026
19c1116
test: give the phone-sized window back
MatheusFontoura Sep 6, 2026
baaf9b7
docs: correct three claims the code does not support
MatheusFontoura Sep 6, 2026
14282a9
test: cover the size caps, the second LIKE wildcard and the failure r…
MatheusFontoura Sep 6, 2026
097eb69
docs: say what the gates did not catch
MatheusFontoura Sep 6, 2026
5c5032a
Merge pull request #17 from MatheusFontoura/chore/final-qa
MatheusFontoura Sep 6, 2026
2411248
fix: name the LIKE escape character so a search for "100%" works
MatheusFontoura Sep 6, 2026
c21bf87
fix: give truncate a width to truncate to
MatheusFontoura Sep 6, 2026
c6b24e0
fix: reject an empty spreadsheet before it reaches the queue
MatheusFontoura Sep 6, 2026
b139286
chore: correct a comment, an assertion and an unused local
MatheusFontoura Sep 6, 2026
69045df
chore: drop generator leftovers nothing reaches
MatheusFontoura Sep 6, 2026
5725997
Merge pull request #18 from MatheusFontoura/fix/search-escape-and-lon…
MatheusFontoura Sep 6, 2026
10af4c7
fix: give the reset form the username it is missing
MatheusFontoura Sep 6, 2026
3ee1bf6
fix: trim the padding off a name
MatheusFontoura Sep 6, 2026
ab3fe4c
Merge pull request #19 from MatheusFontoura/fix/reset-form-username
MatheusFontoura Sep 6, 2026
172aa7a
docs: say that sanitize_sql_like needs the ESCAPE clause
MatheusFontoura Sep 8, 2026
d531e34
Merge pull request #20 from MatheusFontoura/docs/escape-clause
MatheusFontoura Sep 8, 2026
5786711
fix: add the Active Record encryption keys to the credentials
MatheusFontoura Sep 8, 2026
c31b969
chore: cut comments that restate the line under them
MatheusFontoura Sep 8, 2026
9ff4214
docs: document the encryption keys, drop the moral from the disclosure
MatheusFontoura Sep 8, 2026
69835f9
Merge pull request #21 from MatheusFontoura/chore/production-credenti…
MatheusFontoura Sep 8, 2026
359d361
fix: refuse with See Other so the client drops the method
MatheusFontoura Sep 8, 2026
f058d07
docs: follow the suite count
MatheusFontoura Sep 8, 2026
ca8623a
Merge pull request #22 from MatheusFontoura/fix/refusal-must-not-carr…
MatheusFontoura Sep 8, 2026
7095e25
docs: describe the process, not just who typed
MatheusFontoura Sep 9, 2026
58f6b86
Merge pull request #23 from MatheusFontoura/docs/disclosure-frames-th…
MatheusFontoura Sep 9, 2026
5dbe846
test: give Capybara a wait that survives twelve parallel browsers
MatheusFontoura Sep 9, 2026
5ea5b9e
fix: make the reset form's username field one Chrome will accept
MatheusFontoura Sep 9, 2026
fd74c1a
fix: keep a long name from taking the whole edit screen
MatheusFontoura Sep 9, 2026
c260c30
Merge pull request #24 from MatheusFontoura/fix/flaky-system-tests
MatheusFontoura Sep 9, 2026
c5dd7b3
fix: refuse an empty password instead of announcing a reset
MatheusFontoura Sep 10, 2026
2293b52
test: stop comparing two bcrypt digests and calling it entropy
MatheusFontoura Sep 10, 2026
c2f2057
test: restore one assertion and give three others something to prove
MatheusFontoura Sep 10, 2026
9498f30
test: cover the cable connection and stop excluding it from coverage
MatheusFontoura Sep 10, 2026
1afd29f
fix: answer every refusal with See Other, including the rate limits
MatheusFontoura Sep 10, 2026
b0ebf51
chore: drop an unused gem, a false comment and two directories from t…
MatheusFontoura Sep 10, 2026
1623fa8
docs: correct four claims the code stopped supporting
MatheusFontoura Sep 10, 2026
0e4590f
Merge pull request #25 from MatheusFontoura/fix/audit-findings
MatheusFontoura Sep 10, 2026
5209838
fix: show the reset form's errors where every other form shows them
MatheusFontoura Sep 10, 2026
b3210df
Merge pull request #26 from MatheusFontoura/fix/reset-form-errors
MatheusFontoura Sep 10, 2026
193b126
docs: follow the suite count
MatheusFontoura Sep 10, 2026
a07f90b
Merge pull request #27 from MatheusFontoura/docs/count
MatheusFontoura Sep 10, 2026
34c0ddf
chore(deps): bump bootsnap from 1.25.0 to 1.26.0
dependabot[bot] Sep 10, 2026
34c58b3
chore(deps-dev): bump simplecov from 1.1.1 to 1.2.0
dependabot[bot] Sep 10, 2026
4b76947
Merge pull request #28 from MatheusFontoura/dependabot/bundler/bootsn…
MatheusFontoura Sep 11, 2026
95d6bb5
Merge pull request #29 from MatheusFontoura/dependabot/bundler/simple…
MatheusFontoura Sep 11, 2026
4279fa5
docs: follow the SimpleCov bump
MatheusFontoura Sep 11, 2026
9f8635e
Merge pull request #30 from MatheusFontoura/docs/simplecov-version
MatheusFontoura Sep 11, 2026
1e7bc11
fix: give a blank email one reason instead of two
MatheusFontoura Sep 11, 2026
45f1b6e
fix: associate the avatar error with its field
MatheusFontoura Sep 11, 2026
4a7f4eb
test: cover the import validation nothing reached
MatheusFontoura Sep 11, 2026
da6f75c
docs: follow the suite count
MatheusFontoura Sep 11, 2026
ddeb4cd
Merge pull request #31 from MatheusFontoura/fix/one-reason-per-field
MatheusFontoura Sep 11, 2026
149a6c2
fix: welcome a new account instead of refusing it
MatheusFontoura Sep 14, 2026
a56cfc5
fix: put the row actions back on the phone screen
MatheusFontoura Sep 14, 2026
dce166a
fix: give Kamal the registry password it asks for
MatheusFontoura Sep 14, 2026
e1bd8ff
docs: correct what the instructions promised and did not deliver
MatheusFontoura Sep 14, 2026
9adf0a6
test: make the phone action test fail when the actions leave the screen
MatheusFontoura Sep 14, 2026
82bdd2b
docs: make the JIT measurement reproducible without credentials
MatheusFontoura Sep 14, 2026
1f460e8
test: state the rule the phone assertion enforces, not its history
MatheusFontoura Sep 14, 2026
a8591ce
docs: re-wrap the paragraphs the last edits left ragged
MatheusFontoura Sep 14, 2026
df70b84
refactor: cut the comments the code already says, and a Puma line tha…
MatheusFontoura Sep 14, 2026
0752ad3
docs: trim the disclosure to what it discloses
MatheusFontoura Sep 14, 2026
3e236e4
fix: switch the users table to a table only once one fits
MatheusFontoura Sep 14, 2026
b29b4e6
fix: raise two text colours to AA and unstack the avatar field
MatheusFontoura Sep 14, 2026
3891057
fix: keep the imports table inside the card, and fix the seed split
MatheusFontoura Sep 14, 2026
a5629f4
refactor: say four comments a different way
MatheusFontoura Sep 14, 2026
7950c73
Merge pull request #32 from MatheusFontoura/fix/final-polish
MatheusFontoura Sep 14, 2026
d4f12be
Merge the brief repository, keeping this submission's README
MatheusFontoura Sep 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# See https://docs.docker.com/engine/reference/builder/#dockerignore-file for more about ignoring files.

# Ignore git directory.
/.git/
/.gitignore

# Ignore bundler config.
/.bundle

# Ignore all environment files.
/.env*

# Ignore all default key files.
/config/master.key
/config/credentials/*.key

# Ignore all logfiles and tempfiles.
/log/*
/tmp/*
!/log/.keep
!/tmp/.keep

# Ignore pidfiles, but keep the directory.
/tmp/pids/*
!/tmp/pids/.keep

# Ignore storage (uploaded files in development and any SQLite databases).
/storage/*
!/storage/.keep
/tmp/storage/*
!/tmp/storage/.keep

# Ignore assets.
/node_modules/
/app/assets/builds/*
!/app/assets/builds/.keep
/public/assets

# Ignore CI service files.
/.github

# Ignore Kamal files.
/config/deploy*.yml
/.kamal

# Ignore development files
/.devcontainer

# Ignore Docker-related files
/.dockerignore
/Dockerfile*

# Not needed in the image.
/coverage/
/test/
9 changes: 9 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# See https://git-scm.com/docs/gitattributes for more about git attribute files.

# Mark the database schema as having been generated.
db/schema.rb linguist-generated

# Mark any vendored files as having been vendored.
vendor/* linguist-vendored
config/credentials/*.yml.enc diff=rails_credentials
config/credentials.yml.enc diff=rails_credentials
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 2
updates:
- package-ecosystem: bundler
directory: "/"
schedule:
interval: weekly
open-pull-requests-limit: 10
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: weekly
open-pull-requests-limit: 10
101 changes: 101 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: CI

on:
pull_request:
push:
branches: [ master ]

jobs:
scan_ruby:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v7

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true

- name: Scan for common Rails security vulnerabilities using static analysis
run: bin/brakeman --no-pager

- name: Scan for known security vulnerabilities in gems used
run: bin/bundler-audit

scan_js:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v7

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true

- name: Scan for security vulnerabilities in JavaScript dependencies
run: bin/importmap audit

lint:
runs-on: ubuntu-latest
env:
RUBOCOP_CACHE_ROOT: tmp/rubocop
steps:
- name: Checkout code
uses: actions/checkout@v7

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true

- name: Prepare RuboCop cache
uses: actions/cache@v6
env:
DEPENDENCIES_HASH: ${{ hashFiles('.ruby-version', '**/.rubocop.yml', 'Gemfile.lock') }}
with:
path: ${{ env.RUBOCOP_CACHE_ROOT }}
key: rubocop-${{ runner.os }}-${{ env.DEPENDENCIES_HASH }}-${{ github.ref_name == github.event.repository.default_branch && github.run_id || 'default' }}
restore-keys: |
rubocop-${{ runner.os }}-${{ env.DEPENDENCIES_HASH }}-

- name: Lint code for consistent style
run: bin/rubocop -f github

# Unit, integration and system tests run in a single job on purpose: SimpleCov's
# 90% floor is only meaningful when measured over the whole suite at once.
test:
runs-on: ubuntu-latest
steps:
- name: Install packages
run: sudo apt-get update && sudo apt-get install --no-install-recommends -y libvips

- name: Checkout code
uses: actions/checkout@v7

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true

- name: Run the full test suite
env:
RAILS_ENV: test
run: bin/rails db:test:prepare test:all

- name: Keep screenshots from failed system tests
uses: actions/upload-artifact@v7
if: failure()
with:
name: screenshots
path: ${{ github.workspace }}/tmp/screenshots
if-no-files-found: ignore

- name: Publish coverage report
uses: actions/upload-artifact@v7
if: always()
with:
name: coverage
path: ${{ github.workspace }}/coverage
if-no-files-found: ignore
41 changes: 41 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
#
# Temporary files generated by your text editor or operating system
# belong in git's global ignore instead:
# `$XDG_CONFIG_HOME/git/ignore` or `~/.config/git/ignore`

# Ignore bundler config.
/.bundle

# Ignore all environment files.
/.env*

# Ignore all logfiles and tempfiles.
/log/*
/tmp/*
!/log/.keep
!/tmp/.keep

# Ignore pidfiles, but keep the directory.
/tmp/pids/*
!/tmp/pids/
!/tmp/pids/.keep

# Ignore storage (uploaded files in development and any SQLite databases).
/storage/*
!/storage/.keep
/tmp/storage/*
!/tmp/storage/
!/tmp/storage/.keep

/public/assets

# Ignore key files for decrypting credentials and more.
/config/*.key


/app/assets/builds/*
!/app/assets/builds/.keep

# Ignore coverage reports.
/coverage
20 changes: 20 additions & 0 deletions .kamal/secrets
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Secrets defined here are available for reference under registry/password, env/secret, builder/secrets,
# and accessories/*/env/secret in config/deploy.yml. All secrets should be pulled from either
# password manager, ENV, or a file. DO NOT ENTER RAW CREDENTIALS HERE! This file needs to be safe for git.

# Example of extracting secrets from 1password (or another compatible pw manager)
# SECRETS=$(kamal secrets fetch --adapter 1password --account your-account --from Vault/Item KAMAL_REGISTRY_PASSWORD RAILS_MASTER_KEY)
# KAMAL_REGISTRY_PASSWORD=$(kamal secrets extract KAMAL_REGISTRY_PASSWORD ${SECRETS})
# RAILS_MASTER_KEY=$(kamal secrets extract RAILS_MASTER_KEY ${SECRETS})

# Example of extracting secrets from Rails credentials
# KAMAL_REGISTRY_PASSWORD=$(rails credentials:fetch kamal.registry_password)

# Use a GITHUB_TOKEN if private repositories are needed for the image
# GITHUB_TOKEN=$(gh config get -h github.com oauth_token)

# Grab the registry password from ENV
KAMAL_REGISTRY_PASSWORD=$KAMAL_REGISTRY_PASSWORD

# Improve security by using a password manager. Never check config/master.key into git!
RAILS_MASTER_KEY=$(cat config/master.key)
82 changes: 82 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Omakase plus the framework cops it leaves out, the Performance and Minitest
# plugins, and complexity ceilings.
inherit_gem:
rubocop-rails-omakase: rubocop.yml

plugins:
- rubocop-minitest
- rubocop-performance

AllCops:
TargetRubyVersion: 4.0
NewCops: enable
Exclude:
- bin/**/*
- db/schema.rb
- db/*_schema.rb
- db/migrate/*_create_active_storage_tables.active_storage.rb
- vendor/**/*
- node_modules/**/*
- storage/**/*
- tmp/**/*

Metrics/AbcSize:
Max: 17
Metrics/BlockLength:
AllowedMethods: [ configure, draw, included, class_methods ]
Max: 30
Metrics/ClassLength:
Max: 120
Exclude:
- test/**/*
Metrics/CyclomaticComplexity:
Max: 7
Metrics/MethodLength:
Max: 15
Exclude:
- db/migrate/**/*
- test/**/*
Metrics/ModuleLength:
Max: 120
Metrics/ParameterLists:
Max: 5
Metrics/PerceivedComplexity:
Max: 8

Layout/LineLength:
Max: 120
AllowedPatterns: [ '\A#' ]
Exclude:
- db/migrate/**/*

# Omakase stays quiet about naming and dead code.
Lint/UselessAssignment:
Enabled: true
Naming/PredicateMethod:
Enabled: true
Style/RedundantReturn:
Enabled: true
Style/GuardClause:
Enabled: true
Style/IfUnlessModifier:
Enabled: false

Rails/Delegate:
Enabled: true
Rails/HasManyOrHasOneDependent:
Enabled: true
Rails/InverseOf:
Enabled: true
Rails/OutputSafety:
Enabled: true
Rails/SkipsModelValidations:
Enabled: true
# update_counters is how the import reports progress without loading each row.
AllowedMethods: [ touch, update_counters ]
Rails/UniqueValidationWithoutIndex:
Enabled: true
Rails/Validation:
Enabled: true

Minitest/MultipleAssertions:
Max: 12
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4.0.6
Loading