OnePoint config.json 配置详解

in 映射网盘 with 0 comment

概述

OnePoint 将配置与部署相分离,无论部署在哪个平台,该文件一样的。本文档将重点介绍 config.json 文件各个参数的意义,至于部署,请参考其他文档。

注意: 因为版本更新问题,所有的配置教程都可能不是最新的,在阅读配置教程时,请结合自带的config.json使用。

config.json 分为三个部分

G_CONFIG

全局配置部分,各部分介绍如下

"G_CONFIG": {
        "admin_username": "admin",
        "admin_password": "admin",
        "render_name": "w.w",
        "site_name": "OnePoint Demo",
        "site_title": "OnePoint Demo",
        "site_icon": "https://cdn.onesrc.cn/uploads/images/onepoint.png",
        "site_keywords": "OnePoint",
        "site_description": "OnePoint description",
        "site_script": "",
        "site_readme": "支持前后端分离,可在 /admin/ 路径下尝试访问",
        "proxy": [
            "https://proxy.onesrc.workers.dev/"
        ],
        "initTime": "2020-03-03T09:48:13.758Z",
        "admin_password_date_hash": "c289ffe12a30c94530b7fc4e532e2f42",
        "access_origins":["http://localhost:8080"]
    }

补充说明

site_XXX 具体是否使用由主题决定,不能过分依赖此项。

proxy 代理仅支持 cf 部署,其格式为 http://proxy.example.com/url=<encodeURIComponent(需要代理的网站)>

DRIVE_MAP

云盘索引部分,各部分意义如下:

"<映射路径>":{
    "funcName": "<模块名>",
    "spConfig": {
        "root":""//根目录偏移,可以留空
    },
    "password": "mmx"//云盘级密码,访问该云盘时触发
}

各部分配置详解

补充说明

映射路径中必须有一个 / 路径。

system_admin 为管理系统模块,用户在配置时不可使用该项。

DOMAIN_MAP

反向代理时使用,格式为

"<ip>": {
    "domain": "<域名>",
    "path": "<路径 p0>"
}

ip 为反向代理的服务器 ip,域名是此 ip 对应的域名,path 为反向代理使用的路径,格式与 p0 相同。

示例

完整示例

