Giter Site home page Giter Site logo

once's Introduction

once: a one-time file sharing personal service

once is a personal cloud service that enables you to upload a local file of any size and get a link in return.

This link will allow one single download operation, deleting the file once it has been successfully transferred.

once is designed to run on AWS using only serverless components.

Architecture diagram

It can be easily provisioned to a private AWS account and it has been designed to have a negligible footprint on the bill.

You can read this blog post to get some background information.

Deploying on AWS

asciicast

once is implemented using the AWS CloudDevelopment Kit framework, and can be easily deployed as a self-contained CloudFormation stack to any AWS account.

Make sure you have installed the latest CDK version for your platform, following the steps described in the official getting started guide.

Install the required dependencies (you can use a virtualenv for this), with the following command:

poetry install

The deployment can be then initiated, from the project root directory, with the following command:

$ cdk deploy

The output will include the base URL to use the service API.

...
โœ…  once

Outputs:
once.baseurl = https://xxxxxxxxxx.execute-api.eu-west-1.amazonaws.com/

Update your configuration file (by default it can be found at ~/.once) adding the URL under the base_url option, like in the following example config file:

[once]
secret_key = RBeXidk41E1lmB5x839sVjo.....
base_url = https://rrjvo2i9s5.execute-api.eu-west-1.amazonaws.com/

Using a custom domain (optional)

If you want to expose the once API on a custom domain name hosted on Route 53, you can just set the following environment variables before the deployment:

  • CUSTOM_DOMAIN the domain name you want to expose the once API (e.g. once.mydomain.com)
  • HOSTED_ZONE_NAME the Route 53 hosted zone name (e.g. mydomain.com)
  • HOSTED_ZONE_ID the Route 53 hosted zone ID (e.g. Z0113243DF12WNGOIXX)

then the deployment command would look like the following example:

$ DOMAIN_NAME=once.mydomain.com \
  HOSTED_ZONE_NAME=mydomain.com \
  HOSTED_ZONE_ID=Z0113243DF12WNGOIXX \
  cdk deploy

If you need more details about creating a public hosted zone on AWS, consult the official documentation.

Uploading a file

Once the service and the client have been correctly installed and configured, you can upload a local file running the once command.

poetry run once <file_toshare>

The URL can be shared to download the file, only once.

asciicast

Uninstalling

If you want to completely remove once from your AWS account, you will need to run the following command:

cdk destroy

then remember to delete your config file:

rm ~/.once

once's People

Contributors

domtes avatar druizz90 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.