-
-
Notifications
You must be signed in to change notification settings - Fork 2
plugin cdn
Cache purging, HMAC-SHA256 signed URL generation, and multi-provider CDN management. Pro plugin — requires license.
| Tier | Monthly | Annual | Includes this plugin? |
|---|---|---|---|
| Free | $0 | $0 | No |
| Basic | $0.99/mo | $9.99/yr | Yes |
| ɳSelf+ | $3.99/mo | $39.99/yr | Yes |
Minimum tier: Basic (this is a tier: pro plugin per F07-PRICING-TIERS).
This plugin is not currently part of a named bundle. Purchase any per-license subscription (Basic and up) for access.
Or get all bundles + all apps via ɳSelf+ ($3.99/mo or $39.99/yr).
nself license set nself_pro_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
nself plugin install cdn
nself buildThe license is validated against ping.nself.org/license/validate. Insufficient tier returns an error with a link to upgrade.
The CDN plugin connects your nSelf instance to Cloudflare and BunnyCDN, exposing cache purging, signed URL generation, and zone management through a single REST API on port 3036.
Cache purge requests are submitted by URL, wildcard pattern, or full-zone sweep. Every purge is logged to the np_cdn_purge_requests table so you can audit what was cleared, when, and by whom. Signed URLs use HMAC-SHA256 with a configurable expiry and are written to np_cdn_signed_urls for revocation tracking.
Analytics sync is scaffolded but not yet active — the analytics command returns stored snapshots from prior manual calls; automatic periodic sync from the CDN provider is a planned feature.
- Log in to dash.cloudflare.com and go to My Profile > API Tokens.
- Create a token with the Zone > Cache Purge permission (and optionally Zone > Analytics > Read for future analytics sync).
- Copy your Zone ID from the zone's Overview sidebar.
- Set the following env vars:
CDN_CLOUDFLARE_API_TOKEN=your_cloudflare_api_token
CDN_CLOUDFLARE_ZONE_IDS=zone1id,zone2id # comma-separated for multiple zones
CDN_PROVIDER=cloudflare- Log in to bunny.net and go to Account > API.
- Copy your API Key from the account settings page.
- Copy the Pull Zone ID(s) from each Pull Zone's configuration panel.
- Set the following env vars:
CDN_BUNNYCDN_API_KEY=your_bunny_api_key
CDN_BUNNYCDN_PULL_ZONE_IDS=zone1id,zone2id # comma-separated
CDN_PROVIDER=bunnycdnSigned URLs require a secret signing key and an optional default TTL:
CDN_SIGNING_KEY=your_secret_signing_key # min 32 random bytes, base64-safe
CDN_SIGNED_URL_TTL=3600 # default expiry in seconds (1 hour)| Env Var | Default | Description |
|---|---|---|
DATABASE_URL |
— | Postgres connection string (auto-provided by nSelf) |
CDN_API_KEY |
— | API key for inter-plugin auth (auto-provided by nSelf) |
CDN_PROVIDER |
— | Active provider: cloudflare or bunnycdn
|
CDN_CLOUDFLARE_API_TOKEN |
— | Cloudflare API token with Cache Purge permission |
CDN_CLOUDFLARE_ZONE_IDS |
— | Comma-separated Cloudflare zone IDs |
CDN_BUNNYCDN_API_KEY |
— | BunnyCDN account API key |
CDN_BUNNYCDN_PULL_ZONE_IDS |
— | Comma-separated BunnyCDN pull zone IDs |
CDN_SIGNING_KEY |
— | Secret key for HMAC-SHA256 signed URL generation |
CDN_SIGNED_URL_TTL |
3600 |
Default signed URL expiry in seconds |
CDN_PURGE_BATCH_SIZE |
30 |
Max URLs per purge API call |
CDN_ANALYTICS_SYNC_INTERVAL |
86400 |
Analytics poll interval in seconds (future use) |
CDN_RATE_LIMIT_MAX |
100 |
Max requests per rate-limit window |
CDN_RATE_LIMIT_WINDOW_MS |
60000 |
Rate-limit window duration in ms |
CDN_PORT |
3036 |
Port the CDN plugin service listens on |
| Port | Purpose |
|---|---|
3036 |
CDN plugin HTTP service |
4 tables are added to your Postgres database under the np_cdn_* prefix.
| Table | Description |
|---|---|
np_cdn_zones |
CDN zone registry (provider, zone ID, label) |
np_cdn_purge_requests |
Audit log of all cache purge operations |
np_cdn_signed_urls |
Issued signed URL records with expiry and status |
np_cdn_analytics |
Cached analytics snapshots from CDN providers |
All tables include source_account_id TEXT NOT NULL DEFAULT 'primary' for multi-app isolation per the Multi-Tenant Convention Wall.
POST /api/v1/purge
Authorization: Bearer <CDN_API_KEY>
{
"zone_id": "zone1id",
"urls": ["https://cdn.example.com/assets/app.js"],
"wildcard": "*.css",
"purge_all": false
}
Retrieve purge history:
GET /api/v1/purge-requests
Authorization: Bearer <CDN_API_KEY>
| Route | Description |
|---|---|
/cdn/ |
Proxied to CDN plugin service on port 3036 |
# Initialize database schema
nself plugin cdn init
# Add a Cloudflare zone
nself plugin cdn zones add my-zone cloudflare abc123zoneID
# Purge specific URLs
nself plugin cdn purge abc123zoneID --urls https://cdn.example.com/app.js,https://cdn.example.com/app.css
# Purge all CSS files (wildcard)
nself plugin cdn purge abc123zoneID --wildcard "*.css"
# Full-zone cache flush
nself plugin cdn purge abc123zoneID --all
# Generate a signed URL (expires in 1 hour)
nself plugin cdn sign https://cdn.example.com/private/file.mp4 --ttl 3600
# View plugin statistics
nself plugin cdn statusSource-available (license required to run): plugins-pro/paid/cdn/
Note: plugins-pro is a private repository. Source access is granted to ɳSelf+ subscribers and Enterprise customers.
- plugin-cloudflare — Cloudflare DNS, Workers, and Pages management
- plugin-object-storage — S3-compatible object storage for CDN origin content
- Pricing — tier comparison
- Plugins — full plugin index
ɳSelf CLI v1.0.9. MIT licensed. Docs CC BY 4.0.
GitHub · Issues · Discussions · nself.org · docs.nself.org
Getting Started
Commands
- Commands, Overview
- Lifecycle: cmd-init · cmd-build · cmd-start · cmd-stop · cmd-restart · cmd-dev
- Monitoring: cmd-status · cmd-logs · cmd-health · cmd-urls · cmd-doctor · cmd-monitor · cmd-alerts · cmd-sentry · cmd-watchdog · cmd-dogfood
- Data: cmd-db · cmd-backup · cmd-dr · cmd-queue · cmd-webhooks
- Config: cmd-config · cmd-service · cmd-env · cmd-promote
- Networking: cmd-ssl · cmd-trust · cmd-dns-setup
- Security: cmd-security · cmd-secrets · cmd-waf
- Tenancy: cmd-tenant · cmd-billing
- Plugins: cmd-plugin · cmd-license
- AI: cmd-ai · cmd-claw · cmd-model
- Templates: cmd-template
- Utilities: cmd-exec · cmd-clean · cmd-reset · cmd-update · cmd-upgrade · cmd-version · cmd-admin · cmd-migrate · cmd-migrate-firebase · cmd-migrate-supabase · cmd-completion
Features
- Features, Overview
- Feature-Auth
- Feature-Storage
- Feature-Search
- Feature-Functions
- Feature-Email
- Feature-Monitoring
- Feature-Plugins
- Feature-ɳClaw, AI Assistant
- Feature-ɳChat, Messaging
- Feature-ɳTV, Media Player
- Feature-ɳFamily, Family Social
- Feature-ɳCloud, Managed Hosting
- Feature-Memory-Rooms, Knowledge Organization
- Feature-Agent-Dashboard, Agent Metrics
- Feature-Image-Generation, AI Image Generation
Configuration
- Configuration, Overview
- Config-Env-Vars
- Config-Postgres
- Config-Hasura
- Config-Auth
- Config-Nginx
- Config-Optional-Services
- Config-Custom-Services
- Config-System
Plugins (87 + 10 monitoring)
Free (25)
- plugin-backup
- plugin-content-acquisition
- plugin-content-progress
- plugin-cron
- plugin-donorbox
- plugin-feature-flags
- plugin-github
- plugin-github-runner
- plugin-invitations
- plugin-jobs
- plugin-link-preview
- plugin-mdns
- plugin-mlflow
- plugin-monitoring
- plugin-notifications
- plugin-notify
- plugin-paypal
- plugin-search
- plugin-shopify
- plugin-stripe
- plugin-subtitle-manager
- plugin-tokens
- plugin-torrent-manager
- plugin-vpn
- plugin-webhooks
Pro (62)
- plugin-access-controls
- plugin-activity-feed
- plugin-admin-api
- nself-ai-gateway
- nself-ai-cc
- nself-ai-mcp
- plugin-analytics
- plugin-auth
- plugin-backup-pro
- plugin-bots
- plugin-browser
- plugin-calendar
- plugin-cdn
- plugin-chat
- plugin-claw
- plugin-claw-budget
- plugin-claw-news
- plugin-claw-web
- plugin-cloudflare
- plugin-cms
- plugin-compliance
- plugin-cron-pro
- plugin-ddns
- plugin-devices
- plugin-documents
- plugin-donorbox-pro
- plugin-entitlements
- plugin-epg
- plugin-file-processing
- plugin-game-metadata
- plugin-geocoding
- plugin-geolocation
- plugin-google
- plugin-home
- plugin-idme
- plugin-knowledge-base
- plugin-linkedin
- plugin-livekit
- plugin-media-processing
- plugin-meetings
- plugin-moderation
- plugin-mux
- plugin-notify-pro
- plugin-object-storage
- plugin-observability
- plugin-paypal-pro
- plugin-photos
- plugin-podcast
- plugin-post
- plugin-realtime
- plugin-recording
- plugin-retro-gaming
- plugin-rom-discovery
- plugin-shopify-pro
- plugin-social
- plugin-sports
- plugin-stream-gateway
- plugin-streaming
- plugin-stripe-pro
- plugin-support
- plugin-tmdb
- plugin-voice
- plugin-web3
- plugin-workflows
Planned (26)
plugin-auditplugin-blogplugin-checkoutplugin-commerceplugin-drmplugin-exportplugin-flowplugin-importplugin-ldapplugin-mailgunplugin-mediaplugin-oauth-providersplugin-pagesplugin-postmarkplugin-rate-limitplugin-reportsplugin-samlplugin-schedulerplugin-sendgridplugin-ssoplugin-subscriptionplugin-thumbplugin-transcoderplugin-twilioplugin-wafplugin-watermark
Guides
- Guide-Production-Deployment
- Guide-SSL-Setup
- Guide-Multi-Tenancy
- Guide-Security-Hardening
- Guide-Monitoring-Setup
- Guide-Backup-Restore
- Guide-Custom-Services
- Guide-Migration-from-v1
Architecture
Reference
- API-Reference
- reference-error-codes, Error Codes
Licensing
Security
Brand
Operations
- operations/release-cascade, Release Cascade
- operations/self-healing, Self-Healing Schema
- operations/redis-tuning, Redis Pool Tuning
- operations/meilisearch-warmup, MeiliSearch Warm-Up
- operations/jwt-rotation, JWT Key Rotation
- operations/windows-wsl2-setup, Windows / WSL2 Setup
- operations/gemini-oauth-reauth, Gemini OAuth Reauth
Contributing
Admin
- USER-ACTION-QUEUE, Pending Admin Actions