Grant devs journal access

Update dev-add to add systemd-journal group and extend check-deploy output.
This commit is contained in:
Dan 2026-01-22 11:44:11 -08:00
parent 9bc0fd88da
commit 93e694824a
2 changed files with 36 additions and 0 deletions

View file

@ -49,3 +49,33 @@ echo
echo "== Remote current system =="
ssh "root@${HOST}" 'readlink /run/current-system'
echo
echo "== Musiclink local repo HEAD =="
musiclink_repo="/home/dan/proj/musiclink"
if [[ -d "$musiclink_repo/.git" ]]; then
git -C "$musiclink_repo" rev-parse HEAD
else
echo "(missing $musiclink_repo)"
fi
echo
echo "== Musiclink flake.lock rev =="
python3 - <<'PY'
import json
from pathlib import Path
lock_path = Path("flake.lock")
try:
data = json.loads(lock_path.read_text())
rev = data["nodes"]["musiclink"]["locked"].get("rev")
print(rev or "(missing rev)")
except Exception as exc:
print(f"(error reading flake.lock: {exc})")
PY
echo
echo "== Musiclink running ExecStart =="
ssh "root@${HOST}" 'systemctl show -p ExecStart musiclink --value'

View file

@ -76,6 +76,12 @@ create_user() {
log_info "Added to devs group"
fi
# Add to systemd-journal group for log access
if ! groups "$username" | grep -q '\bsystemd-journal\b'; then
usermod -aG systemd-journal "$username"
log_info "Added to systemd-journal group"
fi
# Set up SSH directory and login key (authorized_keys)
local ssh_dir="/home/$username/.ssh"
mkdir -p "$ssh_dir"