summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralto <alto@vndb.org>2018-11-02 18:40:01 +0000
committerYorhel <git@yorhel.nl>2018-11-02 20:09:06 +0100
commit9f4b31ae6aa3f33856978b09481b97c5b13f4359 (patch)
treee0733b31a8fa8ca153f10aed44c19752768de3a5
parent08a13ed84b13d3d5e9f90cceac4aa37fb484c373 (diff)
Change Multi to use separate setting for db_login and to use UNIX socket for Postgres
Update README with basic information on Multi (cherry picked from commit 01188a82ab736a8975c73ac5ec12621426bf6bf2)
-rw-r--r--README.md14
-rw-r--r--data/config_example.pl1
-rw-r--r--lib/Multi/Core.pm5
3 files changed, 16 insertions, 4 deletions
diff --git a/README.md b/README.md
index 3ae842cd..9c8c7268 100644
--- a/README.md
+++ b/README.md
@@ -24,6 +24,13 @@ While running, if you need another terminal into the container:
docker exec -ti vndb su devuser -c 'psql -U vndb' # postgres vndb shell
```
+To run Multi, the optional application server:
+
+```
+ docker exec -ti vndb su -l devuser
+ cd /var/www
+ make multi-restart
+```
## Development database
@@ -101,12 +108,19 @@ util/multi.pl (application server, optional):
- Update the vndb_site password in data/config.pl to whatever you set it in
the previous step.
- (Optional) Import the "Development database" as explained above.
+- (Optional) Do the same for vndb_multi if Multi is needed.
- Now simply run:
```
util/vndb-dev-server.pl
```
+- (Optional) To start Multi, the application server:
+
+```
+ make multi-restart
+```
+
## License
GNU AGPL, see COPYING file for details.
diff --git a/data/config_example.pl b/data/config_example.pl
index aab37d10..4d7d04fc 100644
--- a/data/config_example.pl
+++ b/data/config_example.pl
@@ -22,6 +22,7 @@ package VNDB;
scrypt_salt => '<another unique string>',
);
+$M{db_login} = { dbname => 'vndb', user => 'vndb_multi', password => 'vndb_multi' };
# Uncomment to enable certain features of Multi
diff --git a/lib/Multi/Core.pm b/lib/Multi/Core.pm
index 82b3a9c6..3656f5b7 100644
--- a/lib/Multi/Core.pm
+++ b/lib/Multi/Core.pm
@@ -72,11 +72,8 @@ sub daemon_done {
sub load_pg {
- my @db = @{$VNDB::O{db_login}};
- my @dsn = DBI->parse_dsn($db[0]);
- my %vars = split /[,=]/, $dsn[4];
$PG = AnyEvent::Pg::Pool->new(
- {%vars, user => $db[1], password => $db[2], host => 'localhost'},
+ $VNDB::M{db_login},
timeout => 600, # Some maintenance queries can take a while to run...
on_error => sub { die "Lost connection to PostgreSQL\n"; },
on_connect_error => sub { die "Lost connection to PostgreSQL\n"; },