Difference between revisions of "User:Jtraulle/DiscourseMigration"

From Dolibarr ERP CRM Wiki
Jump to navigation Jump to search
(Created page with "This page gathers info about Discourse migration. <br /> == Allow PostgreSQL to be accessed from an external application == ''Useful to be able to access the databa...")
Tag: 2017 source edit
 
Tag: 2017 source edit
Line 1: Line 1:
 
This page gathers info about Discourse migration.
 
This page gathers info about Discourse migration.
  
<br />
+
==Allow PostgreSQL to be accessed from an external application==
 
 
== Allow PostgreSQL to be accessed from an external application ==
 
 
 
  
 
''Useful to be able to access the database from a graphical client (like pgAdmin 4, TablePlus or Postico for example).''
 
''Useful to be able to access the database from a graphical client (like pgAdmin 4, TablePlus or Postico for example).''
<br />
 
 
# Expose the 5432 TCP port from the container to the host by adding this line to the '''<code>expose:</code>''' section of <code>containers/app.yml</code> :
 
  
 +
1. Expose the 5432 TCP port from the container to the host by adding this line to the '''<code>expose:</code>''' section of <code>containers/app.yml</code> :
 
  - "5432:5432"
 
  - "5432:5432"
 
+
2. Rebuild the container to take into account modifications to '''<code>app.yml</code>''' :
 
+
.launcher rebuild app
 
+
3. Enter into the container, login as the default postgresql user, add a new user and grant it all perms to the database
<br />
+
./launcher enter app
 +
sudo -u postgres psql discourse
 
  CREATE USER my_username WITH PASSWORD 'my_password';
 
  CREATE USER my_username WITH PASSWORD 'my_password';
 
  GRANT ALL PRIVILEGES ON DATABASE "discourse" to my_username;
 
  GRANT ALL PRIVILEGES ON DATABASE "discourse" to my_username;
 
  GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO my_username;
 
  GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO my_username;
 +
\q

Revision as of 08:55, 1 August 2019

This page gathers info about Discourse migration.

Allow PostgreSQL to be accessed from an external application

Useful to be able to access the database from a graphical client (like pgAdmin 4, TablePlus or Postico for example).

1. Expose the 5432 TCP port from the container to the host by adding this line to the expose: section of containers/app.yml :

- "5432:5432"

2. Rebuild the container to take into account modifications to app.yml :

.launcher rebuild app

3. Enter into the container, login as the default postgresql user, add a new user and grant it all perms to the database

./launcher enter app
sudo -u postgres psql discourse
CREATE USER my_username WITH PASSWORD 'my_password';
GRANT ALL PRIVILEGES ON DATABASE "discourse" to my_username;
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO my_username;
\q