linkchanbot

Telegram bot frontend proxy link substituter
Log | Files | Refs | README | LICENSE

commit 809af97e05fb9c4d7a993dadb518301a213ab025
parent 48ae6bac796af129ec84cc9bde866faeaad86e61
Author: Byron Torres <b@torresjrjr.com>
Date:   Sat, 27 Mar 2021 16:36:45 +0000

Rename auth.cfg to bot.cfg

Diffstat:
MMakefile | 4++--
MREADME.md | 2+-
Mdoc/linkchanbot.1.scd | 2+-
Mlinkchanbot | 10+++++-----
Rsample.config/auth.cfg -> sample.config/bot.cfg | 0
5 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/Makefile b/Makefile @@ -29,7 +29,7 @@ install: all mkdir -m755 -p $(DESTDIR)$(BINDIR) $(DESTDIR)$(SHAREDIR) $(DESTDIR)$(MANDIR)/man1 install -m755 linkchanbot $(DESTDIR)$(BINDIR)/linkchanbot install -m644 linkchanbot.1 $(DESTDIR)$(MANDIR)/man1/linkchanbot.1 - install -m644 sample.config/auth.cfg $(DESTDIR)$(SHAREDIR)/auth.cfg + install -m644 sample.config/bot.cfg $(DESTDIR)$(SHAREDIR)/bot.cfg install -m644 sample.config/alts.json $(DESTDIR)$(SHAREDIR)/alts.json install -m644 sample.config/services.json $(DESTDIR)$(SHAREDIR)/services.json install -m644 sample.config/queries.json $(DESTDIR)$(SHAREDIR)/queries.json @@ -37,7 +37,7 @@ install: all uninstall: $(RM) $(DESTDIR)$(BINDIR)/linkchanbot $(RM) $(DESTDIR)$(MANDIR)/man1/linkchanbot.1 - $(RM) $(DESTDIR)$(SHAREDIR)/auth.cfg + $(RM) $(DESTDIR)$(SHAREDIR)/bot.cfg $(RM) $(DESTDIR)$(SHAREDIR)/alts.json $(RM) $(DESTDIR)$(SHAREDIR)/services.json $(RM) $(DESTDIR)$(SHAREDIR)/queries.json diff --git a/README.md b/README.md @@ -54,7 +54,7 @@ Configuration ### Server Add the required bot token (and optionally an admin username) -either in `auth.cfg` in the linkchan config directory +either in `bot.cfg` in the linkchan config directory (`$XDG_CONFIG_HOME/linkchan` or `$HOME/.config/linkchan`): [auth] diff --git a/doc/linkchanbot.1.scd b/doc/linkchanbot.1.scd @@ -36,7 +36,7 @@ from _$XDG_CONFIG_HOME/linkchan_ (defaults to _$HOME/.config/linkchan_). *linkchanbot* will copy missing configuration files from _/etc/local/share/linkchanbot_. -_auth.cfg_ +_bot.cfg_ Defines the _token_ and _admin_ variables. _token_ diff --git a/linkchanbot b/linkchanbot @@ -108,7 +108,7 @@ def init(args): config_dir.mkdir(parents=True, exist_ok=True) # EFFECT sys_config_dir = pathlib.Path('/usr/local/share/linkchanbot') - config_files = ('auth.cfg', 'alts.json', 'services.json', 'queries.json') + config_files = ('bot.cfg', 'alts.json', 'services.json', 'queries.json') # Copy system global config files to local XDG config dir. # Fail if files not found. @@ -146,11 +146,11 @@ def init(args): TOKEN = os.getenv('LINKCHAN_TOKEN') ADMIN = os.getenv('LINKCHAN_ADMIN') - AUTH = configparser.ConfigParser() - AUTH.read(config_dir/'auth.cfg') + BOT_CFG = configparser.ConfigParser() + BOT_CFG.read(config_dir/'bot.cfg') - TOKEN = TOKEN or AUTH.get("auth", "token", fallback=False) - ADMIN = ADMIN or AUTH.get("auth", "admin", fallback=False) + TOKEN = TOKEN or BOT_CFG.get("auth", "token", fallback=False) + ADMIN = ADMIN or BOT_CFG.get("auth", "admin", fallback=False) if not TOKEN: stderr("Error: No bot token provided") diff --git a/sample.config/auth.cfg b/sample.config/bot.cfg