From a5e46864d8b8679a01fee4b9aea9471cf789da9a Mon Sep 17 00:00:00 2001 From: Mark Eaton Date: Fri, 12 Dec 2025 07:46:39 -0500 Subject: [PATCH] initial commit --- libguides-notifier/libguides-notifier.service | 21 ++++++++++++ libguides-notifier/libguides-notifier.timer | 20 +++++++++++ renovate/config.js | 33 +++++++++++++++++++ renovate/renovate.service | 32 ++++++++++++++++++ renovate/renovate.timer | 15 +++++++++ 5 files changed, 121 insertions(+) create mode 100644 libguides-notifier/libguides-notifier.service create mode 100644 libguides-notifier/libguides-notifier.timer create mode 100644 renovate/config.js create mode 100644 renovate/renovate.service create mode 100644 renovate/renovate.timer diff --git a/libguides-notifier/libguides-notifier.service b/libguides-notifier/libguides-notifier.service new file mode 100644 index 0000000..06edb26 --- /dev/null +++ b/libguides-notifier/libguides-notifier.service @@ -0,0 +1,21 @@ +# lives at ~/.config/systemd/user/libguides-notifier.service + +# User-level systemd service to run main.py +# Uses a wrapper script so the working directory and .env are found correctly. +# Configuration is via ~/.config/libguides-notifier.env, no in-file path edits needed. +# Create that file with one line: +# REPO_PATH=/absolute/path/to/this/repo +# Then run: +# systemctl --user daemon-reload +[Unit] +Description=Run main.py (LibGuides notifier) +Wants=network-online.target NetworkManager-wait-online.service +After=network-online.target + +[Service] +Type=oneshot +EnvironmentFile=%h/.config/libguides-notifier.env +ExecStart=/bin/bash -lc '${REPO_PATH}/scripts/run_main.sh' + +[Install] +WantedBy=default.target diff --git a/libguides-notifier/libguides-notifier.timer b/libguides-notifier/libguides-notifier.timer new file mode 100644 index 0000000..8bcc441 --- /dev/null +++ b/libguides-notifier/libguides-notifier.timer @@ -0,0 +1,20 @@ +# lives at ~/.config/systemd/user/libguides-notifier.timer + +# User-level systemd timer that "catches up" missed runs if the machine was off. +[Unit] +Description=Schedule main.py with catch-up if missed + +[Timer] +# Change this to your desired schedule; examples: +# OnCalendar=daily +# OnCalendar=Mon..Fri 09:00 +# See man systemd.time for syntax. +OnCalendar=*-*-03,18 09:00:00 +Timezone=America/New_York +Persistent=true +AccuracySec=1m +RandomizedDelaySec=5m +Unit=libguides-notifier.service + +[Install] +WantedBy=timers.target diff --git a/renovate/config.js b/renovate/config.js new file mode 100644 index 0000000..440344b --- /dev/null +++ b/renovate/config.js @@ -0,0 +1,33 @@ +// lives at /etc/renovate/config.js +// token goes in the same directory + +module.exports = { + platform: 'gitea', + endpoint: 'https://tildegit.org/api/v1/', + token: process.env.RENOVATE_TOKEN, + // repositories: ['MarkEEaton/teams-bot'], + // Or use autodiscover to find all repos + autodiscover: true, + + enabledManagers: ['npm', 'nodenv', 'pip_requirements', 'pip_setup', 'poetry', 'pipenv', 'pep621'], + // Disable GitHub-specific features + fetchReleaseNotes: false, + githubTokenWarn: false, + + // Only use npm registry, PyPI, etc. - don't query GitHub + hostRules: [ + { + hostType: 'github', + enabled: false, + } + ], + + // this is so that renovate doesn't think that python-version is a dependency + packageRules: [ + { + // Ignore Python version updates + matchDatasources: ['python-version'], + enabled: false, + } + ], +}; diff --git a/renovate/renovate.service b/renovate/renovate.service new file mode 100644 index 0000000..3939db7 --- /dev/null +++ b/renovate/renovate.service @@ -0,0 +1,32 @@ +# lives at /etc/systemd/system/renovate.service + +[Unit] +Description=Renovate Bot +After=network-online.target +Wants=network-online.target + +[Service] +Type=oneshot +User=renovate +Group=renovate +WorkingDirectory=/var/lib/renovate +# /snap/bin is included first in the PATH because I needed a more up to +# date node.js than the system had, so I installed the newer version via +# snap. This path points to that first. +Environment="PATH=/snap/bin:/usr/local/bin:/usr/bin:/bin" +# load the token from the environment +EnvironmentFile=/etc/renovate/token-env +Environment="RENOVATE_CONFIG_FILE=/etc/renovate/config.js" +Environment="GIT_AUTHOR_NAME=Renovate Bot" +Environment="GIT_AUTHOR_EMAIL=b7jl@sdf.org" +Environment="GIT_COMMITTER_NAME=Renovate Bot" +Environment="GIT_COMMITTER_EMAIL=b7jl@sdf.org" +# use the snap version of npx +ExecStart=/snap/bin/npx renovate +# Logging +StandardOutput=journal +StandardError=journal +SyslogIdentifier=renovate + +[Install] +WantedBy=multi-user.target diff --git a/renovate/renovate.timer b/renovate/renovate.timer new file mode 100644 index 0000000..de15d60 --- /dev/null +++ b/renovate/renovate.timer @@ -0,0 +1,15 @@ +# lives at /etc/systemd/system/renovate.timer + +[Unit] +Description=Run Renovate Bot periodically +Requires=renovate.service + +[Timer] +# Run every 6 hours +OnCalendar=00/6:00:00 +# Run 5 minutes after boot if we missed a scheduled run +OnBootSec=5min +Persistent=true + +[Install] +WantedBy=timers.target