更改配置:远程访问gitlab的postgresql数据库

时间:2023-03-09 22:30:40
更改配置:远程访问gitlab的postgresql数据库

作为这篇文章的补充:

将gitlab中的postgresql数据库开通远程访问

https://www.cnblogs.com/andy9468/p/10609682.html

替代(二)中的2、3、4步骤。

继续修改gitlab.rb

vim /etc/gitlab/gitlab.rb

postgresql['custom_pg_hba_entries'] = {
APPLICATION:[ { # APPLICATION should identify what the settings are used for
type: "host",
database: "all",
user: "all",
cidr: "0.0.0.0/0",
method: "trust"
# option: exmple
}
]
}

  

效果如图:

更改配置:远程访问gitlab的postgresql数据库

配置生效:

gitlab-ctl  reconfigure

  

随便查看一下pg_hba.conf文件的变化(不用修改)

vim /var/opt/gitlab/postgresql/data/pg_hba.conf

更改配置:远程访问gitlab的postgresql数据库

也就是说以后就不需要修改

/var/opt/gitlab/postgresql/data/pg_hba.conf文件了。

同时也可以使用gitlab-ctl  reconfigure命令了。