A root exports one of its personas (a job) as Mastodon's account archive, so other servers' importers read it: the actor with its public key only, its own posts and boosts with their media, likes, bookmarks and Mastodon's CSV files, plus PrivaPub's filters, followed hashtags, notification policy, pins, scheduled and located posts; nothing of its root, its siblings, its keys or anyone's token. A ticket link downloads it, for a week. An archive (PrivaPub's or Mastodon's) uploaded in pieces is imported into a persona in a job, the parts the root picks, with progress and a stop. SafeArchive refuses links, escaping paths, duplicates, bombs and oversized items, and reads the outbox one item at a time. Imported posts are delivered to no one, put in no home and notify nobody, yet show on the profile, outbox, hashtags and search; back home a post keeps its id, from another actor it gets one of its date and ImportedFromURI, so importing twice changes nothing. Relationships go through the existing services; located, scheduled and likes only when asked; followers never. tools/pasture/scenarios/persona-archive.sh imports mastouser's real Mastodon archive (156 posts, 24 pictures) into a persona Mastodon follows: Mastodon receives none of it, and a second import changes nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LsXgEaXee4GCU1hwYgPJXw
49 lines
1.7 KiB
C#
49 lines
1.7 KiB
C#
namespace PrivaPub.ClientModels.User
|
|
{
|
|
// A persona's archive (owner decision 2026-10-07): made for it to take away, in Mastodon's account-archive layout, and
|
|
// restored into it. States: none, queued, running, ready (export) or done (import), failed, stopped.
|
|
public class ViewPersonaArchive
|
|
{
|
|
public string ExportState { get; set; }
|
|
public DateTime? ExportAskedAt { get; set; }
|
|
public DateTime? ExportReadyAt { get; set; }
|
|
public DateTime? ExportExpiresAt { get; set; }
|
|
public long ExportBytes { get; set; }
|
|
public string ExportError { get; set; }
|
|
|
|
public string ImportState { get; set; }
|
|
public DateTime? ImportAskedAt { get; set; }
|
|
public DateTime? ImportEndedAt { get; set; }
|
|
public List<string> ImportParts { get; set; } = [];
|
|
public long ImportDone { get; set; }
|
|
public long ImportTotal { get; set; }
|
|
public Dictionary<string, int> ImportCounts { get; set; } = [];//what was imported and what skipped, by why
|
|
public string ImportError { get; set; }
|
|
public string ImportFrom { get; set; }//the archive's actor
|
|
public bool ImportSameActor { get; set; }
|
|
}
|
|
|
|
// the parts of an archive to import: posts (with their media), profile, follows, blocks, mutes, domainblocks, lists,
|
|
// bookmarks, filters, tags, notificationpolicy, pins; and only when asked, located, scheduled, likes (which tell their
|
|
// authors)
|
|
public class ImportPersonaArchiveForm
|
|
{
|
|
public string UploadId { get; set; }
|
|
public List<string> Parts { get; set; } = [];
|
|
}
|
|
|
|
public class ViewArchiveTicket
|
|
{
|
|
public string Url { get; set; }
|
|
public DateTime ExpiresAt { get; set; }
|
|
public long Bytes { get; set; }
|
|
}
|
|
|
|
public class ViewArchiveUpload
|
|
{
|
|
public string Id { get; set; }
|
|
public long Received { get; set; }
|
|
public long ChunkBytes { get; set; }
|
|
}
|
|
}
|