Skip to main content

An API for uploading files/notes to a KBFS folder

Project description

KBFS Upload API

Purpose

This API can be used to upload either secure notes or files to a secure KeybaseFS folder. The idea behind it is that files can be stored in a secure, end-to-end encrypted format without having less tech-savvy end users sign up for Keybase. This was created as a work around I needed at work so that coworkers could send me sensitive information in a secure format, but they didn't have Keybase or know how to use GPG. Creating this API and an internal web-page front end for it allowed them to send me this information and have it stored securely without teaching them anything about encryption.

Usage

Direct Launch

If you'd like to run this directly using Poetry to install it. Simply do poetry install to install it, then poetry run kbfsu to launch it.

Docker

This is also available as a Docker image. Simply run docker run -p 5000:5000 -d --restart=always dakotakae/kbfs_upload to start the server listening on port 5000.

Configuration

No matter how you launch it, some configuration will be required. This can all be done with Environment Variables.

Variable Name Data Type Description Required Default
KBFSU_CHAT_TYPE str Type of chat to send notifications to. Can be private, team or silent No silent
KBFSU_CHAT_TEAM str The team that will be used to store the files. The bot must be a member of that team (not just installed) Yes, if KBFSU_CHAT_TYPE is team none
KBFSU_CHAT_TEAM_CHANNEL str The team chat channel to send notifications to. No general
KBFSU_CHAT_USER str The user to sharefiles with Yes, if KBFSU_CHAT_TYPE is private or silent Same as KEYBASE_USERNAME
KBFSU_FILER_DIR str The subdirectory path to store files in. No none
KEYBASE_USERNAME str The username to log into Keybase with Yes none
KEYBASE_PAPERKEY str The paperkey to use to log the user into Keybase Yes none

API Interaction

The API accepts POST requests to /upload/<type>, where type is either note or file. Both types accept form-data as the input. Both types also require the following form entries:

  • filename - The name to save the file to. This filename will be sanitized and timestamped after the fact, but is still required.
  • sender - The name of the person submitting the form.

You can also send recipient to identify the intended recipient of the file. This is an arbitrary string and does not have to be a particular Keybase username.

If type is note, the request also needs to include a body field that contains the text to be stored. If the type is file, the uploaded file must be sent with the file key.

This is all the reference needed to build your own front-end for this api.

Development/Contribution

As stated before, Poetry is used to manage the project. If there are any improvements/changes to be made, feel free to submit a PR.

Support

"Buy Me A Coffee"

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kbfs_upload-0.1.1.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kbfs_upload-0.1.1-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file kbfs_upload-0.1.1.tar.gz.

File metadata

  • Download URL: kbfs_upload-0.1.1.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.10 CPython/3.8.8 Linux/5.11.0-37-generic

File hashes

Hashes for kbfs_upload-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e90f1205ef01d49f1bea0c4b8cd2b052a3034c0ada60962dd3d7b20a2b1d6f69
MD5 0836b46077a57aef1afb08e4004f9b00
BLAKE2b-256 440f6be712b1c75ef7b1f52bc46d137353ecc09faea82693fcf11b71afd2fd89

See more details on using hashes here.

File details

Details for the file kbfs_upload-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: kbfs_upload-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.10 CPython/3.8.8 Linux/5.11.0-37-generic

File hashes

Hashes for kbfs_upload-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 90057b94f9f48a095c5113b91542f5a4622ad22c1d307d5080e8449782c5d377
MD5 6c4453ab1192f241431665bf7cf82df7
BLAKE2b-256 4d05955d55236794afe312fdf2ec480ff07abdafce46419b423a78e5a3d302fb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page