Ajout : forum.cyclocoop.org .
[lhc/ateliers.git] / etc / nginx / site.d / cyclo-forum / local.sh
1 pool=cyclo_forum
2 sudo adduser php_"$pool" www-"$site"
3 sudo adduser php_"$pool" postgres-data
4 sudo adduser www-"$site"-tls www-"$site"
5 "$tool"/local/postgresql-user-create "$pool"
6 if test ! "$pool" = "$(sudo -u postgres psql -AqtX -c \
7 "SELECT datname
8 FROM pg_catalog.pg_database
9 WHERE datname = '$pool'
10 LIMIT 1;")"
11 then
12 "$tool"/local/postgresql-database-create "$pool"
13 sudo -u postgres psql "$pool" -AqtX --set ON_ERROR_STOP=1 \
14 -f /usr/share/phpbb3/dbconfig-common/data/phpbb3/install/pgsql
15 #-f /usr/share/phpbb3/install/schemas/postgres_schema.sql
16 fi
17 "$tool"/local/postgresql-schema-create "$pool"
18 sudo -u postgres psql "$pool" -AqtX --set ON_ERROR_STOP=1 <<-EOF
19 GRANT USAGE ON SCHEMA pg_catalog TO $pool;
20 GRANT SELECT ON TABLE pg_proc TO $pool;
21 GRANT SELECT ON TABLE pg_database TO $pool;
22 EOF
23
24 sudo install -m 640 -o root -g php_"$pool" \
25 "$tool"/etc/phpbb3/forum.cyclocoop.org.inc.php \
26 /etc/phpbb3/forum.cyclocoop.org.inc.php
27 sudo install -m 664 -o root -g www-data \
28 "$tool"/etc/phpbb3/database.inc.php \
29 /etc/phpbb3/database.inc.php