BERESTA

Help

Sync through S3: a Selectel bucket

An S3 bucket is the fastest road for sync between devices, though it takes longer to set up than WebDAV. Below are the steps for Selectel. The fields in Beresta are the same for Backblaze B2, Cloudflare R2, MinIO and any other S3-compatible storage.

Who this is for

People who run Beresta on different systems — Mac, iPhone, iPad, Windows, Linux, Android — and are ready to spend about fifteen minutes in a cloud console once. This is how my own devices sync: through a Selectel bucket.

Your library lives on each device, and the bucket is the road between them. Book cards, highlights, shelves, reading places and covers travel along it. A book’s file arrives when you ask for it on the book’s card. Everything in the bucket except one identity file, beresta-sync.json, is encrypted. Beresta encrypts it on your device with your encryption passphrase. The passphrase itself never leaves the device.

What you need

  • A Selectel account.
  • Fifteen minutes.
  • An encryption passphrase — think of one in advance. It is the same on all your devices.
  • Pen and paper: on the first connection Beresta shows a recovery code.

Step 1. The bucket

In the Selectel console: Products → S3 → Buckets → Create bucket.

  • Name: Latin letters and no dots, for example beresta-obmen.
  • Region: one close to you. The example below uses kz-1 (Kazakhstan).
  • Type: private. A public bucket would hand its contents to anyone with the address.
  • Storage class: standard. Beresta looks into the bucket on every exchange, and cold storage is slower and dearer for frequent reads.
  • Object versioning: leave it off. Sync overwrites its own files, and with versions the bucket would turn into an archive you pay for.
  • Object Lock: leave it off. It forbids deleting, and Beresta removes files from the bucket once they have reached every device.
  • Addressing. Beresta addresses the bucket in path style: https://endpoint/bucket/file. If the console lets you choose addressing, choose path style. If there is no choice, leave it: the check in step 5 shows whether all is well.

Step 2. A service user

Access management → Users → create a service user, for example beresta-obmen, with the s3.user role in the project that holds the bucket. Note its UID, 32 characters; you will need it in step 4.

A separate user keeps the sync key from opening anything but this bucket.

Step 3. An S3 key

For that user, in the S3 keys block press Add key, choose the same project and press Generate. The console shows two values:

  • Access key: in Beresta this is “Key ID”;
  • Secret key: in Beresta this is “Application key” (“Access key” on Windows and Linux).

The console shows the secret key only once. Save both values in your password manager right away.

Step 4. The bucket access policy

The s3.user role on its own does not let you work with files in the bucket; the bucket policy does. Open the bucket → Settings → Access policy and paste the text below. Replace ЗДЕСЬ_UID with the UID from step 2, and beresta-obmen with your bucket name if it is different.

{
  "Version": "2012-10-17",
  "Id": "beresta-obmen-v1",
  "Statement": [
    {
      "Sid": "BerestaObmenListBucket",
      "Effect": "Allow",
      "Principal": {"AWS": "ЗДЕСЬ_UID"},
      "Action": ["s3:ListBucket", "s3:GetBucketLocation"],
      "Resource": ["arn:aws:s3:::beresta-obmen"]
    },
    {
      "Sid": "BerestaObmenObjects",
      "Effect": "Allow",
      "Principal": {"AWS": "ЗДЕСЬ_UID"},
      "Action": ["s3:GetObject", "s3:PutObject", "s3:DeleteObject"],
      "Resource": ["arn:aws:s3:::beresta-obmen/*"]
    }
  ]
}

These are exactly the rights sync needs: to list files, read, put and delete.

Step 5. Connect the first device

  1. Open the sync settings:
    • Mac: Beresta’s settings (⌘ ,) → Sync → the Cloud storage block.
    • iPhone and iPad: the Settings gear in the library → the Cloud storage block.
    • Windows: the Settings button on the shelf toolbar → Sync → the Connect a storage group.
    • Linux: Sync Between Devices… in the main menu → the Connect a storage group.
    • Android (beta): the Sync button at the top of the shelf.
  2. Choose S3: S3-compatible in the Transport switch on Mac, iPhone and iPad, S3 or B2 in the Storage list on Windows and Linux, the S3 button on Android.
  3. Fill in the fields. The grey examples in them come from Backblaze B2; enter your own values.
    • Endpoint: https://s3.kz-1.srvstorage.kz for the kz-1 region or https://s3.ru-3.storage.selcloud.ru for ru-3. Always with https://.
    • Region: kz-1 or ru-3, the same as in the endpoint.
    • Bucket: the bucket name from step 1.
    • Key ID: the access key.
    • Application key (Access key on Windows and Linux): the secret key.
    • Encryption passphrase: your passphrase.
  4. Press Connect.
  5. Beresta shows a recovery code: 64 characters in groups of eight. Write it down on paper and keep it apart from the device. On Mac, iPhone, iPad and Android the window closes with Done only after you tick “I wrote the code down”.

How to check that it works

  1. Press Check storage. Beresta puts a test file into the bucket, reads it back, finds it in the listing and deletes it, and shows the time of each step under the button: “write”, “read”, “list”, “delete”. If something fails, you will see “Check failed: …” with the reason. Connecting on its own only tries reading and writing, so missing rights to list and delete show up only with this button.
  2. Press Sync Now. After the exchange you will see when it happened and how many edits were sent and received.

Step 6. Connect your other devices

Wait until the first device has finished its first exchange. Then repeat step 5 on each other device with the same endpoint, region, bucket, keys and the same passphrase, character for character. If you do not remember the passphrase, turn on I have a recovery code and type the code from paper: dashes and case do not matter. A storage has one recovery code, and a new device does not create another.

The first exchange on a new device takes longer than usual: it receives the whole library. A book that is not on the device arrives when you press Download on its card.

When something is wrong

  • “The field “Endpoint” is not an address”. The endpoint does not start with https://.
  • “The storage refused the access key”. Check the key ID, the key itself (no spaces at the ends) and the bucket policy from step 4. The Region field must match the region in the endpoint.
  • “Check failed” on listing or deleting. The bucket policy lacks a right — compare it with step 4 — or Object Lock is on.
  • “This storage already holds someone else’s unencrypted exchange”. The bucket is not empty. Use an empty one.
  • “The passphrase does not match this storage”. The first device connected with a different passphrase. Enter the same one, or sign in with the recovery code.
  • “Storage did not answer: …”. The bucket did not respond over the network; Beresta names the reason after the colon. Check the endpoint and your internet connection, then press Connect again.

What next

  • Keep the recovery code apart from your devices. If you lose both the passphrase and the code, no one can decrypt the library in the bucket, including me. The books on your devices are not affected.
  • To see the code again, enter your passphrase under Show recovery code in the sync settings on iPhone, iPad, Windows, Linux and Android.
  • Keep all books in the cloud. On Mac, Windows, Linux and Android there is a “Keep all books in the cloud” switch: the device uploads every book file to the bucket, and your other devices fetch them right away instead of waiting for it. You pay for the space the bucket uses.
  • Font size, margins and column width are kept per device by default. To make them match, turn on “Sync font size, margins and column width” in the sync settings.
  • Rather not deal with a bucket? There is sync through WebDAV with Koofr or Beeline Cloud, and for people with only a Mac, iPhone and iPad, through iCloud Drive.

Updated November 25, 2026.