iran-domains-tg-bot

command module
v0.0.0-...-c66872d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 27, 2023 License: AGPL-3.0 Imports: 22 Imported by: 0

README

Iran Domains Telegram Bot

A bot that collects Iranian hosted applications, or websites domain names from user submissions. It's accessible on Telegram with username: @iran_domains_bot.

Usage

  1. Download the latest executable and run it!

    curl -SfLO https://github.com/z4x7k/iran-domains-tg-bot/releases/latest/download/bot && chmod +x ./bot
    

    Verify it's working using ./bot --help command.

  2. Download .env template file:

    curl -SfLo .ir-domains-bot.env https://raw.githubusercontent.com/z4x7k/iran-domains-tg-bot/main/.env.template
    
  3. Set proper values in .env

  4. Run it!

    ./bot run --db ir-domains.db --env .env
    

SystemD Service Unit

Write the content below in a service unit file, e.g., ~/.config/systemd/user/ir-domains-bot.service

[Unit]
Description=Iran Domains Telegram Bot
After=network.target
Wants=network-online.target

[Service]
Restart=on-failure
Type=simple
ExecStart=path_to_bot_executable run --db path_to_db_file.db --env path_to_dotenv
RestartSec=10s
TimeoutStopSec=20s
KillSignal=SIGINT
FinalKillSignal=SIGKILL

[Install]
WantedBy=multi-user.target

Then execute the following commands to activate, start, and enable start-on-boot the service:

systemctl --user daemon-reload
systemctl --user start ir-domains-bot.service
systemctl --user enable ir-domains-bot.service

Note: in order for start-on-boot to work for user service unit to work, run the following command if you haven't already:

sudo loginctl enable-linger $USER

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
db
migration
This file is intended only to export FS variable due to the current limitation of go:embed directive, which does not support paths with '..' or '.'.
This file is intended only to export FS variable due to the current limitation of go:embed directive, which does not support paths with '..' or '.'.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL