summarylogtreecommitdiffstats
path: root/sharkey.install
blob: 09fe4fdbbc453400bff647b2d009ad8124fd4b0c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
post_install() {
    printf "The database needs to be set up.\n"
    printf "First, we need to create a user and database:\n"
    printf "sudo -u postgres psql"
	printf ">>> CREATE DATABASE sharkey WITH ENCODING = 'UTF8';\n"
    printf ">>> CREATE USER sharkey WITH ENCRYPTED PASSWORD '{YOUR_PASSWORD}';\n"
    printf "\nThen grant privileges:\n"
    printf ">>> GRANT ALL PRIVILEGES ON DATABASE sharkey TO sharkey;\n"
    printf ">>> ALTER DATABASE sharkey OWNER TO sharkey;\n"
    printf ">>> \q\n"
    printf "\nNow, create the schema:\n"
    printf ">>> sudo -u sharkey bash\n"
    printf ">>> cd ~/Sharkey\n"
    printf ">>> pnpm run init\n"
    printf "\nFinally, make sure that valkey is running."
    printf "Then you should be good to start Sharkey."
}

pre_upgrade() {
    systemctl stop sharkey.service
}

post_upgrade() {
    printf "The database needs to be migrated:\n"
    printf "sudo -u sharkey bash; cd ~/Sharkey\n"
    printf ">>> pnpm run migrate"
}