mirror of
https://github.com/idanoo/go-mastodon-stats
synced 2025-07-01 05:42:19 +00:00
Add systemd timer/service + update readme
This commit is contained in:
parent
98c957b755
commit
f1066d74d7
3 changed files with 30 additions and 1 deletions
|
@ -1,5 +1,12 @@
|
|||
Create readonly account with access to stats DB
|
||||
# go-mastodon-stats
|
||||
Pulls in a bunch of stats from services, sends to a statsdb schema and posts to matrix/mastodon weekly.
|
||||
|
||||
Setup a new application, use the ID/SECRET in your .env with some user creds
|
||||
> https://mastodon.nz/settings/applications/new
|
||||
|
||||
|
||||
|
||||
Create readonly account with access to stats DB
|
||||
|
||||
```
|
||||
CREATE USER gomastodonstats WITH PASSWORD 'superrandompassword';
|
||||
|
|
12
dist/stats.service
vendored
Normal file
12
dist/stats.service
vendored
Normal file
|
@ -0,0 +1,12 @@
|
|||
[Unit]
|
||||
Description=Add stats to mastodon/etc
|
||||
Wants=stats.timer
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
User=root
|
||||
WorkingDirectory=/root/go-mastodon-stats
|
||||
ExecStart=/usr/local/go/bin/go run cmd/gomastodonstats/main.go
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
10
dist/stats.timer
vendored
Normal file
10
dist/stats.timer
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
[Unit]
|
||||
Description=Run stats on Monday
|
||||
Requires=stats.service
|
||||
|
||||
[Timer]
|
||||
Unit=stats.service
|
||||
OnCalendar=Weekly Pacific/Auckland
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
Loading…
Add table
Add a link
Reference in a new issue