diff --git a/plugins/postgresql/conf/pg_hba.conf b/plugins/postgresql/conf/pg_hba.conf new file mode 100644 index 000000000..b5aee69fd --- /dev/null +++ b/plugins/postgresql/conf/pg_hba.conf @@ -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 \ No newline at end of file diff --git a/plugins/postgresql/conf/postgresql.conf b/plugins/postgresql/conf/postgresql.conf index e47d47b26..d36ddf950 100644 --- a/plugins/postgresql/conf/postgresql.conf +++ b/plugins/postgresql/conf/postgresql.conf @@ -27,4 +27,6 @@ log_destination = 'stderr' log_directory = '{$APP_PATH}/logs' log_filename = 'postgresql-%Y-%m-%d.log' log_statement = all +log_rotation_age = 7d +log_rotation_size = 100MB log_min_duration_statement = 5000 diff --git a/plugins/postgresql/index.py b/plugins/postgresql/index.py index 81861a974..c3d5593c9 100755 --- a/plugins/postgresql/index.py +++ b/plugins/postgresql/index.py @@ -188,12 +188,20 @@ def initDreplace(version=''): init_pl = conf_dir + "/init.pl" if not os.path.exists(init_pl): mw.writeFile(init_pl, 'ok') + + # postgresql.conf pg_conf = conf_dir + '/data/postgresql.conf' tpl = getPluginDir() + '/conf/postgresql.conf' content = mw.readFile(tpl) content = contentReplace(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() if not os.path.exists(logfile): mw.writeFile(logfile, '')