Go to file
2021-07-18 23:23:12 +02:00
.travis.yml Add files 2021-07-18 23:23:12 +02:00
admin.go Add files 2021-07-18 23:23:12 +02:00
app.json Add files 2021-07-18 23:23:12 +02:00
go.mod Add files 2021-07-18 23:23:12 +02:00
go.sum Add files 2021-07-18 23:23:12 +02:00
LICENSE Add files 2021-07-18 23:23:12 +02:00
main.go Add files 2021-07-18 23:23:12 +02:00
README.md Add files 2021-07-18 23:23:12 +02:00
telegram.go Add files 2021-07-18 23:23:12 +02:00
web.go Add files 2021-07-18 23:23:12 +02:00

DeletedBot Backend

Go Report Card

This repo contains the code for DeletedBot's backend, including:

  • The API protocol to be used by the frontend
  • The endpoint for Telegram's webhook

It uses Go Gin as web server and Redis as database.
This project is released under GNU GPL v3.0, read the LICENSE file to know more. Contributions are always welcome!

How to self-host

Notice: The backend, by itself, is pretty useless. So, once you're done self hosting the backend, make sure to check out how you can deploy the frontend here.

The zoomers' way

Deploy

The good'ol way

  1. Download a pre-built binary from the release page or clone the repo and run go build -o deletedbot-backend . in the same directory

  2. Get yourself a Redis server. If you're on a VPS or dedicated server, check out this link; if you're on Heroku or similar services, take a look here to get a free managed Redis database, or get an add-on for the specified service.

  3. Set the following environment variables:

    Key Example Explaination
    FRONTEND_HOST deleted.bot.nu The host where your frontend is located. It will be sent in all /start messages.
    BACKEND_HOST apidel.massivebox.eu.org The host of your backend. All DeletedBots hosted on your instance will have their webhook set to this host. Make sure you have HTTPS!
    PORT 80 The port the web server will listen on.
    REDIS_ADDR localhost:6379 The hostname of your Redis database
    REDIS_PASSWORD ExtremelySafePassword The password of your Redis database. Leave empty if no password is set.
    ADMIN_USERNAME admin The username required to log into the admin console.
    ADMIN_PASSWORD ExtremelySafePassword The password required to log into the admin console.
  4. Run your instance: if you're on a server, use sudo nohup ./deletedbot-backend, if you're using anything else use your common deploying technique.

  5. That's it.