Compare commits
11 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
6a8c01ccdf | ||
|
dd60363721 | ||
|
2d1a59d7ca | ||
|
c6dc2334a7 | ||
|
cf6ba93f35 | ||
|
36c07ba44f | ||
|
353f85474b | ||
|
371bd01528 | ||
|
beb64e256e | ||
|
82e3886525 | ||
|
36a98e7021 |
15
CHANGELOG
15
CHANGELOG
@@ -4,3 +4,18 @@
|
||||
[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)
|
||||
|
||||
|
@@ -5,18 +5,27 @@
|
||||
"description": "file://DESCRIPTION.md",
|
||||
"changelog": "file://CHANGELOG",
|
||||
"tagline": "Modern GPS Tracking Platform",
|
||||
"version": "0.2.0",
|
||||
"upstreamVersion": "5.0",
|
||||
"version": "0.5.0",
|
||||
"upstreamVersion": "5.2",
|
||||
"minBoxVersion": "7.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 },
|
||||
"localstorage": {},
|
||||
"postgresql": {}
|
||||
"mysql": {}
|
||||
},
|
||||
"optionalSso": true,
|
||||
"manifestVersion": 2,
|
||||
"tcpPorts": {
|
||||
"OSMAND_PORT": {
|
||||
|
@@ -3,7 +3,7 @@ FROM cloudron/base:3.2.0@sha256:ba1d566164a67c266782545ea9809dc611c4152e27686fd1
|
||||
RUN mkdir -p /app/code
|
||||
WORKDIR /app/code
|
||||
|
||||
ARG VERSION=5.0
|
||||
ARG VERSION=5.2
|
||||
|
||||
RUN wget https://github.com/traccar/traccar/releases/download/v${VERSION}/traccar-linux-64-${VERSION}.zip -O traccar.zip && \
|
||||
unzip traccar.zip && \
|
||||
|
9
LICENSE
Normal file
9
LICENSE
Normal 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.
|
||||
|
7
POSTINSTALL.md
Normal file
7
POSTINSTALL.md
Normal file
@@ -0,0 +1,7 @@
|
||||
This app is pre-setup with an admin account. The initial credentials are:
|
||||
|
||||
**Username**: admin<br/>
|
||||
**Password**: admin<br/>
|
||||
|
||||
Please change the admin email and password credentials immediately.
|
||||
|
45
README.md
Normal file
45
README.md
Normal file
@@ -0,0 +1,45 @@
|
||||
# Traccar Cloudron App
|
||||
|
||||
This repository contains the Cloudron app package source for [Traccar](https://traccar.org/).
|
||||
|
||||
## Installation
|
||||
|
||||
[](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/
|
||||
|
41
start.sh
41
start.sh
@@ -4,34 +4,47 @@ 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}"
|
||||
|
||||
disable_registration() {
|
||||
sleep 10
|
||||
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"
|
||||
$mysql -e "UPDATE tc_servers SET registration=0 WHERE id=1"
|
||||
}
|
||||
|
||||
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) &
|
||||
disable_registration &
|
||||
fi
|
||||
|
||||
# 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
|
||||
|
||||
# ldap
|
||||
if [[ -n "${CLOUDRON_LDAP_URL:-}" ]]; then
|
||||
xmlstarlet ed --inplace \
|
||||
--update '//properties/entry[@key="ldap.enable"]' -v "true" \
|
||||
--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
|
||||
else
|
||||
xmlstarlet ed --inplace --update '//properties/entry[@key="ldap.enable"]' -v "false" /app/data/traccar.xml
|
||||
fi
|
||||
|
||||
# email
|
||||
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}" \
|
||||
|
@@ -4,7 +4,7 @@
|
||||
|
||||
<properties>
|
||||
|
||||
<entry key='config.default'>./conf/default.xml</entry>
|
||||
<entry key='config.default'>/app/code/conf/default.xml</entry>
|
||||
|
||||
<!--
|
||||
|
||||
@@ -18,10 +18,10 @@
|
||||
|
||||
-->
|
||||
|
||||
<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>
|
||||
|
||||
@@ -41,6 +41,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>
|
||||
|
Reference in New Issue
Block a user