A very minimal script to host a fully-fledged file upload & URL shortening service. It is under a 100 lines of Python code, and is fully customizable with an external configuration file.
It features:
- File upload
- URL shortening
- Size limits
- Time limits
- A landing page
- Customizable with an external file
## Usage
You can push files to it using the following command:
`curl -F file=@your_file up.x1b.dev.com`
You can shorten URL's by using this command and providing the target URL:
`curl -d "url=https://example.com" up.x1b.dev`
After any action you will get a URL with a 6-character key like:
`https://up.x1b.dev.com/xg29a6`
## Requirements
To run this you will need the following packages:
- Default Python packages (os, requests, etc.)
- Flask
- SQlite3
## Setup
After installing the required packages, you can configure your instance, and run the main python script with:
`python3 main.py`
Everything will be set up automatically for a first-time run.
You may want to set this up on a domain name, and not using the server IP. You can do this with a reverse proxy.
You can find documentation on how to set up a [reverse proxy with nginx here](https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/).
## Contribution
Feel free to open pull requests to implement features, or issues to request features / report problems. The only rule is to keep the `main.py` file under 100 lines of code.