From c19f88d8cc8a8d7ab20274ae41a6e3e82a50bd24 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sat, 8 Oct 2022 09:52:56 -0500 Subject: [PATCH] try to autoconfig postgres Signed-off-by: Jeff Carr --- Makefile | 2 +- postinst | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 8f9bb40..e207bc4 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ .PHONY: control VERSION=7.3.0 -MINOR=v8 +MINOR=v9 help: @echo diff --git a/postinst b/postinst index c033d57..85e3117 100755 --- a/postinst +++ b/postinst @@ -1,5 +1,9 @@ #!/bin/sh +# create the mattermost user and database +su postgres -c 'createdb mattermost' +su postgres -c 'createuser mmuser' + echo echo systemctl status mattermost.service echo @@ -8,11 +12,9 @@ echo 'psql' echo '\\db # will list the tablespaces' echo '\\dg # will list users' echo -echo createuser --interactive -P blah -echo createuser -P -s -e jcarr -echo dropuser jcarr -echo '$ psql -U postgres' -echo " db> ALTER USER postgres with password 'your-pass';" -echo "su postgres createdb mattermost" -echo "su postgres createuser mmtest" +echo "ALTER USER mmuser with password 'mmpass';" +echo +echo "CREATE DATABASE mattermost;" +echo "CREATE USER mmuser WITH PASSWORD 'mmpass';" +echo "GRANT ALL PRIVILEGES ON DATABASE mattermost to mmuser;" echo