textbrowser / biblioteq

Archive and catalog the world for today's and tomorrow's generations! Awesome and everyware.
https://textbrowser.github.io/biblioteq/
Other
217 stars 46 forks source link

Configuration PostgreSQL for BQ #377

Closed meteos77 closed 2 weeks ago

meteos77 commented 3 weeks ago

I'm just starting to configure PostgreSQL by following the guide. I'd need to run the command createlang plpgsql -d xbook_db ...

This seems obsolete to me, but what command should I use to replace it?

I've done the import with the command : \i postgresql_create_schema.sql

I connect to the database with the xbook_admin account and the xbook_admin password : $ psql xbook_db -U xbook_admin -> ok

Now I have a problem connecting from BQ it shows me in the log hostname mac-mini ... mac-mini

I tried to add mac-mini to my hosts file, but BQ bogs down after the connection request...

What can I do? Thanks in advance for your help.

textbrowser commented 3 weeks ago

Pasting from documentation.

Create the xbook_db database via createdb xbook_db -E UTF8 or via the PostgreSQL-recommended procedure. Please note that xbook_db is only a suggestion.

Execute createlang plpgsql -d xbook_db or the PostgreSQL-recommended procedure for adding a new programming language to the xbook_db database. Please note that createlang may be deprecated.

If desired, replace all instances of the default administrator xbook_admin in postgresql_create_schema.sql file.

Log into your PostgreSQL xbook_db database and load the postgresql_create_schema.sql file via \i postgresql_create_schema.sql. While logged in, please load the unaccent extension via CREATE EXTENSION IF NOT EXISTS unaccent. You may remove the extension via the DROP EXTENSION command.

Please remember to set a new password for the xbook_admin account.

textbrowser commented 3 weeks ago

Pasting from documentation.

The pg_hba.conf and postgresql.conf files must be modified. The location of these files varies. Please restart the database service after modifying the files.

Example pg_hba.conf:

host xbook_db all 192.168.178.0/24 md5 hostssl xbook_db all 192.168.178.0/24 scram-sha-256

Example postgresql.conf:

listen_addresses = '192.168.178.1, localhost'

textbrowser commented 3 weeks ago

I have an instance of PQ@14 alive on a Mac Mini and able to connect to it via TLS. Not necessary, but easy to do if you read the PQ documentation and configuration files. Not documented because PQ is PQ and not BQ.

textbrowser commented 3 weeks ago

In the BQ configuration file, you need to specify the address of the machine which hosts PQ. The address can be an IP or a host name.

meteos77 commented 3 weeks ago

Of course, I followed your documentation, but I have the impression that you need to be a mechanic to drive the car.

I'd do a little doc for PQ beginners because you don't seem to see the problems you're encountering, even though they are blocking and preventing you from discovering BQ-PQ easily.

-5 -> the pg_hda.conf and postgresql.conf files indicate : "# If you want to allow non-local connections, you need to add more records" => so if you only work locally, it doesn't seem necessary to modify these files?


You need to configure the /opt/biblioteq/biblioteq.conf file and replace hostname = mac-mini by hostname = localhost

meteos77 commented 3 weeks ago

Location: I connect to BiblioteQ on the PostgreSQL database with "xbook_admin" user but I don't have access to the ‘Grant privileges’ management in the key icon member manager ?

textbrowser commented 3 weeks ago

xbook_db=# select * from admin; username | roles
-------------+--------------- xbook_admin | administrator circulation | circulation librarian | librarian membership | membership (4 rows)

textbrowser commented 3 weeks ago

See, all simple.

meteos77 commented 3 weeks ago

xbook_db=# select * from admin; roles | username
---------------+------------- administrator | xbook_admin (1 row)

xbook_db=#

textbrowser commented 3 weeks ago

My button is enabled. The tool tip on said button says "Grant..." And the button is in Member's Browser. Has a key.

textbrowser commented 3 weeks ago

I'll create a local instance and see.

meteos77 commented 3 weeks ago

The documentation that I have followed so far to achieve this result

Installation_et_Configuration_de_PostgreSQL_BiblioteQ_Français.pdf

textbrowser commented 3 weeks ago

