YunoHost-Apps / kimai2_ynh

Kimai v2 package for YunoHost
https://www.kimai.org/
MIT License
13 stars 8 forks source link

Android Tracker App API Error #32

Closed leuchtrakete666 closed 3 years ago

leuchtrakete666 commented 3 years ago

i am on the latest yunohost. i need to use the tracker app, but i get "Invalid answer from API". i set API passwords for my users. to create the user i log in with each single yunohost LDAP user. unfortunetly i dont see them right away in the management gui.

furthermore i cant provide any logs. i only get "Missing Logfile".

anmol26s commented 3 years ago

Have you installed app on private mode or public mode?

leuchtrakete666 commented 3 years ago

what exactly you mean with private and public mode? i dont see any option like this. i guess you talk about the yunohost app kimai while installation?

leuchtrakete666 commented 3 years ago

would be great if i could see any logs. the doctor tab log files is just showing "Missing Logfile" and kimai2/var/log is also empty

leuchtrakete666 commented 3 years ago

Have you installed app on private mode or public mode?

i have installed the kimai app on yunohost disabling the option being seen by anonymous users. also i disabled the option that users can register themselfes.

kevinpapst commented 3 years ago

Can you open xxx/api/doc in your installation? Probably everything is good with Kimai, but you are only using a wrong URL?

Where does the message Invalid answer from API come from?

leuchtrakete666 commented 3 years ago

when i open https://mydomain.my/api/doc i get straight to the login screen.

the message Invalid answer from API appears in the android kimai app, when i push the button "Test Settings"

kevinpapst commented 3 years ago

when i open https://mydomain.my/api/doc i get straight to the login screen.

and after login? please provide as much info as possible

leuchtrakete666 commented 3 years ago

ups, sorry i didnt try to login.

the API Docs page apears. with all api listed.

kevinpapst commented 3 years ago

Two options: you entered a wrong URL in the app or your Kimai is not available from outside (private mode?) I don't know how YunoHost works, so I would test that as well

kevinpapst commented 3 years ago

There was a bug in the app: don't enter a / at the end of the URL! So something like https://example.kimai.cloud or https://mydomain.my

leuchtrakete666 commented 3 years ago

is there a port to open in firewall?

leuchtrakete666 commented 3 years ago

the URL i entered is correct. i checked this many times.

leuchtrakete666 commented 3 years ago

i still dont understand this private and public mode. i dont find any option for this in the installation process of kimai in yunohost.

leuchtrakete666 commented 3 years ago

another question. is there a way to turn on loging? like i write before, there is no logfile for kimai. nor in var/www/kimai2/var/log neither in var/log

anmol26s commented 3 years ago

i have installed the kimai app on yunohost disabling the option being seen by anonymous users. also i disabled the option that users can register themselfes.

This means that you are on private mode. You would not be able to see the Kimai2 page without login to the Yunohost. Please correct me if its other way around and you are on public mode.

is there a port to open in firewall?

No there is not need to open any port. Api is not relate to any port.

another question. is there a way to turn on loging? like i write before, there is no logfile for kimai. nor in var/www/kimai2/var/log neither in var/log

Most of the times problem is in the Nginx configuration. So check the log /var/log/nginx/yourdomain.tld.error.log

anmol26s commented 3 years ago

@kevinpapst Do we have LDAP ready for Kimai2?

kevinpapst commented 3 years ago

Kimai supports LDAP, yes: https://www.kimai.org/documentation/ldap.html Basic installation steps: create local.yaml with correct settings and then add composer package

anmol26s commented 3 years ago

Great, this should be implemented in Kimai2. I will test it this weekend. And from where can we change the log file for the Kimai2?

leuchtrakete666 commented 3 years ago

i have installed the kimai app on yunohost disabling the option being seen by anonymous users. also i disabled the option that users can register themselfes.

This means that you are on private mode. You would not be able to see the Kimai2 page without login to the Yunohost. Please correct me if its other way around and you are on public mode.

thats it!!!! i just installed a new instance with the anonymous option set and now it works.

there is just the logging issue left.

now i will try to install plugins. i hope this will work, if not you will read again from me ;)

kevinpapst commented 3 years ago

Log config: config/packages/prod/monolog.yaml - probably its changed to point to some global YunoHost location?

anmol26s commented 3 years ago

probably its changed to point to some global YunoHost location? I think it has not changed anything. I will test it.

anmol26s commented 3 years ago

thats it!!!! i just installed a new instance with the anonymous option set and now it works. The api should be public by default despite the app being installed on private or public mode. I will fix this in next update.

kevinpapst commented 3 years ago

BTW: "Missing log file" doesn't mean it is not working! Probably there hasn't been any log message ... logs are only written upon errors.

leuchtrakete666 commented 3 years ago

i get it. i will keep an eye on this.

thanks for you all and your help.