diff options
-rw-r--r-- | default.cfg | 4 | ||||
-rw-r--r-- | opengts.cfg | 49 | ||||
-rw-r--r-- | pom.xml | 12 | ||||
-rw-r--r-- | setup/linux/linux.cfg | 88 | ||||
-rwxr-xr-x | setup/linux/traccar.sh | 56 | ||||
-rwxr-xr-x | setup/package.sh | 134 | ||||
-rwxr-xr-x | setup/universal/traccar.sh | 5 | ||||
-rw-r--r-- | setup/windows/traccar.iss | 18 | ||||
-rwxr-xr-x | setup/windows/traccar.sh | 18 | ||||
-rw-r--r-- | setup/windows/windows.cfg | 88 |
10 files changed, 260 insertions, 212 deletions
diff --git a/default.cfg b/default.cfg index 8d4df93c7..4b4685ce1 100644 --- a/default.cfg +++ b/default.cfg @@ -34,10 +34,6 @@ power - Double (NULL for some protocols) extended_info - String (XML) <--> - <!--> - H2 - SCOPE_IDENTITY() - MySQL - LAST_INSERT_ID() - <--> <entry key="database.insertPosition"> INSERT INTO positions (device_id, time, valid, latitude, longitude, altitude, speed, course, power) VALUES (:device_id, :time, :valid, :latitude, :longitude, :altitude, :speed, :course, :power); diff --git a/opengts.cfg b/opengts.cfg index dcfae9c19..a34301aec 100644 --- a/opengts.cfg +++ b/opengts.cfg @@ -17,22 +17,6 @@ SELECT imeiNumber AS id, imeiNumber AS imei FROM Device WHERE imeiNumber <> ''; </entry> - <entry key="database.insertDevice"> - DO 0; - </entry> - - <entry key="database.updateDevice"> - DO 0; - </entry> - - <entry key="database.deleteDevice"> - DO 0; - </entry> - - <entry key="database.selectPosition"> - DO 0; - </entry> - <entry key="database.insertPosition"> START TRANSACTION; UPDATE Device SET lastValidLatitude = :latitude, lastValidLongitude = :longitude, lastGPSTimestamp = UNIX_TIMESTAMP(:time), lastUpdateTime = UNIX_TIMESTAMP(NOW()) WHERE imeiNumber = :device_id; @@ -42,9 +26,12 @@ COMMIT; </entry> + <entry key="database.updateLatestPosition"> + DO 0; + </entry> + <!-- Web interface port --> - <entry key="http.enable">true</entry> - <entry key="http.port">8082</entry> + <entry key="http.enable">false</entry> <!-- Geocoder options --> <entry key="geocoder.enable">true</entry> @@ -124,5 +111,29 @@ <!-- PT502 server configuration --> <entry key="pt502.enable">true</entry> <entry key="pt502.port">5017</entry> - + + <!-- TR20 server configuration --> + <entry key="tr20.enable">true</entry> + <entry key="tr20.port">5018</entry> + + <!-- Navis server configuration --> + <entry key="navis.enable">true</entry> + <entry key="navis.port">5019</entry> + + <!-- Meitrack server configuration --> + <entry key="meitrack.enable">true</entry> + <entry key="meitrack.port">5020</entry> + + <!-- Skypatrol server configuration --> + <entry key="skypatrol.enable">true</entry> + <entry key="skypatrol.port">5021</entry> + + <!-- GT02 server configuration --> + <entry key="gt02.enable">true</entry> + <entry key="gt02.port">5022</entry> + + <!-- GT06 server configuration --> + <entry key="gt06.enable">true</entry> + <entry key="gt06.port">5023</entry> + </properties> @@ -3,7 +3,7 @@ <modelVersion>4.0.0</modelVersion> <groupId>org.traccar</groupId> <artifactId>traccar</artifactId> - <version>1.4-SNAPSHOT</version> + <version>2.0-SNAPSHOT</version> <name>traccar</name> <url>http://www.traccar.org</url> @@ -12,22 +12,22 @@ <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> - <version>4.10</version> + <version>4.11</version> </dependency> <dependency> <groupId>com.h2database</groupId> <artifactId>h2</artifactId> - <version>1.3.168</version> + <version>1.3.170</version> </dependency> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> - <version>5.1.21</version> + <version>5.1.22</version> </dependency> <dependency> <groupId>io.netty</groupId> <artifactId>netty</artifactId> - <version>3.5.9.Final</version> + <version>3.6.1.Final</version> </dependency> <dependency> <groupId>javax.servlet</groupId> @@ -37,7 +37,7 @@ <dependency> <groupId>org.eclipse.jetty.aggregate</groupId> <artifactId>jetty-all-server</artifactId> - <version>8.1.7.v20120910</version> + <version>8.1.8.v20121106</version> </dependency> </dependencies> diff --git a/setup/linux/linux.cfg b/setup/linux/linux.cfg index 6b60d5edc..16dc51e6f 100644 --- a/setup/linux/linux.cfg +++ b/setup/linux/linux.cfg @@ -6,6 +6,7 @@ <!-- Global confiduration --> <entry key="database.driver">org.h2.Driver</entry> + <entry key="database.dataSource">org.h2.jdbcx.JdbcDataSource</entry> <entry key="database.url">jdbc:h2:/opt/traccar/data/database</entry> <entry key="database.user">sa</entry> <entry key="database.password"></entry> @@ -13,59 +14,17 @@ <!-- Database refresh delay in seconds --> <entry key="database.refreshDelay">300</entry> - <!-- Create database schema --> - <entry key="database.initialize"> - CREATE TABLE IF NOT EXISTS devices (id INT IDENTITY, imei VARCHAR(16)); - CREATE TABLE IF NOT EXISTS positions (device_id INT, time TIMESTAMP, valid BOOLEAN, latitude DOUBLE, longitude DOUBLE, speed DOUBLE, course DOUBLE, power DOUBLE); - </entry> - <!--> - id - Integer + id - Long imei - String <--> <entry key="database.selectDevice"> - SELECT id, imei + SELECT id, uniqueId as imei FROM devices; </entry> <!--> - imei - String - <--> - <entry key="database.insertDevice"> - INSERT INTO devices (imei) - VALUES (:imei); - </entry> - - <!--> - id - Integer - imei - String - <--> - <entry key="database.updateDevice"> - UPDATE devices - SET imei = :imei - WHERE id = :id; - </entry> - - <!--> - id - Integer - <--> - <entry key="database.deleteDevice"> - DELETE FROM devices - WHERE id = :id; - </entry> - - <!--> - device_id - Integer - <--> - <entry key="database.selectPosition"> - SELECT * - FROM positions - WHERE device_id = :device_id - ORDER by time DESC; - </entry> - - <!--> - device_id - Integer + device_id - Long time - Date valid - Boolean latitude - Double @@ -76,13 +35,22 @@ extended_info - String (XML) <--> <entry key="database.insertPosition"> - INSERT INTO positions (device_id, time, valid, latitude, longitude, speed, course, power) - VALUES (:device_id, :time, :valid, :latitude, :longitude, :speed, :course, :power); + INSERT INTO positions (device_id, time, valid, latitude, longitude, altitude, speed, course, power) + VALUES (:device_id, :time, :valid, :latitude, :longitude, :altitude, :speed, :course, :power); + </entry> + + <!--> + device_id - Long + id - Long + <--> + <entry key="database.updateLatestPosition"> + UPDATE devices SET latestPosition_id = :id WHERE id = :device_id; </entry> <!-- Web interface port --> <entry key="http.enable">true</entry> <entry key="http.port">8082</entry> + <entry key="http.application">/opt/traccar/traccar-web.war</entry> <!-- Logging options --> <entry key="logger.enable">true</entry> @@ -183,5 +151,29 @@ <!-- GT06 server configuration --> <entry key="gt06.enable">true</entry> <entry key="gt06.port">5023</entry> - + + <!-- TR20 server configuration --> + <entry key="tr20.enable">true</entry> + <entry key="tr20.port">5018</entry> + + <!-- Navis server configuration --> + <entry key="navis.enable">true</entry> + <entry key="navis.port">5019</entry> + + <!-- Meitrack server configuration --> + <entry key="meitrack.enable">true</entry> + <entry key="meitrack.port">5020</entry> + + <!-- Skypatrol server configuration --> + <entry key="skypatrol.enable">true</entry> + <entry key="skypatrol.port">5021</entry> + + <!-- GT02 server configuration --> + <entry key="gt02.enable">true</entry> + <entry key="gt02.port">5022</entry> + + <!-- GT06 server configuration --> + <entry key="gt06.enable">true</entry> + <entry key="gt06.port">5023</entry> + </properties> diff --git a/setup/linux/traccar.sh b/setup/linux/traccar.sh deleted file mode 100755 index bcba7bb5a..000000000 --- a/setup/linux/traccar.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/sh - -app='/opt/traccar' - -tar -xzf wrapper-delta-pack-*.tar.gz -mv wrapper-delta-pack-*/ wrapper/ - -rm -rf out - -mkdir out -mkdir out/bin -mkdir out/conf -mkdir out/data -mkdir out/lib -mkdir out/logs - -cp wrapper/src/bin/sh.script.in out/bin/traccar -cp wrapper/lib/wrapper.jar out/lib -cp wrapper/src/conf/wrapper.conf.in out/conf/wrapper.conf - -cp ../../target/tracker-server.jar out -cp ../../target/lib/* out/lib -cp linux.cfg out/conf - -sed -i 's/@app.name@/traccar/g' out/bin/traccar -sed -i 's/@app.long.name@/traccar/g' out/bin/traccar - -sed -i '/wrapper.java.classpath.1/i\wrapper.java.classpath.2=../tracker-server.jar' out/conf/wrapper.conf -sed -i "/wrapper.app.parameter.1/i\wrapper.app.parameter.2=$app/conf/linux.cfg" out/conf/wrapper.conf -sed -i 's/<YourMainClass>/org.traccar.Main/g' out/conf/wrapper.conf -sed -i 's/@app.name@/traccar/g' out/conf/wrapper.conf -sed -i 's/@app.long.name@/traccar/g' out/conf/wrapper.conf -sed -i 's/@app.description@/traccar/g' out/conf/wrapper.conf - -# linux 32 - -cp wrapper/bin/wrapper-linux-x86-32 out/bin/wrapper -cp wrapper/lib/libwrapper-linux-x86-32.so out/lib/libwrapper.so -chmod +x out/bin/traccar - -makeself out traccar.run "traccar" "mkdir $app; cp -rf * $app; $app/bin/traccar install" -zip traccar-linux-32.zip traccar.run README.txt - -# linux 64 - -cp wrapper/bin/wrapper-linux-x86-64 out/bin/wrapper -cp wrapper/lib/libwrapper-linux-x86-64.so out/lib/libwrapper.so -chmod +x out/bin/traccar - -makeself out traccar.run "traccar" "mkdir $app; cp -rf * $app; $app/bin/traccar install" -zip traccar-linux-64.zip traccar.run README.txt - -rm traccar.run -rm -rf out -rm -rf wrapper - diff --git a/setup/package.sh b/setup/package.sh new file mode 100755 index 000000000..ac0f021a8 --- /dev/null +++ b/setup/package.sh @@ -0,0 +1,134 @@ +#!/bin/sh + +# GENERAL REQUIREMENTS + +# Check web application +if [ -e "traccar-web.war" ]; then + echo "Web application archive found" +else + echo "Put traccar-web.war into this directory" + exit 0 +fi + +# Check wrapper +if ls wrapper-delta-pack-*.tar.gz &> /dev/null; then + echo "Java wrapper package found" +else + echo "Put wrapper-delta-pack-*.tar.gz into this directory" + exit 0 +fi + +# WINDOWS REQUIREMENTS + +# Check inno setup +if ls isetup-*.exe &> /dev/null; then + echo "Inno setup installer found" +else + echo "Put isetup-*.exe into this directory" + exit 0 +fi + +# Check wine +if which wine > /dev/null; then + echo "Found wine" +else + echo "Install wine package" + exit 0 +fi + +# Check innoextract +if which innoextract > /dev/null; then + echo "Found Innoextract" +else + echo "Install innoextract package" + exit 0 +fi + +# LINUX REQUIREMENTS + +# Check makeself +if which makeself > /dev/null; then + echo "Found makeself" +else + echo "Install makeself package" + exit 0 +fi + +# GENERAL PREPARATION + +tar -xzf wrapper-delta-pack-*.tar.gz +mv wrapper-delta-pack-*/ wrapper/ + +# UNIVERSAL PACKAGE + +zip -j tracker-server.zip ../target/tracker-server.jar universal/README.txt + +# WINDOWS PACKAGE + +innoextract isetup-*.exe +echo "NOTE: if you got any errors here try isetup version 5.4.3 (or check what versions are supported by 'innoextract -v')" + +wine app/ISCC.exe windows/traccar.iss + +zip -j traccar-windows-32.zip windows/Output/setup.exe windows/README.txt + +rm -rf windows/Output/ +rm -rf tmp/ +rm -rf app/ + +# LINIX PACKAGE + +app='/opt/traccar' + +rm -rf out + +mkdir out +mkdir out/bin +mkdir out/conf +mkdir out/data +mkdir out/lib +mkdir out/logs + +cp wrapper/src/bin/sh.script.in out/bin/traccar +cp wrapper/lib/wrapper.jar out/lib +cp wrapper/src/conf/wrapper.conf.in out/conf/wrapper.conf + +cp ../target/tracker-server.jar out +cp ../target/lib/* out/lib +cp traccar-web.war out +cp linux/linux.cfg out/conf + +sed -i 's/@app.name@/traccar/g' out/bin/traccar +sed -i 's/@app.long.name@/traccar/g' out/bin/traccar + +sed -i '/wrapper.java.classpath.1/i\wrapper.java.classpath.2=../tracker-server.jar' out/conf/wrapper.conf +sed -i "/wrapper.app.parameter.1/i\wrapper.app.parameter.2=$app/conf/linux.cfg" out/conf/wrapper.conf +sed -i 's/<YourMainClass>/org.traccar.Main/g' out/conf/wrapper.conf +sed -i 's/@app.name@/traccar/g' out/conf/wrapper.conf +sed -i 's/@app.long.name@/traccar/g' out/conf/wrapper.conf +sed -i 's/@app.description@/traccar/g' out/conf/wrapper.conf + +# linux 32 + +cp wrapper/bin/wrapper-linux-x86-32 out/bin/wrapper +cp wrapper/lib/libwrapper-linux-x86-32.so out/lib/libwrapper.so +chmod +x out/bin/traccar + +makeself out traccar.run "traccar" "mkdir $app; cp -rf * $app; $app/bin/traccar install" +zip -j traccar-linux-32.zip traccar.run linux/README.txt + +# linux 64 + +cp wrapper/bin/wrapper-linux-x86-64 out/bin/wrapper +cp wrapper/lib/libwrapper-linux-x86-64.so out/lib/libwrapper.so +chmod +x out/bin/traccar + +makeself out traccar.run "traccar" "mkdir $app; cp -rf * $app; $app/bin/traccar install" +zip -j traccar-linux-64.zip traccar.run linux/README.txt + +rm traccar.run +rm -rf out + +# GENERAL CLEANUP + +rm -rf wrapper/ diff --git a/setup/universal/traccar.sh b/setup/universal/traccar.sh deleted file mode 100755 index 26a3078fa..000000000 --- a/setup/universal/traccar.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -cp ../../target/tracker-server.jar ./ -zip tracker-server.zip tracker-server.jar README.txt -rm tracker-server.jar diff --git a/setup/windows/traccar.iss b/setup/windows/traccar.iss index 54c93367c..dda8e175f 100644 --- a/setup/windows/traccar.iss +++ b/setup/windows/traccar.iss @@ -1,6 +1,6 @@ [Setup]
AppName=Traccar
-AppVersion=1.4
+AppVersion=2.0
DefaultDirName={pf}\Traccar
AlwaysRestart=yes
@@ -12,16 +12,17 @@ Name: "{app}\lib" Name: "{app}\logs"
[Files]
-Source: "wrapper\bin\wrapper-windows-x86-32.exe"; DestDir: "{app}\bin"; DestName: "wrapper.exe"
-Source: "wrapper\src\bin\App.bat.in"; DestDir: "{app}\bin"; DestName: "Traccar.bat"
-Source: "wrapper\src\bin\InstallApp-NT.bat.in"; DestDir: "{app}\bin"; DestName: "InstallTraccar-NT.bat"
-Source: "wrapper\src\bin\UninstallApp-NT.bat.in"; DestDir: "{app}\bin"; DestName: "UninstallTraccar-NT.bat"
-Source: "wrapper\lib\wrapper-windows-x86-32.dll"; DestDir: "{app}\lib"; DestName: "wrapper.dll"
-Source: "wrapper\lib\wrapper.jar"; DestDir: "{app}\lib";
-Source: "wrapper\src\conf\wrapper.conf.in"; DestDir: "{app}\conf"; DestName: "wrapper.conf"; AfterInstall: ConfigureWrapper
+Source: "..\wrapper\bin\wrapper-windows-x86-32.exe"; DestDir: "{app}\bin"; DestName: "wrapper.exe"
+Source: "..\wrapper\src\bin\App.bat.in"; DestDir: "{app}\bin"; DestName: "Traccar.bat"
+Source: "..\wrapper\src\bin\InstallApp-NT.bat.in"; DestDir: "{app}\bin"; DestName: "InstallTraccar-NT.bat"
+Source: "..\wrapper\src\bin\UninstallApp-NT.bat.in"; DestDir: "{app}\bin"; DestName: "UninstallTraccar-NT.bat"
+Source: "..\wrapper\lib\wrapper-windows-x86-32.dll"; DestDir: "{app}\lib"; DestName: "wrapper.dll"
+Source: "..\wrapper\lib\wrapper.jar"; DestDir: "{app}\lib";
+Source: "..\wrapper\src\conf\wrapper.conf.in"; DestDir: "{app}\conf"; DestName: "wrapper.conf"; AfterInstall: ConfigureWrapper
Source: "..\..\target\tracker-server.jar"; DestDir: "{app}"
Source: "..\..\target\lib\*"; DestDir: "{app}\lib"
+Source: "..\traccar-web.war"; DestDir: "{app}"
Source: "windows.cfg"; DestDir: "{app}\conf"; AfterInstall: ConfigureApplication
[Run]
@@ -64,6 +65,7 @@ var begin
LoadStringFromFile(ExpandConstant(CurrentFileName), S);
StringChangeEx(S, '[DATABASE]', ExpandConstant('{app}\data\database'), true);
+ StringChangeEx(S, '[WAR]', ExpandConstant('{app}\traccar-web.war'), true);
StringChangeEx(S, '[LOG]', ExpandConstant('{app}\logs\tracker-server.log'), true);
SaveStringToFile(ExpandConstant(CurrentFileName), S, false);
end;
diff --git a/setup/windows/traccar.sh b/setup/windows/traccar.sh deleted file mode 100755 index e72a130f1..000000000 --- a/setup/windows/traccar.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -tar -xzf wrapper-delta-pack-*.tar.gz -mv wrapper-delta-pack-*/ wrapper/ - -innoextract isetup-*.exe - -wine app/ISCC.exe traccar.iss -mv Output/setup.exe . - -zip traccar-windows-32.zip setup.exe README.txt - -rm setup.exe -rm -rf Output -rm -rf wrapper -rm -rf app -rm -rf tmp - diff --git a/setup/windows/windows.cfg b/setup/windows/windows.cfg index 6e3a1a12f..e6b620b0c 100644 --- a/setup/windows/windows.cfg +++ b/setup/windows/windows.cfg @@ -6,6 +6,7 @@ <!-- Global confiduration -->
<entry key="database.driver">org.h2.Driver</entry>
+ <entry key="database.dataSource">org.h2.jdbcx.JdbcDataSource</entry>
<entry key="database.url">jdbc:h2:[DATABASE]</entry>
<entry key="database.user">sa</entry>
<entry key="database.password"></entry>
@@ -13,59 +14,17 @@ <!-- Database refresh delay in seconds -->
<entry key="database.refreshDelay">300</entry>
- <!-- Create database schema -->
- <entry key="database.initialize">
- CREATE TABLE IF NOT EXISTS devices (id INT IDENTITY, imei VARCHAR(16));
- CREATE TABLE IF NOT EXISTS positions (device_id INT, time TIMESTAMP, valid BOOLEAN, latitude DOUBLE, longitude DOUBLE, speed DOUBLE, course DOUBLE, power DOUBLE);
- </entry>
-
<!-->
- id - Integer
+ id - Long
imei - String
<-->
<entry key="database.selectDevice">
- SELECT id, imei
+ SELECT id, uniqueId as imei
FROM devices;
</entry>
<!-->
- imei - String
- <-->
- <entry key="database.insertDevice">
- INSERT INTO devices (imei)
- VALUES (:imei);
- </entry>
-
- <!-->
- id - Integer
- imei - String
- <-->
- <entry key="database.updateDevice">
- UPDATE devices
- SET imei = :imei
- WHERE id = :id;
- </entry>
-
- <!-->
- id - Integer
- <-->
- <entry key="database.deleteDevice">
- DELETE FROM devices
- WHERE id = :id;
- </entry>
-
- <!-->
- device_id - Integer
- <-->
- <entry key="database.selectPosition">
- SELECT *
- FROM positions
- WHERE device_id = :device_id
- ORDER by time DESC;
- </entry>
-
- <!-->
- device_id - Integer
+ device_id - Long
time - Date
valid - Boolean
latitude - Double
@@ -76,13 +35,22 @@ extended_info - String (XML)
<-->
<entry key="database.insertPosition">
- INSERT INTO positions (device_id, time, valid, latitude, longitude, speed, course, power)
- VALUES (:device_id, :time, :valid, :latitude, :longitude, :speed, :course, :power);
+ INSERT INTO positions (device_id, time, valid, latitude, longitude, altitude, speed, course, power)
+ VALUES (:device_id, :time, :valid, :latitude, :longitude, :altitude, :speed, :course, :power);
+ </entry>
+
+ <!-->
+ device_id - Long
+ id - Long
+ <-->
+ <entry key="database.updateLatestPosition">
+ UPDATE devices SET latestPosition_id = :id WHERE id = :device_id;
</entry>
<!-- Web interface port -->
<entry key="http.enable">true</entry>
<entry key="http.port">8082</entry>
+ <entry key="http.application">[WAR]</entry>
<!-- Logging options -->
<entry key="logger.enable">true</entry>
@@ -159,5 +127,29 @@ <!-- PT502 server configuration -->
<entry key="pt502.enable">true</entry>
<entry key="pt502.port">5017</entry>
-
+
+ <!-- TR20 server configuration -->
+ <entry key="tr20.enable">true</entry>
+ <entry key="tr20.port">5018</entry>
+
+ <!-- Navis server configuration -->
+ <entry key="navis.enable">true</entry>
+ <entry key="navis.port">5019</entry>
+
+ <!-- Meitrack server configuration -->
+ <entry key="meitrack.enable">true</entry>
+ <entry key="meitrack.port">5020</entry>
+
+ <!-- Skypatrol server configuration -->
+ <entry key="skypatrol.enable">true</entry>
+ <entry key="skypatrol.port">5021</entry>
+
+ <!-- GT02 server configuration -->
+ <entry key="gt02.enable">true</entry>
+ <entry key="gt02.port">5022</entry>
+
+ <!-- GT06 server configuration -->
+ <entry key="gt06.enable">true</entry>
+ <entry key="gt06.port">5023</entry>
+
</properties>
|