106 Commits

Author SHA1 Message Date
Elias Hackradt
60cf2dcf03 (fix) 13921 add native app url to the manifest 2025-06-13 13:20:00 +02:00
Girish Ramakrishnan
ab6bd4043f Update documentation url 2025-06-05 10:22:49 +02:00
Package Updates
794650a646 Update package version to 1.17.1 2025-06-02 06:30:21 +00:00
Renovate Bot
f038bf5d67 chore(deps): update dependency traccar/traccar to v6.7.2
| datasource      | package         | from  | to    |
| --------------- | --------------- | ----- | ----- |
| github-releases | traccar/traccar | 6.7.1 | 6.7.2 |
2025-06-02 05:20:51 +00:00
Package Updates
0c10d06b47 Update package version to 1.17.0 2025-05-27 09:26:41 +00:00
Vladimir D
056b8e6e42 OIDC config fixed 2025-05-27 13:12:48 +04:00
Vladimir D
56d4cee9c8 tests updated 2025-05-27 12:30:17 +04:00
Renovate Bot
3432246e5e chore(deps): update dependency traccar/traccar to v6.7.1
| datasource      | package         | from | to    |
| --------------- | --------------- | ---- | ----- |
| github-releases | traccar/traccar | 6.6  | 6.7.1 |
2025-05-24 05:21:15 +00:00
Package Updates
86e97c91fe Update package version to 1.16.0 2025-04-01 15:48:05 +00:00
Girish Ramakrishnan
70e1890001 Update base image to 5.0.0 2025-04-01 17:32:33 +02:00
Package Updates
bdb97eda2f Update package version to 1.15.0 2025-01-12 08:36:48 +00:00
Renovate Bot
0da60dccf0 chore(deps): update dependency traccar/traccar to v6.6
| datasource      | package         | from | to  |
| --------------- | --------------- | ---- | --- |
| github-releases | traccar/traccar | 6.5  | 6.6 |
2025-01-12 06:21:07 +00:00
Vladimir D
94ea75bfdb "CLOUDRON_OIDC_PROVIDER_NAME is not supported" comment added
checklist added
2024-12-26 16:20:18 +04:00
Renovate Bot
4653d689d8 chore(deps): update dependency traccar/traccar to v6.5
| datasource      | package         | from | to  |
| --------------- | --------------- | ---- | --- |
| github-releases | traccar/traccar | 6.4  | 6.5 |
2024-11-11 08:29:52 +00:00
Girish Ramakrishnan
822e7fae94 Update renovate 2024-11-11 08:28:06 +00:00
Johannes Zellner
aa44cf613d Has no patch version 2024-11-10 20:45:05 +01:00
Johannes Zellner
f084b95d66 Downgrade for ci 2024-11-10 20:42:19 +01:00
Johannes Zellner
30203a4fae Prepare for ci 2024-11-10 20:42:07 +01:00
Girish Ramakrishnan
363b3bcbfe Update renovate.json5 2024-11-04 17:09:53 +00:00
Girish Ramakrishnan
cf6e0aa31e Add renovate.json5 2024-11-04 17:02:48 +00:00
Johannes Zellner
8fdae7271a Bump version 2024-09-18 13:47:27 +02:00
Johannes Zellner
a37c8c398f Make tests language independent 2024-09-18 13:40:48 +02:00
Johannes Zellner
365763a684 Update test deps 2024-09-18 11:12:51 +02:00
Johannes Zellner
6ec68a57e5 Update to 6.5 2024-09-18 11:12:34 +02:00
Girish Ramakrishnan
8d35c6b967 Version 1.13.0 2024-08-10 10:17:09 +02:00
Girish Ramakrishnan
c9ed0c7342 Update test packages 2024-08-10 10:02:48 +02:00
Girish Ramakrishnan
eb246a1d9b Update Traccar to 6.4 2024-08-10 09:49:20 +02:00
Girish Ramakrishnan
f59f9b73da Version 1.12.0 2024-07-29 09:51:07 +02:00
Girish Ramakrishnan
fe4d7e7bb3 Update test packages 2024-07-29 09:50:11 +02:00
Girish Ramakrishnan
4999cf00b1 Update Traccar to 6.3 2024-07-29 08:39:22 +02:00
Girish Ramakrishnan
e507297c6e Version 1.11.1 2024-06-13 12:00:02 +02:00
Girish Ramakrishnan
734dd6c167 delete oidc config only on first run 2024-06-13 11:14:20 +02:00
Girish Ramakrishnan
fc14c89b3e Fix up tests 2024-06-13 10:56:00 +02:00
Girish Ramakrishnan
a0e893fbde do not delete oidc config in non-sso mode 2024-06-13 10:55:52 +02:00
Girish Ramakrishnan
8a4cdc2b03 Version 1.11.0 2024-06-06 14:58:20 +02:00
Vladimir D
b6945531b8 OIDC auth implemented, tests updated 2024-06-06 15:56:06 +04:00
Girish Ramakrishnan
b5a542e2b1 Version 1.10.0 2024-06-03 11:32:29 +02:00
Girish Ramakrishnan
1565a0f774 Update test packages 2024-06-03 11:18:26 +02:00
Girish Ramakrishnan
4dbbc317a8 Update Traccar to 6.2 2024-06-03 11:04:33 +02:00
Girish Ramakrishnan
53a09ffee2 Version 1.9.0 2024-04-11 11:49:04 +02:00
Girish Ramakrishnan
bb0d170b27 Update Traccar to 6.1 2024-04-11 09:44:19 +02:00
Johannes Zellner
f9360a5752 Bump version 2024-04-07 14:34:46 +02:00
Johannes Zellner
afd9d1646c Update test deps 2024-04-07 13:01:04 +02:00
Johannes Zellner
abb8c8b871 Update to 6.0 2024-04-07 12:59:40 +02:00
Girish Ramakrishnan
0daf95ec34 Version 1.7.3 2024-03-25 22:55:24 +01:00
Girish Ramakrishnan
4ab0863f24 Update test packages 2024-03-25 22:40:31 +01:00
Girish Ramakrishnan
4957e1f484 chain the commands 2024-03-25 22:39:00 +01:00
Girish Ramakrishnan
dd97a49741 only create admin account the first time
when importing an external traccar with on admin, this ends up
creating an admin
2024-03-25 22:24:19 +01:00
Johannes Zellner
0bc71eaa5b Bump version 2024-01-27 19:41:43 +01:00
Johannes Zellner
a0dc7f4558 Update test deps 2024-01-27 19:31:48 +01:00
Johannes Zellner
9e3d0a4937 Update to 5.12 2024-01-27 19:31:38 +01:00
Johannes Zellner
52b52d1a0f Bump version 2024-01-15 10:33:07 +01:00
Johannes Zellner
fc9323506f Update test deps 2024-01-15 09:54:49 +01:00
Johannes Zellner
f33dc5bc7e Update to version 5.11 2024-01-15 09:54:19 +01:00
Girish Ramakrishnan
39f43c1749 Version 1.7.0 2023-11-22 10:20:25 +01:00
Girish Ramakrishnan
abc9b953ec Update test packages 2023-11-22 10:04:33 +01:00
Girish Ramakrishnan
2c7d09785a Update Traccar to 5.10 2023-11-22 09:22:08 +01:00
Girish Ramakrishnan
28760e473c Version 1.6.0 2023-10-24 09:37:46 +02:00
Girish Ramakrishnan
25fc82e634 Update base image to 4.2.0 2023-10-24 09:22:19 +02:00
Johannes Zellner
f2d5cadcb4 Update test deps 2023-09-03 10:59:08 +02:00
Johannes Zellner
7a7ff78370 Bump version 2023-09-03 10:58:58 +02:00
Girish Ramakrishnan
9de136492f Version 1.5.0 2023-05-31 09:06:45 +02:00
Girish Ramakrishnan
9f3c2cc71c Update test packages 2023-05-31 09:06:41 +02:00
Girish Ramakrishnan
e00970a7ac Update Traccar to 5.8 2023-05-31 08:30:05 +02:00
Girish Ramakrishnan
92b658e10f Version 1.4.0 2023-04-27 19:46:09 +02:00
Girish Ramakrishnan
8addbf5eb5 Add TELTOKIA_PORT 2023-04-27 19:10:57 +02:00
Girish Ramakrishnan
5dd2d5ff29 Version 1.3.0 2023-04-17 09:49:14 +02:00
Girish Ramakrishnan
2800d92f14 Update test packages 2023-04-17 08:27:24 +02:00
Girish Ramakrishnan
c97fa9157a Update Traccar to 5.7 2023-04-17 08:24:16 +02:00
Johannes Zellner
fdd9ac34ae Fix shell script 2023-02-09 15:55:14 +01:00
Johannes Zellner
d090334699 Update test deps 2023-02-09 15:48:08 +01:00
Johannes Zellner
0c4156dce9 Create admin account on our own as it was removed upstream 2023-02-09 15:47:42 +01:00
Johannes Zellner
42321405b4 Update test deps 2023-02-06 10:05:30 +01:00
Johannes Zellner
7da7a5307b Bump version 2023-02-06 10:05:11 +01:00
Johannes Zellner
faaf81f0c4 Update test deps 2023-01-19 18:07:13 +01:00
Johannes Zellner
2754b1f075 Bump version 2023-01-19 18:06:21 +01:00
Girish Ramakrishnan
709feb60bc Version 1.2.0 2023-01-03 11:18:10 +01:00
Girish Ramakrishnan
60ec7830dd Update test packages 2023-01-03 11:08:07 +01:00
Girish Ramakrishnan
5e5c2b96f5 Update base image to 4.0.0 2023-01-03 11:07:53 +01:00
Johannes Zellner
ddd348b09a Bump version 2022-11-28 11:58:30 +01:00
Girish Ramakrishnan
a333a0cfb0 Update test packages 2022-11-28 11:01:30 +01:00
Girish Ramakrishnan
b08767dc17 Update Traccar to 5.5 2022-11-28 11:00:59 +01:00
Johannes Zellner
d7539d6585 Bump version 2022-10-03 20:40:00 +02:00
Johannes Zellner
a1d8c3b2ee Update test deps 2022-09-08 18:21:07 +02:00
Johannes Zellner
a023246104 Add TAIP port 2022-09-08 18:20:54 +02:00
Johannes Zellner
19c6c630c5 Bump version 2022-08-19 15:30:28 +02:00
Johannes Zellner
4c58a95a73 Add GPS103 port 2022-08-19 15:26:56 +02:00
Johannes Zellner
9ec91c5a44 Add LDAP email login tests 2022-08-08 15:21:40 +02:00
Johannes Zellner
4eeea53abc Add device record for proper testing 2022-08-08 15:21:24 +02:00
Johannes Zellner
3603182a84 Ensure we can also use the email to login via LDAP 2022-08-08 15:21:09 +02:00
Johannes Zellner
00f42d92c5 Add initial tests 2022-08-08 14:45:11 +02:00
Johannes Zellner
ee8db31cc6 Make version 1.0.0 2022-08-08 13:01:49 +02:00
Johannes Zellner
c9ece7726e Bump version 2022-08-08 09:16:21 +02:00
Johannes Zellner
6a8c01ccdf Bump version 2022-07-18 08:54:20 +02:00
Johannes Zellner
dd60363721 Bump version 2022-07-11 13:12:56 +02:00
Girish Ramakrishnan
2d1a59d7ca some devices notes 2022-06-09 16:39:43 -07:00
Girish Ramakrishnan
c6dc2334a7 Version 0.4.0 2022-06-09 10:32:48 -07:00
Girish Ramakrishnan
cf6ba93f35 switch to mysql
seems it may be better supported than postgres

