1
0
mirror of https://github.com/netnr/kms synced 2025-01-21 05:32:13 +00:00
This commit is contained in:
netnr 2021-01-23 08:47:15 +08:00
commit 5b2fb1c838
8 changed files with 816 additions and 0 deletions

330
.gitignore vendored Normal file
View File

@ -0,0 +1,330 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUNIT
*.VisualState.xml
TestResult.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
**/Properties/launchSettings.json
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# JustCode is a .NET coding add-in
.JustCode
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# JetBrains Rider
.idea/
*.sln.iml
# CodeRush
.cr/
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/

21
LICENSE Normal file
View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2019 netnr
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

204
README.md Normal file
View File

@ -0,0 +1,204 @@
# KMS
KMS激活服务slmgr命令激活Windows系统、Office
### 激活步骤(管理员命令执行)
1. 设置服务 `slmgr -skms skms.netnr.eu.org`
2. 安装密钥 `slmgr -ipk 版本对应秘钥`
3. 激活系统 `slmgr -ato`
### 可用服务
- `kms.cangshui.net`
- `skms.netnr.eu.org` 推荐使用,维护 **CNAME** 指向有效的服务
+ `telnet skms.netnr.eu.org 1688` 测试服务是否可用
### 安装服务Windows
- [vlmcs-Windows](https://s1.netnr.eu.org/static/app/vlmcs-Windows.zip)
### 安装服务Linux
```
# 一键安装脚本
wget --no-check-certificate https://github.com/teddysun/across/raw/master/kms.sh && chmod +x kms.sh && ./kms.sh
netstat -nxtlp | grep 1688 # 查看端口
/etc/init.d/kms status # 状态
/etc/init.d/kms start # 启动
/etc/init.d/kms stop # 停止
/etc/init.d/kms restart # 重启
./kms.sh uninstall # 卸载
```
<https://teddysun.com/530.html>
### 密钥
<https://docs.microsoft.com/zh-cn/windows-server/get-started/kmsclientkeys>
#### Windows Server 半年频道版本
##### Windows Server 版本 1909、版本1903 和版本 1809
操作系统版本 | KMS 客户端安装密钥
---- | ----
Windows Server Datacenter | 6NMRW-2C8FM-D24W7-TQWMY-CWH2D
Windows Server Standard | N2KJX-J94YW-TQVFB-DG9YT-724CC
##### Windows Server 版本 1803
操作系统版本 | KMS 客户端安装密钥
---- | ----
Windows Server Datacenter | 2HXDN-KRXHB-GPYC7-YCKFJ-7FVDG
Windows Server Standard | PTXN8-JFHJM-4WC78-MPCBR-9W4KR
##### Windows Server 版本 1709
操作系统版本 | KMS 客户端安装密钥
---- | ----
Windows Server Datacenter | 6Y6KB-N82V8-D8CQV-23MJW-BWTG6
Windows Server Standard | DPCNP-XQFKJ-BJF7R-FRC8D-GF6G4
#### Windows Server LTSC/LTSB 版本
##### Windows Server 2019
操作系统版本 | KMS 客户端安装密钥
---- | ----
Windows Server 2019 Datacenter | WMDGN-G9PQG-XVVXX-R3X43-63DFG
Windows Server 2019 Standard | N69G4-B89J2-4G8F4-WWYCC-J464C
Windows Server 2019 Essentials | WVDHN-86M7X-466 P 6-VHXV7-YY726
##### Windows Server 2016
操作系统版本 | KMS 客户端安装密钥
---- | ----
Windows Server 2016 Datacenter | CB7KF-BWN84-R7R2Y-793K2-8XDDG
Windows Server 2016 Standard | WC2BQ-8NRM3-FDDYY-2BFGV-KHKQY
Windows Server 2016 Essentials | JCKRF-N37P4-C2D82-9YXRT-4M63B
#### Windows 10 中,所有受支持的半年频道版本
操作系统版本 | KMS 客户端安装密钥
---- | ----
Windows 10 专业版 | W269N-WFGWX-YVC9B-4J6C9-T83GX
Windows 10 专业版 N | MH37W-N47XK-V7XM9-C7227-GCQG9
Windows 10 专业工作站 | NRG8B-VKK3Q-CXVCJ-9G2XF-6Q84J
Windows 10 专业工作站 N | 9FNHH-K3HBT-3W4TD-6383H-6XYWF
Windows 10 专业教育版 | 6TP4R-GNPTD-KYYHQ-7B7DP-J447Y
Windows 10 专业教育版 N | YVWGF-BXNMC-HTQYQ-CPQ99-66QFC
Windows 10 教育版 | NW6C2-QMPVW-D7KKK-3GKT6-VCFB2
Windows 10 教育版 N | 2WH4N-8QGBV-H22JP-CT43Q-MDWWJ
Windows 10 企业版 | NPPR9-FWDCX-D2C8J-H872K-2YT43
Windows 10 企业版 N | DPH2V-TTNVB-4X9Q3-TJR4H-KHJW4
Windows 10 企业版 G | YYVX9-NTFWV-6MDM3-9PT4T-4M68B
Windows 10 企业版 G N | 44RPN-FTY23-9VTTB-MP9BX-T84FV
#### Windows 10 LTSC/LTSB 版本
##### Windows 10 LTSC 2019
操作系统版本 | KMS 客户端安装密钥
---- | ----
Windows 10 企业版 LTSC 2019 | M7XTQ-FN8P6-TTKYV-9D4CC-J462D
Windows 10 企业版 N LTSC 2019 | 92NFX-8DJQP-P6BBQ-THF9C-7CG2H
##### Windows 10 LTSB 2016
操作系统版本 | KMS 客户端安装密钥
---- | ----
Windows 10 企业版 LTSB 2016 | DCPHK-NFMTC-H88MJ-PFHPY-QJ4BJ
Windows 10 企业版 N LTSB 2016 | QFFDN-GRT3P-VKWWX-X7T3R-8B639
##### Windows 10 LTSB 2015
操作系统版本 | KMS 客户端安装密钥
---- | ----
Windows 10 企业版 2015 长期服务 | WNMTR-4C88C-JK8YV-HQ7T2-76DF9
Windows 10 企业版 2015 长期服务 N | 2F77B-TNFGY-69QQF-B8YKP-D69TJ
#### 较早版本的 Windows Server
##### Windows Server 2012 R2
操作系统版本 | KMS 客户端安装密钥
---- | ----
Windows Server 2012 R2 Server Standard | D2N9P-3P6X9-2R39C-7RTCD-MDVJX
WindowsServer 2012 R2 Datacenter | W3GGN-FT8W3-Y4M27-J84CP-Q3VJ9
WindowsServer 2012 R2 Essentials | KNC87-3J2TX-XB4WP-VCPJV-M4FWM
##### Windows Server 2012
操作系统版本 | KMS 客户端安装密钥
---- | ----
Windows Server 2012 | BN3D2-R7TKB-3YPBD-8DRP2-27GG4
Windows Server 2012 N | 8N2M2-HWPGY-7PGT9-HGDD8-GVGGY
Windows Server 2012 单语言版 | 2WN2H-YGCQR-KFX6K-CD6TF-84YXQ
Windows Server 2012 特定国家/地区版 | 4K36P-JN4VD-GDC6V-KDT89-DYFKP
Windows Server 2012 Server Standard | XC9B7-NBPP2-83J2H-RHMBY-92BT4
Windows Server 2012 MultiPoint Standard | HM7DN-YVMH3-46JC3-XYTG7-CYQJJ
Windows Server 2012 MultiPoint Premium | XNH6W-2V9GX-RGJ4K-Y8X6F-QGJ2G
Windows Server 2012 Datacenter | 48HP8-DN98B-MYWDG-T2DCC-8W83P
##### Windows Server 2008 R2
操作系统版本 | KMS 客户端安装密钥
---- | ----
Windows Server 2008 R2 Web 版 | 6TPJF-RBVHG-WBW2R-86QPH-6RTM4
Windows Server 2008 R2 HPC 版 | TT8MH-CG224-D3D7Q-498W2-9QCTX
WindowsServer 2008 R2 Standard | YC6KT-GKW9T-YTKYR-T4X34-R7VHC
WindowsServer 2008 R2 企业版 | 489J6-VHDMP-X63PK-3K798-CPX3Y
WindowsServer 2008 R2 Datacenter | 74YFP-3QFB3-KQT8W-PMXWJ-7M648
面向基于 Itanium 系统的 Windows Server 2008 R2 | GT63C-RJFQ3-4GMB6-BRFB9-CB83V
##### Windows Server 2008
操作系统版本 | KMS 客户端安装密钥
---- | ----
Windows Web Server 2008 | WYR28-R7TFJ-3X2YQ-YCY4H-M249D
Windows Server 2008 Standard | TM24T-X9RMF-VWXK6-X8JC9-BFGM2
不带 Hyper-V 的 Windows Server 2008 Standard | W7VD6-7JFBR-RX26B-YKQ3Y-6FFFJ
Windows Server 2008 企业版 | YQGMW-MPWTJ-34KDK-48M3W-X4Q6V
不带 Hyper-V 的 Windows Server 2008 企业版 | 39BXF-X8Q23-P2WWT-38T2F-G3FPG
Windows Server 2008 HPC | RCTX3-KWVHP-BR6TB-RB6DM-6X7HP
Windows Server 2008 Datacenter | 7M67G-PC374-GR742-YH8V4-TCBY3
不带 Hyper-V 的 Windows Server 2008 Datacenter | 22XQ2-VRXRG-P8D42-K34TD-G3QQC
面向基于 Itanium 系统的 Windows Server 2008 | 4DWFP-JF3DJ-B7DTH-78FJB-PDRHK
#### 早期版本的 Windows
##### Windows 8.1
操作系统版本 | KMS 客户端安装密钥
---- | ----
Windows 8.1 专业版 | GCRJD-8NW9H-F2CDX-CCM8D-9D6T9
Windows 8.1 专业版 N | HMCNV-VVBFX-7HMBH-CTY9B-B4FXY
Windows 8.1 企业版 | MHF9N-XY6XB-WVXMC-BTDCT-MKKG7
Windows 8.1 企业版 N | TT4HM-HN7YT-62K67-RGRQJ-JFFXW
##### Windows 8
操作系统版本 | KMS 客户端安装密钥
---- | ----
Windows 8 专业版 | NG4HW-VH26C-733KW-K6F98-J8CK4
Windows 8 专业版 N | XCVCF-2NXM9-723PB-MHCB7-2RYQQ
Windows 8 企业版 | 32JNW-9KQ84-P47T8-D8GGY-CWCK7
Windows 8 企业版 N | JMNMF-RHW7P-DMY6X-RF3DR-X2BQT
##### Windows 7
操作系统版本 | KMS 客户端安装密钥
---- | ----
Windows 7 专业版 | FJ82H-XT6CR-J8D7P-XQJJ2-GPDD4
Windows 7 专业版 N | MRPKT-YTG23-K7D7T-X2JMM-QY7MG
Windows 7 专业版 E | W82YF-2Q76Y-63HXB-FGJG9-GF7QX
Windows7 企业版 | 33PXH-7Y6KF-2VJC9-XBBR8-HVTHH
Windows 7 企业版 N | YDRBP-3D83W-TY26F-D46B2-XCKRJ
Windows 7 企业版 E | C29WB-22CC8-VJ326-GHFJW-H9DH4
### 激活说明
- KMS 激活有 180 天期限,此期限称为激活有效间隔
- 若要保持激活状态,您的系统必须通过至少每 180 天连接一次 KMS 服务器来续订激活
- 默认情况下,系统每 7 天自动进行一次激活续订尝试
- 在续订客户端激活之后,激活有效间隔重新开始
- 综上所述,只要您不超过 180 天以上无法连接互联网,系统会自行续期保持激活状态
----------
### OfficeVOL 版本)激活步骤(管理员命令执行)
1. 进入安装目录 `cd "C:\Program Files (x86)\Microsoft Office\Office16"`
- 32 位默认一般为 `C:\Program Files (x86)\Microsoft Office\Office16`
- 64 位默认一般为 `C:\Program Files\Microsoft Office\Office16`
- **Office16** 是 **Office 2016**
- **Office15** 是 **Office 2013**
- **Office14** 是 **Office 2010**
- 打开以上所说的目录,应该有个 `OSPP.VBS` 文件
2. 注册KMS服务 `cscript ospp.vbs /sethst:skms.netnr.eu.org`
3. 激活 Office `cscript ospp.vbs /act`
### Office 密钥列表
- Office 2019 & Office 2016 <https://docs.microsoft.com/en-us/DeployOffice/vlactivation/gvlks>
- Office 2013 <https://technet.microsoft.com/zh-cn/library/dn385360.aspx>
- Office 2010 <https://technet.microsoft.com/zh-cn/library/ee624355(v=office.14).aspx>
### Help
- <https://teddysun.com/530.html>
- <https://03k.org/kms.html>
- <http://kms.cangshui.net>
### Source
- <https://github.com/netnr/kms>
- <https://gitee.com/netnr/kms>

116
api/sdocs.js Normal file
View File

@ -0,0 +1,116 @@
const fs = require('fs');
const mime = require("mime");
const marked = require('marked');
module.exports = (req, res) => {
let vd = {
path: req.url.substr(1).split('?')[0].trim(),
dc: {
coverpage: "",
sidebar: "",
navbar: "",
index: "",
body: "",
output: ""
},
init: function () {
vd.dc.coverpage = vd.replaceMdLink(vd.render(vd.read("_coverpage.md", 'utf-8') || ""));
vd.dc.sidebar = vd.replaceMdLink(vd.render(vd.read("_sidebar.md", 'utf-8') || ""));
vd.dc.navbar = vd.replaceMdLink(vd.render(vd.read("_navbar.md", 'utf-8') || ""));
vd.dc.index = vd.read("index.html", 'utf-8') || "";
let nc = false,
ua = req.headers["user-agent"].toLowerCase(),
//文件名
filename = vd.path.split('/').pop().toLowerCase(),
//爬虫
isbot = ["bot", "spider", "daum", "curl", "postman"].filter(key => ua.indexOf(key) > -1).length > 0;
if (filename == "" || filename == "index" || filename == "index.html") {
nc = true;
vd.path = "index.html";
vd.dc.body = vd.replaceMdLink(vd.render(vd.read('README.md', 'utf-8') || ""));
vd.dc.ctype = 'text/html; charset=utf-8';
}
let hp = function () {
let tpath = vd.path, tbody = vd.read(tpath);
if (tbody != null) {
vd.dc.output = tbody;
} else {
tpath = vd.path + ".html";
tbody = vd.read(tpath, 'utf-8');
if (tbody != null) {
nc = true;
vd.path = tpath;
vd.dc.body = tbody;
vd.dc.ctype = 'text/html; charset=utf-8';
} else {
tpath = vd.path + ".md";
tbody = vd.read(tpath, 'utf-8');
if (tbody != null) {
nc = true;
vd.path = tpath;
vd.dc.body = vd.replaceMdLink(vd.render(tbody));
vd.dc.ctype = 'text/html; charset=utf-8';
}
}
}
}
if (isbot) {
nc = true;
hp();
} else {
vd.dc.output = vd.read(vd.path);
if (vd.dc.output == null) {
hp();
}
}
if (nc) {
vd.dc.output = vd.dc.index.replace("{SEO}", vd.dc.coverpage + vd.dc.navbar + vd.dc.sidebar + vd.dc.body);
}
res.setHeader('content-type', vd.dc.ctype || mime.getType(vd.path));
//输出
res.send(vd.dc.output);
},
/**
* 读取文件内容
* @param {any} path
* @param {any} ec
*/
read: function (path, ec) {
try {
return fs.readFileSync(path, ec);
} catch (e) {
return null;
}
},
/**
* 解析Markdown
* @param {any} markdown
*/
render: function (markdown) {
return marked(markdown);
},
/**
* 替换Markdown链接
* @param {any} html
*/
replaceMdLink: function (html) {
return html.replace(/href="(.*.md)"/g, function (a) {
return a.replace('.md"', '"');
});
}
}
vd.init();
}

BIN
favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

100
index.html Normal file
View File

@ -0,0 +1,100 @@
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>KMS</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<meta name="keywords" content="kms,netnr,NET牛人" />
<meta name="description" content="kms,netnr,NET牛人" />
<style>
.hide {
display: none;
}
.github-corner svg {
width: 80px;
height: 80px;
}
.sidebar ul li p.active > a {
border-right: 2px solid;
font-weight: 600;
color: #42b983;
}
</style>
</head>
<body>
<div id="app">Loading ...</div>
<!--SEO-->
<div class="hide">
{SEO}
</div>
<link href="https://cdn.jsdelivr.net/npm/netnrmd@2.6.1/src/netnrmd.min.css" rel="stylesheet" async />
<script src="https://cdn.jsdelivr.net/npm/netnrmd@2.6.1/src/netnrmd.bundle.min.js" defer></script>
<script>
window.$docsify = {
repo: 'netnr/kms',
noEmoji: true,
auto2top: true,
relativePath: true,
routerMode: 'history',
markdown: {
renderer: {
code: function (str, lang) {
var ch = [];
ch.push("<pre><code>");
try {
str = hljs.getLanguage(lang)
? hljs.highlight(lang, str).value
: hljs.highlightAuto(str).value;
ch.push(str);
} catch (__) {
ch.push(str);
}
ch.push("</code></pre>");
return ch.join('');
}
}
},
search: {
placeholder: {
'/': '搜索'
},
noData: {
'/': '找不到结果'
},
depth: 6,
}
};
function get(url, success) {
var xhr = new XMLHttpRequest();
xhr.open('GET', url, true);
xhr.send();
xhr.onreadystatechange = function () {
if (xhr.readyState == 4 && xhr.status == 200) {
success(xhr.responseText)
}
};
}
get('https://cdn.jsdelivr.net/npm/docsify@4.11.6/lib/themes/vue.css', function (res) {
var ele = document.createElement("STYLE");
ele.innerHTML = "*" + res.split(';*')[1];
document.getElementsByTagName("HEAD")[0].appendChild(ele);
})
</script>
<script src="https://cdn.jsdelivr.net/npm/docsify@4.11.6/lib/docsify.min.js" defer></script>
<script src="https://cdn.jsdelivr.net/npm/docsify@4.11.6/lib/plugins/search.min.js" defer></script>
</body>
</html>

17
package.json Normal file
View File

@ -0,0 +1,17 @@
{
"name": "sdocs",
"version": "0.0.1",
"description": "serverless docs",
"main": "index.js",
"keywords": [
"netnr",
"sdocs",
"serverless docs"
],
"author": "netnr",
"license": "MIT",
"dependencies": {
"marked": "^1.2.7",
"mime": "^2.5.0"
}
}

28
vercel.json Normal file
View File

@ -0,0 +1,28 @@
{
"version": 2,
"functions": {
"api/sdocs.js": {
"includeFiles": "./**"
}
},
"routes": [
{
"src": "/(.*)",
"headers": {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, OPTIONS",
"Access-Control-Allow-Headers": "Accept, Authorization, Cache-Control, Content-Type, DNT, If-Modified-Since, Keep-Alive, Origin, User-Agent, X-Requested-With, Token, x-access-token"
},
"continue": true
},
{
"src": "/(.*)",
"dest": "/api/sdocs.js",
"continue": true
}
]
}