mirror of
https://github.com/rickbarrette/simple-aircraft-manager-rails.git
synced 2026-11-17 15:50:36 -05:00
- Admin → Off-site Backup: connect a Google account with your own OAuth client (drive.file scope; refresh token and secret encrypted) - Nightly after the verified database backup: upload the gzipped snapshot (newest N kept, Settings) and every uploaded file not yet copied - Restore test downloads the newest copy, opens and checks it, and checks sampled files against their checksums; failures emailed to admins - About, procedures document, policy completeness and audits use it - offsite:restore_files rake task; restore steps in the admin guide Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
43 lines
2.7 KiB
ERB
43 lines
2.7 KiB
ERB
<% content_for :title, "Settings" %>
|
|
<h1 class="mb-4 text-2xl font-bold">Settings</h1>
|
|
<%= form_with url: admin_settings_path, method: :patch, class: "card card-body max-w-xl space-y-4" do |f| %>
|
|
<% if @errors.present? %>
|
|
<div class="rounded-md bg-red-50 p-3 text-sm text-red-700 ring-1 ring-red-200" role="alert">
|
|
<ul class="list-disc pl-5"><% @errors.each do |e| %><li><%= e %></li><% end %></ul>
|
|
</div>
|
|
<% end %>
|
|
|
|
<h2 class="card-title">Uploads</h2>
|
|
<% upload = Setting::INTEGERS["max_upload_mb"] %>
|
|
<div>
|
|
<%= label_tag "settings[max_upload_mb]", upload[:label], class: "label" %>
|
|
<%= number_field_tag "settings[max_upload_mb]", @values["max_upload_mb"], id: "settings_max_upload_mb",
|
|
min: upload[:in].min, max: upload[:in].max, step: 1, required: true, class: "input w-32" %>
|
|
<p class="hint">
|
|
The largest single file anyone can upload: documents, squawk photos and bulk uploads. Default <%= upload[:default] %> MB, up to <%= upload[:in].max %> MB.
|
|
</p>
|
|
<p class="hint">
|
|
A proxy in front of the app can have its own, smaller limit. Cloudflare's proxy stops at 100 MB on its free plan; nginx needs <code>client_max_body_size</code>.
|
|
Logbook transcription with Claude reads PDFs up to <%= LogbookTranscriber::MAX_PDF_BYTES / 1.megabyte %> MB and images up to <%= LogbookTranscriber::MAX_IMAGE_BYTES / 1.megabyte %> MB, whatever this is set to.
|
|
</p>
|
|
</div>
|
|
|
|
<h2 class="card-title pt-2">Backups</h2>
|
|
<% kept = Setting::INTEGERS["backups_kept"] %>
|
|
<div>
|
|
<%= label_tag "settings[backups_kept]", kept[:label], class: "label" %>
|
|
<%= number_field_tag "settings[backups_kept]", @values["backups_kept"], id: "settings_backups_kept", min: kept[:in].min, max: kept[:in].max,
|
|
step: 1, required: true, class: "input w-32" %>
|
|
<p class="hint">A verified copy of the database is made nightly in storage/backups; this many of the newest are kept. Back up off the server too: <%= link_to "Off-site Backup", admin_offsite_backup_path, class: "link" %>.</p>
|
|
</div>
|
|
<% okept = Setting::INTEGERS["offsite_backups_kept"] %>
|
|
<div>
|
|
<%= label_tag "settings[offsite_backups_kept]", okept[:label], class: "label" %>
|
|
<%= number_field_tag "settings[offsite_backups_kept]", @values["offsite_backups_kept"], id: "settings_offsite_backups_kept", min: okept[:in].min, max: okept[:in].max,
|
|
step: 1, required: true, class: "input w-32" %>
|
|
<p class="hint">With off-site backup to Google Drive, this many of the newest nightly database copies are kept there. Uploaded files are copied once and kept.</p>
|
|
</div>
|
|
|
|
<div class="flex gap-2"><%= f.submit "Save Settings", class: "btn-primary" %><%= link_to "Cancel", admin_about_path, class: "btn-secondary" %></div>
|
|
<% end %>
|