Git Product home page Git Product logo

trax's Introduction

trax

Simple time tracking server designed to work with Mattermost / Slack.

Built with Cookiecutter Django
License:MIT

Overview

Trax is a time tracking server written in Python/Django, designed to work within a chat server such as Mattermost or Slack. You interact with it directly from your chat server, using slash commands and webhooks:

# start to work on something
/trax start making coffee

# Get a pretty reminder in channel in 5 minutes
/trax remind add "Call mom" "in 5 minutes"

# start to work on something else
/trax start reading emails

# Stop working
/trax stop

# see how you spent your time today
/trax stats

Documentation

Detailed user guide, installation and deployment instructions are available at https://traxio.readthedocs.io/.

trax's People

Contributors

christianlupus avatar eliotberriot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

trax's Issues

Retroactive /trax stop hh:mm stops in the future

After invoking /trax stop 17h15 on a running task at day+1 the task completely disappears from the /trax stats table

Timers were successfully stopped on Jan. 6, 2017, 5:15 p.m.:
reticulating splines

Invalid HTTP_HOST header: '127.0.0.1'. You may need to add '127.0.0.1' to ALLOWED_HOSTS.

Hello,

I tried to deploy using the docker-compose method you detail.

I configured my .env file with:

DJANGO_ALLOWED_HOSTS=['127.0.0.1']

but then when I try to visit http://127.0.0.1:8079, I get a 400 level error, and the following in the docker logs:

ERROR 2020-09-14 17:59:00,229 exception 16 140629607933760 Invalid HTTP_HOST header: '127.0.0.1:8079'. You may need to add '127.0.0.1' to ALLOWED_HOSTS.

I tried adding 127.0.0.1:8079 there, but that didn't work.

thought the problem might have been the port, so I tried to change the port in the docker-compose.yml to just map 80, but I still get this:

ERROR 2020-09-14 18:04:28,490 exception 17 140046465333056 Invalid HTTP_HOST header: '127.0.0.1'. You may need to add '127.0.0.1' to ALLOWED_HOSTS.

configure dateparser to prefer future dates

When you add a reminder, you always want it in the future. In the parse_future function, the default PREFER_DATES_FROM settings is applied and choose past dates.

e.g.: if the current day is tuesday and you add a reminder for wednesday 10 o'clock, it will raise an error since the parse_future function won't return anything.

The easy fix is to specify settings={'PREFER_DATES_FROM': 'future'} in the parameters of the dateparser.parse function:
parse(u'wednesday 10h00', settings={'PREFER_DATES_FROM': 'future'})

Add teams / projects

  • A user can belong to one or multiple teams
  • A project belongs to a team
  • A timer may belongs to a project, but will always at least belong to a team

Trax/django produces HTTP 500 internal server errors

I tried to make trax running using docker. I went with your suggestion

# clone the repository
git clone https://github.com/EliotBerriot/trax.git
cd trax

# setup the environment variables
# edit the .env file, especially the TIME_ZONE variable
# and the DJANGO_ALLOWED_HOSTS one
cp env.example .env
nano .env

# set up the docker-compose file
# customize any configuration in the docker compose file
# especially, you can change the listening port and ip
cp docker-compose.example.yml docker-compose.yml
nano docker-compose.yml

# build and run the containers
docker-compose build
docker-compose up -d

# create tables in the database
docker-compose run django python manage.py migrate

# create an admin user (this will be needed to configure your tokens)
docker-compose run django python manage.py createsuperuser

Unfortunately you do not mention what the various settings mean and how they should be set up correctly.

I put an apache web server (serves also other sites) as a reverse proxy between the internet and trax. That is it is configured to forward all traffic for domain trax.example.com to the nginx in the docker container. I put in the list of allowed hosts the site trax.example.com as sole entry. Using this setup, I can connect to the django server (later I want to get rid of nginx but this is another story).

When I try to log in using my username and password as set up in the commands above, I get a HTTP error 500 Internal server error. This is coming from django itself. I sniffed into the traffic of the bridge and the nginx sends the POST request to /accounts/login with the credentials to django. The result is the error 500.

In the docker logs there is nothing that looks suspicious except for some warnings about missing .env files. Especially there are no errors shown.

What can I do to track this further down?

Mattermost moving to API version 4

Hey @EliotBerriot !

First, hugely appreciate you sharing this project back with the world. Fantastic work!

I wanted to let you know about our plans moving to API v4:

To make the Mattermost API web service easier to use and to offer more powerful options for these integrations, Mattermost will be moving to a new API version soon. Highlights include:

  • Fully documented API endpoints
  • More in-depth access to server functionality
  • Wider use of established HTTP verbs
  • Consistent endpoint structures
  • A new and improved Go driver

We plan to release API version 4 on March 16th, with Mattermost server 3.7. While the current API version 3 will be supported until September 16th, we recommend you begin using API version 4 soon after its release.

Contributing

API version 4 is an active and on-going project. If you're interested in helping contribute, please join our Mattermost community instance and the APIv4 channel.

We've prepared a contribution process for APIv4 and a progress tracker for new APIv4 enpoints to help you get started.

We're also open for suggestions on adding new API endpoints to help with your integration.

Problems during building worker with PostgreSQL 11.5

At the moment the build fails when processing as described in https://traxio.readthedocs.io/.

During building the worker image, you get the error message:

Collecting psycopg2==2.6.2 (from -r /requirements/base.txt (line 31))
  Downloading https://files.pythonhosted.org/packages/7b/a8/dc2d50a6f37c157459cd18bab381c8e6134b9381b50fbe969997b2ae7dbc/psycopg2-2.6.2.tar.gz (376kB)
    ERROR: Command errored out with exit status 1:
     command: /usr/local/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-wi3ankid/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-wi3ankid/psycopg2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
         cwd: /tmp/pip-install-wi3ankid/psycopg2/
    Complete output (7 lines):
    running egg_info
    creating pip-egg-info/psycopg2.egg-info
    writing pip-egg-info/psycopg2.egg-info/PKG-INFO
    writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt
    writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt
    writing manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.txt'
    Error: could not determine PostgreSQL version from '11.5'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Service 'worker' failed to build: The command '/bin/sh -c pip list && pip install -r /requirements/production.txt     && groupadd -r django     && useradd -r -g django django' returned a non-zero code: 1

A quick research brought me to this issue of psycopg2. When updating the version to 2.7.3.1 (the one I tried out of the blue) in requirements/base.txt, it seems to compile successfully.

Nevertheless I did not try to check for any other bugs/errors/incompatibilities. I ask you to check on this issue and update the code accordingly.

Fix timezone errors

Now we switched to summer time, at least in France, it seems that existing reminders are occuring one hour later :/

Install without docker

I'm running mattermost on a shared system without docker. So I would love a way to install trax without docker.

Problem with manage.py

Running docker-compose -f dev.yml run django python manage.py createsuperuser fails with ImportError: No module named 'boto'

I´d really like to see trax more modular and better documented to integrate it into our running Mattermost instance. I´m not very familiar with Docker and have no idea what went wrong.

Thanks for this project, I´ve really missed something like this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.