{
    "G_CONFIG": {
        "admin_username": "admin",
        "admin_password": "admin",
        "render_name": "w.w",
        "site_name": "OnePoint Demo",
        "site_title": "OnePoint Demo",
        "site_icon": "https://cdn.onesrc.cn/uploads/images/onepoint.png",
        "site_keywords": "OnePoint",
        "site_description": "OnePoint description",
        "site_script": "",
        "site_readme": "支持前后端分离,可在 /admin/ 路径下尝试访问",
        "proxy": [
            "https://proxy.onesrc.workers.dev/"
        ],
        "access_origins":["http://localhost:8080"]
    },
    "DRIVE_MAP": {
        "/": {
            "funcName": "system_phony",
            "spConfig": {}
        },
        "/demo_sharepoint/": {
            "funcName": "onedrive_sharepoint",
            "spConfig": {
                "shareUrl": "https://lovelearn-my.sharepoint.com/:f:/g/personal/admin_share_onesrc_cc/Es6CMetI4fJCr4GqWZ3uvA0BEnzJxxb4CU-iQr04VYomLQ?e=C9K35U",
                "root": ""
            }
        },
        "/demo_linux/": {
            "funcName": "linux_scf",
            "spConfig": {
                "root": ""
            }
        },
        "/demo_goindex/": {
            "funcName": "gdrive_goindex",
            "spConfig": {
                "password": "index",
                "cfurl": "https://goindex.onesrc.workers.dev"
            }
        },
        "/demo_onedrive_1/": {
            "funcName": "onedrive_graph",
            "spConfig": {
                "refresh_token": "OAQABAAAAAABeAFzDwllzTYGDLh_qYbH8T4VEMWcDAA66TH1bqjcGBV7gILezW8TUS_VOmxrmWwvOjLepq0RegTqQItPllIHLVmBqbYX4zEdcNWV4kU7-heUVoYDKHZP1Zrs209oeBce1sZGKJp-wbhsTFGdJ-Q1hee10lOt4o1cwdMK5V0561ZmTFvSHP60O1DRaGjm3AlxqaEoylFo-a9tdL090-kGAiCHttwh4D3d5qPsWYZFrY3bb3XQu88froQwvB6Q2EzKoXx8FZs9pAIf1k0QuWdCx9wwb2_Nwr4pL9wJVPN8Q9eSUcbYpJEZwLKJhOc29J2s2aZpeBZ5rJH4NYSM4q0HEW7lqvR3KjKamr93W5rSfpE9LaqifoHTrp0zrY7dJmQiQ0V3qJKZ9CWDNwHGqCfDtRXMWyuQQ4xs2jgMTj0L2FMxb9BeQGYAjjbSm53aiYxv7adQzr7PZezL2voIGljIO553GLd3jFTPwrubTEIPnkgTXuHxR_qH-uVFBIji0Oosb56j5aSgYIsc8TlsGLN0Czx6V6D84poizWENn9mWVzhy3eZR2sNc6m1Tdxl1ifafZukFoElFkeCK41vuhAJjHU1ichuCYsl3OuN78ItisNtZvmGi6RjXC3nd6d8QdMEcnilsRTIl-wb0xM5QAhzZWM2wuIpUvAICiZwNBOGjzAgk20EL-tJsQMd_BxvM8J_HTGBIU23sZYgoLKOVPI6QOMM74sLsBjAvsOvmVLU3OH3GFcMjj3DTFVjgP7AXOaTFjHVVlJE76ArYvHRuK1SeVRNQmzK3q-7sLIc8Kgc7zMCAA",
                "oauth": 0
            }
        },
        "/demo_onedrive_2/": {
            "funcName": "onedrive_graph",
            "spConfig": {
                "refresh_token": "OAQABAAAAAAD32Me_adtYS4A5iUsE7inoN5eLCtuGw7w_Tet8aXmvp6ic05XEkEHQwQF2MgJkaTp-mEZKlXH0QvI3NCbZh9NI5wvP_r0nqb6UaBeLxeOCgrlbhH1FzeX0ep0ZZQ8D0J6ky1yEazxxkg8c4FsMvUWVxkw5kiHYVc3DK_Y3WmtvRHFxazeWgxBaiYm9jfbcR8maVNeey6oGZCw6zUvwrINoLOCok05imP_GEf_eHCsDcISTU0MI_XpEy9Ak0i8jo6ii74EUVEtJAloaaf56OtIQliyWkH56VtVsRnDpW1DftsJY1qRsCbSq7PmpLWscvLW8qdmvFy13_nEhp8PAei41fz9XnDT4AS7gWHUpFGmw837MVSDz0jk2LJrFBh7_CywK9uaj3mdY49paJEP7YuIVf8RkQMMFFudFazeKwx19TPZepZmR580rpr6qhs2aL4WG6YhacWnRfKZGGs_sL9aJviBkzvO_vDWjxO7cMvKd_SXDt9s8_IeloARxvbKZQ-z2ojbYm_bbY7917fxDlISRrDp_SVHJtq9s-YS3ZS6lFA_aBChaIXTxskJXZB-jHueQ7arEi7N4zCB4hUb58J5DIL_BEdcps_icYAySjbRFU170kTIw7aB67wjIiTLoXMoMopMU9FmfctnqB34ubTNK6FHWMICRRWZLiThyEFSYwM9ER0HyJFQjncMxBs2cuhJx5zZeXeQhEsrVuJtULxdWeZr-4Grhz3XlyhH72jyjFeXAvey1Ew_H7myl0aBKFosqSNMSXLBY-x32v6uUaCKPziaQHKfWQ8cAoNrhM2yb_CAA",
                "oauth": 1
            }
        },
        "/demo_password_123_密码测试/": {
            "funcName": "onedrive_sharepoint",
            "spConfig": {
                "shareUrl": "https://lovelearn-my.sharepoint.com/:f:/g/personal/admin_share_onesrc_cc/Es6CMetI4fJCr4GqWZ3uvA0BEnzJxxb4CU-iQr04VYomLQ?e=C9K35U",
                "root": "/image"
            },
            "password": "123",
            "password_date_hash": "ae6e334f62fb5d989398deed87568c94"
        },
        "/demo_phony/": {
            "funcName": "system_phony",
            "spConfig": {
                "list": [
                    "https://ukuq.github.io/onepoint/log.md",
                    "https://ukuq.github.io/hello-word/README.md",
                    "https://ukuq.github.io/onepoint/favicon.png",
                    "http://www.w3school.com.cn/i/horse.ogg",
                    "http://www.w3school.com.cn/i/movie.mp4",
                    "http://www.w3school.com.cn/i/movie.ogg",
                    "https://zfile.jun6.net/directlink/视频/带字幕的视频.mp4",
                    "https://zfile.jun6.net/directlink/视频/带字幕的视频.mp4.vtt",
                    "https://zfile.jun6.net/directlink/音频/刘乐瑶 - 父亲写的散文诗.mp3",
                    "https://zfile.jun6.net/directlink/音频/任素汐 - 胡广生.mp3",
                    "https://zfile.jun6.net/directlink/视频/Lemon (Full Covered by.mp4",
                    "https://zfile.jun6.net/directlink/图片/图片铜牌03.jpg"
                ]
            }
        }
    }
}

