Initial scaffolding
This commit is contained in:
1 parent
15a0ff43de
commit
989415ec1f
20 files changed
+743
No files matched your search
Executable
+13
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env perl
|
||||
use strict;
|
||||
use warnings;
|
||||
use FindBin qw($RealBin);
|
||||
use lib "$RealBin/../lib";
|
||||
|
||||
# TODO: Parse --config flag (default: $RealBin/../config/mnemosyne.conf)
|
||||
# TODO: Load Mnemosyne::Config, Mnemosyne::DB
|
||||
# TODO: Build Mojolicious::Lite app:
|
||||
# POST /<webhook_path> => validate secret token, route to Mnemosyne::Webhook
|
||||
# TODO: Start app on 127.0.0.1:<listen_port> (never bind 0.0.0.0)
|
||||
|
||||
print "mnemosyne-bot: not yet implemented\n";
|
||||
Executable
+19
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env perl
|
||||
use strict;
|
||||
use warnings;
|
||||
use FindBin qw($RealBin);
|
||||
use lib "$RealBin/../lib";
|
||||
|
||||
# Invoked by cron every N minutes (e.g. */5 * * * *).
|
||||
# Exits immediately unless:
|
||||
# a) the current local time matches digest_time (within the cron granularity window), AND
|
||||
# b) last_digest_sent (config table) is not today's date.
|
||||
# On success, records today's date in last_digest_sent to prevent duplicate sends.
|
||||
#
|
||||
# TODO: Load config + DB
|
||||
# TODO: Read digest_time and last_digest_sent from config table
|
||||
# TODO: Compare current local time against digest_time (allow ±(cron_interval/2) window)
|
||||
# TODO: If it's time and not already sent: call Mnemosyne::Digest::send(...)
|
||||
# TODO: On success: update last_digest_sent to today's ISO date
|
||||
|
||||
print "mnemosyne-digest: not yet implemented\n";
|
||||
Executable
+19
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env perl
|
||||
use strict;
|
||||
use warnings;
|
||||
use FindBin qw($RealBin);
|
||||
use lib "$RealBin/../lib";
|
||||
|
||||
# One-shot helper to register (or remove) the Telegram webhook.
|
||||
# Run once after install, and again whenever the webhook URL changes.
|
||||
# Only one webhook can be active per bot token at a time.
|
||||
#
|
||||
# Usage:
|
||||
# mnemosyne-webhook [--config /path/to/mnemosyne.conf] [--delete]
|
||||
#
|
||||
# TODO: Load config
|
||||
# TODO: --delete: call Mnemosyne::Telegram::delete_webhook()
|
||||
# TODO: default: call Mnemosyne::Telegram::set_webhook(webhook_url, webhook_secret)
|
||||
# TODO: Print result (registered URL, or confirmation of deletion)
|
||||
|
||||
print "mnemosyne-webhook: not yet implemented\n";
|
||||
Reference in new issue
Block a user