mirror of
https://github.com/hassio-addons/addon-traccar.git
synced 2025-05-04 19:11:31 +00:00
🎉 Adds initial add-on code
This commit is contained in:
parent
c0b7d3b437
commit
b07a3043ca
18 changed files with 895 additions and 0 deletions
222
README.md
Normal file
222
README.md
Normal file
|
@ -0,0 +1,222 @@
|
|||
# Community Hass.io Add-ons: Traccar
|
||||
|
||||
[![GitHub Release][releases-shield]][releases]
|
||||
![Project Stage][project-stage-shield]
|
||||
[![License][license-shield]](LICENSE.md)
|
||||
|
||||
[![GitLab CI][gitlabci-shield]][gitlabci]
|
||||
![Project Maintenance][maintenance-shield]
|
||||
[![GitHub Activity][commits-shield]][commits]
|
||||
|
||||
[![Bountysource][bountysource-shield]][bountysource]
|
||||
[![Discord][discord-shield]][discord]
|
||||
[![Community Forum][forum-shield]][forum]
|
||||
|
||||
[![Buy me a coffee][buymeacoffee-shield]][buymeacoffee]
|
||||
|
||||
[![Support my work on Patreon][patreon-shield]][patreon]
|
||||
|
||||
Modern GPS Tracking Platform.
|
||||
|
||||
## About
|
||||
|
||||
Lorem ipsum.
|
||||
|
||||
## Installation
|
||||
|
||||
The installation of this add-on is pretty straightforward and not different in
|
||||
comparison to installing any other Hass.io add-on.
|
||||
|
||||
1. [Add our Hass.io add-ons repository][repository] to your Hass.io instance.
|
||||
1. Install the "Traccar" add-on.
|
||||
1. Start the "Traccar" add-on
|
||||
1. Check the logs of the "Traccar" add-on to see if everything went well.
|
||||
1. Click the "OPEN WEB UI" button and log in using `admin`/`admin`.
|
||||
1. Be sure to change the username and password!
|
||||
|
||||
**NOTE**: Do not add this repository to Hass.io, please use:
|
||||
`https://github.com/hassio-addons/repository`.
|
||||
|
||||
## Docker status
|
||||
|
||||
![Supports armhf Architecture][armhf-shield]
|
||||
![Supports aarch64 Architecture][aarch64-shield]
|
||||
![Supports amd64 Architecture][amd64-shield]
|
||||
![Supports i386 Architecture][i386-shield]
|
||||
|
||||
[![Docker Layers][layers-shield]][microbadger]
|
||||
[![Docker Pulls][pulls-shield]][dockerhub]
|
||||
|
||||
## Configuration
|
||||
|
||||
**Note**: _Remember to restart the add-on when the configuration is changed._
|
||||
|
||||
Example add-on configuration:
|
||||
|
||||
```json
|
||||
{
|
||||
"log_level": "info",
|
||||
"port": 8082,
|
||||
"ssl": true,
|
||||
"certfile": "fullchain.pem",
|
||||
"keyfile": "privkey.pem"
|
||||
}
|
||||
```
|
||||
|
||||
**Note**: _This is just an example, don't copy and past it! Create your own!_
|
||||
|
||||
### Option: `log_level`
|
||||
|
||||
The `log_level` option controls the level of log output by the addon and can
|
||||
be changed to be more or less verbose, which might be useful when you are
|
||||
dealing with an unknown issue. Possible values are:
|
||||
|
||||
- `trace`: Show every detail, like all called internal functions.
|
||||
- `debug`: Shows detailed debug information.
|
||||
- `info`: Normal (usually) interesting events.
|
||||
- `warning`: Exceptional occurrences that are not errors.
|
||||
- `error`: Runtime errors that do not require immediate action.
|
||||
- `fatal`: Something went terribly wrong. Add-on becomes unusable.
|
||||
|
||||
Please note that each level automatically includes log messages from a
|
||||
more severe level, e.g., `debug` also shows `info` messages. By default,
|
||||
the `log_level` is set to `info`, which is the recommended setting unless
|
||||
you are troubleshooting.
|
||||
|
||||
### Option: `port`
|
||||
|
||||
The `port` setting allows you to change the port the web interface
|
||||
Traccar is running on.
|
||||
|
||||
### Option: `ssl`
|
||||
|
||||
Enables/Disables SSL (HTTPS) on the web interface.
|
||||
Set it `true` to enable it, `false` otherwise.
|
||||
|
||||
### Option: `certfile`
|
||||
|
||||
The certificate file to use for SSL.
|
||||
|
||||
**Note**: _The file MUST be stored in `/ssl/`, which is the default for Hass.io_
|
||||
|
||||
### Option: `keyfile`
|
||||
|
||||
The private key file to use for SSL.
|
||||
|
||||
**Note**: _The file MUST be stored in `/ssl/`, which is the default for Hass.io_
|
||||
|
||||
## Changelog & Releases
|
||||
|
||||
This repository keeps a change log using [GitHub's releases][releases]
|
||||
functionality. The format of the log is based on
|
||||
[Keep a Changelog][keepchangelog].
|
||||
|
||||
Releases are based on [Semantic Versioning][semver], and use the format
|
||||
of ``MAJOR.MINOR.PATCH``. In a nutshell, the version will be incremented
|
||||
based on the following:
|
||||
|
||||
- ``MAJOR``: Incompatible or major changes.
|
||||
- ``MINOR``: Backwards-compatible new features and enhancements.
|
||||
- ``PATCH``: Backwards-compatible bugfixes and package updates.
|
||||
|
||||
## Support
|
||||
|
||||
Got questions?
|
||||
|
||||
You have several options to get them answered:
|
||||
|
||||
- The [Community Hass.io Add-ons Discord chat server][discord] for add-on
|
||||
support and feature requests.
|
||||
- The [Home Assistant Discord chat server][discord-ha] for general Home
|
||||
Assistant discussions and questions.
|
||||
- The Home Assistant [Community Forum][forum].
|
||||
- Join the [Reddit subreddit][reddit] in [/r/homeassistant][reddit]
|
||||
|
||||
You could also [open an issue here][issue] GitHub.
|
||||
|
||||
## Contributing
|
||||
|
||||
This is an active open-source project. We are always open to people who want to
|
||||
use the code or contribute to it.
|
||||
|
||||
We have set up a separate document containing our
|
||||
[contribution guidelines](CONTRIBUTING.md).
|
||||
|
||||
Thank you for being involved! :heart_eyes:
|
||||
|
||||
## Authors & contributors
|
||||
|
||||
The original setup of this repository is by [Franck Nijhof][frenck].
|
||||
|
||||
For a full list of all authors and contributors,
|
||||
check [the contributor's page][contributors].
|
||||
|
||||
## We have got some Hass.io add-ons for you
|
||||
|
||||
Want some more functionality to your Hass.io Home Assistant instance?
|
||||
|
||||
We have created multiple add-ons for Hass.io. For a full list, check out
|
||||
our [GitHub Repository][repository].
|
||||
|
||||
## License
|
||||
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2018 Franck Nijhof
|
||||
|
||||
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.
|
||||
|
||||
[aarch64-shield]: https://img.shields.io/badge/aarch64-yes-green.svg
|
||||
[amd64-shield]: https://img.shields.io/badge/amd64-yes-green.svg
|
||||
[anchore-shield]: https://anchore.io/service/badges/image/67d1185473090e99d5ac5e1bb4d1aa2295117a9bd3d7abbf8cd8a71e331c8388
|
||||
[anchore]: https://anchore.io/image/dockerhub/hassioaddons%2Ftraccar%3Alatest
|
||||
[armhf-shield]: https://img.shields.io/badge/armhf-yes-green.svg
|
||||
[bountysource-shield]: https://img.shields.io/bountysource/team/hassio-addons/activity.svg
|
||||
[bountysource]: https://www.bountysource.com/teams/hassio-addons/issues
|
||||
[buymeacoffee-shield]: https://www.buymeacoffee.com/assets/img/guidelines/download-assets-sm-2.svg
|
||||
[buymeacoffee]: https://www.buymeacoffee.com/frenck
|
||||
[commits-shield]: https://img.shields.io/github/commit-activity/y/hassio-addons/addon-traccar.svg
|
||||
[commits]: https://github.com/hassio-addons/addon-traccar/commits/master
|
||||
[contributors]: https://github.com/hassio-addons/addon-traccar/graphs/contributors
|
||||
[discord-ha]: https://discord.gg/c5DvZ4e
|
||||
[discord-shield]: https://img.shields.io/discord/478094546522079232.svg
|
||||
[discord]: https://discord.me/hassioaddons
|
||||
[dockerhub]: https://hub.docker.com/r/hassioaddons/traccar
|
||||
[forum-shield]: https://img.shields.io/badge/community-forum-brightgreen.svg
|
||||
[forum]: https://community.home-assistant.io/t/?u=frenck
|
||||
[frenck]: https://github.com/frenck
|
||||
[gitlabci-shield]: https://gitlab.com/hassio-addons/addon-traccar/badges/master/pipeline.svg
|
||||
[gitlabci]: https://gitlab.com/hassio-addons/addon-traccar/pipelines
|
||||
[home-assistant]: https://home-assistant.io
|
||||
[i386-shield]: https://img.shields.io/badge/i386-yes-green.svg
|
||||
[issue]: https://github.com/hassio-addons/addon-traccar/issues
|
||||
[keepchangelog]: http://keepachangelog.com/en/1.0.0/
|
||||
[layers-shield]: https://images.microbadger.com/badges/image/hassioaddons/traccar.svg
|
||||
[license-shield]: https://img.shields.io/github/license/hassio-addons/addon-traccar.svg
|
||||
[maintenance-shield]: https://img.shields.io/maintenance/yes/2018.svg
|
||||
[microbadger]: https://microbadger.com/images/hassioaddons/traccar
|
||||
[patreon-shield]: https://www.frenck.nl/images/patreon.png
|
||||
[patreon]: https://www.patreon.com/frenck
|
||||
[project-stage-shield]: https://img.shields.io/badge/project%20stage-experimental-yellow.svg
|
||||
[pulls-shield]: https://img.shields.io/docker/pulls/hassioaddons/traccar.svg
|
||||
[reddit]: https://reddit.com/r/homeassistant
|
||||
[releases-shield]: https://img.shields.io/github/release/hassio-addons/addon-traccar.svg
|
||||
[releases]: https://github.com/hassio-addons/addon-traccar/releases
|
||||
[repository]: https://github.com/hassio-addons/repository
|
||||
[semver]: http://semver.org/spec/v2.0.0.htm
|
70
traccar/.README.j2
Normal file
70
traccar/.README.j2
Normal file
|
@ -0,0 +1,70 @@
|
|||
# Community Hass.io Add-ons: Traccar
|
||||
|
||||
[![Release][release-shield]][release] ![Project Stage][project-stage-shield] ![Project Maintenance][maintenance-shield]
|
||||
|
||||
[![Discord][discord-shield]][discord] [![Community Forum][forum-shield]][forum]
|
||||
|
||||
[![Buy me a coffee][buymeacoffee-shield]][buymeacoffee]
|
||||
|
||||
[![Support my work on Patreon][patreon-shield]][patreon]
|
||||
|
||||
Modern GPS Tracking Platform.
|
||||
|
||||
## About
|
||||
|
||||
Lorem ipsum.
|
||||
|
||||
[Click here for the full documentation][docs]
|
||||
|
||||
{% if channel == "edge" %}
|
||||
## WARNING! THIS IS AN EDGE VERSION!
|
||||
|
||||
This Hass.io Add-ons repository contains edge builds of add-ons. Edge builds
|
||||
add-ons are based upon the latest development version.
|
||||
|
||||
- They may not work at all.
|
||||
- They might stop working at any time.
|
||||
- They could have a negative impact on your system.
|
||||
|
||||
This repository was created for:
|
||||
|
||||
- Anybody willing to test.
|
||||
- Anybody interested in trying out upcoming add-ons or add-on features.
|
||||
- Developers.
|
||||
|
||||
If you are more interested in stable releases of our add-ons:
|
||||
|
||||
<https://github.com/hassio-addons/repository>
|
||||
|
||||
{% endif %}
|
||||
{% if channel == "beta" %}
|
||||
## WARNING! THIS IS A BETA VERSION!
|
||||
|
||||
This Hass.io Add-ons repository contains beta releases of add-ons.
|
||||
|
||||
- They might stop working at any time.
|
||||
- They could have a negative impact on your system.
|
||||
|
||||
This repository was created for:
|
||||
|
||||
- Anybody willing to test.
|
||||
- Anybody interested in trying out upcoming add-ons or add-on features.
|
||||
|
||||
If you are more interested in stable releases of our add-ons:
|
||||
|
||||
<https://github.com/hassio-addons/repository>
|
||||
|
||||
{% endif %}
|
||||
[buymeacoffee-shield]: https://www.buymeacoffee.com/assets/img/guidelines/download-assets-sm-2.svg
|
||||
[buymeacoffee]: https://www.buymeacoffee.com/frenck
|
||||
[discord-shield]: https://img.shields.io/discord/478094546522079232.svg
|
||||
[discord]: https://discord.me/hassioaddons
|
||||
[docs]: {{ repo }}/blob/{{ version }}/README.md
|
||||
[forum-shield]: https://img.shields.io/badge/community-forum-brightgreen.svg
|
||||
[forum]: https://community.home-assistant.io/?u=frenck
|
||||
[maintenance-shield]: https://img.shields.io/maintenance/yes/2018.svg
|
||||
[patreon-shield]: https://www.frenck.nl/images/patreon.png
|
||||
[patreon]: https://www.patreon.com/frenck
|
||||
[project-stage-shield]: https://img.shields.io/badge/project%20stage-production%20ready-brightgreen.svg
|
||||
[release-shield]: https://img.shields.io/badge/version-{{ version }}-blue.svg
|
||||
[release]: {{ repo }}/tree/{{ version }}
|
50
traccar/Dockerfile
Executable file
50
traccar/Dockerfile
Executable file
|
@ -0,0 +1,50 @@
|
|||
ARG BUILD_FROM=hassioaddons/base:2.3.0
|
||||
# hadolint ignore=DL3006
|
||||
FROM ${BUILD_FROM}
|
||||
|
||||
# Set shell
|
||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||
|
||||
# Copy root filesystem
|
||||
COPY rootfs /
|
||||
|
||||
# Set working dir
|
||||
WORKDIR /opt/traccar
|
||||
|
||||
# Setup base
|
||||
RUN \
|
||||
apk add --no-cache \
|
||||
nginx=1.14.0-r1 \
|
||||
openjdk8-jre=8.181.13-r0 \
|
||||
\
|
||||
&& curl -J -L -o /tmp/traccar.zip \
|
||||
"https://github.com/traccar/traccar/releases/download/v4.1/traccar-other-4.1.zip" \
|
||||
\
|
||||
&& mkdir -p /opt/traccar \
|
||||
&& unzip -d /opt/traccar /tmp/traccar.zip \
|
||||
\
|
||||
&& rm -fr /tmp/*
|
||||
|
||||
# Build arugments
|
||||
ARG BUILD_ARCH
|
||||
ARG BUILD_DATE
|
||||
ARG BUILD_REF
|
||||
ARG BUILD_VERSION
|
||||
|
||||
# Labels
|
||||
LABEL \
|
||||
io.hass.name="Traccar" \
|
||||
io.hass.description="Modern GPS Tracking Platform." \
|
||||
io.hass.arch="${BUILD_ARCH}" \
|
||||
io.hass.type="addon" \
|
||||
io.hass.version=${BUILD_VERSION} \
|
||||
maintainer="Franck Nijhof <frenck@addons.community>" \
|
||||
org.label-schema.description="Modern GPS Tracking Platform." \
|
||||
org.label-schema.build-date=${BUILD_DATE} \
|
||||
org.label-schema.name="Traccar" \
|
||||
org.label-schema.schema-version="1.0" \
|
||||
org.label-schema.url="https://community.home-assistant.io/?u=frenck" \
|
||||
org.label-schema.usage="https://github.com/hassio-addons/addon-traccar/tree/master/README.md" \
|
||||
org.label-schema.vcs-ref=${BUILD_REF} \
|
||||
org.label-schema.vcs-url="https://github.com/hassio-addons/addon-traccar" \
|
||||
org.label-schema.vendor="Community Hass.io Add-ons"
|
9
traccar/build.json
Normal file
9
traccar/build.json
Normal file
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"build_from": {
|
||||
"aarch64": "hassioaddons/base-aarch64:2.3.0",
|
||||
"amd64": "hassioaddons/base-amd64:2.3.0",
|
||||
"armhf": "hassioaddons/base-armhf:2.3.0",
|
||||
"i386": "hassioaddons/base-i386:2.3.0"
|
||||
},
|
||||
"args": {}
|
||||
}
|
41
traccar/config.json
Executable file
41
traccar/config.json
Executable file
|
@ -0,0 +1,41 @@
|
|||
{
|
||||
"name": "Traccar",
|
||||
"version": "dev",
|
||||
"slug": "traccar",
|
||||
"description": "Modern GPS Tracking Platform",
|
||||
"url": "https://community.home-assistant.io/?u=frenck",
|
||||
"webui": "[PROTO:ssl]://[HOST]:[PORT:8082]",
|
||||
"startup": "services",
|
||||
"arch": [
|
||||
"aarch64",
|
||||
"amd64",
|
||||
"armhf",
|
||||
"i386"
|
||||
],
|
||||
"boot": "auto",
|
||||
"hassio_api": true,
|
||||
"hassio_role": "default",
|
||||
"homeassistant_api": false,
|
||||
"host_network": true,
|
||||
"map": [
|
||||
"config:rw",
|
||||
"ssl"
|
||||
],
|
||||
"options": {
|
||||
"log_level": "info",
|
||||
"port": 8082,
|
||||
"ssl": true,
|
||||
"certfile": "fullchain.pem",
|
||||
"keyfile": "privkey.pem"
|
||||
},
|
||||
"schema": {
|
||||
"log_level": "match(^(trace|debug|info|notice|warning|error|fatal)$)",
|
||||
"port": "port",
|
||||
"ssl": "bool",
|
||||
"certfile": "str",
|
||||
"keyfile": "str"
|
||||
},
|
||||
"environment": {
|
||||
"LOG_FORMAT": "{LEVEL}: {MESSAGE}"
|
||||
}
|
||||
}
|
BIN
traccar/icon.png
Normal file
BIN
traccar/icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.7 KiB |
BIN
traccar/logo.png
Normal file
BIN
traccar/logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.5 KiB |
26
traccar/rootfs/etc/cont-init.d/10-requirements.sh
Normal file
26
traccar/rootfs/etc/cont-init.d/10-requirements.sh
Normal file
|
@ -0,0 +1,26 @@
|
|||
#!/usr/bin/with-contenv bash
|
||||
# ==============================================================================
|
||||
# Community Hass.io Add-ons: Traccar
|
||||
# This files check if all user configuration requirements are met
|
||||
# ==============================================================================
|
||||
# shellcheck disable=SC1091
|
||||
source /usr/lib/hassio-addons/base.sh
|
||||
|
||||
# Check SSL requirements, if enabled
|
||||
if hass.config.true 'ssl'; then
|
||||
if ! hass.config.has_value 'certfile'; then
|
||||
hass.die 'SSL is enabled, but no certfile was specified'
|
||||
fi
|
||||
|
||||
if ! hass.config.has_value 'keyfile'; then
|
||||
hass.die 'SSL is enabled, but no keyfile was specified'
|
||||
fi
|
||||
|
||||
if ! hass.file_exists "/ssl/$(hass.config.get 'certfile')"; then
|
||||
hass.die 'The configured certfile is not found'
|
||||
fi
|
||||
|
||||
if ! hass.file_exists "/ssl/$(hass.config.get 'keyfile')"; then
|
||||
hass.die 'The configured keyfile is not found'
|
||||
fi
|
||||
fi
|
11
traccar/rootfs/etc/cont-init.d/20-config.sh
Normal file
11
traccar/rootfs/etc/cont-init.d/20-config.sh
Normal file
|
@ -0,0 +1,11 @@
|
|||
#!/usr/bin/with-contenv bash
|
||||
# ==============================================================================
|
||||
# Community Hass.io Add-ons: Traccar
|
||||
# Ensures the user configuration file is present
|
||||
# ==============================================================================
|
||||
# shellcheck disable=SC1091
|
||||
source /usr/lib/hassio-addons/base.sh
|
||||
|
||||
if ! hass.file_exists "/config/traccar.xml"; then
|
||||
cp /etc/traccar/traccar.xml /config/traccar.xml
|
||||
fi
|
25
traccar/rootfs/etc/cont-init.d/30-nginx.sh
Normal file
25
traccar/rootfs/etc/cont-init.d/30-nginx.sh
Normal file
|
@ -0,0 +1,25 @@
|
|||
#!/usr/bin/with-contenv bash
|
||||
# ==============================================================================
|
||||
# Community Hass.io Add-ons: Traccar
|
||||
# Configures NGINX for use with the Traccar server
|
||||
# ==============================================================================
|
||||
# shellcheck disable=SC1091
|
||||
source /usr/lib/hassio-addons/base.sh
|
||||
|
||||
declare certfile
|
||||
declare keyfile
|
||||
declare port
|
||||
|
||||
if hass.config.true 'ssl'; then
|
||||
rm /etc/nginx/nginx.conf
|
||||
mv /etc/nginx/nginx-ssl.conf /etc/nginx/nginx.conf
|
||||
|
||||
certfile=$(hass.config.get 'certfile')
|
||||
keyfile=$(hass.config.get 'keyfile')
|
||||
|
||||
sed -i "s/%%certfile%%/${certfile}/g" /etc/nginx/nginx.conf
|
||||
sed -i "s/%%keyfile%%/${keyfile}/g" /etc/nginx/nginx.conf
|
||||
fi
|
||||
|
||||
port=$(hass.config.get 'port')
|
||||
sed -i "s/%%port%%/${port}/g" /etc/nginx/nginx.conf
|
63
traccar/rootfs/etc/nginx/nginx-ssl.conf
Normal file
63
traccar/rootfs/etc/nginx/nginx-ssl.conf
Normal file
|
@ -0,0 +1,63 @@
|
|||
worker_processes 1;
|
||||
pid /var/run/nginx.pid;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
include mime.types;
|
||||
default_type application/octet-stream;
|
||||
sendfile on;
|
||||
keepalive_timeout 65;
|
||||
|
||||
upstream traccar {
|
||||
ip_hash;
|
||||
server 127.0.0.1:18682;
|
||||
}
|
||||
|
||||
map $http_upgrade $connection_upgrade {
|
||||
default upgrade;
|
||||
'' close;
|
||||
}
|
||||
|
||||
server {
|
||||
server_name hassio.local;
|
||||
listen %%port%% default_server ssl;
|
||||
root /dev/null;
|
||||
|
||||
ssl_certificate /ssl/%%certfile%%;
|
||||
ssl_certificate_key /ssl/%%keyfile%%;
|
||||
ssl_protocols TLSv1.2;
|
||||
ssl_prefer_server_ciphers on;
|
||||
ssl_ciphers ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:DHE-RSA-AES256-SHA;
|
||||
ssl_ecdh_curve secp384r1;
|
||||
ssl_session_timeout 10m;
|
||||
ssl_session_cache shared:SSL:10m;
|
||||
ssl_session_tickets off;
|
||||
ssl_stapling on;
|
||||
ssl_stapling_verify on;
|
||||
|
||||
add_header X-Content-Type-Options nosniff;
|
||||
add_header X-XSS-Protection "1; mode=block";
|
||||
add_header X-Robots-Tag none;
|
||||
|
||||
location / {
|
||||
proxy_redirect off;
|
||||
proxy_pass http://traccar;
|
||||
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $connection_upgrade;
|
||||
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-NginX-Proxy true;
|
||||
if ($uri != '/') {
|
||||
expires 30d;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
47
traccar/rootfs/etc/nginx/nginx.conf
Normal file
47
traccar/rootfs/etc/nginx/nginx.conf
Normal file
|
@ -0,0 +1,47 @@
|
|||
worker_processes 1;
|
||||
pid /var/run/nginx.pid;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
include mime.types;
|
||||
default_type application/octet-stream;
|
||||
sendfile on;
|
||||
keepalive_timeout 65;
|
||||
|
||||
upstream traccar {
|
||||
ip_hash;
|
||||
server 127.0.0.1:18682;
|
||||
}
|
||||
|
||||
map $http_upgrade $connection_upgrade {
|
||||
default upgrade;
|
||||
'' close;
|
||||
}
|
||||
|
||||
server {
|
||||
server_name hassio.local;
|
||||
listen %%port%% default_server;
|
||||
root /dev/null;
|
||||
|
||||
location / {
|
||||
proxy_redirect off;
|
||||
proxy_pass http://traccar;
|
||||
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $connection_upgrade;
|
||||
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-NginX-Proxy true;
|
||||
if ($uri != '/') {
|
||||
expires 30d;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
9
traccar/rootfs/etc/services.d/nginx/finish
Normal file
9
traccar/rootfs/etc/services.d/nginx/finish
Normal file
|
@ -0,0 +1,9 @@
|
|||
#!/usr/bin/execlineb -S0
|
||||
# ==============================================================================
|
||||
# Community Hass.io Add-ons: Traccar
|
||||
# Take down the S6 supervision tree when Nginx fails
|
||||
# ==============================================================================
|
||||
if -n { s6-test $# -ne 0 }
|
||||
if -n { s6-test ${1} -eq 256 }
|
||||
|
||||
s6-svscanctl -t /var/run/s6/services
|
9
traccar/rootfs/etc/services.d/nginx/run
Normal file
9
traccar/rootfs/etc/services.d/nginx/run
Normal file
|
@ -0,0 +1,9 @@
|
|||
#!/usr/bin/with-contenv bash
|
||||
# ==============================================================================
|
||||
# Community Hass.io Add-ons: Traccar
|
||||
# Runs the Nginx daemon
|
||||
# ==============================================================================
|
||||
# shellcheck disable=SC1091
|
||||
source /usr/lib/hassio-addons/base.sh
|
||||
|
||||
exec nginx -g "daemon off;"
|
9
traccar/rootfs/etc/services.d/traccar/finish
Normal file
9
traccar/rootfs/etc/services.d/traccar/finish
Normal file
|
@ -0,0 +1,9 @@
|
|||
#!/usr/bin/execlineb -S0
|
||||
# ==============================================================================
|
||||
# Community Hass.io Add-ons: Traccar
|
||||
# Take down the S6 supervision tree when the Traccar daemon fails
|
||||
# ==============================================================================
|
||||
if -n { s6-test $# -ne 0 }
|
||||
if -n { s6-test ${1} -eq 256 }
|
||||
|
||||
s6-svscanctl -t /var/run/s6/services
|
26
traccar/rootfs/etc/services.d/traccar/run
Normal file
26
traccar/rootfs/etc/services.d/traccar/run
Normal file
|
@ -0,0 +1,26 @@
|
|||
#!/usr/bin/with-contenv bash
|
||||
# ==============================================================================
|
||||
# Community Hass.io Add-ons: Traccar
|
||||
# Runs the Traccar daemon
|
||||
# ==============================================================================
|
||||
# shellcheck disable=SC1091
|
||||
source /usr/lib/hassio-addons/base.sh
|
||||
|
||||
declare -a options
|
||||
|
||||
# Memory settings
|
||||
options+=(-Xms256m)
|
||||
options+=(-Xmx512m)
|
||||
|
||||
# Prefer IPv4, because of Hassio general issues with IPv6
|
||||
options+=("-Djava.net.preferIPv4Stack=true")
|
||||
|
||||
# Run the JAR
|
||||
options+=(-jar tracker-server.jar)
|
||||
|
||||
# Configuration file
|
||||
options+=(/config/traccar.xml)
|
||||
|
||||
# Run the Traccar daemon
|
||||
cd /opt/traccar
|
||||
exec java "${options[@]}"
|
256
traccar/rootfs/etc/traccar/hassio.xml
Normal file
256
traccar/rootfs/etc/traccar/hassio.xml
Normal file
|
@ -0,0 +1,256 @@
|
|||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
|
||||
<!DOCTYPE properties SYSTEM 'http://java.sun.com/dtd/properties.dtd'>
|
||||
|
||||
<properties>
|
||||
|
||||
<entry key='web.enable'>true</entry>
|
||||
<entry key='web.port'>18682</entry>
|
||||
<entry key='web.path'>./web</entry>
|
||||
<entry key='web.address'>127.0.0.1</entry>
|
||||
<entry key='web.cacheControl'>max-age=3600,public</entry>
|
||||
|
||||
<entry key='geocoder.enable'>false</entry>
|
||||
<entry key='geocoder.type'>google</entry>
|
||||
|
||||
<entry key='logger.enable'>true</entry>
|
||||
<entry key='logger.level'>info</entry>
|
||||
<entry key='logger.file'>/dev/stdout</entry>
|
||||
|
||||
<entry key='filter.enable'>true</entry>
|
||||
<entry key='filter.future'>86400</entry>
|
||||
|
||||
<entry key='event.enable'>true</entry>
|
||||
<entry key='event.ignoreDuplicateAlerts'>true</entry>
|
||||
<entry key='processing.computedAttributes.enable'>true</entry>
|
||||
<entry key='processing.engineHours.enable'>true</entry>
|
||||
|
||||
<entry key='media.path'>./media</entry>
|
||||
|
||||
<entry key='notificator.types'>web,mail</entry>
|
||||
|
||||
<entry key='commands.queueing'>true</entry>
|
||||
|
||||
<entry key='database.ignoreUnknown'>true</entry>
|
||||
<entry key='database.generateQueries'>true</entry>
|
||||
<entry key='database.changelog'>./schema/changelog-master.xml</entry>
|
||||
<entry key='database.driver'>org.h2.Driver</entry>
|
||||
<entry key='database.url'>jdbc:h2:/data</entry>
|
||||
<entry key='database.user'>sa</entry>
|
||||
<entry key='database.password'></entry>
|
||||
|
||||
<entry key='database.loginUser'>
|
||||
SELECT * FROM tc_users
|
||||
WHERE email = :email OR login = :email
|
||||
</entry>
|
||||
|
||||
<entry key='database.selectPositions'>
|
||||
SELECT * FROM tc_positions WHERE deviceId = :deviceId AND fixTime BETWEEN :from AND :to ORDER BY fixTime
|
||||
</entry>
|
||||
|
||||
<entry key='database.selectLatestPositions'>
|
||||
SELECT tc_positions.* FROM tc_positions INNER JOIN tc_devices ON tc_positions.id = tc_devices.positionid;
|
||||
</entry>
|
||||
|
||||
<entry key='database.updateLatestPosition'>
|
||||
UPDATE tc_devices SET positionId = :id WHERE id = :deviceId
|
||||
</entry>
|
||||
|
||||
<entry key='database.selectEvents'>
|
||||
SELECT * FROM tc_events WHERE deviceId = :deviceId AND serverTime BETWEEN :from AND :to ORDER BY serverTime
|
||||
</entry>
|
||||
|
||||
<entry key='database.deletePositions'>
|
||||
DELETE FROM tc_positions WHERE serverTime < :serverTime AND id NOT IN (SELECT positionId FROM tc_devices WHERE positionId IS NOT NULL)
|
||||
</entry>
|
||||
|
||||
<entry key='database.deleteEvents'>
|
||||
DELETE FROM tc_events WHERE serverTime < :serverTime
|
||||
</entry>
|
||||
|
||||
<entry key='database.selectStatistics'>
|
||||
SELECT * FROM tc_statistics WHERE captureTime BETWEEN :from AND :to ORDER BY captureTime
|
||||
</entry>
|
||||
|
||||
<entry key='gps103.port'>5001</entry>
|
||||
<entry key='tk103.port'>5002</entry>
|
||||
<entry key='gl100.port'>5003</entry>
|
||||
<entry key='gl200.port'>5004</entry>
|
||||
<entry key='t55.port'>5005</entry>
|
||||
<entry key='xexun.port'>5006</entry>
|
||||
<entry key='xexun.extended'>false</entry>
|
||||
<entry key='totem.port'>5007</entry>
|
||||
<entry key='enfora.port'>5008</entry>
|
||||
<entry key='meiligao.port'>5009</entry>
|
||||
<entry key='trv.port'>5010</entry>
|
||||
<entry key='suntech.port'>5011</entry>
|
||||
<entry key='progress.port'>5012</entry>
|
||||
<entry key='h02.port'>5013</entry>
|
||||
<entry key='jt600.port'>5014</entry>
|
||||
<entry key='huabao.port'>5015</entry>
|
||||
<entry key='v680.port'>5016</entry>
|
||||
<entry key='pt502.port'>5017</entry>
|
||||
<entry key='tr20.port'>5018</entry>
|
||||
<entry key='navis.port'>5019</entry>
|
||||
<entry key='meitrack.port'>5020</entry>
|
||||
<entry key='skypatrol.port'>5021</entry>
|
||||
<entry key='gt02.port'>5022</entry>
|
||||
<entry key='gt06.port'>5023</entry>
|
||||
<entry key='megastek.port'>5024</entry>
|
||||
<entry key='navigil.port'>5025</entry>
|
||||
<entry key='gpsgate.port'>5026</entry>
|
||||
<entry key='teltonika.port'>5027</entry>
|
||||
<entry key='mta6.port'>5028</entry>
|
||||
<entry key='tzone.port'>5029</entry>
|
||||
<entry key='tlt2h.port'>5030</entry>
|
||||
<entry key='taip.port'>5031</entry>
|
||||
<entry key='wondex.port'>5032</entry>
|
||||
<entry key='cellocator.port'>5033</entry>
|
||||
<entry key='galileo.port'>5034</entry>
|
||||
<entry key='ywt.port'>5035</entry>
|
||||
<entry key='tk102.port'>5036</entry>
|
||||
<entry key='intellitrac.port'>5037</entry>
|
||||
<entry key='gpsmta.port'>5038</entry>
|
||||
<entry key='wialon.port'>5039</entry>
|
||||
<entry key='carscop.port'>5040</entry>
|
||||
<entry key='apel.port'>5041</entry>
|
||||
<entry key='manpower.port'>5042</entry>
|
||||
<entry key='globalsat.port'>5043</entry>
|
||||
<entry key='atrack.port'>5044</entry>
|
||||
<entry key='pt3000.port'>5045</entry>
|
||||
<entry key='ruptela.port'>5046</entry>
|
||||
<entry key='topflytech.port'>5047</entry>
|
||||
<entry key='laipac.port'>5048</entry>
|
||||
<entry key='aplicom.port'>5049</entry>
|
||||
<entry key='gotop.port'>5050</entry>
|
||||
<entry key='sanav.port'>5051</entry>
|
||||
<entry key='gator.port'>5052</entry>
|
||||
<entry key='noran.port'>5053</entry>
|
||||
<entry key='m2m.port'>5054</entry>
|
||||
<entry key='osmand.port'>5055</entry>
|
||||
<entry key='easytrack.port'>5056</entry>
|
||||
<entry key='gpsmarker.port'>5057</entry>
|
||||
<entry key='khd.port'>5058</entry>
|
||||
<entry key='piligrim.port'>5059</entry>
|
||||
<entry key='stl060.port'>5060</entry>
|
||||
<entry key='cartrack.port'>5061</entry>
|
||||
<entry key='minifinder.port'>5062</entry>
|
||||
<entry key='haicom.port'>5063</entry>
|
||||
<entry key='eelink.port'>5064</entry>
|
||||
<entry key='box.port'>5065</entry>
|
||||
<entry key='freedom.port'>5066</entry>
|
||||
<entry key='telic.port'>5067</entry>
|
||||
<entry key='trackbox.port'>5068</entry>
|
||||
<entry key='visiontek.port'>5069</entry>
|
||||
<entry key='orion.port'>5070</entry>
|
||||
<entry key='riti.port'>5071</entry>
|
||||
<entry key='ulbotech.port'>5072</entry>
|
||||
<entry key='tramigo.port'>5073</entry>
|
||||
<entry key='tr900.port'>5074</entry>
|
||||
<entry key='ardi01.port'>5075</entry>
|
||||
<entry key='xt013.port'>5076</entry>
|
||||
<entry key='autofon.port'>5077</entry>
|
||||
<entry key='gosafe.port'>5078</entry>
|
||||
<entry key='tt8850.port'>5079</entry>
|
||||
<entry key='bce.port'>5080</entry>
|
||||
<entry key='xirgo.port'>5081</entry>
|
||||
<entry key='calamp.port'>5082</entry>
|
||||
<entry key='mtx.port'>5083</entry>
|
||||
<entry key='tytan.port'>5084</entry>
|
||||
<entry key='avl301.port'>5085</entry>
|
||||
<entry key='castel.port'>5086</entry>
|
||||
<entry key='mxt.port'>5087</entry>
|
||||
<entry key='cityeasy.port'>5088</entry>
|
||||
<entry key='aquila.port'>5089</entry>
|
||||
<entry key='flextrack.port'>5090</entry>
|
||||
<entry key='blackkite.port'>5091</entry>
|
||||
<entry key='adm.port'>5092</entry>
|
||||
<entry key='watch.port'>5093</entry>
|
||||
<entry key='t800x.port'>5094</entry>
|
||||
<entry key='upro.port'>5095</entry>
|
||||
<entry key='auro.port'>5096</entry>
|
||||
<entry key='disha.port'>5097</entry>
|
||||
<entry key='thinkrace.port'>5098</entry>
|
||||
<entry key='pathaway.port'>5099</entry>
|
||||
<entry key='arnavi.port'>5100</entry>
|
||||
<entry key='nvs.port'>5101</entry>
|
||||
<entry key='kenji.port'>5102</entry>
|
||||
<entry key='astra.port'>5103</entry>
|
||||
<entry key='homtecs.port'>5104</entry>
|
||||
<entry key='fox.port'>5105</entry>
|
||||
<entry key='gnx.port'>5106</entry>
|
||||
<entry key='arknav.port'>5107</entry>
|
||||
<entry key='supermate.port'>5108</entry>
|
||||
<entry key='appello.port'>5109</entry>
|
||||
<entry key='idpl.port'>5110</entry>
|
||||
<entry key='huasheng.port'>5111</entry>
|
||||
<entry key='l100.port'>5112</entry>
|
||||
<entry key='granit.port'>5113</entry>
|
||||
<entry key='carcell.port'>5114</entry>
|
||||
<entry key='obddongle.port'>5115</entry>
|
||||
<entry key='hunterpro.port'>5116</entry>
|
||||
<entry key='raveon.port'>5117</entry>
|
||||
<entry key='cradlepoint.port'>5118</entry>
|
||||
<entry key='arknavx8.port'>5119</entry>
|
||||
<entry key='autograde.port'>5120</entry>
|
||||
<entry key='oigo.port'>5121</entry>
|
||||
<entry key='jpkorjar.port'>5122</entry>
|
||||
<entry key='cguard.port'>5123</entry>
|
||||
<entry key='fifotrack.port'>5124</entry>
|
||||
<entry key='smokey.port'>5125</entry>
|
||||
<entry key='extremtrac.port'>5126</entry>
|
||||
<entry key='trakmate.port'>5127</entry>
|
||||
<entry key='at2000.port'>5128</entry>
|
||||
<entry key='maestro.port'>5129</entry>
|
||||
<entry key='ais.port'>5130</entry>
|
||||
<entry key='gt30.port'>5131</entry>
|
||||
<entry key='tmg.port'>5132</entry>
|
||||
<entry key='pretrace.port'>5133</entry>
|
||||
<entry key='pricol.port'>5134</entry>
|
||||
<entry key='siwi.port'>5135</entry>
|
||||
<entry key='starlink.port'>5136</entry>
|
||||
<entry key='dmt.port'>5137</entry>
|
||||
<entry key='xt2400.port'>5138</entry>
|
||||
<entry key='dmthttp.port'>5139</entry>
|
||||
<entry key='alematics.port'>5140</entry>
|
||||
<entry key='gps056.port'>5141</entry>
|
||||
<entry key='flexcomm.port'>5142</entry>
|
||||
<entry key='vt200.port'>5143</entry>
|
||||
<entry key='owntracks.port'>5144</entry>
|
||||
<entry key='vtfms.port'>5145</entry>
|
||||
<entry key='tlv.port'>5146</entry>
|
||||
<entry key='esky.port'>5147</entry>
|
||||
<entry key='genx.port'>5148</entry>
|
||||
<entry key='flespi.port'>5149</entry>
|
||||
<entry key='dway.port'>5150</entry>
|
||||
<entry key='recoda.port'>5151</entry>
|
||||
<entry key='oko.port'>5152</entry>
|
||||
<entry key='ivt401.port'>5153</entry>
|
||||
<entry key='sigfox.port'>5154</entry>
|
||||
<entry key='t57.port'>5155</entry>
|
||||
<entry key='spot.port'>5156</entry>
|
||||
<entry key='m2c.port'>5157</entry>
|
||||
<entry key='austinnb.port'>5158</entry>
|
||||
<entry key='opengts.port'>5159</entry>
|
||||
<entry key='cautela.port'>5160</entry>
|
||||
<entry key='continental.port'>5161</entry>
|
||||
<entry key='egts.port'>5162</entry>
|
||||
<entry key='robotrack.port'>5163</entry>
|
||||
<entry key='pt60.port'>5164</entry>
|
||||
<entry key='telemax.port'>5165</entry>
|
||||
<entry key='sabertek.port'>5166</entry>
|
||||
<entry key='retranslator.port'>5167</entry>
|
||||
<entry key='svias.port'>5168</entry>
|
||||
<entry key='eseal.port'>5169</entry>
|
||||
<entry key='freematics.port'>5170</entry>
|
||||
<entry key='avema.port'>5171</entry>
|
||||
<entry key='autotrack.port'>5172</entry>
|
||||
<entry key='tek.port'>5173</entry>
|
||||
<entry key='wristband.port'>5174</entry>
|
||||
<entry key='applet.port'>5175</entry>
|
||||
<entry key='milesmate.port'>5176</entry>
|
||||
<entry key='anytrek.port'>5177</entry>
|
||||
<entry key='smartsole.port'>5178</entry>
|
||||
<entry key='its.port'>5179</entry>
|
||||
|
||||
</properties>
|
22
traccar/rootfs/etc/traccar/traccar.xml
Normal file
22
traccar/rootfs/etc/traccar/traccar.xml
Normal file
|
@ -0,0 +1,22 @@
|
|||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<!DOCTYPE properties SYSTEM 'http://java.sun.com/dtd/properties.dtd'>
|
||||
|
||||
<properties>
|
||||
|
||||
<!--
|
||||
Loads default configuration for the Hass.io add-on.
|
||||
WARNING: Do not remove this line!
|
||||
-->
|
||||
<entry key='config.default'>/etc/traccar/hassio.xml</entry>
|
||||
|
||||
<!--
|
||||
This is the main configuration file. All your configuration parameters should be placed in this file.
|
||||
Parameters in the main config file override values in the default file. Do not
|
||||
remove "config.default" parameter from this file unless you know what you are doing.
|
||||
For list of available parameters see following page:
|
||||
https://www.traccar.org/configuration-file/
|
||||
-->
|
||||
|
||||
<!-- Enter you custom configuration below this line -->
|
||||
|
||||
</properties>
|
Loading…
Add table
Add a link
Reference in a new issue