onedrive 极简示例

配置时修改 refresh_token 属性即可。

{
    "G_CONFIG": {
        "admin_username": "admin",
        "admin_password": "admin",
        "render_name": "w.w",
        "site_name": "OnePoint Demo",
        "site_title": "OnePoint Demo",
        "site_icon": "https://cdn.onesrc.cn/uploads/images/onepoint.png",
        "site_keywords": "OnePoint",
        "site_description": "OnePoint description",
        "site_script": "",
        "site_readme": "支持前后端分离,可在 /admin/ 路径下尝试访问",
        "proxy": [
            "https://proxy.onesrc.workers.dev/"
        ],
        "access_origins":["http://localhost:8080"]
    },
    "DRIVE_MAP": {
        "/": {
            "funcName": "onedrive_graph",
            "spConfig": {
                "refresh_token": "OAQABAAAAAABeAFzDwllzTYGDLh_qYbH8T4VEMWcDAA66TH1bqjcGBV7gILezW8TUS_VOmxrmWwvOjLepq0RegTqQItPllIHLVmBqbYX4zEdcNWV4kU7-heUVoYDKHZP1Zrs209oeBce1sZGKJp-wbhsTFGdJ-Q1hee10lOt4o1cwdMK5V0561ZmTFvSHP60O1DRaGjm3AlxqaEoylFo-a9tdL090-kGAiCHttwh4D3d5qPsWYZFrY3bb3XQu88froQwvB6Q2EzKoXx8FZs9pAIf1k0QuWdCx9wwb2_Nwr4pL9wJVPN8Q9eSUcbYpJEZwLKJhOc29J2s2aZpeBZ5rJH4NYSM4q0HEW7lqvR3KjKamr93W5rSfpE9LaqifoHTrp0zrY7dJmQiQ0V3qJKZ9CWDNwHGqCfDtRXMWyuQQ4xs2jgMTj0L2FMxb9BeQGYAjjbSm53aiYxv7adQzr7PZezL2voIGljIO553GLd3jFTPwrubTEIPnkgTXuHxR_qH-uVFBIji0Oosb56j5aSgYIsc8TlsGLN0Czx6V6D84poizWENn9mWVzhy3eZR2sNc6m1Tdxl1ifafZukFoElFkeCK41vuhAJjHU1ichuCYsl3OuN78ItisNtZvmGi6RjXC3nd6d8QdMEcnilsRTIl-wb0xM5QAhzZWM2wuIpUvAICiZwNBOGjzAgk20EL-tJsQMd_BxvM8J_HTGBIU23sZYgoLKOVPI6QOMM74sLsBjAvsOvmVLU3OH3GFcMjj3DTFVjgP7AXOaTFjHVVlJE76ArYvHRuK1SeVRNQmzK3q-7sLIc8Kgc7zMCAA",
                "oauth": 0
            }
        }
    }
}

补充说明

暂无

上一篇: 利用 cloudflare 解决 ajax 跨域问题
下一篇: 如何优雅地使用 IDM 下载工具
Responses