% content_for :title, "Off-site backup" %>
Every night, after the verified database backup, the app copies it to Google Drive with every uploaded file not already there, so the records survive losing this server (AC 120-78B 3.2.7). The newest <%= Setting.integer("offsite_backups_kept") %> database copies are kept (<%= link_to "Settings", edit_admin_settings_path, class: "link" %>); uploaded files are copied once and never deleted there. The app can only see the files it created in your Drive.
Connected <%= @connection.account_email %>, by <%= @connection.connected_by&.display_name %> on <%= @connection.connected_at&.to_date %>. Folder: <%= OffsiteConnection::ROOT_FOLDER %>.
Uploaded files copied: <%= @files_copied %> of <%= @files_total %>.
The OAuth client is saved. Connect the Google account whose Drive will hold the backups.
<%= link_to "Connect Google Drive", connect_admin_offsite_backup_path, class: "btn-primary self-start", data: { turbo: false } %> <% else %>Not set up. Follow the steps to create a Google OAuth client, then connect.
<% end %> <%= form_with model: @connection, url: admin_offsite_backup_path, method: :patch, class: "space-y-3 border-t border-slate-100 pt-3" do |f| %> <%= f.field :client_id, label: "OAuth client ID", placeholder: "1234567890-abc.apps.googleusercontent.com" %> <%= f.field :client_secret, as: :password, label: "OAuth client secret", value: nil, placeholder: (@connection.client_secret.present? ? "saved (leave blank to keep)" : nil), autocomplete: "off" %> <%= f.submit "Save client", class: "btn-secondary" %> <% end %><%= @connection.redirect_uri %>
(It must be the address you open the app at; set APP_URL if it isn't.)Restoring: see <%= link_to "Help → Administration", help_page_path("administration", anchor: "restoring-from-google-drive"), class: "link" %>.