手贱把服务器玩炸了

服务器玩炸了

知道为什么,重启之后就炸了。数据也都有备份。重新部署也不算办法。索性记录一下。

内存运行现有的程序有点不足了。也扩容了一下。

使用nginx-proxy-manager,其他的都容易。

要注意的是,在群晖中使用,DB_MYSQL_HOST要设置为bridge后的地址,否则找不到数据库。

mail-server 的更新

mail-server文档

比之前的更加完善了,文档写个的更摆烂了。

创建时,需要mailserver.env从官方下载就行。

docker挂着去来了后,先创建用户,后创建DKIM。之后对域名进行对应设置。

创建用户

创建用户的命令,[email protected]password改自己就就行。

1
docker exec -ti mailserver setup email add [email protected] password

更新密码

1
docker exec -ti mailserver setup email update [email protected] New_Password

创建dkim

之后是创建dkim主用是验证邮件是从你域名发出的,免得被标记为垃圾邮件。

有其他的选项可用运行docker exec -ti mailserver setup help自己看看就行

1
docker exec -ti mailserver setup config dkim

开启FAIL2BAN

主要作用是BAN掉登录密码过多的IP

docker-compose.yml中添加

1
2
3
4
5
6
volumes:
$PWD/docker-data/dms/config/:/tmp/docker-mailserver/
environment:
- ENABLE_FAIL2BAN=1
cap_add:
- NET_ADMIN

和我一样被BAN掉接触方法

1
docker exec -ti mailserver setup fail2ban unban 00.00.00.00

显示BAN掉的IP

1
docker exec -ti mailserver setup fail2ban

以上

MailWebUI

总是添加邮箱地址有点烦了,找了一个WebUI对接有点小坑

登录是ssl链接失败报错

因为走的是docker内部网络,设置中ROUNDCUBEMAIL_DEFAULT_HOSTROUNDCUBEMAIL_SMTP_SERVER要写为mailserver的容器名

还要关闭WebUI的ssl的验证

添加设置文件customcfg.inc.phpdata/config/config.inc.php

并在config.inc.php中引入,设置完成后可以使用之前的用户名与密码登录

1
include(__DIR__ . '/customcfg.inc.php');

customcfg.inc.php文件如下

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?php
$config['imap_conn_options'] = [
'ssl' => [
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true,
],
];

$config['smtp_conn_options'] = [
'ssl' => [
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true,
],
];

docker-compose.yml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
version: '3'

services:
roundcube:
image: roundcube/roundcubemail:latest
container_name: roundcube
restart: unless-stopped
volumes:
- ./data:/var/www/html
- ./db/sqlite:/var/roundcube/db
- ./config:/var/roundcube/config
# ports:
# - "80"
# expose:
# - "80"
environment:
- ROUNDCUBEMAIL_DB_TYPE=sqlite
- ROUNDCUBEMAIL_SKIN=elastic
- ROUNDCUBEMAIL_DEFAULT_HOST=ssl://mailserver
- ROUNDCUBEMAIL_DEFAULT_PORT=993
- ROUNDCUBEMAIL_SMTP_SERVER=ssl://mailserver
- ROUNDCUBEMAIL_SMTP_PORT=465
- ROUNDCUBEMAIL_UPLOAD_MAX_FILESIZE=20M

networks:
default:
external:
name: nginx-proxy-manager-network

一些设置

VS Code

Nerd Font

Nerd Font

1
2
brew tap homebrew/cask-fonts
brew install font-hack-nerd-font

设置终端颜色

起因是使用了,亮色背景后,终端背景也变亮色的了

搭配网站

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{
"terminal.integrated.fontFamily":"Hack Nerd Font",
"workbench.colorCustomizations": {
"terminal.background":"#000000",
"terminal.foreground":"#B5B3AA",
"terminalCursor.background":"#B5B3AA",
"terminalCursor.foreground":"#B5B3AA",
"terminal.ansiBlack":"#000000",
"terminal.ansiBlue":"#96CBFE",
"terminal.ansiBrightBlack":"#6C6C66",
"terminal.ansiBrightBlue":"#96CBFE",
"terminal.ansiBrightCyan":"#C6C5FE",
"terminal.ansiBrightGreen":"#A8FF60",
"terminal.ansiBrightMagenta":"#FF73FD",
"terminal.ansiBrightRed":"#FF6C60",
"terminal.ansiBrightWhite":"#FDFBEE",
"terminal.ansiBrightYellow":"#FFFFB6",
"terminal.ansiCyan":"#C6C5FE",
"terminal.ansiGreen":"#A8FF60",
"terminal.ansiMagenta":"#FF73FD",
"terminal.ansiRed":"#FF6C60",
"terminal.ansiWhite":"#B5B3AA",
"terminal.ansiYellow":"#FFFFB6"
}
}

Zsh

安装完powerlevel10k后,使用source引入会有提示,为了避免建议使用plugins安装

powerlevel10k 样式优化

powerlevel10k文档

安装

1
2
brew install romkatv/powerlevel10k/powerlevel10k
echo "source $(brew --prefix)/opt/powerlevel10k/powerlevel10k.zsh-theme" >>~/.zshrc

安装完成后设置

1
p10k configure

zsh-autosuggestions 自动补全

zsh-autosuggestions文档

安装

1
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

~./zshrc设置

1
2
3
4
plugins=( 
# other plugins...
zsh-autosuggestions
)

zsh-syntax-highlighting 错误高亮

zsh-syntax-highlighting文档

安装

1
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

~./zshrc设置

1
2
3
4
5
plugins=( 
# other plugins...
zsh-autosuggestions
zsh-syntax-highlighting
)

z cd命令记忆

直接在~./zshrc中添加

使用,先手动cd一次,以后使用z 最后的文件夹名称就行