keybase / client

Keybase Go Library, Client, Service, OS X, iOS, Android, Electron
BSD 3-Clause "New" or "Revised" License
8.89k stars 1.23k forks source link

[feature request] Stream video directly to FS #24344

Open AdamTheLang opened 3 years ago

AdamTheLang commented 3 years ago

There ought to be a solution for taking video and streaming it in as close to real-time as possible to a secure location (keybase's fs). This has some obvious applications with regard to documenting repressive regimes where your phone might be confiscated at any time, but you don't want your video to be easily accessible by authorities via one of the mainstream streaming sites.

Adding a camera interface to the iOS client for this would be relatively easy, but I have no insight into how easy adding the local buffering and real-time uploading would be.

AlbinoGeek commented 3 years ago

Keybase [as far as I can tell, based on reaching through the codebase] signs and uploads messages to s3, it doesn't appear to support any kind of streaming currently (whether it be a streamed file transfer, video file, audio, etc.)

AdamTheLang commented 3 years ago

That's not a particular problem: chopping your video up into bits and uploading them as each bit is finished is also not especially difficult.

AlbinoGeek commented 3 years ago

I'd agree. I was trying to implement something like this before, but other than their chat api command, it was feasibly impossible to upload or download a file -- while a file transfer gives you many fields, none of them is the secret required to access the file in the bucket (would love if a dev would explain this process.)

{
  "region":    "us-east-1",
  "endpoint":  "https://s3.amazonaws.com",
  "bucket":    "kb-chat",
  "path":      "-snip-",
  "size":      12345,
  "mimeType":  "audio/x-m4a",
  "encHash":   "-snip-",
  "ptHash":    "-snip-",
  "key":       "-snip-",
  "verifyKey": "-snip-",
  "nonce":     "-snip-"
}

Going over the S3 documentation, I could not figure out how I would assemble a signed HMAC256 using only these pieces -- nor could I figure out if one of these keys were already that.

AdamTheLang commented 3 years ago

Wait, I'm confused. What about that keybase filesystem thing? That's all files.

AlbinoGeek commented 3 years ago

Right, this was a copy of the API message given when an attachment hit chat, which then made me realize that all chat messages end up in that S3 bucket -- thereby thinking that all of the files in KBFS also went there. That, and, we [my company] were going to implement video chat using team channels and chunked uploads, hence going down this rabbit hole.