Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ sudo systemctl enable --now modlog@<subreddit>
tail -f /var/log/redditmodlog/<subreddit>.log
```

`install.sh` creates the `modlogbot` user, `/etc/redditmodlog`, `/var/log/redditmodlog`, `/opt/RedditModLog/data`, and a daily logrotate rule (30 files, 100 MB max). Per-instance credentials can go in `/etc/redditmodlog/<subreddit>.env`. The unit sets `ProtectSystem=strict` and allows writes only to `/opt/RedditModLog/data` and `/var/log/redditmodlog`, so set `DATABASE_PATH=/opt/RedditModLog/data/modlog.db` and `LOGS_DIR=/var/log/redditmodlog` in that env file. Limits: 256 MB memory and 25% CPU.
`install.sh` creates the `modlogbot` user, `/etc/redditmodlog`, `/var/log/redditmodlog`, `/opt/RedditModLog/data`, and a daily logrotate rule (30 files, 100 MB max). Per-instance credentials can go in `/etc/redditmodlog/<subreddit>.env`. The unit sets `ProtectSystem=false`, allows writes to `/etc/redditmodlog` and `/var/log/redditmodlog`, and sets `DATABASE_PATH=/etc/redditmodlog/modlog.db` and `LOGS_DIR=/var/log/redditmodlog`. Limits: 256 MB memory and 25% CPU.

## Troubleshooting

Expand Down
6 changes: 4 additions & 2 deletions systemd/modlog@.service
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ WorkingDirectory=/opt/RedditModLog

# Environment file for credentials (optional)
EnvironmentFile=-/etc/redditmodlog/%i.env
Environment="DATABASE_PATH=/etc/redditmodlog/modlog.db"
Environment="LOGS_DIR=/var/log/redditmodlog"

# Use config file specific to this subreddit
ExecStart=/opt/.venv/redditbot/bin/python /opt/RedditModLog/modlog_wiki_publisher.py \
Expand All @@ -27,9 +29,9 @@ StartLimitBurst=3
# Security hardening
NoNewPrivileges=true
PrivateTmp=true
ProtectSystem=strict
ProtectSystem=false
ProtectHome=true
ReadWritePaths=/opt/RedditModLog/data /var/log/redditmodlog
ReadWritePaths=/etc/redditmodlog /var/log/redditmodlog

# Resource limits
MemoryMax=256M
Expand Down