Code Monkey home page Code Monkey logo

file2url-go's Introduction

File 2 URL Bot

A simple bot to convert files sent to it to URLs to make direct download links.

Features

  • Fast download speeds
  • Option to allow only specific users to create download links
  • Range support
  • Database support

Setup

At first download the program from releases. Then before running the application, set these values as environment variables:

export APP_ID=1234
export APP_HASH=abcd
export BOT_TOKEN=zyxw
export ALLOWED_USERS=1,2

ALLOWED_USERS is the list of user IDs which are allowed to use the bot. Do not specify this variable in order to make the bot public.

Running on your server

If you are planning to run this bot on your server you also have to specify these two environment variables:

export LISTEN=0.0.0.0:12345
export URL_PREFIX=my-ip-or-domain:12345

LISTEN is the listen address of the server. URL_PREFIX will be as the domain/ip of the links which are sent to users.

Then simply run the executable file.

Running with Heroku

To run this app on Heroku, you only need to specify one environment variable other than bot id and app hash/id.

export DYNO_NAME=my-dyno-name

Databases

This bot will use a database to store the file information which is mapped from a UUID. By default, bot will use an in memory cache to store these values. This each entry has a TTL of one day by default.

You can change the in memory cache to bbolt in order to make the data persistent on disk. To enable bbolt, set the environment variable of BOLT_DB_PATH to a file which is the database.

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.