45 lines
1.8 KiB
Bash
Executable File
45 lines
1.8 KiB
Bash
Executable File
#!/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"
|