Mezzotre is a Telegram bot for helping you manage your DnD content https://mezzotre.poldebra.me
 
 
Go to file
Davide Polonio 9ff5748964
continuous-integration/drone/push Build is passing Details
chore: perform refactor for db-cleaning and more testing
* Add Javadoc where missing
* Solve some FIXMEs here and there
2023-04-14 15:00:25 +02:00
.mvn/wrapper feat: use mvnw, add DroneCI 2023-03-26 22:47:54 +02:00
.run chore: add drone-ci-tests and docker build (#1) 2023-03-27 17:16:29 +02:00
conf chore: add drone-ci-tests and docker build (#1) 2023-03-27 17:16:29 +02:00
schema/json feat: add change language in welcome message (#2) 2023-04-03 10:57:14 +02:00
src chore: perform refactor for db-cleaning and more testing 2023-04-14 15:00:25 +02:00
.drone.yml chore: add drone-ci-tests and docker build (#1) 2023-03-27 17:16:29 +02:00
.gitignore chore: first commit 2023-03-21 18:09:06 +01:00
.markdownlint.yaml feat: add change language in welcome message (#2) 2023-04-03 10:57:14 +02:00
.pre-commit-config.yaml chore: add drone-ci-tests and docker build (#1) 2023-03-27 17:16:29 +02:00
Dockerfile chore: add drone-ci-tests and docker build (#1) 2023-03-27 17:16:29 +02:00
LICENSE chore: add README 2023-03-26 21:39:02 +02:00
README.md feat: first implementation of help command, wip 2023-04-04 17:48:27 +02:00
docker-compose.yml chore: first commit 2023-03-21 18:09:06 +01:00
mvnw feat: use mvnw, add DroneCI 2023-03-26 22:47:54 +02:00
mvnw.cmd feat: use mvnw, add DroneCI 2023-03-26 22:47:54 +02:00
pom.xml feat: first implementation of help command, wip 2023-04-04 17:48:27 +02:00

README.md

Mezzotre

Build Status

Mezzotre is a DnD content management system. Currently, it is still in the first development stages and everything is still evolving, goals included.

The whole system is based on Java17+ for the language, incoming Webhooks from Telegram, Jooby backend to handle the requests, PostgresSQL to store data and long-term chat context information.

Shipping and running

Keep in mind that Mezzotre is meant to be run behind a reverse proxy handling all the TLS stuff. In the root of the project you can find a docker-compose.yml file that can be a useful starting point to generate your configuration. Finally, you can use the same docker-compose definition as a developer to have a live version running. Simply run:

DEBUG_OPTS=debug- docker-compose up -d --build && docker-compose logs -f

to run a debug instance. Omit the DEBUG_OPTS env variable for a "production" style environment. Note that this configuration requires an .env file (that is not committed for obvious reasons) containing the database password and a valid Telegram Bot token.

To configure Webhook configuration for your bot, open up a terminal and type:

curl -F "url=https://example.com/api/tg" \
 -F "allowed_updates=[\"message\", \"edited_message\", \"channel_post\", \"edited_channel_post\", \"inline_query\", \"choosen_inline_result\", \"callback_query\", \"poll\", \"poll_answer\", \"my_chat_member\", \"chat_member\", \"chat_join_request\"]" \
 https://api.telegram.org/bot<YOUR BOT TOKEN>/setWebhook

Building

Build is achieved through Maven. To build a jar run:

./mvnw package -DskipTests=true -Dmaven.test.skip=true -Dmaven.site.skip=true -Dmaven.javadoc.skip=true

In the target/ folder you will find an uber-jar and optionally the possibility to run it via a script and to setup auto-startup via systemd or openrc units.

Developing

Automatic testing

You can simply run tests with ./mvnw test. This will run UT and IT tests together.

Manual testing

For a manual approach, just open a terminal and type mvn jooby:run. Assuming you have a database locally available (check out application.conf) and a valid Telegram token set (maybe as environment variable) you can develop and see live changes of your Mezzotre on the fly. Finally, by using Postman, you can simulate incoming Telegram events.

License

This software is under AGPL3+. You can find all details in the LICENSE file.