first commit

This commit is contained in:
2026-01-26 12:34:00 +01:00
commit e64465a7e6
29 changed files with 2952 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
[Unit]
Description=News Agent - Daily Tech News Aggregator
After=network-online.target
Wants=network-online.target
[Service]
Type=oneshot
User=%u
WorkingDirectory=/home/%u/news-agent
Environment="PATH=/home/%u/news-agent/.venv/bin:/usr/local/bin:/usr/bin"
# Run the news agent
ExecStart=/home/%u/news-agent/.venv/bin/python -m src.main
# Logging
StandardOutput=journal
StandardError=journal
SyslogIdentifier=news-agent
# Resource limits
MemoryLimit=512M
CPUQuota=50%
# Restart policy (only on failure)
Restart=on-failure
RestartSec=5min
[Install]
WantedBy=default.target

15
systemd/news-agent.timer Normal file
View File

@@ -0,0 +1,15 @@
[Unit]
Description=News Agent Daily Timer
Requires=news-agent.service
[Timer]
# Run daily at 07:00 Europe/Oslo time
OnCalendar=07:00
Persistent=true
# If system was off at trigger time, run on next boot
# but wait 5 minutes after system is up
OnBootSec=5min
[Install]
WantedBy=timers.target