Using PostgreSQL/PostGIS in 4.0.3 (re-send)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Using PostgreSQL/PostGIS in 4.0.3 (re-send)

Mats Elfström-3
Trying to configure this I encountered this syntax for the jdbc.properties.

jdbc.username=#{systemEnvironment['GEONETWORK_DB_USERNAME']?:'www-data'}
jdbc.password=#{systemEnvironment['GEONETWORK_DB_PASSWORD']?:'www-data'}
jdbc.database=#{systemEnvironment['GEONETWORK_DB_NAME']?:'~/gn'}
jdbc.host=#{systemEnvironment['GEONETWORK_DB_HOST']?:'localhost'}
jdbc.port=#{systemEnvironment['GEONETWORK_DB_PORT']}
jdbc.connectionProperties=#{systemEnvironment['GEONETWORK_DB_CONNECTION_PROPERTIES']}

And I am confused. shall GEONETWORK_DB_PORT be substituted with 5432 and
GEONETWORK_DB_USERNAME with the username, what is www-data?
Anyway, it seems not to work.
Please advise. The manual simply says that the file shall be updated.
I have used PostgreSQL databases before, but have no live instance at the
moment.

Regards, Mats.E

--


*GisKraft*, Geodatakonsult

Mats Elfström, Marsvinsholms stationsväg 80, 271 93 Ystad, Sweden
tel: +46 70 595 39 35 / www.giskraft.se

_______________________________________________
GeoNetwork-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork
Reply | Threaded
Open this post in threaded view
|

Re: Using PostgreSQL/PostGIS in 4.0.3 (re-send)

ianwallen
Mats,

As you are using postgres,  The values will be supplied to the following file.

https://github.com/geonetwork/core-geonetwork/blob/master/web/src/main/webResources/WEB-INF/config-db/postgres.xml

More specifically - this line

<constructor-arg value="jdbc:postgresql://${jdbc.host}:${jdbc.port:5432}/${jdbc.database}?${jdbc.connectionProperties}"/>

So if the port is not specified then it will default to 5432
The GEONETWORK_DB_USERNAME of www-data is just the default username and password that is used for H2 database.  You will have to modify these to suit your database.

The following will also need to be modified to indicate the database that you want to use.
https://github.com/geonetwork/core-geonetwork/blob/master/web/src/main/webResources/WEB-INF/config-node/srv.xml

If you know how to supply the ENV variables to your application then you could pass those without having to modify any files at all.

i.e. if the following env were available to the application then it would connect to a postgres database on localhost using port 5432 with ssl mode.

GEONETWORK_DB_TYPE=postgres
GEONETWORK_DB_HOST=localhost
GEONETWORK_DB_PORT=5432
GEONETWORK_DB_NAME=geonetwork
GEONETWORK_DB_CONNECTION_PROPERTIES=sslmode=require
GEONETWORK_DB_USERNAME=geonetwork
GEONETWORK_DB_PASSWORD=password

________________________________
From: Mats Elfström <[hidden email]>
Sent: March 26, 2021 8:36 AM
To: [hidden email] <[hidden email]>
Subject: [GeoNetwork-users] Using PostgreSQL/PostGIS in 4.0.3 (re-send)

Trying to configure this I encountered this syntax for the jdbc.properties.

jdbc.username=#{systemEnvironment['GEONETWORK_DB_USERNAME']?:'www-data'}
jdbc.password=#{systemEnvironment['GEONETWORK_DB_PASSWORD']?:'www-data'}
jdbc.database=#{systemEnvironment['GEONETWORK_DB_NAME']?:'~/gn'}
jdbc.host=#{systemEnvironment['GEONETWORK_DB_HOST']?:'localhost'}
jdbc.port=#{systemEnvironment['GEONETWORK_DB_PORT']}
jdbc.connectionProperties=#{systemEnvironment['GEONETWORK_DB_CONNECTION_PROPERTIES']}

