From 830d9018508d28d7921188e3329923bdc81a5e3e Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 21 Jun 2015 12:55:38 +1200 Subject: Update OSX setup config --- setup/macosx/traccar.cfg | 407 ----------------------------------------------- setup/macosx/traccar.xml | 286 +++++++++++++++++++++++++++++++++ 2 files changed, 286 insertions(+), 407 deletions(-) delete mode 100644 setup/macosx/traccar.cfg create mode 100644 setup/macosx/traccar.xml (limited to 'setup/macosx') diff --git a/setup/macosx/traccar.cfg b/setup/macosx/traccar.cfg deleted file mode 100644 index 8256bbcce..000000000 --- a/setup/macosx/traccar.cfg +++ /dev/null @@ -1,407 +0,0 @@ - - - - - - - - org.h2.Driver - jdbc:h2:/opt/traccar/data/database - sa - - - - id - Long - imei - String - <--> - - SELECT id, uniqueId as imei - FROM devices; - - - - device_id - Long - time - Date - valid - Boolean - latitude - Double - longitude - Double - speed - Double - course - Double - power - Double (NULL for some protocols) - extended_info - String (XML) - <--> - - INSERT INTO positions (device_id, time, valid, latitude, longitude, altitude, speed, course, address, other) - VALUES (:device_id, :time, :valid, :latitude, :longitude, :altitude, :speed, :course, :address, :extended_info); - - - - device_id - Long - id - Long - <--> - - UPDATE devices SET latestPosition_id = :id WHERE id = :device_id; - - - - true - - 8082 - /opt/traccar/traccar-web.war - - - false - nominatim - http://nominatim.openstreetmap.org/reverse - - - - - - true - all - /opt/traccar/logs/tracker-server.log - - - true - 5000 - - - true - 5001 - - - true - 5002 - - - true - 5003 - - - true - 5004 - - - true - 5005 - - - true - 5006 - false - - - true - 5007 - - - true - 5008 - - - true - 5009 - - - true - 5010 - - - true - 5011 - - - true - 5012 - - - true - 5013 - - - true - 5014 - - - true - 5015 - - - true - 5016 - - - true - 5017 - - - true - 5018 - - - true - 5019 - - - true - 5020 - - - true - 5021 - - - true - 5022 - - - true - 5023 - - - true - 5024 - - - true - 5025 - - - true - 5026 - - - true - 5027 - - - true - 5028 - - - true - 5029 - - - true - 5030 - - - true - 5031 - - - true - 5032 - - - true - 5033 - - - true - 5034 - - - true - 5035 - - - true - 5036 - - - true - 5037 - - - true - 5038 - - - true - 5039 - - - true - 5040 - - - true - 5041 - - - true - 5042 - - - true - 5043 - - - true - 5044 - - - true - 5045 - - - true - 5046 - - - true - 5047 - - - true - 5048 - - - true - 5049 - - - true - 5050 - - - true - 5051 - - - true - 5052 - - - true - 5053 - - - true - 5054 - - - true - 5055 - - - true - 5056 - - - true - 5057 - - - true - 5058 - - - true - 5059 - - - true - 5060 - - - true - 5061 - - - true - 5062 - - - true - 5063 - - - true - 5064 - - - true - 5065 - - - true - 5066 - - - true - 5067 - - - true - 5068 - - - true - 5069 - - - true - 5070 - - - true - 5071 - - - true - 5072 - - - true - 5073 - - - true - 5074 - - - true - 5075 - - - true - 5076 - - - true - 5077 - - - true - 5078 - - - true - 5079 - - - true - 5080 - - - true - 5081 - - - true - 5082 - - - true - 5083 - - diff --git a/setup/macosx/traccar.xml b/setup/macosx/traccar.xml new file mode 100644 index 000000000..99b66336a --- /dev/null +++ b/setup/macosx/traccar.xml @@ -0,0 +1,286 @@ + + + + + + + + + true + 8082 + true + web + webm + + true + google + + true + all + /opt/traccar/logs/tracker-server.log + + + + org.h2.Driver + jdbc:h2:/opt/traccar/data/database + sa + + traccar + + + CREATE TABLE user ( + id INT PRIMARY KEY AUTO_INCREMENT, + name VARCHAR(1024) NOT NULL, + email VARCHAR(256) NOT NULL UNIQUE, + hashedPassword VARCHAR(1024) NOT NULL, + salt VARCHAR(1024) DEFAULT '' NOT NULL, + readonly BOOLEAN DEFAULT false NOT NULL, + admin BOOLEAN DEFAULT false NOT NULL, + map VARCHAR(1024) DEFAULT 'osm' NOT NULL, + language VARCHAR(1024) DEFAULT 'en' NOT NULL, + distanceUnit VARCHAR(1024) DEFAULT 'km' NOT NULL, + speedUnit VARCHAR(1024) DEFAULT 'kmh' NOT NULL, + latitude DOUBLE DEFAULT 0 NOT NULL, + longitude DOUBLE DEFAULT 0 NOT NULL, + zoom INT DEFAULT 0 NOT NULL); + + CREATE TABLE device ( + id INT PRIMARY KEY AUTO_INCREMENT, + name VARCHAR(1024) NOT NULL, + uniqueId VARCHAR(256) NOT NULL UNIQUE, + status VARCHAR(1024), + lastUpdate TIMESTAMP, + positionId INT, + dataId INT); + + CREATE TABLE user_device ( + userId INT NOT NULL, + deviceId INT NOT NULL, + `read` BOOLEAN DEFAULT true NOT NULL, + `write` BOOLEAN DEFAULT true NOT NULL, + FOREIGN KEY (userId) REFERENCES user(id) ON DELETE CASCADE, + FOREIGN KEY (deviceId) REFERENCES device(id) ON DELETE CASCADE); + + CREATE INDEX user_device_user_id ON user_device(userId); + + CREATE TABLE position ( + id INT PRIMARY KEY AUTO_INCREMENT, + protocol VARCHAR(1024), + deviceId INT NOT NULL, + serverTime TIMESTAMP NOT NULL, + deviceTime TIMESTAMP NOT NULL, + fixTime TIMESTAMP NOT NULL, + valid BOOLEAN NOT NULL, + latitude DOUBLE NOT NULL, + longitude DOUBLE NOT NULL, + altitude DOUBLE NOT NULL, + speed DOUBLE NOT NULL, + course DOUBLE NOT NULL, + address VARCHAR(1024), + other VARCHAR(8192) NOT NULL, + FOREIGN KEY (deviceId) REFERENCES device(id) ON DELETE CASCADE); + + CREATE TABLE data ( + id INT PRIMARY KEY AUTO_INCREMENT, + protocol VARCHAR(1024), + deviceId INT NOT NULL, + serverTime TIMESTAMP NOT NULL, + deviceTime TIMESTAMP NOT NULL, + other VARCHAR(8192) NOT NULL, + FOREIGN KEY (deviceId) REFERENCES device(id)); + + ALTER TABLE device ADD + FOREIGN KEY (positionId) REFERENCES `position`(id); + + ALTER TABLE device ADD + FOREIGN KEY (dataId) REFERENCES data(id); + + CREATE TABLE server ( + id INT PRIMARY KEY AUTO_INCREMENT, + registration BOOLEAN NOT NULL, + latitude DOUBLE NOT NULL, + longitude DOUBLE NOT NULL, + zoom INT NOT NULL); + + CREATE TABLE traccar ( + id INT PRIMARY KEY AUTO_INCREMENT); + + + + SELECT * FROM server; + + + + INSERT INTO server (registration, latitude, longitude, zoom) + VALUES (:registration, :latitude, :longitude, :zoom); + + + + UPDATE server SET registration = :registration WHERE id = :id; + + + + SELECT * FROM user + WHERE email = :email; + + + + SELECT * FROM user; + + + + INSERT INTO user (name, email, hashedPassword, salt, admin) + VALUES (:name, :email, :hashedPassword, :salt, :admin); + + + + UPDATE user SET name = :name, email = :email, admin = :admin + WHERE id = :id; + + + + UPDATE user SET hashedPassword = :hashedPassword, salt = :salt WHERE id = :id; + + + + DELETE FROM user WHERE id = :id; + + + + SELECT userId, deviceId FROM user_device; + + + + SELECT * FROM device; + + + + SELECT * FROM device d INNER JOIN user_device ud ON d.id = ud.deviceId WHERE ud.userId = :userId; + + + + INSERT INTO device (name, uniqueId) VALUES (:name, :uniqueId); + + + + UPDATE device SET name = :name, uniqueId = :uniqueId WHERE id = :id; + + + + DELETE FROM device WHERE id = :id; + + + + INSERT INTO user_device (userId, deviceId) VALUES (:userId, :deviceId); + + + + SELECT * FROM position WHERE deviceId = :deviceId AND fixTime BETWEEN :from AND :to; + + + + INSERT INTO position (deviceId, serverTime, deviceTime, fixTime, valid, latitude, longitude, altitude, speed, course, address, other) + VALUES (:deviceId, NOW(), :time, :time, :valid, :latitude, :longitude, :altitude, :speed, :course, :address, :other); + + + + SELECT * FROM position WHERE id IN (SELECT positionId FROM device); + + + + UPDATE device SET positionId = :id WHERE id = :deviceId; + + + + + 5000 + 5001 + 5002 + 5003 + 5004 + 5005 + 5006 + false + 5007 + 5008 + 5009 + 5010 + 5011 + 5012 + 5013 + 5014 + 5015 + 5016 + 5017 + 5018 + 5019 + 5020 + 5021 + 5022 + 5023 + 5024 + 5025 + 5026 + 5027 + 5028 + 5029 + 5030 + 5031 + 5032 + 5033 + 5034 + 5035 + 5036 + 5037 + 5038 + 5039 + 5040 + 5041 + 5042 + 5043 + 5044 + 5045 + 5046 + 5047 + 5048 + 5049 + false + 5050 + 5051 + 5052 + 5053 + 5054 + 5055 + 5056 + 5057 + 5058 + 5059 + 5060 + 5061 + 5062 + 5063 + 5064 + 5065 + 5066 + 5067 + 5068 + 5069 + 5070 + 5071 + 5072 + 5073 + 5074 + 5075 + 5076 + 5077 + 5078 + 5079 + 5080 + 5081 + 5082 + 5083 + 5084 + 5085 + 5086 + + -- cgit v1.2.3