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 bash
|
||||
# Online SQLite backup using the .backup API (safe while the bot is running).
|
||||
# TODO: implement; outline below.
|
||||
set -euo pipefail
|
||||
|
||||
# TODO: read DB_PATH from config or env
|
||||
# TODO: BACKUP_DIR default /var/backups/mnemosyne, override via $MNEMOSYNE_BACKUP_DIR
|
||||
# TODO: filename: mnemosyne-$(date +%Y%m%d-%H%M%S).db
|
||||
# TODO: sqlite3 "$DB_PATH" ".backup '$BACKUP_DIR/$FILENAME'"
|
||||
# (uses the SQLite backup API — safe for concurrent access, no locks held)
|
||||
# TODO: optionally prune backups older than N days
|
||||
|
||||
echo "TODO: backup.sh not yet implemented"
|
||||
Executable
+44
@@ -0,0 +1,44 @@
|
||||
#!/usr/bin/env bash
|
||||
# Mnemosyne install script — idempotent; safe to re-run.
|
||||
# Does NOT clobber an existing database or config file.
|
||||
# TODO: implement; outline below.
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
# --- Detect distro family ---
|
||||
# TODO: detect RHEL/AlmaLinux (dnf/yum) vs Debian/Ubuntu (apt) vs other
|
||||
# TODO: on RHEL family: dnf install -y perl perl-App-cpanminus perl-DBI sqlite
|
||||
# TODO: on Debian family: apt-get install -y perl cpanminus libdbi-perl sqlite3
|
||||
# TODO: document: on either family, run `cpanm --installdeps .` after this step
|
||||
|
||||
# --- System user ---
|
||||
# TODO: create 'mnemosyne' system user/group if not present (useradd -r -s /sbin/nologin)
|
||||
|
||||
# --- Directories ---
|
||||
# TODO: /opt/mnemosyne — app files (copy repo here or symlink)
|
||||
# TODO: /var/lib/mnemosyne — database directory, owned by mnemosyne user
|
||||
# TODO: /etc/mnemosyne — config directory (skip if already exists to avoid clobbering)
|
||||
|
||||
# --- Config ---
|
||||
# TODO: if /etc/mnemosyne/mnemosyne.conf does not exist:
|
||||
# copy config/mnemosyne.conf.example → /etc/mnemosyne/mnemosyne.conf
|
||||
# chmod 640, chown root:mnemosyne
|
||||
# print reminder to edit the file before starting the service
|
||||
|
||||
# --- CPAN deps ---
|
||||
# TODO: cd /opt/mnemosyne && cpanm --installdeps .
|
||||
|
||||
# --- Systemd ---
|
||||
# TODO: copy systemd/mnemosyne-bot.service → /etc/systemd/system/
|
||||
# TODO: systemctl daemon-reload
|
||||
# TODO: systemctl enable mnemosyne-bot (but do NOT start — user must configure first)
|
||||
|
||||
# --- Cron for digest ---
|
||||
# TODO: install a cron entry for mnemosyne user:
|
||||
# */5 * * * * /opt/mnemosyne/bin/mnemosyne-digest --config /etc/mnemosyne/mnemosyne.conf
|
||||
# This fires every 5 minutes; the script itself checks against digest_time and exits early.
|
||||
|
||||
# --- Nginx ---
|
||||
# TODO: remind user to copy nginx/mnemosyne.conf.example and adjust, then reload nginx
|
||||
|
||||
echo "TODO: install.sh not yet implemented"
|
||||
Reference in new issue
Block a user