added gitea activity for fun
This commit is contained in:
@@ -44,3 +44,59 @@ systemctl list-timers tasknest-demo-seed.timer
|
||||
|
||||
The supplied timer runs daily at 03:15 Europe/Amsterdam and catches up after a
|
||||
missed scheduled run when the host comes back online.
|
||||
|
||||
## Fasting phase notifications
|
||||
|
||||
The `notify_fasting_phases` command checks each active fasting schedule and sends
|
||||
an ntfy notification when the current phase changes to fasting or eating. It
|
||||
requires a tested, enabled ntfy topic in Settings. The command records each
|
||||
phase boundary so repeated runs do not send duplicate notifications. A failed
|
||||
delivery is retried on the next run. If the host was offline across several
|
||||
boundaries, only the current phase is announced.
|
||||
|
||||
The host runs Python 3.12 while the development environment uses Python 3.13.
|
||||
Create a separate host virtualenv so systemd does not follow a symlink to a
|
||||
Python executable absent from the host:
|
||||
|
||||
```sh
|
||||
cd /home/jorenmartijn/django
|
||||
python3 -m venv tasksnest-host
|
||||
tasksnest-host/bin/python -m pip install -r main/requirements.txt
|
||||
tasksnest-host/bin/python main/manage.py check
|
||||
```
|
||||
|
||||
Install the provided systemd service and timer to run this check every minute:
|
||||
|
||||
```sh
|
||||
sudo cp main/deploy/systemd/tasknest-fasting-notifications.{service,timer} /etc/systemd/system/
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable --now tasknest-fasting-notifications.timer
|
||||
```
|
||||
|
||||
Run database migrations before enabling the timer. Adjust the service's user
|
||||
and paths for your deployment.
|
||||
|
||||
## Gitea activity widget
|
||||
|
||||
The main task page shows a contribution grid below Daily Workout when
|
||||
`GITEA_USERNAME` is set in the Django server process environment. It uses
|
||||
Gitea's `/api/v1/users/{username}/heatmap` endpoint, refreshes the server-side
|
||||
cache every 15 minutes, and keeps any token out of browser requests.
|
||||
|
||||
Put these values in `/home/jorenmartijn/django/.env`, then restart the service
|
||||
that runs Django. Values set directly in the service environment take priority:
|
||||
|
||||
```ini
|
||||
GITEA_USERNAME=your-gitea-username
|
||||
GITEA_BASE_URL=https://git.jorendegraaf.eu
|
||||
# Only if the public heatmap endpoint does not show the activity you want:
|
||||
GITEA_TOKEN=your-read-only-token
|
||||
```
|
||||
|
||||
The base URL already defaults to `https://git.jorendegraaf.eu`. For public
|
||||
activity, try without a token first. If Gitea requires authentication or you
|
||||
want activity visible only to your account, create a token in Gitea's **User
|
||||
Settings → Applications → Generate New Token** with `read:user` permission.
|
||||
Store it in the Django service environment, never in this repository or in
|
||||
browser JavaScript. The dashboard shows a short unavailable message if the
|
||||
endpoint cannot be reached.
|
||||
|
||||
Reference in New Issue
Block a user