Files
LocalNav/README.md
T
2026-07-12 11:58:47 +08:00

57 lines
2.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 本地导航站
Flask + SQLite 的局域网导航聚合:左侧分组与服务列表,右侧 iframe 内嵌打开 `http://内网IP:端口`,统一入口管理宝塔、面板、本地服务等。
**代码仓库:** https://git.bz121.com/dekun/LocalNav.git
**完整中文说明与部署文档:** [部署与使用说明.md](./部署与使用说明.md)
**默认端口:** `5070`(可通过环境变量 `NAV_PORT` 修改)
## 一键部署(无需预先克隆)
在**空目录或新服务器**上,只需运行安装脚本,按提示输入 Git 仓库地址即可自动克隆并完成部署:
```bash
# Linux / macOS(推荐:一条命令,无需先 git clone)
curl -fsSL https://git.bz121.com/dekun/LocalNav/raw/main/scripts/install.sh | bash
# 或本地已有 install 脚本时
bash scripts/install.sh
python scripts/install.py
# Windows PowerShell
.\scripts\install.ps1
```
运行后会提示:
1. **Git 仓库地址**(默认 `https://git.bz121.com/dekun/LocalNav.git`
2. **安装目录**Linux 默认 `/opt/LocalNav`Windows 默认 `./LocalNav`
随后自动:`git clone` → 创建虚拟环境 → 安装依赖 → 生成 `.env``NAV_SECRET_KEY`**自动 pm2 启动**(若已安装 pm2)。
非交互安装(使用默认值):
```bash
python scripts/install.py -y
# 或指定参数
python scripts/install.py --repo https://git.bz121.com/dekun/LocalNav.git --dir /opt/LocalNav
```
**默认登录:** `admin` / `admin123`(生产环境请尽快在「系统设置」中修改密码)
**已安装后的更新**(在项目目录内):
```bash
cd /opt/LocalNav
git pull
python scripts/deploy.py # 或 bash scripts/deploy.sh
```
配置:将 `.env.example` 复制为 `.env` 并填写变量(与 `app.py` 同目录);详见说明文档「环境变量与 `.env`」一节。
进程守护(可选):`pm2 start ecosystem.config.cjs`(需已安装 PM2),详见 [部署与使用说明.md](./部署与使用说明.md) 中「9.7 使用 PM2」。
**Ubuntu 生产部署(推荐):** 克隆到 `/opt/LocalNav`,以 **root** 用户运行 systemd 服务,默认监听 `5070`;外网访问请配置 Nginx/Caddy 反向代理与 HTTPS,详见部署文档「九、部署指南」与「9.8 外网 HTTPS 访问」。