summarylogtreecommitdiffstats
path: root/pagure.install
blob: 2a9e2abd74e6e63fdad047790141b757244c0c07 (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
28
29
30
31
32
33
34
35
36
37
38
39
post_install() {
	cat <<- EOF
		Either MariaDB or PostgreSQL must be configured and running.
		To setup using PostreSQL, use:
		
		\$ sudo -u postgres psql
		CREATE DATABASE pagure;
		CREATE USER pagure;
		ALTER USER pagure WITH ENCRYPTED PASSWORD '--PagureDBUserPW--';
		GRANT ALL PRIVILEGES ON DATABASE pagure to pagure;
		GRANT ALL PRIVILEGES ON ALL tables IN SCHEMA public TO pagure;
		GRANT ALL PRIVILEGES ON ALL sequences IN SCHEMA public TO pagure;
		\\q
		
		Te setup using MariaDB use:
		
		\$ sudo mysql -u root -p
		mysql> create database pagure;
		mysql> grant all privileges on pagure.* to pagure identified by '--PagureDBUserPW--';
		mysql> flush privileges;
		mysql> exit
		
		Configure Pagure is /etc/pagure/pagure.cfg and /etc/pagure/alembic.ini
		
		Once configured with the correct backend, populate the database:
		
		python /usr/share/pagure/pagure_createdb.py -c /etc/pagure/pagure.cfg -i /etc/pagure/alembic.ini
	EOF
}

post_upgrade() {
	cat <<- EOF
		Update Pagure database format using:
		
		\$ python /usr/share/pagure/pagure_createdb.py -c /etc/pagure/pagure.cfg
	EOF
}

# vim : ts=4 sw=4 noet