Skip to content

用node.js弄的自定义导航页项目 A Node.js-based web navigation system that provides a customizable, authenticated web interface for organizing and accessing links

License

Notifications You must be signed in to change notification settings

SSSSSSSan/SanMPage

Repository files navigation

sanMPage 项目文档

项目概述

sanMPage 是一个基于 Node.js 的导航页面,旨在提供一个简洁的导航界面。用户可以通过配置文件自定义导航链接,并通过简单的身份验证访问该页面。

deepseek和文心一言打了一架

快速启动

Node.js 本地运行

# 安装依赖
npm install

# 启动开发服务器(带热更新)
npm run dev

# 或直接运行
node index.js

Docker 容器运行

# 构建Docker镜像

docker build -t sanmpage .

# 运行容器(映射3000端口)
docker run -p 3000:3000 sanmpage

重要提醒:数据持久化 运行容器时,请确保映射app/data目录到宿主机目录,以持久化配置文件和导航数据。否则容器重启后所有配置将丢失。示例命令:

docker run -p 3000:3000 -v /path/to/your/data:/app/data sanmpage

/path/to/your/data替换为宿主机上实际的data目录路径。


## 配置文件说明

### config.ini (服务端配置)

位置:`/data/config.ini`

**使用前重命名 config.example.js 为 config.ini**

配置项说明:

```ini
[server]
# 服务端口号
port = 3000

[user]
# 如果为*则不校验,但是这里不能删
name = *
password = *

示例 url:

http://localhost:300/?name=你的设置&password=你的设置

配置为*的话可不带对应参数

list.json (前端内容配置)

位置:/data/web/list.json

使用前重命名 list.example.json 为 list.json

搜索引擎功能

在配置文件中添加 search 字段可启用搜索引擎功能:

  • name: 搜索引擎显示名称
  • link: 搜索链接模板,使用 {%search%} 作为关键词占位符

配置结构示例:

{
  "tips": "将文件重名名为list.json,然后修改其中的内容即可. 这行可以删掉",
  "title": "TITLE",
  "backgroundColor": "#1A1A1A",
  "fontColor": "#FFFEDA",
  "search": [
    {
      "name": "bing",
      "link": "https://cn.bing.com/search?q={%search%} -csdn"
    },
    {
      "name": "google",
      "link": "https://www.google.com/search?q={%search%}"
    }
  ],
  "list": [
    {
      "name": "Lab1",
      "list": [
        {
          "name": "百度",
          "link": "https://www.baidu.com/"
        },
        {
          "name": "必应",
          "link": "https://www.bing.com/"
        }
      ]
    },
    {
      "name": "Lab2",
      "list": [
        {
          "name": "啊B",
          "link": "https://www.bilibili.com/"
        },
        {
          "name": "幻星",
          "link": "https://play-live.bilibili.com/"
        }
      ]
    }
  ]
}

About

用node.js弄的自定义导航页项目 A Node.js-based web navigation system that provides a customizable, authenticated web interface for organizing and accessing links

Resources

License

Stars

Watchers

Forks

Packages