Skip to content

Commit a999a8f

Browse files
author
pptfz
committed
更新gitlab笔记
1 parent fbccfc7 commit a999a8f

5 files changed

Lines changed: 74 additions & 41 deletions

File tree

.DS_Store

0 Bytes
Binary file not shown.

docs/linux/devops工具/gitlab/gitlab配置文件修改/gitlab配置文件修改记录.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,24 @@
2020

2121
## gitlab修改默认80端口
2222

23-
**修改 `/var/opt/gitlab/nginx/conf/gitlab-http.conf` 文件中 `listen` **
23+
修改 `/var/opt/gitlab/nginx/conf/gitlab-http.conf` 文件中 `listen` 配置项
2424

25-
⚠️ 依次执行完命令 `gitlab-ctl restart``gitlab-ctl reconfigure` 才会有文件 `/var/opt/gitlab/nginx/conf/gitlab-http.conf`
25+
:::说明
2626

27-
```shell
27+
依次执行完命令 `gitlab-ctl restart``gitlab-ctl reconfigure` 后才会生成文件 `/var/opt/gitlab/nginx/conf/gitlab-http.conf`
28+
29+
:::
30+
31+
```nginx
2832
server {
2933
listen *:80;
3034
...
3135
```
3236

33-
⚠️ 修改完后执行 `gitlab-ctl restart`重启即可,不能执行 `gitlab-ctl reconfigure` 重载配置文件,否则会覆盖修改
37+
38+
39+
:::caution 注意
40+
41+
修改完后执行 `gitlab-ctl restart` 重启即可,不能执行 `gitlab-ctl reconfigure` 重载配置文件,否则会覆盖修改
42+
43+
:::

docs/linux/linux服务/ldap/Self Service Password.md

Lines changed: 58 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -153,48 +153,51 @@ $ldap_filter = "(&(objectClass=*)($ldap_login_attribute={login}))";
153153

154154

155155

156-
**<span style={{color: 'red'}}>⚠️官方文档docker启动命令有坑,这里稍做了一下修改</span>**
156+
#### 获取配置文件
157+
158+
创建持久化目录
157159

158160
```shell
159-
# /var/www/conf/config.inc.local.php在ssp容器中是一个空目录!!!
160-
-v /home/test/ssp.conf.php:/var/www/conf/config.inc.local.php
161+
[ -d /data/docker-volume/ssp ] || mkdir -p /data/docker-volume/ssp
161162
```
162163

163164

164165

165-
创建volume
166+
运行临时容器,拷贝配置文件
166167

167-
```
168-
docker volume create ssp
168+
```shell
169+
docker run --name ssp-temp -d docker.io/ltbproject/self-service-password:1.7.3
170+
docker cp ssp-temp:/var/www/config.inc.php.orig /data/docker-volume/ssp/config.inc.local.php
171+
docker rm -f ssp-temp
169172
```
170173

171174

172175

173-
直接启动容器
176+
#### 启动容器
174177

175178
```shell
176-
docker run \
177-
-d \
178-
--restart=always \
179-
--name self-service-password \
180-
-h self-service-password \
181-
-p 8000:80 \
182-
-v ssp:/var/www/conf/ \
183-
-it docker.io/ltbproject/self-service-password:latest
179+
docker run -d \
180+
--restart=always \
181+
--name self-service-password \
182+
-p 8000:80 \
183+
-v /data/docker-volume/ssp/config.inc.local.php:/var/www/conf/config.inc.local.php \
184+
docker.io/ltbproject/self-service-password:1.7.3
184185
```
185186

186187

187188

188-
## 配置ldap连接
189+
#### 修改配置文件
189190

190-
修改配置文件 `config.inc.php`
191+
##### 配置ldap连接
192+
193+
修改配置文件 `config.inc.local.php`
191194

192195
```php
193196
# LDAP
194-
$ldap_url = "ldap://172.30.100.17:389"; // 修改为ldap服务器地址
197+
$ldap_url = "ldap://10.0.16.17:389"; // 修改为ldap服务器地址
195198
$ldap_starttls = false;
196-
$ldap_binddn = "cn=admin,dc=qike,dc=com"; // ldap管理员账号
197-
$ldap_bindpw = '123456'; // ldap管理员密码
199+
$ldap_binddn = "cn=admin,dc=ops,dc=com"; // ldap管理员账号
200+
$ldap_bindpw = 'admin'; // ldap管理员密码
198201
// for GSSAPI authentication, comment out ldap_bind* and uncomment ldap_krb5ccname lines
199202
//$ldap_krb5ccname = "/path/to/krb5cc";
200203
$ldap_base = "dc=qike,dc=com"; // ldap搜索参数
@@ -207,6 +210,29 @@ $ldap_use_ppolicy_control = false;
207210

208211

209212

213+
##### 配置 `keyphrase`
214+
215+
[关于配置keyphrase的官方文档说明](https://self-service-password.readthedocs.io/en/latest/config_general.html#security)
216+
217+
:::tip 说明
218+
219+
默认配置是 `$keyphrase = "secret";` ,需要将值 `secret` 修改为随机字符串
220+
221+
如果未在 `$login_forbidden_chars` 中配置字符,则仅允许字母数字字符,默认的配置是
222+
223+
```php
224+
$login_forbidden_chars = "*()&|";
225+
```
226+
227+
:::
228+
229+
```shell
230+
修改为任意字符的随机字符串
231+
$keyphrase = "pfFad4rs5aGn9Q";
232+
```
233+
234+
235+
210236
修改完成后重启docker容器
211237

212238
```shell
@@ -219,19 +245,21 @@ docker restart self-service-password
219245

220246
浏览器访问 `IP:8000`
221247

222-
![iShot2021-09-20_19.29.51](https://raw.githubusercontent.com/pptfz/picgo-images/master/img/iShot2021-09-20_19.29.51.png)
248+
![iShot_2025-06-13_15.10.44](https://raw.githubusercontent.com/pptfz/picgo-images/master/img/iShot_2025-06-13_15.10.44.png)
249+
250+
223251

224252

225253

226254

227255

228256
## 配置修改密码策略
229257

230-
修改配置文件 `config.inc.php`
258+
修改配置文件 `config.inc.local.php`
231259

232260
```php
233261
# 设置密码长度
234-
$pwd_min_length = 4; # 最少位数
262+
$pwd_min_length = 2; # 最少位数
235263
$pwd_max_length = 8; # 最多位数
236264

237265
# 设置大小写、数字、特殊字符最小数量
@@ -256,9 +284,9 @@ $pwd_diff_last_min_chars = 3;
256284
$pwd_forbidden_words = array("azerty", "qwerty", "password");
257285

258286
# 总是向用户显示密码策略
259-
$pwd_show_policy = always
287+
$pwd_show_policy = "always";
260288

261-
# 配置策略是显示在表单上方还是下方
289+
# 配置策略是显示在表单上方还是下方 above是上方 below是下方
262290
$pwd_show_policy_pos = "above";
263291

264292
# 当密码被拒绝时,您可以显示目录返回的错误信息。消息内容取决于您的 LDAP 服务器软件。
@@ -272,13 +300,15 @@ $show_extended_error = true;
272300
- `always`: 策略总是显示
273301

274302
- `never`: 策略从不显示
275-
- `onerror`: 仅当密码因此被拒绝时才显示策略,并且用户正确提供了他的旧密码
303+
- `onerror`: 仅当密码因此被拒绝时才显示策略,并且用户正确提供了他的旧密码
276304

277305

278306

279307
配置完成后重启容器,刷新页面,刚才配置的密码策略就显示出来了
280308

281-
![iShot2021-09-20_20.30.08](https://raw.githubusercontent.com/pptfz/picgo-images/master/img/iShot2021-09-20_20.30.08.png)
309+
![iShot_2025-06-13_15.25.25](https://raw.githubusercontent.com/pptfz/picgo-images/master/img/iShot_2025-06-13_15.25.25.png)
310+
311+
282312

283313

284314

@@ -288,7 +318,7 @@ $show_extended_error = true;
288318

289319
**<span style={{color: 'red'}}>⚠️在self service password中使用邮箱重置密码功能的前提是邮箱必须是ldap中用户绑定的邮箱</span>**
290320

291-
修改配置文件 `config.inc.php`
321+
修改配置文件 `config.inc.local.php`
292322

293323
配置邮件
294324

docs/linux/linux服务/ldap/centos7安装openldap.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ olcRootPW: {SSHA}uUFY4EJIccmbnIZBPMiq06QK4HG9vO/a
255255
256256
:::caution 注意
257257
258-
修改ldap的相关文件不要使用命令手动编辑,在开头也会有 `# AUTO-GENERATED FILE - DO NOT EDIT!! Use ldapmodify.` 的相关提示,正确的方式是先创建 `*ldif` 文件,然后使用 `ldapmodify` 命令进行修改
258+
修改ldap的相关文件不要使用命令手动编辑,在开头也会有 `# AUTO-GENERATED FILE - DO NOT EDIT!! Use ldapmodify.` 的相关提示,正确的方式是先创建 `*.ldif` 文件,然后使用 `ldapmodify` 命令进行修改
259259

260260
:::
261261

docs/云原生/容器/docker/docker安装.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,6 @@ yum -y install docker-ce
1010

1111
systemctl start docker && systemctl enable docker
1212

13-
# 配置rainbond镜像加速地址
14-
cat > /etc/docker/daemon.json <<-'EOF'
15-
{
16-
"registry-mirrors": ["https://docker.rainbond.cc"]
17-
}
18-
EOF
19-
2013
# 配置完成后重启docker
2114
systemctl restart docker
2215
```
@@ -52,7 +45,7 @@ yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce
5245
### 1.2 安装docker最新版
5346

5447
```python
55-
yum -y install docker-ce
48+
yum -y install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
5649
```
5750

5851

0 commit comments

Comments
 (0)