And I am confused. shall GEONETWORK_DB_PORT be substituted with 5432 and
GEONETWORK_DB_USERNAME with the username, what is www-data?
Anyway, it seems not to work.
Please advise. The manual simply says that the file shall be updated.
I have used PostgreSQL databases before, but have no live instance at the
moment.

Regards, Mats.E

--


*GisKraft*, Geodatakonsult

Mats Elfström, Marsvinsholms stationsväg 80, 271 93 Ystad, Sweden
tel: +46 70 595 39 35 / www.giskraft.se<http://www.giskraft.se>

_______________________________________________
GeoNetwork-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork

_______________________________________________
GeoNetwork-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork
Reply | Threaded
Open this post in threaded view
|

Re: Using PostgreSQL/PostGIS in 4.0.3 (re-send)

ianwallen
Mats,

I thought you were trying to get the base geonetwork working.
which would have used the following
<!--<import resource="../config-db/postgres.xml"/>-->
In this case you would configure the jdbc options that you originally mentioned.

I'm assuming you are talking about the following line.
 <!--<import resource="../config-db/jndi-postgres-postgis.xml"/> -->
That is just an example.  I believe it is assumed that you would modify the jdni.xml for your database.
you would also need to modify your application server.
https://geonetwork-opensource.org/manuals/trunk/en/install-guide/configuring-database.html#configuring-a-database-via-jndi
There are some example here
https://github.com/geonetwork/core-geonetwork/tree/master/web/src/main/webResources/WEB-INF/config-db/jndiExamples_tomcat

If you provide the error message that you are receiving, it may help solve the issue.


________________________________
From: Mats Elfström <[hidden email]>
Sent: March 26, 2021 3:35 PM
To: Ian Allen <[hidden email]>
Subject: Re: [GeoNetwork-users] Using PostgreSQL/PostGIS in 4.0.3 (re-send)

Hi Ian!
Thanks for hints.
However, despite numerous attempts, Geonetwork 4 fails to start when directed to PostgreSQL. I have tried also JNDI, but the file jndi-postgres-postgis.xml is missing from config.db
It is the only apparent error message I get.

Regards, Mats.E

Den fre 26 mars 2021 kl 13:45 skrev Ian Allen <[hidden email]<mailto:[hidden email]>>:
Mats,

As you are using postgres,  The values will be supplied to the following file.

https://github.com/geonetwork/core-geonetwork/blob/master/web/src/main/webResources/WEB-INF/config-db/postgres.xml

More specifically - this line

<constructor-arg value="jdbc:postgresql://${jdbc.host}:${jdbc.port:5432}/${jdbc.database}?${jdbc.connectionProperties}"/>

So if the port is not specified then it will default to 5432
The GEONETWORK_DB_USERNAME of www-data is just the default username and password that is used for H2 database.  You will have to modify these to suit your database.

The following will also need to be modified to indicate the database that you want to use.
https://github.com/geonetwork/core-geonetwork/blob/master/web/src/main/webResources/WEB-INF/config-node/srv.xml

If you know how to supply the ENV variables to your application then you could pass those without having to modify any files at all.

i.e. if the following env were available to the application then it would connect to a postgres database on localhost using port 5432 with ssl mode.

GEONETWORK_DB_TYPE=postgres
GEONETWORK_DB_HOST=localhost
GEONETWORK_DB_PORT=5432
GEONETWORK_DB_NAME=geonetwork
GEONETWORK_DB_CONNECTION_PROPERTIES=sslmode=require
GEONETWORK_DB_USERNAME=geonetwork
GEONETWORK_DB_PASSWORD=password

________________________________
From: Mats Elfström <[hidden email]<mailto:[hidden email]>>
Sent: March 26, 2021 8:36 AM
To: [hidden email]<mailto:[hidden email]> <[hidden email]<mailto:[hidden email]>>
Subject: [GeoNetwork-users] Using PostgreSQL/PostGIS in 4.0.3 (re-send)

