惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

MyScale Blog
MyScale Blog
Apple Machine Learning Research
Apple Machine Learning Research
H
Help Net Security
雷峰网
雷峰网
V
Visual Studio Blog
G
Google Developers Blog
Microsoft Azure Blog
Microsoft Azure Blog
Hugging Face - Blog
Hugging Face - Blog
爱范儿
爱范儿
IT之家
IT之家
Engineering at Meta
Engineering at Meta
Microsoft Security Blog
Microsoft Security Blog
aimingoo的专栏
aimingoo的专栏
大猫的无限游戏
大猫的无限游戏
M
MIT News - Artificial intelligence
月光博客
月光博客
A
About on SuperTechFans
B
Blog RSS Feed
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The GitHub Blog
The GitHub Blog
N
Netflix TechBlog - Medium
J
Java Code Geeks
云风的 BLOG
云风的 BLOG
Blog — PlanetScale
Blog — PlanetScale

博客 on 打工人日志

k8s RKE2 cilium L2 + envoy gateway 安装配置 k8s RKE2 vSphere 存储配置 OpenClaw 全能指南:从安装到进阶自动化实战 (2026 最终版) Kubernetes — skywalking + banyanDB APM监控部署 Kubernetes — promtail + loki + grafana 日志系统部署 k8s master 节点 Unauthorized Kubernetes — metalLB + Traefik 部署 Kubernetes — SSL 证书自动更新 Kubernetes — RKE2 + kube-vip + cilium 部署 使用TLSv1.3 升级nginx和openssl Proxmox VE(PVE) 更新到最新版本 kindle 邮件发送失败,错误代码E999 metallb + ingress-nginx + argocd 本地部署 iStoreOS(旁路由)使用openclash实现dns劫持 异常流量分析:图片库服务黑客入侵 openwrt 硬盘扩容 搭建ip地址检索服务 Kubernetes — k8s 手动安装 1.17.9 SELinux 问题:导致端口无法创建,无法访问 【福利】免费!本地部署!去除视频中移动的物体 通知:《打工人日报》迁移到独立板块 KyBook 3 | calibre-web - IOS系统最佳图书伴侣 Tmux 安装和使用教程 DockerHub 加速镜像部署 - 使用cloudflare 代理 docker的零停机部署 SD-webui 批量处理图片 ubuntu 安装 ComfyUI ubuntu 安装 stable-diffusion-webui 测试策略:微服务架构 单元测试:测试单元质量提升
Gitlab批量导出用户
2022-01-14 · via 博客 on 打工人日志

Gitlab 批量导出用户

登陆 Gitlab 服务器进行数据库登陆、数据查询及信息导出操作。

操作步骤

  1. 根据配置文件,定位数据库相关信息
1cat /var/opt/gitlab/gitlab-rails/etc/database.yml

exportuser1

  1. 查看 Gitlab 对应的系统用户
1cat /etc/passwd | grep gitlab

exportuser2

  1. 切换用户 gitlab-psql
  1. 登陆数据库(-h 指定 host,-d 指定数据库) 使用第 1 步获取的信息
1psql -h /var/opt/gitlab/postgresql -d gitlabhq_production

(1) 查看帮助信息

1gitlabhq_production=# \h

(2) 查看数据库

1gitlabhq_production=# \l

(3) 查看库中的表(执行命令后,按回车键显示更多表信息)

1gitlabhq_production=# \dt

(4) 通过筛查,可在库中找到 users 表,相关用户信息都记录在表中!

1gitlabhq_production=# \d users

(5) 查看表信息

1gitlabhq_production=# SELECT * FROM users;

(6) 查看 users 表中的 name 字段

1gitlabhq_production=# SELECT name FROM users;

(7)登出数据库

1gitlabhq_production=# \q
  1. 根据需要提取的信息,确定表 users 中的字段,进行导出操作
1echo 'select name,username,email,state from users;' |psql -h /var/opt/gitlab/postgresql -d gitlabhq_production > userinfo.txt

存储在/var/opt/gitlab/postgresql/userinfo.txt