Repository navigation
Releases
Releases · GenericJam/mob_deliver_server
0.3.0
Upgrading
- Custom
MobDeliverServer.Storageimplementations: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/4callback 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.FSpublishes to the same channel used to both
succeed; the second now fails with{:error, {:locked, path}}. - An explicit
:issued_atthat 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 newissued_atis now one second after the replaced
manifest's when the clock isn't already later; an explicit
:issued_atthat isn't later is{:error, {:issued_at_not_after_current, issued_at, current}}, and a replaced
manifest without a readableissued_atstops the publish with
{:error, :unreadable_current_manifest}(--replace-unverifieddoesn'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-unverifiedpublishes 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 optionallock/4callback.
Storage.FSimplements 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 withoutlock/4must serialise publishes. issued_at: nilis{: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.Storagecallbacklock/4, implemented by
Storage.FSwith 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 onlymanifests/andbeam/. MobDeliverServer.Manifest.verify/2: checks a manifest body's signature
against a public key.
0.2.0
Added
mix mob_deliver.pruneandMobDeliverServer.Storage.FS.prune/2—
delete blobs no manifest in the store references any more (every app
and channel), after a grace period (--older-than, default7d, by
file mtime);--dry-runreports only. Blobs dropped by a publish
within the grace period are kept, so a device that fetched the
previous manifest can still download them. To know that,
Storage.FS.put_manifest/4now keeps the manifest it replaces under
replaced/<app>/<channel>/(pruned with the same grace period).mix mob_deliver.publishrefuses a signing key whose public half
doesn't match the project'sconfig :mob_deliver, :trusted_publish_key
(every device built from that config would reject the manifest with
:invalid_signature);--forcepublishes anyway with a warning, e.g.
during a key rotation. Projects without that setting aren't checked.MobDeliverServer.valid_app_version?/1andgate_fields/1.
Changed
min_app_versionmust be dotted numeric (1,1.4,1.4.0): the
form the client's forced-update gate compares.publish/2and the
task used to accept any non-empty string, which the client ignores
(leaving the gate open).force_update_afterwithout
min_app_versionis rejected too: the client ignores such a deadline.
The publish task checks both flags, with a message naming the flag,
before compiling.
Fixed
- README "Development" described mob_deliver as both a Hex and a path
dependency for the interop tests; it's Hex by default, or the checkout
atMOB_DELIVER_PATH.
0.1.0-dev
Added
MobDeliverServer.Manifest— canonical signing payload (wire format
v1), Ed25519sign/2, key file format
(ed25519-private:<base64 seed>) andpublic_key_string/1for the
client'strusted_publish_key. Pinned to mob_deliver's golden vector.MobDeliverServer.build/2— compiles amobile/tree against the
current code path into stripped, deterministic, content-addressed
BEAMs keyed like the manifest ("MyApp.HomeScreen",":my_mod").MobDeliverServer.publish/2— writes blobs, then the signed manifest,
through theMobDeliverServer.Storagebehaviour;
MobDeliverServer.Storage.FSships (beam/<sha>,
manifests/<app>/<channel>.json, temp-file + fsync + rename writes).MobDeliverServer.Plug—POST /manifestandGET /beam/:sha256
with the wire's content types and cache headers, strong ETags /304,
body-size limit, SHA and name validation before storage is touched.mix mob_deliver.gen.keyandmix mob_deliver.publish.- Interop tests against the real client (
MobDeliver.Manifest.verify/3,
MobDeliver.Client.fetch_manifest/1,fetch_beam/2).
0.1.0
Added
MobDeliverServer.Manifest— canonical signing payload (wire format
v1), Ed25519sign/2, key file format
(ed25519-private:<base64 seed>) andpublic_key_string/1for the
client'strusted_publish_key. Pinned to mob_deliver's golden vector.MobDeliverServer.build/2— compiles amobile/tree against the
current code path into stripped, deterministic, content-addressed
BEAMs keyed like the manifest ("MyApp.HomeScreen",":my_mod").MobDeliverServer.publish/2— writes blobs, then the signed manifest,
through theMobDeliverServer.Storagebehaviour;
MobDeliverServer.Storage.FSships (beam/<sha>,
manifests/<app>/<channel>.json, temp-file + fsync + rename writes).MobDeliverServer.Plug—POST /manifestandGET /beam/:sha256
with the wire's content types and cache headers, strong ETags /304,
body-size limit, SHA and name validation before storage is touched.mix mob_deliver.gen.keyandmix mob_deliver.publish.- Interop tests against the real client (
MobDeliver.Manifest.verify/3,
MobDeliver.Client.fetch_manifest/1,fetch_beam/2).