diff --git a/.pgpass b/.pgpass index 8f91a03..a4b984c 100644 --- a/.pgpass +++ b/.pgpass @@ -1 +1 @@ -db:5432:trackdirect:root:foobar \ No newline at end of file +db:5432:trackdirect:postgres:foobar diff --git a/config/aprsc.conf b/config/aprsc.conf index 48d5927..471a7ab 100755 --- a/config/aprsc.conf +++ b/config/aprsc.conf @@ -1,9 +1,9 @@ # Note that server id and passcode needs to be changed -ServerId MY-SERVER-ID -PassCode 11111 +ServerId APRSDIR-3 +PassCode 30376 -MyAdmin "My Name, MySignal" -MyEmail me@domain.com +MyAdmin "Per Qvarforth, SM4WJF" +MyEmail per@qvarforth.se disallow_unverified false RunDir data @@ -27,4 +27,4 @@ HTTPStatusOptions ShowEmail=1 # After configuring the rest of the settings, remove this bad command # from the configuration file. It's here only to avoid starting the # server up accidentally with an invalid configuration. -MagicBadness 42.7 +#MagicBadness 42.7 diff --git a/config/trackdirect.ini b/config/trackdirect.ini index 049dbcc..39886cd 100644 --- a/config/trackdirect.ini +++ b/config/trackdirect.ini @@ -34,7 +34,7 @@ coverage_percentile="95" ;; If using docker, set host to "db", otherwise "127.0.0.1" host="db" database="trackdirect" -username="root" +username="postgres" password="foobar" port="5432" diff --git a/crontab b/crontab index 6d8c3f5..3ee247f 100644 --- a/crontab +++ b/crontab @@ -1,2 +1,2 @@ 40 * * * * ~/trackdirect/server/scripts/remover.sh trackdirect.ini -*/30 * * * * ~/trackdirect/server/scripts/ogn_devices_install.sh trackdirect db 5432 +*/30 * * * * ~/trackdirect/server/scripts/ogn_devices_install.sh trackdirect db 5432 postgres diff --git a/docker-compose.yml b/docker-compose.yml index df1e41c..4d861ce 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -61,11 +61,11 @@ services: context: . dockerfile: trackdirect-db.dockerfile environment: - POSTGRES_USER: root + POSTGRES_USER: postgres POSTGRES_PASSWORD: foobar POSTGRES_DB: trackdirect volumes: - $PWD/db:/var/lib/postgresql/data command: -c config_file=/etc/postgresql.conf ports: - - "5432:5432" \ No newline at end of file + - "5432:5432" diff --git a/server/scripts/collector.sh b/server/scripts/collector.sh index e7fc1eb..353b85b 100755 --- a/server/scripts/collector.sh +++ b/server/scripts/collector.sh @@ -18,7 +18,7 @@ else sleep 30 export PYTHONPATH=$PYTHONPATH:$CURRENTDIR/../trackdirect cd $CURRENTDIR/../.. - $CURRENTDIR/ogn_devices_install.sh trackdirect db 5432 + $CURRENTDIR/ogn_devices_install.sh trackdirect db 5432 postgres python $CURRENTDIR/../bin/collector.py $CONFIGFILE $COLLECTORNUMBER exit 0 fi diff --git a/server/scripts/ogn_devices_install.sh b/server/scripts/ogn_devices_install.sh index 51eeeaa..2175b76 100755 --- a/server/scripts/ogn_devices_install.sh +++ b/server/scripts/ogn_devices_install.sh @@ -2,13 +2,14 @@ if [ $# -eq 0 ] then echo "No arguments supplied" - echo "$0 [dbname] [dbport]" + echo "$0 [dbname] [dbport] [dbuser]" exit fi DATABASE=$1 HOST=$2 PORT=$3 +USER=$4 pushd `dirname $0` > /dev/null SCRIPTPATH=`pwd -P` @@ -34,7 +35,7 @@ else sed '/^#/ d' < ogndevices.csv > ogndevices2.csv # Load file into database (assumes .pgpass is correctly set) -psql -h $HOST -p $PORT $DATABASE << EOF +psql -h $HOST -p $PORT $DATABASE -U $USER << EOF create table if not exists ogn_device ( "device_type" text not null,