Trying to configure this I encountered this syntax for the jdbc.properties.

jdbc.username=#{systemEnvironment['GEONETWORK_DB_USERNAME']?:'www-data'}
jdbc.password=#{systemEnvironment['GEONETWORK_DB_PASSWORD']?:'www-data'}
jdbc.database=#{systemEnvironment['GEONETWORK_DB_NAME']?:'~/gn'}
jdbc.host=#{systemEnvironment['GEONETWORK_DB_HOST']?:'localhost'}
jdbc.port=#{systemEnvironment['GEONETWORK_DB_PORT']}
jdbc.connectionProperties=#{systemEnvironment['GEONETWORK_DB_CONNECTION_PROPERTIES']}

And I am confused. shall GEONETWORK_DB_PORT be substituted with 5432 and
GEONETWORK_DB_USERNAME with the username, what is www-data?
Anyway, it seems not to work.
Please advise. The manual simply says that the file shall be updated.
I have used PostgreSQL databases before, but have no live instance at the
moment.

Regards, Mats.E

--


*GisKraft*, Geodatakonsult

Mats Elfström, Marsvinsholms stationsväg 80, 271 93 Ystad, Sweden
tel: +46 70 595 39 35 / www.giskraft.se<http://www.giskraft.se>

_______________________________________________
GeoNetwork-users mailing list
[hidden email]<mailto:[hidden email]>
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork


--

[https://drive.google.com/uc?id=1sRHl_CnQrtHqnEvCnblOPhzklqxxeH5J&export=download]

GisKraft, Geodatakonsult

Mats Elfström, Marsvinsholms stationsväg 80, 271 93 Ystad, Sweden
tel: +46 70 595 39 35 / www.giskraft.se<http://www.giskraft.se>

_______________________________________________
GeoNetwork-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork
Reply | Threaded
Open this post in threaded view
|

Re: Using PostgreSQL/PostGIS in 4.0.3 (re-send)

ianwallen
I was suggesting that you make a copy of jndi.xml to jndi-postgres-postgis.xml and update the file to meet your postgres requirements.

Alternatively, point to jndi.xml instead of jndi-postgres-postgis.xml.  But you will still need to update the jndi.xml to meet your postgres requirements. There is a sample for postgres in the jndi.xml file
https://github.com/geonetwork/core-geonetwork/blob/master/web/src/main/webResources/WEB-INF/config-db/jndi.xml

I have created a PR to update the sample to point to jndi.xml so that this may help avoid future confusion.
https://github.com/geonetwork/core-geonetwork/pull/5543


________________________________
From: Mats Elfström <[hidden email]>
Sent: March 27, 2021 9:58 AM
To: Ian Allen <[hidden email]>
Subject: Re: [GeoNetwork-users] Using PostgreSQL/PostGIS in 4.0.3 (re-send)

Hi Ian!
I have followed those instructions to the best of my ability.
The error message is very clear:
Caused by: java.io.FileNotFoundException: C:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps\GeoNetwork-4.0.3-0\WEB-INF\config-node\..\config-db\jndi-postgres-postgis.xml (The system cannot find the file specified)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
at java.io.FileInputStream.<init>(FileInputStream.java:93)
at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188)
at org.springframework.core.io.UrlResource.getInputStream(UrlResource.java:173)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:333)
... 60 more

As all the other db dialects are represented in the config-db folder, it is fair to assume that there would be a jndi-postgres-postgis.xml as well. Indeed, the instructions for srv.xml are simply "Choose the database type to use." (by uncommenting - commenting the appropriate strings)
I also created a localhost xml file from the JNDI example, named and placed at C:\Program Files\Apache Software Foundation\Tomcat 9.0\conf\Catalina\localhost as instructed.
However, I am pretty sure that the missing file in config-db is the key to the solution.

Regards, Mats.E

Den lör 27 mars 2021 kl 13:07 skrev Ian Allen <[hidden email]<mailto:[hidden email]>>:
Mats,

I thought you were trying to get the base geonetwork working.
which would have used the following
<!--<import resource="../config-db/postgres.xml"/>-->
In this case you would configure the jdbc options that you originally mentioned.

I'm assuming you are talking about the following line.
 <!--<import resource="../config-db/jndi-postgres-postgis.xml"/> -->
That is just an example.  I believe it is assumed that you would modify the jdni.xml for your database.
you would also need to modify your application server.
https://geonetwork-opensource.org/manuals/trunk/en/install-guide/configuring-database.html#configuring-a-database-via-jndi
There are some example here
https://github.com/geonetwork/core-geonetwork/tree/master/web/src/main/webResources/WEB-INF/config-db/jndiExamples_tomcat

If you provide the error message that you are receiving, it may help solve the issue.


________________________________
From: Mats Elfström <[hidden email]<mailto:[hidden email]>>
Sent: March 26, 2021 3:35 PM
To: Ian Allen <[hidden email]<mailto:[hidden email]>>
Subject: Re: [GeoNetwork-users] Using PostgreSQL/PostGIS in 4.0.3 (re-send)

Hi Ian!
Thanks for hints.
However, despite numerous attempts, Geonetwork 4 fails to start when directed to PostgreSQL. I have tried also JNDI, but the file jndi-postgres-postgis.xml is missing from config.db
It is the only apparent error message I get.

Regards, Mats.E

Den fre 26 mars 2021 kl 13:45 skrev Ian Allen <[hidden email]<mailto:[hidden email]>>:
Mats,

As you are using postgres,  The values will be supplied to the following file.

https://github.com/geonetwork/core-geonetwork/blob/master/web/src/main/webResources/WEB-INF/config-db/postgres.xml

More specifically - this line

<constructor-arg value="jdbc:postgresql://${jdbc.host}:${jdbc.port:5432}/${jdbc.database}?${jdbc.connectionProperties}"/>

So if the port is not specified then it will default to 5432
The GEONETWORK_DB_USERNAME of www-data is just the default username and password that is used for H2 database.  You will have to modify these to suit your database.

The following will also need to be modified to indicate the database that you want to use.
https://github.com/geonetwork/core-geonetwork/blob/master/web/src/main/webResources/WEB-INF/config-node/srv.xml

If you know how to supply the ENV variables to your application then you could pass those without having to modify any files at all.

i.e. if the following env were available to the application then it would connect to a postgres database on localhost using port 5432 with ssl mode.

GEONETWORK_DB_TYPE=postgres
GEONETWORK_DB_HOST=localhost
GEONETWORK_DB_PORT=5432
GEONETWORK_DB_NAME=geonetwork
GEONETWORK_DB_CONNECTION_PROPERTIES=sslmode=require
GEONETWORK_DB_USERNAME=geonetwork
GEONETWORK_DB_PASSWORD=password

________________________________
From: Mats Elfström <[hidden email]<mailto:[hidden email]>>
Sent: March 26, 2021 8:36 AM
To: [hidden email]<mailto:[hidden email]> <[hidden email]<mailto:[hidden email]>>
Subject: [GeoNetwork-users] Using PostgreSQL/PostGIS in 4.0.3 (re-send)

Trying to configure this I encountered this syntax for the jdbc.properties.

jdbc.username=#{systemEnvironment['GEONETWORK_DB_USERNAME']?:'www-data'}
jdbc.password=#{systemEnvironment['GEONETWORK_DB_PASSWORD']?:'www-data'}
jdbc.database=#{systemEnvironment['GEONETWORK_DB_NAME']?:'~/gn'}
jdbc.host=#{systemEnvironment['GEONETWORK_DB_HOST']?:'localhost'}
jdbc.port=#{systemEnvironment['GEONETWORK_DB_PORT']}
jdbc.connectionProperties=#{systemEnvironment['GEONETWORK_DB_CONNECTION_PROPERTIES']}

And I am confused. shall GEONETWORK_DB_PORT be substituted with 5432 and
GEONETWORK_DB_USERNAME with the username, what is www-data?
Anyway, it seems not to work.
Please advise. The manual simply says that the file shall be updated.
I have used PostgreSQL databases before, but have no live instance at the
moment.

Regards, Mats.E

--


*GisKraft*, Geodatakonsult

Mats Elfström, Marsvinsholms stationsväg 80, 271 93 Ystad, Sweden
tel: +46 70 595 39 35 / www.giskraft.se<http://www.giskraft.se>

_______________________________________________
GeoNetwork-users mailing list
[hidden email]<mailto:[hidden email]>
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork


--

[https://drive.google.com/uc?id=1sRHl_CnQrtHqnEvCnblOPhzklqxxeH5J&export=download]

GisKraft, Geodatakonsult

Mats Elfström, Marsvinsholms stationsväg 80, 271 93 Ystad, Sweden
tel: +46 70 595 39 35 / www.giskraft.se<http://www.giskraft.se>


--

[https://drive.google.com/uc?id=1sRHl_CnQrtHqnEvCnblOPhzklqxxeH5J&export=download]

GisKraft, Geodatakonsult

Mats Elfström, Marsvinsholms stationsväg 80, 271 93 Ystad, Sweden
tel: +46 70 595 39 35 / www.giskraft.se<http://www.giskraft.se>

_______________________________________________
GeoNetwork-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork
Reply | Threaded
Open this post in threaded view
|

Re: Using PostgreSQL/PostGIS in 4.0.3 (re-send)

Jose Garcia
Hi Mats

I usually hardcode the values in my local checkout in
https://github.com/geonetwork/core-geonetwork/blob/c6e2fa3b916923f6a97ca3edc718c90c63580178/pom.xml#L1465-L1472,
instead of using environmental variables, changing the database name,
credentials, etc.

<db.type>${geonetwork.db.type:postgres}</db.type>
<!-- Instead of using db_type a specific config file can be specified -->
<db.config.file>../config-db/${db.type}.xml</db.config.file>
<db.host>#{systemEnvironment['GEONETWORK_DB_HOST']?:'localhost'}</db.host>
<db.port>#{systemEnvironment['GEONETWORK_DB_PORT']}?:5432</db.port>
<db.name>#{systemEnvironment['GEONETWORK_DB_NAME']?:'gn'}</db.name>
<db.username>#{systemEnvironment['GEONETWORK_DB_USERNAME']?:'www-data'}
</db.username>
<db.password>#{systemEnvironment['GEONETWORK_DB_PASSWORD']?:'www-data'}
</db.password>

Regards,
Jose García


On Sat, Mar 27, 2021 at 4:16 PM Ian Allen <[hidden email]> wrote:

> I was suggesting that you make a copy of jndi.xml to
> jndi-postgres-postgis.xml and update the file to meet your postgres
> requirements.
>
> Alternatively, point to jndi.xml instead of jndi-postgres-postgis.xml.
> But you will still need to update the jndi.xml to meet your postgres
> requirements. There is a sample for postgres in the jndi.xml file
>
> https://github.com/geonetwork/core-geonetwork/blob/master/web/src/main/webResources/WEB-INF/config-db/jndi.xml
>
> I have created a PR to update the sample to point to jndi.xml so that this
> may help avoid future confusion.
> https://github.com/geonetwork/core-geonetwork/pull/5543
>
>
> ________________________________
> From: Mats Elfström <[hidden email]>
> Sent: March 27, 2021 9:58 AM
> To: Ian Allen <[hidden email]>
> Subject: Re: [GeoNetwork-users] Using PostgreSQL/PostGIS in 4.0.3 (re-send)
>
> Hi Ian!
> I have followed those instructions to the best of my ability.
> The error message is very clear:
> Caused by: java.io.FileNotFoundException: C:\Program Files\Apache Software
> Foundation\Tomcat
> 9.0\webapps\GeoNetwork-4.0.3-0\WEB-INF\config-node\..\config-db\jndi-postgres-postgis.xml
> (The system cannot find the file specified)
> at java.io.FileInputStream.open0(Native Method)
> at java.io.FileInputStream.open(FileInputStream.java:195)
> at java.io.FileInputStream.<init>(FileInputStream.java:138)
> at java.io.FileInputStream.<init>(FileInputStream.java:93)
> at
> sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)
> at
> sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188)
> at org.springframework.core.io
> .UrlResource.getInputStream(UrlResource.java:173)
> at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:333)
> ... 60 more
>
> As all the other db dialects are represented in the config-db folder, it
> is fair to assume that there would be a jndi-postgres-postgis.xml as well.
> Indeed, the instructions for srv.xml are simply "Choose the database type
> to use." (by uncommenting - commenting the appropriate strings)
> I also created a localhost xml file from the JNDI example, named and
> placed at C:\Program Files\Apache Software Foundation\Tomcat
> 9.0\conf\Catalina\localhost as instructed.
> However, I am pretty sure that the missing file in config-db is the key to
> the solution.
>
> Regards, Mats.E
>
> Den lör 27 mars 2021 kl 13:07 skrev Ian Allen <[hidden email]
> <mailto:[hidden email]>>:
> Mats,
>
> I thought you were trying to get the base geonetwork working.
> which would have used the following
> <!--<import resource="../config-db/postgres.xml"/>-->
> In this case you would configure the jdbc options that you originally
> mentioned.
>
> I'm assuming you are talking about the following line.
>  <!--<import resource="../config-db/jndi-postgres-postgis.xml"/> -->
> That is just an example.  I believe it is assumed that you would modify
> the jdni.xml for your database.
> you would also need to modify your application server.
>
> https://geonetwork-opensource.org/manuals/trunk/en/install-guide/configuring-database.html#configuring-a-database-via-jndi
> There are some example here
>
> https://github.com/geonetwork/core-geonetwork/tree/master/web/src/main/webResources/WEB-INF/config-db/jndiExamples_tomcat
>
> If you provide the error message that you are receiving, it may help solve
> the issue.
>
>
> ________________________________
> From: Mats Elfström <[hidden email]<mailto:
> [hidden email]>>
> Sent: March 26, 2021 3:35 PM
> To: Ian Allen <[hidden email]<mailto:[hidden email]>>
> Subject: Re: [GeoNetwork-users] Using PostgreSQL/PostGIS in 4.0.3 (re-send)
>
> Hi Ian!
> Thanks for hints.
> However, despite numerous attempts, Geonetwork 4 fails to start when
> directed to PostgreSQL. I have tried also JNDI, but the file
> jndi-postgres-postgis.xml is missing from config.db
> It is the only apparent error message I get.
>
> Regards, Mats.E
>
> Den fre 26 mars 2021 kl 13:45 skrev Ian Allen <[hidden email]
> <mailto:[hidden email]>>:
> Mats,
>
> As you are using postgres,  The values will be supplied to the following
> file.
>
>
> https://github.com/geonetwork/core-geonetwork/blob/master/web/src/main/webResources/WEB-INF/config-db/postgres.xml
>
> More specifically - this line
>
> <constructor-arg
> value="jdbc:postgresql://${jdbc.host}:${jdbc.port:5432}/${jdbc.database}?${jdbc.connectionProperties}"/>
>
> So if the port is not specified then it will default to 5432
> The GEONETWORK_DB_USERNAME of www-data is just the default username and
> password that is used for H2 database.  You will have to modify these to
> suit your database.
>
> The following will also need to be modified to indicate the database that
> you want to use.
>
> https://github.com/geonetwork/core-geonetwork/blob/master/web/src/main/webResources/WEB-INF/config-node/srv.xml
>
> If you know how to supply the ENV variables to your application then you
> could pass those without having to modify any files at all.
>
> i.e. if the following env were available to the application then it would
> connect to a postgres database on localhost using port 5432 with ssl mode.
>
> GEONETWORK_DB_TYPE=postgres
> GEONETWORK_DB_HOST=localhost
> GEONETWORK_DB_PORT=5432
> GEONETWORK_DB_NAME=geonetwork
> GEONETWORK_DB_CONNECTION_PROPERTIES=sslmode=require
> GEONETWORK_DB_USERNAME=geonetwork
> GEONETWORK_DB_PASSWORD=password
>
> ________________________________
> From: Mats Elfström <[hidden email]<mailto:
> [hidden email]>>
> Sent: March 26, 2021 8:36 AM
> To: [hidden email]<mailto:
> [hidden email]> <
> [hidden email]<mailto:
> [hidden email]>>
> Subject: [GeoNetwork-users] Using PostgreSQL/PostGIS in 4.0.3 (re-send)
>
> Trying to configure this I encountered this syntax for the jdbc.properties.
>
> jdbc.username=#{systemEnvironment['GEONETWORK_DB_USERNAME']?:'www-data'}
> jdbc.password=#{systemEnvironment['GEONETWORK_DB_PASSWORD']?:'www-data'}
> jdbc.database=#{systemEnvironment['GEONETWORK_DB_NAME']?:'~/gn'}
> jdbc.host=#{systemEnvironment['GEONETWORK_DB_HOST']?:'localhost'}
> jdbc.port=#{systemEnvironment['GEONETWORK_DB_PORT']}
>
> jdbc.connectionProperties=#{systemEnvironment['GEONETWORK_DB_CONNECTION_PROPERTIES']}
>
> And I am confused. shall GEONETWORK_DB_PORT be substituted with 5432 and
> GEONETWORK_DB_USERNAME with the username, what is www-data?
> Anyway, it seems not to work.
> Please advise. The manual simply says that the file shall be updated.
> I have used PostgreSQL databases before, but have no live instance at the
> moment.
>
> Regards, Mats.E
>
> --
>
>
> *GisKraft*, Geodatakonsult
>
> Mats Elfström, Marsvinsholms stationsväg 80, 271 93 Ystad, Sweden
> tel: +46 70 595 39 35 / www.giskraft.se<http://www.giskraft.se>
>
> _______________________________________________
> GeoNetwork-users mailing list
> [hidden email]<mailto:
> [hidden email]>
> https://lists.sourceforge.net/lists/listinfo/geonetwork-users
> GeoNetwork OpenSource is maintained at
> http://sourceforge.net/projects/geonetwork
>
>
> --
>
> [
> https://drive.google.com/uc?id=1sRHl_CnQrtHqnEvCnblOPhzklqxxeH5J&export=download
> ]
>
> GisKraft, Geodatakonsult
>
> Mats Elfström, Marsvinsholms stationsväg 80, 271 93 Ystad, Sweden
> tel: +46 70 595 39 35 / www.giskraft.se<http://www.giskraft.se>
>
>
> --
>
> [
> https://drive.google.com/uc?id=1sRHl_CnQrtHqnEvCnblOPhzklqxxeH5J&export=download
> ]
>
> GisKraft, Geodatakonsult
>
> Mats Elfström, Marsvinsholms stationsväg 80, 271 93 Ystad, Sweden
> tel: +46 70 595 39 35 / www.giskraft.se<http://www.giskraft.se>
>
> _______________________________________________
> GeoNetwork-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/geonetwork-users
> GeoNetwork OpenSource is maintained at
> http://sourceforge.net/projects/geonetwork
>


--











*Vriendelijke groeten / Kind regards,Jose García
<http://www.geocat.net/>Veenderweg 136721 WD BennekomThe NetherlandsT: +31
(0)318 416664 <+31318416664>Please consider the environment before printing
this email.*

_______________________________________________
GeoNetwork-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork