Maintenance commands: doctor, records check, restore, sign out all, more

- sam:doctor: health report (secret key, address, HTTPS, SMTP and SSO
  reachable, Google Drive, migrations, disk, jobs, backup/check/off-site/
  procedures/audit recency); exits 1 on a failure
- records:check: backup now + history and signature check; exits 1 on a problem
- backups:list / backups:restore[file]: checks the copy (nightly or Drive
  .gz), refuses while the server runs, moves the current DB aside, asks
  (CONFIRM=yes to skip)
- users:sign_out_all, sam:records_package[tail], email:test[address],
  offsite:backup, offsite:restore_test
- Admin guide: maintenance commands table, restore steps use backups:restore

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rickyandClaude Opus 5.5 committed 2026-11-07 16:42:52 -05:00
1 parent 20fe485f10
commit 1412470cd5
11 files changed
+434 -11

No files matched your search

+8
View File
@@ -65,6 +65,14 @@ class AccountRecovery
[ user, password ]
end
# Ends every session of every user (suspected compromise): everyone signs
# in again, through the lockout and two-factor checks.
def self.sign_out_all!
count = Session.delete_all
Rails.logger.warn("[account recovery] all #{count} sessions ended from the command line")
count
end
def self.generate_password = SecureRandom.alphanumeric(20).scan(/.{5}/).join("-")
def self.log(user, what) = Rails.logger.warn("[account recovery] #{user.email_address}: #{what} from the command line")