zl程序教程

您现在的位置是:首页 >  数据库

当前栏目

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

数据库配置postgresql 远程 访问 更改 gitlab
2023-09-14 09:00:34 时间

作为这篇文章的补充:

将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-ctl  reconfigure

  

 

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

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

 

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

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

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