Ajout : forum.cyclocoop.org .
[lhc/ateliers.git] / etc / nginx / site.d / cyclo-forum / local.sh
diff --git a/etc/nginx/site.d/cyclo-forum/local.sh b/etc/nginx/site.d/cyclo-forum/local.sh
new file mode 100644 (file)
index 0000000..198d7aa
--- /dev/null
@@ -0,0 +1,29 @@
+pool=cyclo_forum
+sudo adduser php_"$pool" www-"$site"
+sudo adduser php_"$pool" postgres-data
+sudo adduser www-"$site"-tls www-"$site"
+"$tool"/local/postgresql-user-create "$pool"
+if test ! "$pool" = "$(sudo -u postgres psql -AqtX -c \
+ "SELECT datname
+       FROM pg_catalog.pg_database
+       WHERE datname = '$pool'
+       LIMIT 1;")"
+ then
+       "$tool"/local/postgresql-database-create "$pool"
+       sudo -u postgres psql "$pool" -AqtX --set ON_ERROR_STOP=1 \
+        -f /usr/share/phpbb3/dbconfig-common/data/phpbb3/install/pgsql
+        #-f /usr/share/phpbb3/install/schemas/postgres_schema.sql
+ fi
+"$tool"/local/postgresql-schema-create "$pool"
+sudo -u postgres psql "$pool" -AqtX --set ON_ERROR_STOP=1 <<-EOF
+       GRANT USAGE ON SCHEMA pg_catalog  TO $pool;
+       GRANT SELECT ON TABLE pg_proc     TO $pool;
+       GRANT SELECT ON TABLE pg_database TO $pool;
+       EOF
+
+sudo install -m 640 -o root -g php_"$pool" \
+ "$tool"/etc/phpbb3/forum.cyclocoop.org.inc.php \
+        /etc/phpbb3/forum.cyclocoop.org.inc.php
+sudo install -m 664 -o root -g www-data \
+ "$tool"/etc/phpbb3/database.inc.php \
+        /etc/phpbb3/database.inc.php