← 返回
未分类 中文

Md Viewer

LAN-accessible web viewer for Markdown files optimized for e-readers. Auto-binds to LAN IP for easy access. TRIGGER when user says "cho tôi xem", "show me",...
局域网可访问的 Markdown 文件网页查看器,针对电子书阅读器优化,自动绑定局域网 IP 便于访问。触发词:"cho tôi xem", "show me"等。
hoangcongst hoangcongst 来源
未分类 clawhub v1.0.2 1 版本 100000 Key: 无需
★ 0
Stars
📥 381
下载
💾 0
安装
1
版本
#latest

概述

MD Viewer

Key Principle

When user says "show me the file", "view this file":

  • ❌ DO NOT read and summarize the content
  • ✅ DO generate LAN link for user to view directly

User wants to VIEW the file themselves, not hear a summary.

Security Features

  • Only .md files - Blocks all other file types
  • Blocked paths - Cannot access /etc, ~/.ssh, ~/.gnupg, etc.
  • Password protection - Auto-generated password with cookie auth (30 days)
  • XSS protection - HTML sanitized with bleach library
  • CSP headers - Content Security Policy enforced
  • Auto LAN IP binding - Binds to LAN IP automatically
  • Link sharing - Token in URL for one-time access, saves cookie for future
  • No caching - Files always refresh on page reload

Workflow

Step 1: Start Server (Auto-generates password and binds to LAN)

python3 ~/.openclaw/skills/md-viewer/scripts/server.py

Output:

============================================================
📄 MD Viewer Server Started
============================================================
Local:    http://localhost:8765
Network:  http://10.0.10.93:8765
------------------------------------------------------------
🔐 Password: a1b2c3d4e5f6
   ⚠️  SAVE THIS PASSWORD - Required for login!
============================================================

Step 2: Share Link

Links include password token for easy sharing:

http://10.0.10.93:8765/view?path=/path/to/file.md&token=PASSWORD

Step 3: Access

  1. Click link → Auto-authenticated via token
  2. Password saved to cookie (30 days)
  3. Future visits → Auto-authenticated via cookie

Server Options

python3 ~/.openclaw/skills/md-viewer/scripts/server.py [options]

Options:
  --host HOST          Host to bind (default: auto-detect LAN IP)
  --port PORT          Port (default: 8765)
  --password PASSWORD  Custom password (auto-generated if not set)
  --no-history         Disable history tracking for privacy
  --localhost          Bind to localhost only (no LAN access)

Blocked Paths

Automatically blocked:

  • System: /etc, /proc, /sys, /dev, /var/log
  • SSH: ~/.ssh/, id_rsa, id_dsa, etc.
  • GPG: ~/.gnupg/
  • Cloud: ~/.aws/, ~/.gcp/
  • Passwords: .netrc, .pgpass, .env
  • Certs: .pem, .key, .p12, .pfx

Features

  • Light theme (e-ink optimized)
  • Serif fonts for comfortable reading
  • High contrast for e-readers
  • Syntax highlighting
  • Mobile-friendly UI
  • History tracking (50 files, enabled by default)
  • Cookie-based authentication (30 days)
  • XSS protection with bleach
  • Auto LAN IP binding

Dependencies

pip3 install markdown bleach

Resources

scripts/

  • server.py - Web server with security features
  • md-link.py - Link generator helper

版本历史

共 1 个版本

  • v1.0.2 当前
    2026-05-07 04:54 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-agent

self-improving agent

pskoett
捕获经验教训、错误及修正内容,以实现持续改进。适用于以下场景:(1)命令或操作意外失败;(2)用户纠正Claude(如“不,那不对……”“实际上……”);(3)用户请求的功能不存在;(4)外部API或工具出现故障;(5)Claude发现自身
★ 4,082 📥 810,505
ai-agent

Skill Vetter

spclaudehome
AI智能体技能安全预审工具。安装ClawdHub、GitHub等来源技能前,检查风险信号、权限范围及可疑模式。
★ 1,227 📥 267,876
dev-programming

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 676 📥 325,463