Browse Source

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 01188a82ab)
alto 2 weeks ago
parent
commit
9f4b31ae6a
3 changed files with 16 additions and 4 deletions
  1. 14
    0
      README.md
  2. 1
    0
      data/config_example.pl
  3. 1
    4
      lib/Multi/Core.pm

+ 14
- 0
README.md View File

@@ -24,6 +24,13 @@ While running, if you need another terminal into the container:
24 24
   docker exec -ti vndb su devuser -c 'psql -U vndb'   # postgres vndb shell
25 25
 ```
26 26
 
27
+To run Multi, the optional application server:
28
+
29
+```
30
+  docker exec -ti vndb su -l devuser
31
+  cd /var/www
32
+  make multi-restart
33
+```
27 34
 
28 35
 ## Development database
29 36
 
@@ -101,12 +108,19 @@ util/multi.pl (application server, optional):
101 108
 - Update the vndb_site password in data/config.pl to whatever you set it in
102 109
   the previous step.
103 110
 - (Optional) Import the "Development database" as explained above.
111
+- (Optional) Do the same for vndb_multi if Multi is needed.
104 112
 - Now simply run:
105 113
 
106 114
 ```
107 115
   util/vndb-dev-server.pl
108 116
 ```
109 117
 
118
+- (Optional) To start Multi, the application server:
119
+
120
+```
121
+  make multi-restart
122
+```
123
+
110 124
 ## License
111 125
 
112 126
 GNU AGPL, see COPYING file for details.

+ 1
- 0
data/config_example.pl View File

@@ -22,6 +22,7 @@ package VNDB;
22 22
   scrypt_salt  => '<another unique string>',
23 23
 );
24 24
 
25
+$M{db_login} = { dbname => 'vndb', user => 'vndb_multi', password => 'vndb_multi' };
25 26
 
26 27
 # Uncomment to enable certain features of Multi
27 28
 

+ 1
- 4
lib/Multi/Core.pm View File

@@ -72,11 +72,8 @@ sub daemon_done {
72 72
 
73 73
 
74 74
 sub load_pg {
75
-  my @db = @{$VNDB::O{db_login}};
76
-  my @dsn = DBI->parse_dsn($db[0]);
77
-  my %vars = split /[,=]/, $dsn[4];
78 75
   $PG = AnyEvent::Pg::Pool->new(
79
-    {%vars, user => $db[1], password => $db[2], host => 'localhost'},
76
+    $VNDB::M{db_login},
80 77
     timeout => 600, # Some maintenance queries can take a while to run...
81 78
     on_error => sub { die "Lost connection to PostgreSQL\n"; },
82 79
     on_connect_error => sub { die "Lost connection to PostgreSQL\n"; },