https://www.traccar.org/forums/topic/traccar-on-aws-ec2-amazon-aurora-vs-mysql-on-amazon-rds/
2022-06-09 10:30:20 -07:00
Girish Ramakrishnan
36c07ba44f Optional sso support 2022-06-09 09:53:57 -07:00
Girish Ramakrishnan
353f85474b Version 0.3.0 2022-06-08 22:24:23 -07:00
Girish Ramakrishnan
371bd01528 log to stdout 2022-06-08 22:23:57 -07:00
Girish Ramakrishnan
beb64e256e readme 2022-06-08 22:09:10 -07:00
Girish Ramakrishnan
82e3886525 Add license 2022-06-08 22:07:56 -07:00
Girish Ramakrishnan
36a98e7021 add postinstall 2022-06-08 22:07:46 -07:00
Girish Ramakrishnan
3843e7629b Version 0.2.0 2022-06-08 22:07:22 -07:00
Girish Ramakrishnan
4b9cc5ef87 add forum and doc url 2022-06-08 21:53:05 -07:00
13 changed files with 3672 additions and 43 deletions

View File

@@ -1,2 +0,0 @@
[0.1.0]
* Initial version

176
CHANGELOG.md Normal file
View File

@@ -0,0 +1,176 @@
[0.1.0]
* Initial version
[0.2.0]
* Update manifest
[0.3.0]
* Log to stdout
[0.4.0]
* Switch from postgres to mysql. This will break previous installations, please start afresh
* Optional SSO
[0.4.1]
* Update traccar to 5.1
* [Full changelog](https://github.com/traccar/traccar/releases/tag/v5.1)
[0.5.0]
* Update traccar to 5.2
* [Full changelog](https://github.com/traccar/traccar/releases/tag/v5.2)
[0.6.0]
* Update traccar to 5.3
* [Full changelog](https://github.com/traccar/traccar/releases/tag/v5.3)
[1.0.0]
* First stable release
* Add support for gl200 protocol port 5004
[1.0.1]
* Add GPS103 port 5001
[1.0.2]
* Add TAIP port 5031
[1.0.3]
* Update traccar to 5.4
* [Full changelog](https://github.com/traccar/traccar/releases/tag/v5.4)
[1.1.0]
* Update traccar to 5.5
* [Full changelog](https://github.com/traccar/traccar/releases/tag/v5.5)
[1.2.0]
* Update base image to 4.0.0
[1.2.1]
* Add H02 port 5013
[1.2.2]
* Update traccar to 5.6
* [Full changelog](https://github.com/traccar/traccar/releases/tag/v5.6)
[1.3.0]
* Update traccar to 5.7
* [Full changelog](https://github.com/traccar/traccar/releases/tag/v5.7)
[1.4.0]
* Add support for Telefonika TMT250 Port 5027
[1.5.0]
* Update traccar to 5.8
* [Full changelog](https://github.com/traccar/traccar/releases/tag/v5.8)
[1.5.1]
* Update traccar to 5.9
* [Full changelog](https://github.com/traccar/traccar/releases/tag/v5.9)
[1.6.0]
* Update base image to 4.2.0
[1.7.0]
* Update traccar to 5.10
* [Full changelog](https://github.com/traccar/traccar/releases/tag/v5.10)
* [Release Announcement](https://www.traccar.org/blog/traccar-5-10/)
* Two-factor authentication using TOTP
* Event to notify about sent queued commands
* Option to access last position in computed attributes
* Unification of OBD speed units
* Event buffer limit in the web app (should improve performance)
* Automatic update check for the web app
[1.7.1]
* Update traccar to 5.11
* [Full changelog](https://github.com/traccar/traccar/releases/tag/v5.11)
* Update web submodule
[1.7.2]
* Update traccar to 5.12
* [Full changelog](https://www.traccar.org/blog/traccar-5-12/)
[1.7.3]
* Only create admin account on fresh installation
[1.8.0]
* Update traccar to 6.0
* [Full changelog](https://www.traccar.org/blog/traccar-6-0/)
[1.9.0]
* Update traccar to 6.1
* [Full changelog](https://www.traccar.org/blog/traccar-6-1/)
[1.10.0]
* Update traccar to 6.2
* [Full changelog](https://www.traccar.org/blog/traccar-6-2/)
* Computed attributes can now be ordered using priority
* Support token authentication for WebSocket
* Allow regular users to edit hours and total distance
* Support for right-to-left languages on map
* Terms and privacy policy option
* Engine hours are now calculated after computed attributes
* Default configuration file is now removed to avoid confusion and misconfiguration
[1.11.0]
* Migrate to OIDC login
[1.11.1]
* Fix bug where OIDC configuration was cleared in non-sso mode
[1.12.0]
* Update traccar to 6.3
* [Full changelog](https://www.traccar.org/blog/traccar-6-3/)
* Health check on the volume of stored messages
* Fix push notifications for read-only users
* Use official Google Map tiles with an API key
* Add Google traffic overlay
* New reverse geocoding options
* Faster device removal without removing history
* Avoid duplicated tasks with horizontal scaling
* Add a users column to the device list
* Clear attribute on null computation result
[1.13.0]
* Update traccar to 6.4
* [Full changelog](https://www.traccar.org/blog/traccar-6-4/)
* critical fix for device freezing issue
[1.14.0]
* Update traccar to 6.5
* [Full changelog](https://www.traccar.org/blog/traccar-6-5/)
* Handling processing errors to fix freezing devices
* Option to use linked driver as the current driver
* Support multiple alarms in a single position
* Improve web app loading experience
* Google Maps fallback option with no API key
* Wialon position forwarding option
* Fix map attribution control
[1.15.0]
* Update traccar to 6.6
* [Full Changelog](https://www.traccar.org/blog/traccar-6-6/)
* Managers can now send announcements
* Fixes for multiline SMS notifications
* Early and late computed attributes
* Improvements to user session security
* Support for custom navigation links
* Enhanced speed color scheme
* Collapsible settings and reports drawer
* Improved device card UI
[1.16.0]
* Update base image to 5.0.0
[1.17.0]
* Update traccar to 6.7.1
* [Full Changelog](https://www.traccar.org/blog/traccar-6-7.1/)
* Breaking change: Updated database schema to version 12
* Feature: Added support for new GPS device models
* Feature: Improved geofencing accuracy
* Bugfix: Fixed issue with device disconnection
* Bugfix: Resolved memory leak in server module
* Bugfix: Corrected timezone handling in reports
[1.17.1]
* Update traccar to 6.7.2

View File

@@ -3,26 +3,75 @@
"title": "Traccar",
"author": "Traccar developers",
"description": "file://DESCRIPTION.md",
"changelog": "file://CHANGELOG",
"changelog": "file://CHANGELOG.md",
"tagline": "Modern GPS Tracking Platform",
"version": "0.1.0",
"upstreamVersion": "5.0",
"minBoxVersion": "7.1.0",
"version": "1.17.1",
"upstreamVersion": "6.7.2",
"minBoxVersion": "8.1.0",
"memoryLimit": 1073741824,
"healthCheckPath": "/",
"httpPort": 8082,
"httpPorts": {
"OSMAND_DOMAIN": {
"title": "OsmAnd Domain",
"description": "Port over which OsmAnd clients can connect",
"containerPort": 5055,
"defaultValue": "osmand"
}
},
"addons": {
"ldap": {},
"sendmail": { "supportsDisplayName": false },
"sendmail": {
"supportsDisplayName": false
},
"localstorage": {},
"postgresql": {}
"mysql": {},
"oidc": {
"loginRedirectUri": "/api/session/openid/callback, org.traccar.manager:/api/session/openid/callback"
}
},
"optionalSso": true,
"checklist": {
"change-default-password": {
"message": "Change the admin email and password credentials"
}
},
"manifestVersion": 2,
"tcpPorts": {
"OSMAND_PORT": {
"title": "OsmAnd Port",
"description": "Port over which OsmAnd clients can connect",
"defaultValue": 5055
"defaultValue": 5055,
"containerPort": 5055
},
"GL200_PORT": {
"title": "GL200 Protocol Port",
"description": "Port over which GL200 clients can connect",
"defaultValue": 5004,
"containerPort": 5004
},
"GPS103_PORT": {
"title": "GPS103 Protocol Port",
"description": "Port over which GPS103 clients can connect",
"defaultValue": 5001,
"containerPort": 5001
},
"TAIP_PORT": {
"title": "TAIP Protocol Port",
"description": "Port over which TAIP clients can connect",
"defaultValue": 5031,
"containerPort": 5031
},
"H02_PORT": {
"title": "H02 Protocol Port",
"description": "Port over which H02 clients can connect",
"defaultValue": 5013,
"containerPort": 5013
},
"TELTOKIA_PORT": {
"title": "Teltonika Protocol Port",
"description": "Port over which Teltonika clients can connect",
"defaultValue": 5027,
"containerPort": 5027
}
},
"website": "https://www.traccar.org",
@@ -30,12 +79,16 @@
"contactEmail": "support@cloudron.io",
"icon": "file://logo.png",
"tags": [
"gps", "tracking", "seek", "fleet"
"gps",
"tracking",
"seek",
"fleet"
],
"mediaLinks": [
"https://screenshots.cloudron.io/org.traccar.cloudronapp/web.png",
"https://screenshots.cloudron.io/org.traccar.cloudronapp/polyline.png",
"https://screenshots.cloudron.io/org.traccar.cloudronapp/command_new.png"
]
],
"forumUrl": "https://forum.cloudron.io/category/146/traccar",
"documentationUrl": "https://docs.cloudron.io/packages/traccar"
}

View File

@@ -1,11 +1,12 @@
FROM cloudron/base:3.2.0@sha256:ba1d566164a67c266782545ea9809dc611c4152e27686fd14060332dd88263ea
FROM cloudron/base:5.0.0@sha256:04fd70dbd8ad6149c19de39e35718e024417c3e01dc9c6637eaf4a41ec4e596c
RUN mkdir -p /app/code
WORKDIR /app/code
ARG VERSION=5.0
# renovate: datasource=github-releases depName=traccar/traccar versioning=regex:^(?<major>\d+)\.(?<minor>\d+)\.?(?<patch>\d+)?$ extractVersion=^v(?<version>.+)$
ARG TRACCAR_VERSION=6.7.2
RUN wget https://github.com/traccar/traccar/releases/download/v${VERSION}/traccar-linux-64-${VERSION}.zip -O traccar.zip && \
RUN wget https://github.com/traccar/traccar/releases/download/v${TRACCAR_VERSION}/traccar-linux-64-${TRACCAR_VERSION}.zip -O traccar.zip && \
unzip traccar.zip && \
./traccar.run --target /app/code/ --noexec && \
rm README.txt traccar.zip traccar.run

9
LICENSE Normal file
View File

@@ -0,0 +1,9 @@
MIT License (MIT)
Copyright (c) 2016 Cloudron UG
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

8
POSTINSTALL.md Normal file
View File

@@ -0,0 +1,8 @@
This app is pre-setup with an admin account. The initial credentials are:
**Username**: admin@cloudron.local<br/>
**Password**: admin<br/>
<sso>
By default, Cloudron users have regular users permissions. Permissions can be updated on the user profile page in the admin back-end.
</sso>

45
README.md Normal file
View File

@@ -0,0 +1,45 @@
# Traccar Cloudron App
This repository contains the Cloudron app package source for [Traccar](https://traccar.org/).
## Installation
[![Install](https://cloudron.io/img/button.svg)](https://cloudron.io/button.html?app=org.traccar.cloudronapp)
or using the [Cloudron command line tooling](https://cloudron.io/references/cli.html)
```
cloudron install --appstore-id org.traccar.cloudronapp
```
## Building
The app package can be built using the [Cloudron command line tooling](https://cloudron.io/references/cli.html).
```
cd traccar-app
cloudron build
cloudron install
```
## Testing
The e2e tests are located in the `test/` folder and require [nodejs](http://nodejs.org/). They are creating a fresh build, install the app on your Cloudron, perform tests, backup, restore and test if the repos are still ok. The tests expect port 29418 to be available.
```
cd traccar-app/test
npm install
USERNAME=<cloudron username> PASSWORD=<cloudron password> mocha --bail test.js
```
## Devices
https://www.traccar.org/devices/
Traccar client | osmand | port 5055 (http)
Tracker for Traccar | t55 | port 5005 | sends odb2 data
Owntracks | owntracks | port 5144 | https://owntracks.org/booklet/features/traccar/

4
renovate.json5 Normal file
View File

@@ -0,0 +1,4 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["local>devops/renovator//default.renovate.json5"]
}

View File

@@ -4,34 +4,73 @@ set -eu -o pipefail
mkdir -p /run/traccar/logs /app/data/media
echo -e "[client]\npassword=${CLOUDRON_MYSQL_PASSWORD}" > /run/traccar/mysql-extra
readonly mysql="mysql --defaults-file=/run/traccar/mysql-extra --user=${CLOUDRON_MYSQL_USERNAME} --host=${CLOUDRON_MYSQL_HOST} -P ${CLOUDRON_MYSQL_PORT} ${CLOUDRON_MYSQL_DATABASE}"
wait_for_table() {
ret=`$mysql --skip-column-names -s -e "SHOW TABLES LIKE '$1';"`
while [ "$ret" != "$1" ]; do
echo "=> Table $1 not yet created, waiting ..."
sleep 1;
ret=`$mysql --skip-column-names -s -e "SHOW TABLES LIKE '$1';"`
echo "ret was ${ret}"
done
}
disable_registration() {
echo "==> disabling registration"
PGPASSWORD=${CLOUDRON_POSTGRESQL_PASSWORD} psql -h ${CLOUDRON_POSTGRESQL_HOST} -p ${CLOUDRON_POSTGRESQL_PORT} -U ${CLOUDRON_POSTGRESQL_USERNAME} -d ${CLOUDRON_POSTGRESQL_DATABASE} -c "UPDATE tc_servers SET registration=false WHERE id=1"
wait_for_table tc_servers;
echo "==> Disabling registration"
$mysql -e "UPDATE tc_servers SET registration=0 WHERE id=1"
}
ensure_admin_account() {
wait_for_table tc_users;
echo "==> Ensure admin account"
count=`$mysql --skip-column-names -s -e "SELECT COUNT(*) FROM tc_users;"`
if [[ "$count" = "0" ]]; then
echo "==> Create initial admin account"
# Values are from https://github.com/traccar/traccar/blob/master/schema/changelog-3.3.xml#L179 which is not used anymore, but we still want the admin account
$mysql -e "INSERT INTO tc_users (name, email, hashedpassword, salt, administrator) VALUES ('admin', 'admin@cloudron.local', 'D33DCA55ABD4CC5BC76F2BC0B4E603FE2C6F61F4C1EF2D47', '000000000000000000000000000000000000000000000000', TRUE)"
fi
}
echo "=> Ensure traccar.xml config"
if [[ ! -f /app/data/traccar.xml ]]; then
cp /app/pkg/traccar.xml.template /app/data/traccar.xml
(sleep 10000; disable_registration) &
[[ -z "${CLOUDRON_OIDC_ISSUER:-}" ]] && sed -e 's/^.*openid\..*$//g' -i /app/data/traccar.xml # do this only first run
fi
echo "=> Ensure database settings"
# database (https://www.traccar.org/mysql/)
xmlstarlet ed --inplace \
--update '//properties/entry[@key="database.url"]' -v "jdbc:postgresql://${CLOUDRON_POSTGRESQL_HOST}:${CLOUDRON_POSTGRESQL_PORT}/${CLOUDRON_POSTGRESQL_DATABASE}" \
--update '//properties/entry[@key="database.user"]' -v "${CLOUDRON_POSTGRESQL_USERNAME}" \
--update '//properties/entry[@key="database.password"]' -v "${CLOUDRON_POSTGRESQL_PASSWORD}" \
--update '//properties/entry[@key="database.url"]' -v "jdbc:mysql://${CLOUDRON_MYSQL_HOST}:${CLOUDRON_MYSQL_PORT}/${CLOUDRON_MYSQL_DATABASE}?serverTimezone=UTC&allowPublicKeyRetrieval=true&useSSL=false&allowMultiQueries=true&autoReconnect=true&useUnicode=yes&characterEncoding=UTF-8&sessionVariables=sql_mode=''" \
--update '//properties/entry[@key="database.user"]' -v "${CLOUDRON_MYSQL_USERNAME}" \
--update '//properties/entry[@key="database.password"]' -v "${CLOUDRON_MYSQL_PASSWORD}" \
/app/data/traccar.xml
# origin
xmlstarlet ed --inplace --update '//properties/entry[@key="web.url"]' -v "${CLOUDRON_APP_ORIGIN}" /app/data/traccar.xml
xmlstarlet ed --inplace \
--update '//properties/entry[@key="ldap.url"]' -v "${CLOUDRON_LDAP_URL}" \
--update '//properties/entry[@key="ldap.base"]' -v "${CLOUDRON_LDAP_USERS_BASE_DN}" \
--update '//properties/entry[@key="ldap.idAttribute"]' -v "username" \
--update '//properties/entry[@key="ldap.searchFilter"]' -v 'username=:login' \
--update '//properties/entry[@key="ldap.user"]' -v "${CLOUDRON_LDAP_BIND_DN}" \
--update '//properties/entry[@key="ldap.password"]' -v "${CLOUDRON_LDAP_BIND_PASSWORD}" \
/app/data/traccar.xml
# OIDC
if [[ -n "${CLOUDRON_OIDC_ISSUER:-}" ]]; then
# update config file (to be removed on the next release)
sed -e 's/^.*openid.issuerUrl.*$//g' -i /app/data/traccar.xml
echo "=> Ensure OIDC settings"
# CLOUDRON_OIDC_PROVIDER_NAME is not supported
xmlstarlet ed --inplace \
--update '//properties/entry[@key="openid.clientId"]' -v "${CLOUDRON_OIDC_CLIENT_ID}" \
--update '//properties/entry[@key="openid.clientSecret"]' -v "${CLOUDRON_OIDC_CLIENT_SECRET}" \
--update '//properties/entry[@key="openid.authUrl"]' -v "${CLOUDRON_OIDC_AUTH_ENDPOINT}" \
--update '//properties/entry[@key="openid.tokenUrl"]' -v "${CLOUDRON_OIDC_TOKEN_ENDPOINT}" \
--update '//properties/entry[@key="openid.userInfoUrl"]' -v "${CLOUDRON_OIDC_PROFILE_ENDPOINT}" \
/app/data/traccar.xml
fi
# email
echo "=> Ensure mail settings"
xmlstarlet ed --inplace \
--update '//properties/entry[@key="mail.smtp.host"]' -v "${CLOUDRON_MAIL_SMTP_SERVER}" \
--update '//properties/entry[@key="mail.smtp.port"]' -v "${CLOUDRON_MAIL_SMTP_PORT}" \
@@ -42,6 +81,8 @@ xmlstarlet ed --inplace \
--update '//properties/entry[@key="mail.smtp.password"]' -v "${CLOUDRON_MAIL_SMTP_PASSWORD}" \
/app/data/traccar.xml
(disable_registration; ensure_admin_account) &
chown -R cloudron /run/traccar /app/data
# https://www.traccar.org/optimization/

3049
test/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

19
test/package.json Normal file
View File

@@ -0,0 +1,19 @@
{
"name": "test",
"version": "1.0.0",
"description": "",
"main": "test.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"devDependencies": {
"expect.js": "^0.3.1",
"mocha": "^11.5.0",
"selenium-webdriver": "^4.33.0"
},
"dependencies": {
"chromedriver": "^137.0.0"
}
}

223
test/test.js Normal file
View File

@@ -0,0 +1,223 @@
#!/usr/bin/env node
/* global it, xit, describe, before, after, afterEach */
'use strict';
require('chromedriver');
const execSync = require('child_process').execSync,
expect = require('expect.js'),
fs = require('fs'),
path = require('path'),
{ Builder, By, Key, until } = require('selenium-webdriver'),
{ Options } = require('selenium-webdriver/chrome');
if (!process.env.USERNAME || !process.env.EMAIL || !process.env.PASSWORD) {
console.log('USERNAME, EMAIL and PASSWORD env vars need to be set');
process.exit(1);
}
describe('Application life cycle test', function () {
this.timeout(0);
const LOCATION = process.env.LOCATION || 'test';
const TEST_TIMEOUT = 20000;
const EXEC_ARGS = { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' };
const DEVICE_NAME = 'FancyDevice';
const DEVICE_IDENTIFIER = 'device1';
const ADMIN_USERNAME = 'admin@cloudron.local';
const ADMIN_PASSWORD = 'admin';
const USERNAME = process.env.USERNAME;
const EMAIL = process.env.EMAIL;
const PASSWORD = process.env.PASSWORD;
let browser, app;
let athenticated_by_oidc = false;
before(function () {
const chromeOptions = new Options().windowSize({ width: 1280, height: 1024 });
if (process.env.CI) chromeOptions.addArguments('no-sandbox', 'disable-dev-shm-usage', 'headless');
browser = new Builder().forBrowser('chrome').setChromeOptions(chromeOptions).build();
if (!fs.existsSync('./screenshots')) fs.mkdirSync('./screenshots');
});
after(function () {
browser.quit();
});
afterEach(async function () {
if (!process.env.CI || !app) return;
const currentUrl = await browser.getCurrentUrl();
if (!currentUrl.includes(app.domain)) return;
expect(this.currentTest.title).to.be.a('string');
const screenshotData = await browser.takeScreenshot();
fs.writeFileSync(`./screenshots/${new Date().getTime()}-${this.currentTest.title.replaceAll(' ', '_')}.png`, screenshotData, 'base64');
});
async function waitForElement(elem) {
await browser.wait(until.elementLocated(elem), TEST_TIMEOUT);
await browser.wait(until.elementIsVisible(browser.findElement(elem)), TEST_TIMEOUT);
}
function getAppInfo() {
var inspect = JSON.parse(execSync('cloudron inspect'));
app = inspect.apps.filter(function (a) { return a.location.indexOf(LOCATION) === 0; })[0];
expect(app).to.be.an('object');
}
async function login(emailOrUsername, password) {
await browser.get(`https://${app.fqdn}/login`);
await waitForElement(By.xpath('//input[@name="email"]'));
await browser.findElement(By.xpath('//input[@name="email"]')).sendKeys(Key.CONTROL + 'a' + Key.BACK_SPACE + Key.COMMAND + 'a' + Key.BACK_SPACE);
await browser.findElement(By.xpath('//input[@name="email"]')).sendKeys(emailOrUsername);
await browser.findElement(By.xpath('//input[@name="password"]')).sendKeys(password);
await browser.findElement(By.xpath('//button[text()="Login"]')).click();
await browser.sleep(3000);
await waitForElement(By.xpath('//span[text()="Account"]'));
}
async function loginOIDC(username, password, alreadyAuthenticated = true) {
browser.manage().deleteAllCookies();
await browser.get(`https://${app.fqdn}/login`);
await browser.sleep(2000);
await waitForElement(By.xpath('//button[contains(., "Login with OpenID")]'));
await browser.findElement(By.xpath('//button[contains(., "Login with OpenID")]')).click();
await browser.sleep(2000);
if (!alreadyAuthenticated) {
await waitForElement(By.id('inputUsername'));
await browser.findElement(By.id('inputUsername')).sendKeys(username);
await browser.findElement(By.id('inputPassword')).sendKeys(password);
await browser.findElement(By.id('loginSubmitButton')).click();
}
await browser.sleep(3000);
await waitForElement(By.xpath('//span[text()="Account"]'));
}
async function logout() {
await browser.get(`https://${app.fqdn}`);
await waitForElement(By.xpath('//span[text()="Account"]'));
await browser.findElement(By.xpath('//span[text()="Account"]')).click();
await browser.sleep(1000);
await waitForElement(By.xpath('//p[text()="Logout"]'));
await browser.findElement(By.xpath('//p[text()="Logout"]')).click();
await waitForElement(By.xpath('//input[@name="email"]'));
}
async function addDevice() {
await browser.get(`https://${app.fqdn}/settings/device`);
await waitForElement(By.xpath('//input[@id=":r3:" or @id="«r8»"]'));
await browser.findElement(By.xpath('//input[@id=":r3:" or @id="«r8»"]')).sendKeys(DEVICE_NAME);
await browser.findElement(By.xpath('//input[@id=":r4:" or @id="«r9»"]')).sendKeys(DEVICE_IDENTIFIER);
await browser.findElement(By.xpath('//button[text()="Save"]')).click();
await waitForElement(By.xpath(`//span[text()="${DEVICE_NAME}"]`));
}
async function deviceExists() {
await browser.get(`https://${app.fqdn}`);
await waitForElement(By.xpath(`//span[text()="${DEVICE_NAME}"]`));
}
xit('build app', function () { execSync('cloudron build', EXEC_ARGS); });
// no sso
it('install app (no sso)', function () { execSync(`cloudron install --no-sso --location ${LOCATION}`, EXEC_ARGS); });
it('can get app information', getAppInfo);
it('can login as admin', login.bind(null, ADMIN_USERNAME, ADMIN_PASSWORD));
it('can add device', addDevice);
it('device exists', deviceExists);
it('can logout', logout);
it('uninstall app', async function () {
// ensure we don't hit NXDOMAIN in the mean time
await browser.get('about:blank');
execSync(`cloudron uninstall --app ${app.id}`, EXEC_ARGS);
});
// sso
it('install app (sso)', function () { execSync(`cloudron install --location ${LOCATION}`, EXEC_ARGS); });
it('can get app information', getAppInfo);
it('can login as admin', login.bind(null, ADMIN_USERNAME, ADMIN_PASSWORD));
it('can add device', addDevice);
it('device exists', deviceExists);
it('can logout', logout);
it('can login as normal user via OIDC', loginOIDC.bind(null, process.env.USERNAME, process.env.PASSWORD, false));
it('can logout', logout);
it('can restart app', function () { execSync(`cloudron restart --app ${app.id}`); });
it('can login', login.bind(null, ADMIN_USERNAME, ADMIN_PASSWORD));
it('device exists', deviceExists);
it('can logout', logout);
it('backup app', function () { execSync(`cloudron backup create --app ${app.id}`, EXEC_ARGS); });
it('restore app', function () {
const backups = JSON.parse(execSync(`cloudron backup list --raw --app ${app.id}`));
execSync(`cloudron uninstall --app ${app.id}`, EXEC_ARGS);
execSync(`cloudron install --location ${LOCATION}`, EXEC_ARGS);
getAppInfo();
execSync(`cloudron restore --backup ${backups[0].id} --app ${app.id}`, EXEC_ARGS);
});
it('can login', login.bind(null, ADMIN_USERNAME, ADMIN_PASSWORD));
it('device exists', deviceExists);
it('can logout', logout);
it('can login as normal user via OIDC', loginOIDC.bind(null, process.env.USERNAME, process.env.PASSWORD));
it('can logout', logout);
it('move to different location', async function () {
// ensure we don't hit NXDOMAIN in the mean time
await browser.get('about:blank');
execSync(`cloudron configure --location ${LOCATION}2 --app ${app.id}`, EXEC_ARGS);
});
it('can get app information', getAppInfo);
it('can login', login.bind(null, ADMIN_USERNAME, ADMIN_PASSWORD));
it('device exists', deviceExists);
it('can logout', logout);
it('can login as normal user via OIDC', loginOIDC.bind(null, process.env.USERNAME, process.env.PASSWORD));
it('can logout', logout);
it('uninstall app', async function () {
// ensure we don't hit NXDOMAIN in the mean time
await browser.get('about:blank');
execSync(`cloudron uninstall --app ${app.id}`, EXEC_ARGS);
});
// test update
it('can install app for update', function () { execSync(`cloudron install --appstore-id org.traccar.cloudronapp --location ${LOCATION}`, EXEC_ARGS); });
it('can get app information', getAppInfo);
it('can login', login.bind(null, ADMIN_USERNAME, ADMIN_PASSWORD));
it('can add device', addDevice);
it('device exists', deviceExists);
it('can logout', logout);
it('can login as normal user via OIDC', loginOIDC.bind(null, process.env.USERNAME, process.env.PASSWORD));
it('can logout', logout);
it('can update', function () { execSync(`cloudron update --app ${app.id}`, EXEC_ARGS); });
it('can login', login.bind(null, ADMIN_USERNAME, ADMIN_PASSWORD));
it('device exists', deviceExists);
it('can logout', logout);
// OIDC login
it('can login as normal user via OIDC', loginOIDC.bind(null, process.env.USERNAME, process.env.PASSWORD));
it('can logout', logout);
it('uninstall app', async function () {
// ensure we don't hit NXDOMAIN in the mean time
await browser.get('about:blank');
execSync(`cloudron uninstall --app ${app.id}`, EXEC_ARGS);
});
});

View File

@@ -4,7 +4,7 @@
<properties>
<entry key='config.default'>./conf/default.xml</entry>
<entry key='config.default'>/app/code/conf/default.xml</entry>
<!--
@@ -18,20 +18,18 @@
-->
<entry key='database.driver'>org.postgresql.Driver</entry>
<entry key='database.url'>jdbc:postgresql://##CLOUDRON_POSTGRESQL_HOST##:##CLOUDRON_POSTGRESQL_PORT##/##CLOUDRON_POSTGRESQL_DATABASE##</entry>
<entry key='database.user'>##CLOUDRON_POSTGRESQL_USERNAME##</entry>
<entry key='database.password'>##CLOUDRON_POSTGRESQL_PASSWORD##</entry>
<entry key='database.driver'>com.mysql.cj.jdbc.Driver</entry>
<entry key='database.url'>jdbc:mysql://##CLOUDRON_MYSQL_HOST##:##CLOUDRON_MYSQL_PORT##/##CLOUDRON_MYSQL_DATABASE##</entry>
<entry key='database.user'>##CLOUDRON_MYSQL_USERNAME##</entry>
<entry key='database.password'>##CLOUDRON_MYSQL_PASSWORD##</entry>
<entry key='web.url'>##CLOUDRON_APP_ORIGIN##</entry>
<entry key='ldap.enable'>true</entry>
<entry key='ldap.url'>##CLOUDRON_LDAP_URL##</entry>
<entry key='ldap.base'>##CLOUDRON_LDAP_USERS_BASE_DN##</entry>
<entry key='ldap.idAttribute'>username</entry>
<entry key='ldap.searchFilter'>username=:login</entry>
<entry key='ldap.user'>##CLOUDRON_LDAP_BIND_DN##</entry>
<entry key='ldap.password'>##CLOUDRON_LDAP_BIND_PASSWORD##</entry>
<entry key='openid.clientId'>##CLOUDRON_OIDC_CLIENT_ID##</entry>
<entry key='openid.clientSecret'>##CLOUDRON_OIDC_CLIENT_SECRET##</entry>
<entry key='openid.authUrl'>##CLOUDRON_OIDC_AUTH_ENDPOINT##</entry>
<entry key='openid.tokenUrl'>##CLOUDRON_OIDC_TOKEN_ENDPOINT##</entry>
<entry key='openid.userInfoUrl'>##CLOUDRON_OIDC_PROFILE_ENDPOINT##</entry>
<entry key='mail.smtp.host'>smtp.gmail.com</entry>
<entry key='mail.smtp.port'>587</entry>
@@ -41,6 +39,11 @@
<entry key='mail.smtp.username'>YourAddress@gmail.com</entry>
<entry key='mail.smtp.password'>YourPassword</entry>
<entry key='logger.console'>true</entry>
<entry key='logger.queries'>false</entry>
<entry key='logger.level'>config</entry>
<entry key='logger.fullStackTraces'>true</entry>
<!-- https://github.com/traccar/traccar/blob/8eecfdcf5c59f92158a6c339d1622e0e9d67968c/src/main/java/org/traccar/config/Keys.java -->
<entry key='users.defaultDeviceLimit'>-1</entry>
<entry key='media.path'>/app/data/media</entry>