88398088452451e682a7a94ba17f1e6efdd85caf
Run pm2 start or restart when PM2 is available, fall back to systemd nav-site, and verify /login responds before finishing. Co-authored-by: Cursor <cursoragent@cursor.com>
本地导航站
Flask + SQLite 的局域网导航聚合:左侧分组与服务列表,右侧 iframe 内嵌打开 http://内网IP:端口,统一入口管理宝塔、面板、本地服务等。
代码仓库: https://git.bz121.com/dekun/LocalNav.git
完整中文说明与部署文档: 部署与使用说明.md
默认端口: 5070(可通过环境变量 NAV_PORT 修改)
一键部署(无需预先克隆)
在空目录或新服务器上,只需运行安装脚本,按提示输入 Git 仓库地址即可自动克隆并完成部署:
# 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
运行后会提示:
- Git 仓库地址(默认
https://git.bz121.com/dekun/LocalNav.git) - 安装目录(Linux 默认
/opt/LocalNav,Windows 默认./LocalNav)
随后自动:git clone → 创建虚拟环境 → 安装依赖 → 生成 .env 与 NAV_SECRET_KEY。
非交互安装(使用默认值):
python scripts/install.py -y
# 或指定参数
python scripts/install.py --repo https://git.bz121.com/dekun/LocalNav.git --dir /opt/LocalNav
默认登录: admin / admin123(生产环境请尽快在「系统设置」中修改密码)
已安装后的更新(在项目目录内):
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 中「9.7 使用 PM2」。
Ubuntu 生产部署(推荐): 克隆到 /opt/LocalNav,以 root 用户运行 systemd 服务,默认监听 5070;外网访问请配置 Nginx/Caddy 反向代理与 HTTPS,详见部署文档「九、部署指南」与「9.8 外网 HTTPS 访问」。
Description
Languages
Python
55.5%
HTML
31.5%
CSS
9.2%
Shell
1.6%
JavaScript
1.1%
Other
1.1%