A pet project to learn Go, Dennis is a privacy friendly Telegram bot to manage expense tracking. Talk to him here
Dennis was written as a way to track international expenses in a single currency. He keeps an encrypted log of international expenses and returns the total (daily, weekly, monthly) in the user's preferred currency. At the moment, he suppoorts the following commands:
- Track an expense
format: <integer_amount><currency_iso> for <description>
example: 200RUB for Lunch
- Get expense history
format: how much did I spend <time_period> (today, this week, this month)
example: How much did I spend today?
While Dennis respects your privacy, he's not intented to store confidential data. His primary use case is to offer a convenient way to follow up on your day to day spending. In short, he protects you from himself - the bot owner cannot access your detailed expenditures, or use your information for advertising. Anyone with access to your device however can easily access or request this info.
Dennis creates a private/public key pair for all users to encrypt most details of their expenses (note: timestamps are unencrypted). Your private key is protected with a password of your choice. This ensures the admin running the bot has no zero access to your expenditures.
While this protect's user data from the bot owner, keep in mind passwords are visible in plaintext right inside of the Telegram application. Anyone who has access to your chats for instance, can grab hold of your expense history.
With the exception of error logging, there are no logs set up to identify incoming or outgoing chat history between the user and Dennis.
You will need API key's for the following services to get started.
The test suite requires Postgres and Redis to be set up as well as a valid
configuraiton file. The config.example.json
file is already prepared to use the
default settings in the sample docker-compose.example.yml
.
The command below will generate a test config and spin up docker and redis
make develop
docker-compose up -d
This project uses Dep
for dependency mangagement and Megacheck
and golint
as a linter.
If these packages are not installed on your system, run:
make dev_dependencies
Otherwise just install the app's third party packages.
dep ensure -vendor-only -v
Note, test packages are dependent on a local shared DB. They must be run sequentially
with -p=1
to prevent race conditions during teardown methods.
go test -p=1 ./...
You can also run vet, golint, megacheck and test (with race check and cache disabled) using the command below.
make test_and_lint
These steps are not necessary if all you want to do is run the test suite.
./ngrok http 8080
database
andreddis
- Postgres & Redis settings if you are not using the default test configtelegram
- Telegram API token to respond to messageswit
- Wit.ai auth token to parse user messagesalphapoint
- Alphapoint API key to convert currencybot_domain
- Domain the bot will be receiving webhooks from. In development, this will be the Ngrok URL
go build ./cmd/dennis-bot
./dennis-bot
Telegram does not send any authentication headers in their requests, and instead recommends you instead use the token as the path of your webhook.
Tagged builds are available on docker hub. They sould be configured with an environment variable
DENNIS_BOT_CONFIG
that points to a JSON config on a local volume.