traccar-web icon indicating copy to clipboard operation
traccar-web copied to clipboard

Where i can edit the traccar-web.war to allow traccar manager app work.

Open onethings opened this issue 9 years ago • 17 comments

Hi, Which file (traccar-web.war ) and code i can edit to allow traccar manager app ( android & ios ) work. Thank you very much.

Android – https://github.com/tananaev/traccar-manager-android iOS – https://github.com/tananaev/traccar-manager-ios

onethings avatar Jul 04 '16 10:07 onethings

The main incompatibility is the password hashing functionality:

  1. Currently Traccar Web UI Mod does not support hashing function from the backend: https://github.com/tananaev/traccar/blob/master/src/org/traccar/helper/Hashing.java#L52

  2. Salt for the backend is generated per user, in my project there is a single salt for the whole application. I believe this is fine for an acceptable level of security.

So, to handle this the following steps must be changed:

  1. Add new hashing function https://github.com/vitalidze/traccar-web/blob/dev/src/main/java/org/traccar/web/shared/model/PasswordHashMethod.java with exactly same algorithm as implemented on the backend with salt from the doHash method argument

  2. Update database.loginUser query:

    <entry key='database.loginUser'>
        SELECT * FROM users
        WHERE email = :email;
    </entry>

It should join the salt column from application_settings table with salt alias. This will force backend to use salt from the global settings.

  1. All users should have email field filled in because backend is using it for the authorization.

For testing here are docs of the backend API: https://www.traccar.org/traccar-api/

These are just my thoughts, I haven't tried it myself.

vitalidze avatar Jul 04 '16 20:07 vitalidze

Hi Vitaly,

Have you fixed this issue in your new release? or How can I use your rest API in our mobile app.

Hi @onethings

Have you got any solution of this issue. I am also facing same issue.

rbniranjan avatar Jul 13 '16 15:07 rbniranjan

No, I haven't fixed that yet.

среда, 13 июля 2016 г. пользователь rbniranjan написал:

Hi Vitaly,

Have you fixed this issue in your new release? or How can I use your rest API in our mobile app.

Hi @onethings https://github.com/onethings

Have you got any solution of this issue. I am also facing same issue.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/vitalidze/traccar-web/issues/759#issuecomment-232391219, or mute the thread https://github.com/notifications/unsubscribe/ACMCNWupaaU2JG7iPMI_Snk98lHkK1XEks5qVQOjgaJpZM4JEP3a .

Kind regards, Vitaly Litvak

vitalidze avatar Jul 13 '16 15:07 vitalidze

Thanks for your update.

Now I am thinking into another way. I will try to login using your api and then try to use traccar server api. I hope it will work.

rbniranjan avatar Jul 13 '16 15:07 rbniranjan

Hi, @rbniranjan I haven't got solution of this issue yet.

onethings avatar Jul 13 '16 17:07 onethings

@rbniranjan i found this android app can login with traccar web ui mod and traccar mod. https://play.google.com/store/apps/details?id=org.erlymon.traccarm Have you got any solution yet?

onethings avatar Jul 20 '16 04:07 onethings

@vitalidze Can you show the correct way to make the add new hashing function with the same algorithm and the query please? I'm lose! XD

EasywareMX avatar Nov 04 '16 03:11 EasywareMX

I gave a reference to code in backend project. You need to put it into PasswordHashMethod class somehow.

vitalidze avatar Nov 04 '16 05:11 vitalidze

Hi All

Hope you are well. I am also having this issue. I have VERY limited programming knowledge and am trying to learn. I do however need some guidance as to how to fix this issue? It is quite important to me as I would like to learn to develop on this MOD as it is FANTASTIC!

Please can you guide me on how to get this resolved?

rdentandt avatar Nov 12 '16 23:11 rdentandt

@rdentandt do you have a particular question? From my point of view all needed information is already present in this ticket.

vitalidze avatar Nov 13 '16 13:11 vitalidze

Hi There

Might be but I am no developer and would some guidance on how to add the doHash commands to the java file before compiling.

Apologies for this but like I said I have no development experience. I am learning so any guidance will be helpful.

Thanks

On 13 Nov 2016, at 3:26 PM, Vitaly Litvak [email protected] wrote:

@rdentandt do you have a particular question? From my point of view all needed information is already present in this ticket.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

rdentandt avatar Nov 13 '16 14:11 rdentandt

@rdentandt You need to start from learning java.

vitalidze avatar Nov 13 '16 14:11 vitalidze

Added basic support, written news, article, updated latest and demo versions.

vitalidze avatar Dec 17 '16 11:12 vitalidze

Hi, I developed a Traccar manager version using hybrid framework (Ionic), it is free and compatible with the UI Mod: https://play.google.com/store/apps/details?id=com.ionicframework.tracgpsmonitor461755

ijrad avatar Dec 17 '16 12:12 ijrad

# LOVE YOU LITVAK! There changes on new version are awesome! Thank you very much!

EasywareMX avatar Dec 27 '16 22:12 EasywareMX

hi,, litvak

i cant add a new user.. in WEB UI 3.9 the log

|Service traccar|17-05-06 19:11:47| ... 52 more FINEST|1034/0|Service traccar|17-05-06 19:11:47|Caused by: org.h2.jdbc.JdbcSQLException: NULL not allowed for column "NAME"; SQL statement: FINEST|1034/0|Service traccar|17-05-06 19:11:47|insert into users (id, admin, archive, blocked, companyName, email, expirationDate, firstName, lastName, login, managedBy_id, manager, maxNumOfDevices, notifications, password, password_hash_method, phoneNumber, readOnly, salt, userSettings_id) values (null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [23502-194] FINEST|1034/0|Service traccar|17-05-06 19:11:47| at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)

cuantic avatar May 06 '17 23:05 cuantic

@cuantic first of all, please don't post your questions in random threads. I don't see any relation with this thread.

Regarding your issue: this means you haven't followed installation instructions carefully. Most probably you haven't dropped existing database or haven't disabled database schema updates.

vitalidze avatar May 07 '17 06:05 vitalidze