From da974e8a40bad0ec3252b9f70db5393f2449d4c3 Mon Sep 17 00:00:00 2001 From: Michael Yick Date: Sat, 8 Jul 2023 17:27:19 -0500 Subject: [PATCH] fix setupdb.sh --- Makefile | 4 ++-- setupdb.sh | 11 +++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) mode change 100644 => 100755 setupdb.sh diff --git a/Makefile b/Makefile index d1cb6d1..09b469c 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ INC += -I/usr/include -L/usr/lib SRCFILES = src/main.cpp -DEF += -DCROW_ENABLE_SSL +#DEF += -DCROW_ENABLE_SSL LIBS += -lpqxx -lcurl -lcrypto -lssl -pthread @@ -33,4 +33,4 @@ clean: buildRun: clear g++ $(INC) -o cavecomm $(SRCFILES) $(DEF) $(LIBS) - ./cavecomm src/default-cavecomm.conf \ No newline at end of file + ./cavecomm src/default-cavecomm.conf diff --git a/setupdb.sh b/setupdb.sh old mode 100644 new mode 100755 index 29f2eef..087927b --- a/setupdb.sh +++ b/setupdb.sh @@ -1,7 +1,7 @@ #!/bin/sh -sudo -u postgres createuser -P -e cavecomm -sudo -u postgres createdb --owner=cavecomm cavecomm 'contains all the information for the cavecomm instance on this device' -sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE cavecomm TO cavecomm;" +sudo -u postgres createuser -P -e cavecommadmin +sudo -u postgres createdb --owner=cavecommadmin cavecomm 'contains all the information for the cavecomm instance on this device' +sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE cavecomm TO cavecommadmin;" sudo -u postgres psql -c "CREATE TABLE requests( id INT PRIMARY KEY GENERATED ALWAYS AS IDENTITY, customerName text, @@ -45,7 +45,7 @@ sudo -u postgres psql -c "CREATE TABLE templates( contactInformation text, currencyPreference text, priceUpFront decimal, - priceOnDeliver decimal, + priceOnDeliver decimal ); " cavecomm @@ -78,3 +78,6 @@ sudo -u postgres psql -c "CREATE TABLE aliasRoutes( routeParameters text ); " cavecomm +sudo -u postgres psql cavecomm -c "GRANT ALL ON ALL FUNCTIONS IN SCHEMA public to cavecommadmin;" +sudo -u postgres psql cavecomm -c "GRANT ALL ON ALL SEQUENCES IN SCHEMA public to cavecommadmin;" +sudo -u postgres psql cavecomm -c "GRANT ALL ON ALL TABLES IN SCHEMA public to cavecommadmin;"