Created according to official simple document. Simple. Then connected as xbook_admin and I see Grant Privileges (PostgreSQL) as available.

Contributed documents are in a whatever category. I don't review them. If they instruct you to implode your computer, that's your fault.

meteos77 commented 3 weeks ago

This is my doc, so I find it clearer than your simple doc :-)

textbrowser commented 3 weeks ago

Also reviewed the logic. The button is available for administrator.

textbrowser commented 3 weeks ago

Send a picture.

And what about the rest? Good?

meteos77 commented 3 weeks ago

A picture of what? Importing works well I connect well with xbook_guest

textbrowser commented 3 weeks ago

"Location: I connect to BiblioteQ on the PostgreSQL database with "xbook_admin" user but I don't have access to the ‘Grant privileges’ management in the key icon member manager ?"

meteos77 commented 3 weeks ago

image

textbrowser commented 3 weeks ago

The button with the key icon is enabled. Did you click it?

meteos77 commented 3 weeks ago

The real difference with you is

xbook_db=# select * from admin; username | roles -------------+--------------- xbook_admin | administrator circulation | circulation librarian | librarian membership | membership (4 rows)

xbook_db=# select * from admin; roles | username ---------------+------------- administrator | xbook_admin (1 row)

textbrowser commented 3 weeks ago

The real difference with you is

xbook_db=# select * from admin; username | roles -------------+--------------- xbook_admin | administrator circulation | circulation librarian | librarian membership | membership (4 rows)

xbook_db=# select * from admin; roles | username ---------------+------------- administrator | xbook_admin (1 row)

I created the other administrator accounts to protect the data. They're not required. The members browser is for members, patrons. On the main window, there is a means for adding administrators on the left. There's a button there.

textbrowser commented 3 weeks ago

I find it natural to have different accounts for different purposes. So a circulation account for circulating, a membership account for members, etc. A super account is like root and root can be destructive.

meteos77 commented 3 weeks ago

I've just seen the icon to change password and create an admin. I had deactivated the “connection” bar with sqlite

barre_icone

textbrowser commented 3 weeks ago

I curios if there are other free software which have two databases. I see Ever and Koha and they are both Web-facing places so I imagine they have a single database engine.

textbrowser commented 3 weeks ago

With BQ, BQ is an interface. The data can be presented with other mediums. There was some person some years ago who made a Web interface. Is dead now. Not the person, well, maybe them too.

meteos77 commented 3 weeks ago

advancement with “connection bar” icons I've created a “circulation” user OK

xbook_db=# select * from admin; roles | username
----------------------------------+------------- administrator | xbook_admin circulation librarian membership | circulation (2 rows)

meteos77 commented 3 weeks ago

I don't know what screen to get with the key icon in the member manager?

textbrowser commented 3 weeks ago

Members. I added the key button for older accounts. 2008 maybe.

meteos77 commented 3 weeks ago

As I don't have an old account, that explains why I get nothing when I click on the button?

textbrowser commented 3 weeks ago

It doesn't produce a dialog.

meteos77 commented 3 weeks ago

Extract from the documentation: Grant Privileges Grant Privileges is available for PostgreSQL databases. If pressed, each listed account is removed from and added to the biblioteq_patron role.

I don't understand what this icon is for?

textbrowser commented 3 weeks ago

You described it by pasting its documented description.

textbrowser commented 3 weeks ago

From PostgreSQL documentation: “PostgreSQL manages database access permissions using the concept of roles. A role can be thought of as either a database user, or a group of database users, depending on how the role is set up. Roles can own database objects (for example, tables and functions) and can assign privileges on those objects to other roles to control who has access to which objects. Furthermore, it is possible to grant membership in a role to another role, thus allowing the member role to use privileges assigned to another role. The concept of roles subsumes the concepts of “users” and “groups”. In PostgreSQL versions before 8.1, users and groups were distinct kinds of entities, but now there are only roles. Any role can act as a user, a group, or both.”

textbrowser commented 2 weeks ago

Don't ask me, ask the PQ directly.

meteos77 commented 2 weeks ago

Thanks for the help and explanations.

If I get stuck, I'll think about looking at the key icon to see if it does anything. permissions

I'm going to take it easy with BQ-PQ now that it's installed.