You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
Upgrading
Custom MobDeliverServer.Storage implementations: get_manifest/3
must return {:error, :not_found} for a missing manifest. A publish now
reads the current manifest (twice: before uploading blobs and again
before writing the manifest); any other error stops it with {:error, {:get_manifest, reason}}. The publisher therefore needs read
access to the storage, not only write access.
Storage without the new optional lock/4 callback keeps working, but
must serialise publishes to one app and channel itself.
Rotating keys over an existing manifest now needs --replace-unverified (replace_unverified: true): the current
manifest isn't signed by the new key. That's in addition to --force,
which is still needed when the new key doesn't match the project's trusted_publish_key.
A publish killed mid-run can leave Storage.FS's .locks/<app>/<channel> file behind under the publish directory;
every later publish to that channel fails with {:error, {:locked, path}} until you delete that file (rm <out>/.locks/<app>/<channel>)
once the process named in it is gone.
Overlapping Storage.FS publishes to the same channel used to both
succeed; the second now fails with {:error, {:locked, path}}.
An explicit :issued_at that isn't later than the current manifest's is
refused with {:error, {:issued_at_not_after_current, issued_at, current}}.
Changed
A publish is dated after the manifest it replaces (MOB-486). mob_deliver
0.4.0 and later devices refuse a manifest that isn't newer than the
newest they've verified (its replay floor), so two publishes in one second, or one after a publish dated
in the future, would have been refused by every device that saw the
previous one. The new issued_at is now one second after the replaced
manifest's when the clock isn't already later; an explicit :issued_at that isn't later is {:error, {:issued_at_not_after_current, issued_at, current}}, and a replaced
manifest without a readable issued_at stops the publish with {:error, :unreadable_current_manifest} (--replace-unverified doesn't
get past it: fix or remove that manifest). Only a
replaced manifest the publishing key signed for the same app and
channel dates the new one: any other (unsigned, another key's, another
app's or channel's — e.g. planted on a static host's branch, dated
years ahead to hold back every later publish) stops the publish with {:error, {:unverified_current_manifest, reason}} and no manifest is
written (blobs uploaded before a re-check found it stay, unreferenced,
for prune). replace_unverified: true / mix mob_deliver.publish --replace-unverified publishes over it, dated by the clock alone (a
key rotation, a manifest replaced on purpose).
A publish reads the manifest it replaces, writes its blobs and its
manifest under the storage's new optional lock/4 callback. Storage.FS implements it with an exclusive lock file
(.locks/<app>/<channel>): an overlapping publish to the same channel
is {:error, {:locked, path}} instead of racing to an older-dated
current manifest. Storage without lock/4 must serialise publishes.
issued_at: nil is {:error, {:invalid, :issued_at, nil}} (it used to
publish a manifest without one, or raise).
Added
replace_unverified: true / mix mob_deliver.publish --replace-unverified: publish over a current manifest the publishing
key didn't sign for this app and channel.
Optional MobDeliverServer.Storage callback lock/4, implemented by Storage.FS with a lock file.
README: static hosting (GitHub Pages, a bucket) for mob_deliver 0.4.1's endpoint_type: :static: the publish directory served as it is, what
that makes public, and to deploy only manifests/ and beam/.
MobDeliverServer.Manifest.verify/2: checks a manifest body's signature
against a public key.