aboutsummaryrefslogtreecommitdiffstats
path: root/modules/phpbb/files
diff options
context:
space:
mode:
Diffstat (limited to 'modules/phpbb/files')
-rw-r--r--modules/phpbb/files/phpbb_apply_config.pl28
-rw-r--r--modules/phpbb/files/robots.txt7
2 files changed, 35 insertions, 0 deletions
diff --git a/modules/phpbb/files/phpbb_apply_config.pl b/modules/phpbb/files/phpbb_apply_config.pl
new file mode 100644
index 00000000..a58df24e
--- /dev/null
+++ b/modules/phpbb/files/phpbb_apply_config.pl
@@ -0,0 +1,28 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+use Env qw(VALUE);
+use DBI;
+
+my $key = $ARGV[0];
+
+# DBI will use default value coming from env
+# see puppet manifests
+my $dbh = DBI->connect("dbi:Pg:","","", {
+ AutoCommit => 0,
+ RaiseError => 1,
+});
+
+my $table = "phpbb_config";
+
+# FIXME add rollback if there is a problem
+# https://docstore.mik.ua/orelly/linux/dbi/ch06_03.htm
+my $update = $dbh->prepare("UPDATE $table SET config_value = ?, is_dynamic = ? WHERE config_name = ?");
+my $insert = $dbh->prepare("INSERT INTO $table ( config_value, is_dynamic, config_name ) VALUES ( ? , ? , ? )");
+
+my $res = $update->execute($VALUE, 1, $key) or die "cannot do update $?";
+if ($res == 0 ) {
+ $insert->execute($VALUE, 1, $key) or die "cannot do insert $?";
+}
+$dbh->commit();
+$dbh->disconnect();
diff --git a/modules/phpbb/files/robots.txt b/modules/phpbb/files/robots.txt
new file mode 100644
index 00000000..1c335a73
--- /dev/null
+++ b/modules/phpbb/files/robots.txt
@@ -0,0 +1,7 @@
+User-agent: *
+Disallow: /*/faq.php?
+Disallow: /*/memberlist.php?
+Disallow: /*/posting.php?
+Disallow: /*/search.php?
+Disallow: /*/ucp.php?
+Crawl-delay: 30