Habit service for entrello, built on top of Google Sheets.
You must have a dedicated sheet for the current month in your spreadsheet.
Do not delete sheets for past months as they may be used by the progress report feature.
Sheet names must follow a certain convention. Some examples:
The sheet format must follow this specific convention:
- Dates go to the first column, starting from
A3. (LeaveA1andA2blank.) - Habit names go to the first row, starting from
B1. - Scores go to the second row, starting from
B2.
Here's an example:
Conditional formatting of the colors can be adjusted from Google Sheets UI.
Start the server:
go run ./cmd/serverFetch all habits that are not marked yet as done/skipped/failed.
entrello will periodically call this endpoint and create a Trello card for each returned habit.
Alternatively, you can run following command to print the same result set on the console:
go run ./cmd/cliMark a habit as done/skipped/failed.
entrello will call this endpoint whenever a habit card is archived on your Trello board.
Generate and send a progress report as a Telegram message.
This endpoint will not be called by entrello. It's meant to be called by a separate scheduled job, or manually on demand. You don't have to put anything in the POST request body, but if you set the SECRET environment variable, you must also set the X-API-Key header accordingly.
Alternatively, you can run following command to generate and send a progress report:
go run ./cmd/cli progress-reportPut your environment variables in a file called .env, based on .env.example.
| Environment Variable | Description |
|---|---|
TIMEZONE_LOCATION |
Timezone, e.g. "Europe/Istanbul" |
GSHEETS_CLIENT_ID |
Google Sheets Client ID |
GSHEETS_CLIENT_SECRET |
Google Sheets Client Secret |
GSHEETS_ACCESS_TOKEN |
Google Sheets Access Token |
GSHEETS_REFRESH_TOKEN |
Google Sheets Refresh Token |
SPREADSHEET_ID |
Google Spreadsheet ID |
PORT |
HTTP port (server mode only) |
SECRET |
API secret (server mode only, optional) |
PROGRESS_REPORT_SKIP_LIST |
Comma-separated habit names to be excluded from progress reports |
TELEGRAM_TOKEN |
Telegram Bot API Token |
TELEGRAM_CHAT_ID |
Telegram Bot Chat ID |
A new Docker image will be created upon each release.
-
Authenticate with the GitHub container registry (only once):
echo $GITHUB_ACCESS_TOKEN | docker login ghcr.io -u GITHUB_USERNAME --password-stdin
-
Pull the latest Docker image:
docker pull ghcr.io/utkuufuk/habit-service/image:latest
-
Start a container:
# server docker run -d \ -p <PORT>:<PORT> \ --env-file </abs/path/to/.env> \ --restart unless-stopped \ --name habit-service \ ghcr.io/utkuufuk/habit-service/image:latest # CLI docker run --rm \ --env-file </abs/path/to/.env> \ ghcr.io/utkuufuk/habit-service/image:latest \ ./cli

