From 55bcec90c14db6f2956ed51cf4df1503c0767f81 Mon Sep 17 00:00:00 2001 From: Ken D'Ambrosio Date: Mon, 25 May 2026 00:46:10 +0000 Subject: =?UTF-8?q?Initial=20commit=20=E2=80=94=20menu.jots.org=20Flask/SQ?= =?UTF-8?q?Lite=20meal=20planner?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Full-featured weekly menu planner with: - Recipe library with ratings, comments, cuisine/nationality, added-by attribution - AI recipe assistant (Claude) with URL fetching and file upload - Weekly meal plan grid with shopping list generation - Sort by name, prep/cook time, or rating - Print and copy-link support - Deployed on LXC container (192.168.10.51) behind Apache reverse proxy Co-Authored-By: Claude Sonnet 4.6 --- refresh-token.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 refresh-token.sh (limited to 'refresh-token.sh') diff --git a/refresh-token.sh b/refresh-token.sh new file mode 100755 index 0000000..0f9038b --- /dev/null +++ b/refresh-token.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +# Refresh the Claude OAuth token and update it on menu.jots.org +# Runs automatically twice daily via systemd timer (menu-token-refresh.timer) + +set -e + +CREDS="$HOME/.claude/.credentials.json" +if [ ! -f "$CREDS" ]; then + echo "ERROR: $CREDS not found" + exit 1 +fi + +ACCESS_TOKEN=$(grep -o '"accessToken":"[^"]*"' "$CREDS" | cut -d'"' -f4) + +if [ -z "$ACCESS_TOKEN" ]; then + echo "ERROR: could not read access token from $CREDS" + exit 1 +fi + +echo "Pushing fresh token to menu-planner LXC container..." +ssh root@192.168.10.50 " + sed -i 's|^ANTHROPIC_API_KEY=.*|ANTHROPIC_API_KEY=${ACCESS_TOKEN}|' /var/lib/lxc/menu-planner/rootfs/etc/menu-planner.env && + lxc-attach -n menu-planner -- systemctl restart menu-planner +" + +echo "Done. AI assistant is live with a fresh token." -- cgit v1.2.3