meinside / telegram-totp-bot

Telegram Bot for managing TOTP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Telegram TOTP Bot

A Telegram Bot for managing (registering, deleting, generating tokens) TOTP.

  • digits: 6
  • interval: 30 seconds
  • algorithm: hmac-sha1

Installation

$ git clone https://github.com/meinside/telegram-totp-bot.git
$ cd telegram-totp-bot/
$ go build

Configuration

Create a config file:

{
    "telegram_bot_token": "YOUR_TELEGRAM_BOT_TOKEN",
    "database_file_location": "/path/to/your/database.db"
}

Run

and then run with:

$ ./telegram-totp-bot -config /path/to/your/config.json

Or run with systemd

Create a systemd service file:

[Unit]
Description=Telegram TOTP Bot
After=syslog.target
After=network.target

[Service]
Type=simple
User=ubuntu
Group=ubuntu
WorkingDirectory=/path/to/your/telegram-totp-bot-directory/
ExecStart=/path/to/your/telegram-totp-bot-directory/telegram-totp-bot -config /path/to/your/config.json
Restart=always
RestartSec=5
Environment=
MemoryAccounting=true
MemoryHigh=100M
MemoryMax=128M

[Install]
WantedBy=multi-user.target

at /etc/systemd/system/telegram-totp-bot.service,

and run:

# make it launch automatically at boot
$ systemctl enable telegram-totp-bot.service

# start, restart, or stop it
$ systemctl start telegram-totp-bot.service
$ systemctl restart telegram-totp-bot.service
$ systemctl stop telegram-totp-bot.service

License

MIT

About

Telegram Bot for managing TOTP


Languages

Language:Go 100.0%