Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API: Kimai metadata endpoint #320

Closed
bastilimbach opened this issue Sep 23, 2018 · 8 comments
Closed

API: Kimai metadata endpoint #320

bastilimbach opened this issue Sep 23, 2018 · 8 comments

Comments

@bastilimbach
Copy link

Describe the solution you'd like
Currently, there aren't any endpoints to determine some metadata about the running Kimai instance. It would be very beneficial to get some data about the currently running Kimai version and other information. Examples:

  • Used Database
  • Kimai version
  • PHP version

Additional context
As you know, I'm currently converting Timeu to support Kimai2 instead of Kimai v1. It would be really helpful to get the version of the running Kimai instance. With the version number, I could verify, that certain API endpoints and functionalities are available . Currently, I use the version number of the swagger API documentation for that use case, which isn't really optimal. I'm not even sure if the version number gets updated on an API change:

  "swagger": "2.0",
  "info": {
    "title": "Kimai 2 - API Docs",
    "description": "REST API description for the Kimai 2 time-tracking software",
    "version": 0.1
  },

Related issues
#319

@kevinpapst
Copy link
Member

Currently Kimai2 doesn't know its version number. But I guess I have to add it... probably to the api/ping endpoint. But this will ONLY include the Kimai version.
I don't think why we should expose the PHP version or database. Why would you need them?

@bastilimbach
Copy link
Author

bastilimbach commented Sep 23, 2018

I'm totally fine with only the version number! I thought this could be useful to other API clients, like a data-migration script. But that's not a common use case and the exposed PHP or database version could lead to a security breach.

If you could add the version number to the ping endpoint, that would be perfect! With this, I could validate the Kimai instance URL and the version.

How do you plan on updating the version number? Do you get the version from the database or a static config file?

@kevinpapst
Copy link
Member

I would keep it as constant in one file. Other third party provider already asked for it, as they need it for their automated installer. I'll add the changes later and send you an update here.

@kevinpapst
Copy link
Member

Added PR #321 - do you have a local installation for testing the branch?

@bastilimbach
Copy link
Author

bastilimbach commented Sep 23, 2018

I'm having some issues with creating a local dev environment for Kimai2. If I execute bin/console kimai:reset-dev after doctrine:database:create and doctrine:schema:create I get the following error message:

[ERROR] Failed to import fixtures: There are no commands defined in the "doctrine:fixtures" namespace.

         Did you mean one of these?
             doctrine
             doctrine:cache
             doctrine:database
             doctrine:generate
             doctrine:mapping
             doctrine:migrations
             doctrine:query
             doctrine:schema

Also if I try to run the server using bin/console server:run it gave me this error:

There are no commands defined in the "server" namespace.

PHP and Composer are up to date and the PHP extension intl is installed.

@kevinpapst
Copy link
Member

kevinpapst commented Sep 23, 2018

You are running in prod mode, please change your .env file to APP_ENV=dev.
These commands are only registered in dev.

@bastilimbach
Copy link
Author

bastilimbach commented Sep 23, 2018

Oh wow. I should read the full documentation next time...

Testing the branch now 👍

@lock
Copy link

lock bot commented Nov 23, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Nov 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants