Code Monkey home page Code Monkey logo

upngo's Introduction

UpN'Go

This app is currently a work in progress. The ultimate goal is to build a personal hosted file uploader, so that you can easily share files.

The tus protocol

This app uses tus as its protocol, which allows it to support resumable file uploads.

Deploying the app

The docker-compose.yml file contains everything needed to deploy the app quickly to any server. You only need to have Docker and docker-compose installed.

These are the only commands you'll need to type:

# clone the repository
$ git clone https://github.com/alarsyo/upngo
$ cd upngo

# choose a domain name for the app and launch it
$ export UPNGO_HOSTNAME=example.com
$ docker-compose up -d

This automatically spawns a Caddy container acting as a reverse proxy to your app, to serve it over HTTPS with a Let's Encrypt certificate.

This certificate will be stored in $HOME/.caddy outside the container, so make sure you don't have anything conflicting there.

Testing the setup by uploading a file

The app is still a work in progress, but you can test that your setup is working by using tus-py-client, a Python client library for the tus protocol.

First, get the tus-py-client on your machine:

# create a python virtual environment to install the tus client
$ python -m venv venv
$ source venv/bin/activate
$ pip install tuspy

Then write this inside a up.py file:

import sys

from tusclient import client
from tusclient.storage import filestorage

storage = filestorage.FileStorage('tus_save_file')
my_client = client.TusClient('https://example.com/files/')

uploader = my_client.uploader(sys.argv[1], metadata={"filename": sys.argv[1]}, store_url=True, url_storage=storage)
uploader.upload()
print(uploader.get_url())

Finally, run:

$ python up.py MY_TEST_FILE.txt

That's it! Your file was uploaded to the server, and you can download it by opening the url printed by the script.

Why UpN'Go

I'm just bad at naming things. That's an uploader. Written in Go.

upngo's People

Contributors

alarsyo avatar ilnoumri avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

arvretoned

upngo's Issues

Exit gracefully on SIGTERM/SIGINT

http.Server provides a Shutdown() function for this.

Currently the hypothetical ongoing requests don't have time to terminate properly, the server is just killed

Implement authentication

The first step to having a functional application, now that the proof of concept works, is to implement auth. This is the tracking issue for it.

  • Server authentication #6
  • Frontend for auth logic #7

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.