Skip to content

Amir-hossein-Mazaheri/Jarvis

Repository files navigation

Versions Details

version 0.9.2 beta

Changes since the last version:

  • Added Webapp front-end for building json files for tasks
  • Added a simple REST api back-end to serve each team members

version 0.8.3 beta

Changes since the last version:

  • Added public announcement for admin user
  • Added public announcement for updating bot for admin user
  • Fixed some little but harmful bugs
  • Fixed admin users list action too long message by adding pagination
  • Improved code maintainability and made it more cleaner by adding some super handlers

version 0.7 beta

Changes since the last version:

  • Added multiple team support for users
  • Fixed CallbackHandler pattern matching
  • Added toggle edit info for admin user
  • Added adding member from other team for head users
  • Added removing member from team for head users
  • Added see team members for head users

version 0.5 beta

First public publish of bot


How to run bot

It is much different for development and production so I made two different description


Pre Requirements

  • Docker
  • Python(a version with async support)

Development

First you should make a file called .env which follow instructions of .env.example(copy and paste the fill it with correct info)

Second run below command to run the database with docker compose:

docker compose -f docker-compose.dev.yml up -d

Then you should execute the main.py like:

python main.py

If you are on linux you should use python3 instead on python


Alernative way for running python command


If you want to change the code and see the result constantly follow these commands:

First you should install NodeJS on you computer then run the bellow command

    npm i -g nodemon

Then for running the bot run this:

    nodemon --w . --exec python main.py

With this command the you don't need to rerun the command when you edit code


Production

First you need to ssh into your server and clone this repo like this:

git clone https://github.com/Amir-hossein-Mazaheri/Jarvis.git bot
cd bot

To run this app for production purpose you need to create secrets before you run docker

List of secrets you need to create:

  • db.txt
  • db_user.txt
  • db_pass.txt
  • bot_token.txt
  • bot_secret.txt
  • server_ip.txt

Each of them is a text file that you must create


To make password or secret you can use following command:

openssl rand -hex 64

This command will log a 64 character string which is random to make it more fluid you can use this alternative command:

openssl rand -hex 64 > db_pass.txt

You can do the same thing for generating bot_secret.txt


After making secrets you're ready to run the app with the following command:

docker compose up -d

If you're struggling with compose cache you can use following command too(may or may not fix your problem):

docker compose up --build -d

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published