diff --git a/README.md b/README.md index 8056290c..8c13ed00 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ pom.xml -- frontend -- pom.xml ``` -#MVN command +## MVN command ```shell script To clean: @@ -198,7 +198,7 @@ Info: So far only filtered data is pushed into the database. } } ``` -##Region Import +## Region Import Region is imported by parsing Folder path of ride or profile file. Its important to keep Rides and Profiles under City name. diff --git a/alternative_install.sh b/alternative_install.sh new file mode 100644 index 00000000..3912e848 --- /dev/null +++ b/alternative_install.sh @@ -0,0 +1,135 @@ +#!/bin/bash +set -e + +#get info from user +echo Please enter server name, ex: yourserver.com: +read servername +echo Please specify the directory to be monitored by the importer: +read monitorpath +echo Please specify the directory for the pbf files: +read pbffiles +echo Please specify the logging directory: +read loggingdir +echo Please specify the user you want to run the java applications on: +read javauser + +#add required repositories +sudo apt-get install software-properties-common +sudo apt-add-repository universe +sudo apt update + +#install nginx +sudo apt install nginx -y + +#install java + maven +sudo apt-get install default-jre -y +sudo apt-get install default-jdk -y +sudo apt install maven -y + +#install nodejs +curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash - +sudo apt-get install -y nodejs + +#install mongodb +. /etc/lsb-release +sudo apt-get install gnupg -y +wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add - +if [ "$DISTRIB_CODENAME" = "xenial" ] +then + echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.2.list +else + echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.2.list +fi +sudo apt update +sudo apt install mongodb-org -y +sudo systemctl daemon-reload +sudo systemctl start mongod + +#install git +sudo apt install git -y + +#clone repository +git clone https://github.com/simra-project/SimRa-Visualization.git +cd SimRa-Visualization + +#update configuration of CSV importer +sudo cat <> backend/csvimporter/src/main/resources/application.properties +csv.monitor.path=$monitorpath +pbf.path=$pbffiles +logging.file.name=$loggingdir/csvimporter.log +EOT + +#compile jars +sudo mvn clean install -DskipTests + +#import dump +mongorestore + +#compile frontend +cd frontend +npm install +npm run build +cd .. + +#configure and start frontend +sudo sed -i 's/# server_names_hash_bucket_size 64;/server_names_hash_bucket_size 256;/g' /etc/nginx/nginx.conf +sudo cat < ./simra.conf +server { + listen 80; + server_name $servername; + + # Tell Nginx where your app's 'public' directory is + root `pwd`/frontend/dist; + + location / { + try_files \$uri \$uri/ /index.html; + } +} +EOT +sudo mv ./simra.conf /etc/nginx/sites-enabled/simra.conf +sudo service nginx restart + +#configure and start interface +sudo cat < ./simra_api.service +[Unit] +Description=Simra Springboot API +After=syslog.target +After=network.target + +[Service] +ExecStart=/usr/bin/java -jar `pwd`/backend/SimRa-Visualization-API/target/SimRa-Visualization-API-1.0-SNAPSHOT.jar +Restart=always +StandardOutput=syslog +StandardError=syslog +SyslogIdentifier=simra_api +User=$javauser +Type=simple + +[Install] +WantedBy=multi-user.target +EOT +sudo mv ./simra_api.service /etc/systemd/system/simra_api.service +sudo systemctl start simra_api + +#configure and start backend + +sudo cat < ./simra_backend.service +[Unit] +Description=Simra Springboot API +After=syslog.target +After=network.target + +[Service] +ExecStart=/usr/bin/java -jar `pwd`/backend/csvimporter/target/csvimporter-0.0.1-SNAPSHOT.jar +Restart=always +StandardOutput=syslog +StandardError=syslog +SyslogIdentifier=simra_backend +User=$javauser +Type=simple + +[Install] +WantedBy=multi-user.target +EOT +sudo mv ./simra_backend.service /etc/systemd/system/simra_backend.service +sudo systemctl start simra_backend diff --git a/backend/SimRa-Visualization-API/pom.xml b/backend/SimRa-Visualization-API/pom.xml index f9f6b642..c3fec87f 100644 --- a/backend/SimRa-Visualization-API/pom.xml +++ b/backend/SimRa-Visualization-API/pom.xml @@ -121,7 +121,7 @@ junit junit - 4.11 + 4.13.1 test @@ -152,16 +152,17 @@ osgeo - Open Source Geospatial Foundation Repository - http://download.osgeo.org/webdav/geotools/ + OSGeo Release Repository + https://repo.osgeo.org/repository/release/ + false + true - - true - - boundless - Boundless Maven Repository - http://repo.boundlessgeo.com/main + osgeo-snapshot + OSGeo Snapshot Repository + https://repo.osgeo.org/repository/snapshot/ + true + false diff --git a/install.sh b/install.sh index fe9ea1f5..ea0e08a7 100755 --- a/install.sh +++ b/install.sh @@ -5,7 +5,7 @@ set -e echo Please enter server name, ex: yourserver.com: read servername echo Please specify the directory to be monitored by the importer: -read monitordir +read monitorpath echo Please specify the directory for the pbf files: read pbffiles echo Please specify the logging directory: