Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OSUG
RESIF
resif_data_reporter
Commits
349fa7b3
Commit
349fa7b3
authored
Jul 22, 2021
by
Jonathan Schaeffer
Browse files
Connect to postgres with env variable PGPASSWORD
parent
a1aa50b4
Pipeline
#71796
passed with stage
in 33 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
config.yml.example
View file @
349fa7b3
#
# Configuration file for resif_data_reporter.py
#
logger_file: "logger.conf" # relative or absolute path for the logger configuration file
cache_ttl: 15 # Cache validity time in day
volumes: # list of directories to scan
- name: path1
path: /path/1
...
...
@@ -18,5 +15,4 @@ postgres:
host: postgres-server # Host serving postgres
port: 5432 # Postgres port
database: statistics # Database having the dataholdings table
user: statistics
password: statistics_secret
user: statistics # Password is taken from PGPASSWORD environment variable
resifdatareporter/resifdatareporter.py
View file @
349fa7b3
...
...
@@ -170,7 +170,7 @@ def cli(configfile, force_scan, dryrun, verbose, version):
if
'postgres'
in
cfg
:
logger
.
info
(
'Writing to postgres database'
)
conn
=
psycopg2
.
connect
(
dbname
=
cfg
[
'postgres'
][
'database'
],
user
=
cfg
[
'postgres'
][
'user'
],
host
=
cfg
[
'postgres'
][
'host'
],
password
=
cfg
[
'postgres'
][
'password'
],
port
=
cfg
[
'postgres'
][
'port'
])
host
=
cfg
[
'postgres'
][
'host'
],
port
=
cfg
[
'postgres'
][
'port'
])
cur
=
conn
.
cursor
()
for
stat
in
statistics
:
try
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment