Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7cbae154bf |
+3
-3
@@ -2,7 +2,7 @@
|
||||
|
||||
NewSzxcn Email is a self-hosted mail server with a complete Webmail client and administration console. It bundles Go, React, Postfix, Dovecot, Rspamd, and SQLite into an all-in-one Docker deployment.
|
||||
|
||||
[Releases](https://github.com/zxyszx/NewSzxcn-Email/releases) · [Chinese README](README.md)
|
||||
[Releases](https://gitea.xzys.me/szx/NewSzxcn-Email/releases) · [Chinese README](README.md)
|
||||
|
||||
## Features
|
||||
|
||||
@@ -18,7 +18,7 @@ NewSzxcn Email is a self-hosted mail server with a complete Webmail client and a
|
||||
Debian and Ubuntu on `amd64` or `arm64` are supported.
|
||||
|
||||
```bash
|
||||
curl -fsSL https://raw.githubusercontent.com/zxyszx/NewSzxcn-Email/main/install.sh | sudo bash
|
||||
curl -fsSL https://gitea.xzys.me/szx/NewSzxcn-Email/raw/branch/main/install.sh | sudo bash
|
||||
```
|
||||
|
||||
The installer configures `/opt/newszxcn-email`, starts the Docker services, and waits for the health check. DNS records and provider port restrictions must still be configured by the operator.
|
||||
@@ -55,7 +55,7 @@ Open TCP ports `25`, `80`, `443`, `465`, `587`, `993`, and `995` as needed. Publ
|
||||
## Manual source deployment
|
||||
|
||||
```bash
|
||||
git clone https://github.com/zxyszx/NewSzxcn-Email.git
|
||||
git clone https://gitea.xzys.me/szx/NewSzxcn-Email.git
|
||||
cd NewSzxcn-Email/deploy
|
||||
cp .env.example .env
|
||||
docker compose -f docker-compose.yml -f docker-compose.build.yml up -d --build
|
||||
|
||||
@@ -2,12 +2,7 @@
|
||||
|
||||
NewSzxcn-Email 是一个可自建、可管理、带完整 Webmail 与管理后台的开源邮箱系统。
|
||||
|
||||
[](https://github.com/zxyszx/NewSzxcn-Email/releases)
|
||||
[](https://github.com/zxyszx/NewSzxcn-Email/actions/workflows/docker.yml)
|
||||
[](https://github.com/zxyszx/NewSzxcn-Email/actions/workflows/ci.yml)
|
||||
[](LICENSE)
|
||||
|
||||
[邮箱后台配置指南](docs/GUIDE.md) · [版本发布](https://github.com/zxyszx/NewSzxcn-Email/releases) · [部署文档](deploy/README.md) · [English](README.en.md)
|
||||
[邮箱后台配置指南](docs/GUIDE.md) · [版本发布](https://gitea.xzys.me/szx/NewSzxcn-Email/releases) · [部署文档](deploy/README.md) · [English](README.en.md) · [MIT License](LICENSE)
|
||||
|
||||
## 主要功能
|
||||
|
||||
@@ -26,13 +21,13 @@ NewSzxcn-Email 是一个可自建、可管理、带完整 Webmail 与管理后
|
||||
支持 Debian / Ubuntu 的 `amd64` 与 `arm64` 服务器。建议至少 2 核、2 GB 内存,并准备一个已解析到服务器的邮件主机名,例如 `mail.example.com`。
|
||||
|
||||
```bash
|
||||
curl -fsSL https://raw.githubusercontent.com/zxyszx/NewSzxcn-Email/main/install.sh | sudo bash
|
||||
curl -fsSL https://gitea.xzys.me/szx/NewSzxcn-Email/raw/branch/main/install.sh | sudo bash
|
||||
```
|
||||
|
||||
已使用 `root` 登录时,也可以使用:
|
||||
|
||||
```bash
|
||||
bash <(curl -fsSL https://raw.githubusercontent.com/zxyszx/NewSzxcn-Email/main/install.sh)
|
||||
bash <(curl -fsSL https://gitea.xzys.me/szx/NewSzxcn-Email/raw/branch/main/install.sh)
|
||||
```
|
||||
|
||||
### 管理面板
|
||||
@@ -194,7 +189,7 @@ sudo newszxcn-email uninstall
|
||||
需要自行控制 Compose 配置时:
|
||||
|
||||
```bash
|
||||
git clone https://github.com/zxyszx/NewSzxcn-Email.git
|
||||
git clone https://gitea.xzys.me/szx/NewSzxcn-Email.git
|
||||
cd NewSzxcn-Email/deploy
|
||||
cp .env.example .env
|
||||
# 编辑 .env
|
||||
@@ -216,7 +211,7 @@ docker compose -f docker-compose.yml -f docker-compose.build.yml up -d --build
|
||||
- 后端:Go、Chi、SQLite
|
||||
- 前端:React、TypeScript、TanStack Query、shadcn/ui、Tailwind CSS
|
||||
- 邮件:Postfix、Dovecot、Rspamd
|
||||
- 部署:Docker、Docker Compose、GitHub Actions、GHCR
|
||||
- 部署:Docker、Docker Compose、GHCR
|
||||
|
||||
## 本地开发
|
||||
|
||||
|
||||
+5
-5
@@ -2,7 +2,7 @@
|
||||
|
||||
NewSzxcn-Email 是一个可自建、可管理、带完整 Webmail 与管理后台的开源邮箱系统。
|
||||
|
||||
[版本发布](https://github.com/zxyszx/NewSzxcn-Email/releases) · [部署文档](deploy/README.md) · [English](README.en.md)
|
||||
[版本发布](https://gitea.xzys.me/szx/NewSzxcn-Email/releases) · [部署文档](deploy/README.md) · [English](README.en.md)
|
||||
|
||||
## 主要功能
|
||||
|
||||
@@ -21,13 +21,13 @@ NewSzxcn-Email 是一个可自建、可管理、带完整 Webmail 与管理后
|
||||
支持 Debian / Ubuntu 的 `amd64` 与 `arm64` 服务器。建议至少 2 核、2 GB 内存,并准备一个已解析到服务器的邮件主机名,例如 `mail.example.com`。
|
||||
|
||||
```bash
|
||||
curl -fsSL https://raw.githubusercontent.com/zxyszx/NewSzxcn-Email/main/install.sh | sudo bash
|
||||
curl -fsSL https://gitea.xzys.me/szx/NewSzxcn-Email/raw/branch/main/install.sh | sudo bash
|
||||
```
|
||||
|
||||
已使用 `root` 登录时,也可以使用:
|
||||
|
||||
```bash
|
||||
bash <(curl -fsSL https://raw.githubusercontent.com/zxyszx/NewSzxcn-Email/main/install.sh)
|
||||
bash <(curl -fsSL https://gitea.xzys.me/szx/NewSzxcn-Email/raw/branch/main/install.sh)
|
||||
```
|
||||
|
||||
脚本会自动完成:
|
||||
@@ -123,7 +123,7 @@ sudo newszxcn-email uninstall
|
||||
需要自行控制 Compose 配置时:
|
||||
|
||||
```bash
|
||||
git clone https://github.com/zxyszx/NewSzxcn-Email.git
|
||||
git clone https://gitea.xzys.me/szx/NewSzxcn-Email.git
|
||||
cd NewSzxcn-Email/deploy
|
||||
cp .env.example .env
|
||||
# 编辑 .env
|
||||
@@ -145,7 +145,7 @@ docker compose -f docker-compose.yml -f docker-compose.build.yml up -d --build
|
||||
- 后端:Go、Chi、SQLite
|
||||
- 前端:React、TypeScript、TanStack Query、shadcn/ui、Tailwind CSS
|
||||
- 邮件:Postfix、Dovecot、Rspamd
|
||||
- 部署:Docker、Docker Compose、GitHub Actions、GHCR
|
||||
- 部署:Docker、Docker Compose、GHCR
|
||||
|
||||
## 本地开发
|
||||
|
||||
|
||||
@@ -393,7 +393,7 @@ export function ProfilePage() {
|
||||
<StatsRangeTabs rangeDays={statsRangeDays} onRangeChange={setStatsRangeDays} />
|
||||
</div>
|
||||
: tab === "apiTokens"
|
||||
? <Button asChild variant="outline" size="sm" className="h-8 px-3 text-xs"><a href="https://github.com/zxyszx/NewSzxcn-Email/blob/main/docs/API.md" target="_blank" rel="noreferrer"><BookOpen className="h-4 w-4" />API 文档</a></Button>
|
||||
? <Button asChild variant="outline" size="sm" className="h-8 px-3 text-xs"><a href="https://gitea.xzys.me/szx/NewSzxcn-Email/src/branch/main/docs/API.md" target="_blank" rel="noreferrer"><BookOpen className="h-4 w-4" />API 文档</a></Button>
|
||||
: undefined
|
||||
|
||||
return (
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
推荐直接使用仓库根目录的管理脚本:
|
||||
|
||||
```bash
|
||||
curl -fsSL https://raw.githubusercontent.com/zxyszx/NewSzxcn-Email/main/install.sh | sudo bash
|
||||
curl -fsSL https://gitea.xzys.me/szx/NewSzxcn-Email/raw/branch/main/install.sh | sudo bash
|
||||
```
|
||||
|
||||
后续操作:
|
||||
|
||||
@@ -22,7 +22,7 @@ Telegram 消息包含邮局域名、服务器 IP、系统版本、已有域名
|
||||
确认文件已经上传后,首次执行官方脚本:
|
||||
|
||||
```bash
|
||||
curl -fsSL https://raw.githubusercontent.com/zxyszx/NewSzxcn-Email/main/install.sh | sudo bash
|
||||
curl -fsSL https://gitea.xzys.me/szx/NewSzxcn-Email/raw/branch/main/install.sh | sudo bash
|
||||
```
|
||||
|
||||
脚本显示“尚未安装”管理菜单后,输入 `2`,选择“备份恢复”。在恢复完成后,以后需要管理系统时才使用 `ns` 打开管理菜单。
|
||||
|
||||
+2
-2
@@ -7,7 +7,7 @@
|
||||
建议使用 Debian 或 Ubuntu,并提前准备一个已经解析到服务器的邮件主机名,例如 `mail.example.com`。
|
||||
|
||||
```bash
|
||||
bash <(curl -fsSL https://raw.githubusercontent.com/zxyszx/NewSzxcn-Email/main/install.sh)
|
||||
bash <(curl -fsSL https://gitea.xzys.me/szx/NewSzxcn-Email/raw/branch/main/install.sh)
|
||||
```
|
||||
|
||||
安装脚本会依次询问防火墙配置和邮件服务器域名,自动检测邮箱地址域名,再让你选择默认 `admin` 前缀或自定义管理员邮箱前缀,最后输入密码并选择 Web 部署方式。例如输入服务器域名 `mail.newszxcn.com`,确认检测结果 `@newszxcn.com`,选择 `1. 使用默认前缀 admin` 会创建 `admin@newszxcn.com`;选择 `2. 自定义管理员邮箱前缀` 后才需要输入邮箱账号前缀。选择“自动配置 Nginx + SSL”时,脚本会安装 Nginx,并使用官方 `acme.sh` 申请 Let's Encrypt 证书。
|
||||
@@ -170,4 +170,4 @@ sudo newszxcn-email reset-2fa
|
||||
- [项目说明](../README.md)
|
||||
- [Docker 部署说明](../deploy/README.md)
|
||||
- [API 文档](API.md)
|
||||
- [版本发布](https://github.com/zxyszx/NewSzxcn-Email/releases)
|
||||
- [版本发布](https://gitea.xzys.me/szx/NewSzxcn-Email/releases)
|
||||
|
||||
+10
-3
@@ -1,9 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
set -Eeuo pipefail
|
||||
|
||||
REPOSITORY="zxyszx/NewSzxcn-Email"
|
||||
RAW_BASE="https://raw.githubusercontent.com/${REPOSITORY}/main"
|
||||
INSTALL_DIR="${LANQIN_INSTALL_DIR:-/opt/newszxcn-email}"
|
||||
DEFAULT_RAW_BASE="https://gitea.xzys.me/szx/NewSzxcn-Email/raw/branch/main"
|
||||
SOURCE_URL_FILE="${INSTALL_DIR}/.source-url"
|
||||
RAW_BASE="${LANQIN_RAW_BASE:-}"
|
||||
if [[ -z "${RAW_BASE}" && -s "${SOURCE_URL_FILE}" ]]; then
|
||||
RAW_BASE="$(tr -d '\r\n' < "${SOURCE_URL_FILE}")"
|
||||
fi
|
||||
RAW_BASE="${RAW_BASE:-${DEFAULT_RAW_BASE}}"
|
||||
COMMAND="${1:-menu}"
|
||||
ROLLBACK_FILE="${INSTALL_DIR}/.rollback-image"
|
||||
ROLLBACK_POINTER="${INSTALL_DIR}/.rollback-manifest"
|
||||
@@ -135,6 +140,8 @@ apply_staged_assets() {
|
||||
install -m 0644 "${INSTALL_DIR}/.env.example.new" "${INSTALL_DIR}/.env.example" || return 1
|
||||
install -m 0755 "${INSTALL_DIR}/.install.sh.new" "${CLI_PATH}.new" || return 1
|
||||
mv "${CLI_PATH}.new" "${CLI_PATH}" || return 1
|
||||
printf '%s\n' "${RAW_BASE}" > "${SOURCE_URL_FILE}" || return 1
|
||||
chmod 0644 "${SOURCE_URL_FILE}" || return 1
|
||||
rm -f "${INSTALL_DIR}/.docker-compose.yml.new" "${INSTALL_DIR}/.env.example.new" "${INSTALL_DIR}/.install.sh.new"
|
||||
}
|
||||
|
||||
@@ -1524,7 +1531,7 @@ SSL 证书:有效期至 ${certificate_expiry}
|
||||
重置管理员密码:newszxcn-email reset-password
|
||||
|
||||
公开教程:
|
||||
https://github.com/zxyszx/NewSzxcn-Email/blob/main/docs/GUIDE.md
|
||||
https://gitea.xzys.me/szx/NewSzxcn-Email/src/branch/main/docs/GUIDE.md
|
||||
EOF
|
||||
install -m 0600 "${tmp}" "${GUIDE_FILE}"
|
||||
rm -f "${tmp}"
|
||||
|
||||
@@ -126,6 +126,24 @@ test_compose_configuration() {
|
||||
grep -Fq './certs:/certs:ro' "${ROOT_DIR}/deploy/docker-compose.yml" || fail_test "certificate mount missing"
|
||||
}
|
||||
|
||||
test_source_url_persistence() (
|
||||
local temp_dir
|
||||
temp_dir="$(mktemp -d)"
|
||||
INSTALL_DIR="${temp_dir}/install"
|
||||
SOURCE_URL_FILE="${INSTALL_DIR}/.source-url"
|
||||
CLI_PATH="${temp_dir}/newszxcn-email"
|
||||
RAW_BASE="https://gitea.example.test/szx/NewSzxcn-Email/raw/branch/main"
|
||||
mkdir -p "${INSTALL_DIR}"
|
||||
printf 'services: {}\n' > "${INSTALL_DIR}/.docker-compose.yml.new"
|
||||
printf 'LANQIN_IMAGE=test\n' > "${INSTALL_DIR}/.env.example.new"
|
||||
printf '#!/usr/bin/env bash\nexit 0\n' > "${INSTALL_DIR}/.install.sh.new"
|
||||
|
||||
apply_staged_assets
|
||||
|
||||
assert_eq "${RAW_BASE}" "$(cat "${SOURCE_URL_FILE}")" "persisted installer source URL"
|
||||
[[ -x "${CLI_PATH}" ]] || fail_test "installed CLI is not executable"
|
||||
)
|
||||
|
||||
test_legacy_configuration_is_preserved() {
|
||||
local temp_dir
|
||||
temp_dir="$(mktemp -d)"
|
||||
@@ -835,6 +853,7 @@ test_install_configuration 1 1 "127.0.0.1:8088" "https://mail.example.com" "fals
|
||||
test_install_configuration 2 2 "127.0.0.1:8088" "https://mail.example.com" "false"
|
||||
test_nginx_configuration
|
||||
test_compose_configuration
|
||||
test_source_url_persistence
|
||||
test_legacy_configuration_is_preserved
|
||||
test_menu_choice
|
||||
test_menu_rendering
|
||||
|
||||
Reference in New Issue
Block a user