npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@waline-tscf/avatar

v1.0.0-beta.3

Published

A comment system avatar proxy compatible with Tencent SCF deployment based on Waline

Downloads

6

Readme

waline-tscf-avatar

waline-tscf的Avatar代理,部署在cloudfare。

waline-tscf:一个基于 Waline 的评论系统,专为 腾讯云函数 SCF 部署场景优化,增强后端性能,优化个人博客的前端样式。

主要特性

  • 前端:admin/client
    • 样式定制:更改默认主题,定制个人博客样式
  • 后端:server
    • SCF支持:适配腾讯云函数serverless运行环境,提供快速部署模板
    • 功能增强:优化注册登录及邮件通知逻辑,支持通过环境变量输出多维度日志记录
    • 隐私保护:针对QQ邮箱头像获取,采用AES-256-GCM加密(需部署waline-tscf-avatar服务)
    • 性能优化:通过依赖懒加载提升冷启动速度,结合缓存与map策略优化热启动性能
    • 资源加速:采用 jsDelivr 提供CDN加速,针对性优化MongoDB的连接性能

Avatar代理

本仓库包含一个简单的 Avatar 代理示例(见 index.js),用于在边缘统一代理头像请求并可选地解密带密文的头像 URL。代理支持两种请求方式:

主要功能

  • 支持明文和 AES-256-GCM 加密两种模式(通过 AVATAR_PROXY_KEY 环境变量配置)
  • 请求来源域名白名单校验(通过 ALLOWED_DOMAINS 环境变量配置)
  • 边缘缓存优化(由 Cloudflare CDN 自动处理)
  • 防止 SSRF 攻击和滥用

快速开始

  1. 克隆仓库

    git clone https://github.com/abiscuitx/waline-tscf-avatar.git
    cd waline-tscf-avatar
  2. 安装 Wrangler CLI(如果还没有安装)

    npm install -g wrangler
  3. 登录 Cloudflare

    wrangler login
  4. 配置环境变量

    编辑 wrangler.toml,设置允许访问此 Worker 的来源域名白名单:

    [vars]
    ALLOWED_DOMAINS = "example.com,blog.example.com,your-blog-domain.com"
  5. 设置加密密钥(如果使用加密模式)

    wrangler secret put AVATAR_PROXY_KEY
    # 输入你的密钥(与 waline-tscf 后端配置的密钥保持一致)
  6. 部署到 Cloudflare Workers

    wrangler deploy

加密细节

  • 使用 AES-GCM(AES-256-GCM)进行加密/解密。
  • 密钥的派生:将 AVATAR_PROXY_KEY 的 UTF-8 bytes 做 SHA-256,得到 32 字节的 AES 密钥。
  • 密文格式(二进制拼接后 Base64 编码,再做 URL 编码传入):
    • IV(12 字节) + 密文(ciphertext) + Tag(16 字节)

API 请求示例

  • 明文模式:

    GET https://your-worker.workers.dev/?url=https%3A%2F%2Fexample.com%2Favatar.jpg
    Referer: https://your-blog-domain.com/
  • 加密模式:

    GET https://your-worker.workers.dev/?e=<加密参数>
    Referer: https://your-blog-domain.com/

部署配置

在 Cloudflare Worker 中部署时,需要配置以下环境变量(在 dashboard 的 Variables 或使用 wrangler.tomlvars 配置):

  • AVATAR_PROXY_KEY: 用于解密加密参数 e 的密钥(如果使用加密模式)
  • ALLOWED_DOMAINS: 请求来源域名白名单,多个域名用英文逗号分隔(例如:example.com,blog.example.com,your-site.com
    • 如果配置了此变量,Worker 只会接受来自白名单域名的请求(通过检查 RefererOrigin 请求头),其他来源会返回 403 错误
    • 如果不配置此变量,则允许所有来源访问(不推荐,可能导致 Worker 被滥用)
    • 支持精确匹配和子域名匹配(例如配置 example.com 会同时允许 example.comsub.example.com

安全与隐私

  • 密钥管理:请妥善保管 AVATAR_PROXY_KEY,不要硬编码在仓库中。使用 Cloudflare 的环境变量/Secrets 管理功能(推荐使用 wrangler secret put 命令设置)
  • 来源域名白名单:强烈建议配置 ALLOWED_DOMAINS 环境变量,限制只有你的网站可以调用此 Worker,防止被他人滥用消耗你的 Cloudflare Workers 配额