pull/156/head
midoks 3 years ago
parent 0d09cf6ad4
commit 1bf2dc2738
  1. 10
      plugins/postgresql/conf/pg_hba.conf
  2. 2
      plugins/postgresql/conf/postgresql.conf
  3. 8
      plugins/postgresql/index.py

@ -0,0 +1,10 @@
# PostgreSQL Client Authentication Configuration File
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all trust
host all all 127.0.0.1/32 trust
host all all ::1/128 trust
local replication all trust
host replication all 127.0.0.1/32 trust
host replication all ::1/128 trust

@ -27,4 +27,6 @@ log_destination = 'stderr'
log_directory = '{$APP_PATH}/logs' log_directory = '{$APP_PATH}/logs'
log_filename = 'postgresql-%Y-%m-%d.log' log_filename = 'postgresql-%Y-%m-%d.log'
log_statement = all log_statement = all
log_rotation_age = 7d
log_rotation_size = 100MB
log_min_duration_statement = 5000 log_min_duration_statement = 5000

@ -188,12 +188,20 @@ def initDreplace(version=''):
init_pl = conf_dir + "/init.pl" init_pl = conf_dir + "/init.pl"
if not os.path.exists(init_pl): if not os.path.exists(init_pl):
mw.writeFile(init_pl, 'ok') mw.writeFile(init_pl, 'ok')
# postgresql.conf
pg_conf = conf_dir + '/data/postgresql.conf' pg_conf = conf_dir + '/data/postgresql.conf'
tpl = getPluginDir() + '/conf/postgresql.conf' tpl = getPluginDir() + '/conf/postgresql.conf'
content = mw.readFile(tpl) content = mw.readFile(tpl)
content = contentReplace(content) content = contentReplace(content)
mw.writeFile(pg_conf, content) mw.writeFile(pg_conf, content)
# pg_hba.conf
tpl = getPluginDir() + '/conf/pg_hba.conf'
pg_hba_conf = conf_dir + '/data/pg_hba.conf'
content = mw.readFile(tpl)
mw.writeFile(pg_hba_conf, content)
logfile = runLog() logfile = runLog()
if not os.path.exists(logfile): if not os.path.exists(logfile):
mw.writeFile(logfile, '') mw.writeFile(logfile, '')

Loading…
Cancel
Save