Cloudsteading
Grid light
Grid light

Davflare

An R2 file library with WebDAV, protected sharing and browser uploads.

Davflare is a self-hosted Dropbox alternative built on Cloudflare (Pages, R2). Free tier eligible within limits. Inspect the source and license in the linked repository.

Source & license

Upstream license: MIT

License TL;DR

You can use it, change it, self-host it and sell it. Keep the original copyright and license notice with copies of the code. You don’t have to publish your changes. The authors don’t promise it will work.

Explain MIT in plain English →

Summary of the main license. Separate packages and assets can have different terms.

Inspect repository ↗Read this project’s actual license ↗

Repository owner

@fanchenggang

See the upstream repository for the original creator and contributors.

Maintain this project? Maintainer verification →README badge, corrections or removal →

Cloudflare hosting

Free tier eligible within limits

The reviewed Cloudflare deployment is eligible for Free-plan allowances for the stated small workload and feature scope. Usage limits, CPU, required account setup and separate services apply.

Hosting requirements
  • Activate R2 with a payment method and deploy the Pages application against your own BUCKET, credentials and resource names.
  • Keep total Standard R2 storage within 10 GB-month, Class A operations within 1 million/month and Class B operations within 10 million/month.
  • Keep dynamic Pages Functions traffic and CPU within Workers Free limits; large ZIP creation and large-file workloads may need a paid plan.
  • The default recycle-bin retention is 30 days and still consumes storage; custom domains are optional and may cost separately.
  • Dynamic Pages Functions requests share the Workers account allowance; only requests that do not invoke Functions count as free unlimited static asset requests.
  • R2 Standard allowance: 10 GB-month storage, 1 million Class A and 10 million Class B operations/month; account activation may require billing setup, and other storage classes are excluded.
Check current pricing ↗
Review findings & limitations
  • Source-reviewed at a pinned commit; deployment, screenshots and behavior were not runtime-tested.
  • Actual Pages config has pages_build_output_dir and only the BUCKET R2 binding.
  • README explicitly requires R2 payment-method activation; free storage is conditional, not an account with no billing setup.
  • MIT notice credits Siyu Long and README credits FlareDrive; preserved provenance.
  • Pinned runtime source review now includes 45 TS/JS files and recognizes handler/router declarations. This is static source evidence, not verification of running deployment, authentication or external service delivery.
Sources checked 01/10/2026

Repository snapshot: 77ef481. Hosting eligibility reflects the deployment documentation and listed assumptions.

  • dropbox ↗

    ip, and a zero-JS landing page - Recycle bin with configurable retention (`TRASH_RETENTION_DAYS`) - WebDAV Class 1/2 at `/webdav` (toggleable without affecting the web UI) - API keys for scripted upload / download / sync, plus remote MCP at `/mcp` (25 tools) - Static sites and image host on a separate hostname (`SITES_HOST`), plus a GitHub Action to deploy from CI - Owner Settings with five persistent feature switches - `davflare-cli`, optional Chrome MV3 extension, and agent layouts on R2 - Chinese / English UI ## Quick start 1. Open [Workers & Pages → Create](

  • pages ↗

    name = "davflare" pages_build_output_dir = "build" compatibility_date = "2024-06-20" [vars] WEBDAV_PUBLIC_READ = "0" # SITES_HOST is set as a Cloudflare Pages environment variable in the dashboard # (production/preview), NOT hard-coded here, so a deploy cannot override it. # Empty/missing SITES_HOST = static sites stay off. [[r2_buckets]] binding = "BUCKET" bucket_name = "webdav"

  • r2 ↗

    cannot override it. # Empty/missing SITES_HOST = static sites stay off. [[r2_buckets]] binding = "BUCKET" bucket_name = "webdav"

  • free-tier-eligible ↗

    name = "davflare" pages_build_output_dir = "build" compatibility_date = "2024-06-20" [vars] WEBDAV_PUBLIC_READ = "0" # SITES_HOST is set as a Cloudflare Pages environment variable in the dashboard # (production/preview), NOT hard-coded here, so a deploy cannot override it. # Empty/missing SITES_HOST = static sites stay off. [[r2_buckets]] binding = "BUCKET" bucket_name = "webdav"

  • free-tier-eligible ↗

    s.cloudflare.com/workers/platform/pricing/#how-to-switch-usage-models). ### Static asset requests On both free and paid plans, requests to static assets are free and unlimited. A request is considered static when it does not invoke Functions. Refer to [Functions invocation routes](https://developers.cloudflare.com/pages/functions/routing/#functions-invocation-routes) to learn more about when Functions are invoked. ## Free Plan Requests to your Pages Functions count towards your quota for the Workers Free plan. For example, you could use 50,000 Functions reques

  • free-tier-eligible ↗

    f you have retrieved data (for infrequent access storage) for 1.1 GB, you will be billed for 2 GB. ### Free tier You can use the following amount of storage and operations each month for free. | | Free | | --- | --- | | Storage | 10 GB-month / month | | Class A Operations | 1 million requests / month | | Class B Operations | 10 million requests / month | | Egress (data transfer to Internet) | Free <sup>[1](#user-content-fn-1)</sup> | Caution The free tier only applies to Standard storage, and does not apply to Infrequent Access storage. ### Storage usage S

  • MIT ↗

    MIT License Copyright (c) 2026 Siyu Long 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

  • architecture ↗

    name = "davflare" pages_build_output_dir = "build" compatibility_date = "2024-06-20" [vars] WEBDAV_PUBLIC_READ = "0" # SITES_HOST is set as a Cloudflare Pages environment variable in the dashboard # (production/preview), NOT hard-coded here, so a deploy cannot override it. # Empty/missing SITES_HOST = static sites stay off. [[r2_buckets]] binding = "BUCKET" bucket_name = "webdav"

Upstream screenshot · fanchenggang/Davflare repository contributors ↗. Depicts the upstream project. We have not deployed and tested a fresh installation here.

What it can replace

Compare the workflow you need. These mappings describe overlap; full feature parity requires a separate comparison.

Dropbox logoDropbox ↗

Editorial workflow alternative: Browser file storage, folder management and protected sharing; no claim of native device sync or enterprise collaboration parity.

See supporting source ↗
Workflow overlap
Pricing not verified
→ Pages + R2

How it works

The shape of Davflare on Cloudflare, and how it stacks up against the rented tools it replaces.

Architecture

Diagram of deployment declarations at the reviewed commit. Each app has its own entrypoint; declared resources do not prove runtime calls. Follow file and line sources below.

View upstream source ↗
Public interface
Configured entry points1
davflare
wrangler.toml
↓
App
davflare
entry
Cloudflare Pages
↓

Configuration and workflow sources

Reviewed commit 77ef48128670. This configuration evidence comes from reading source files. Execution checks, when available, appear in the project's runtime review.

Deployment configuration · 1 file
wrangler.toml ↗

Cloudflare Pages · compatibility 2024-06-20

davflare · default

  • BUCKET → R2

Named environments are separate deployments. Bindings are shown only where declared. Configured routes are URL patterns, not verified application endpoints.

Runtime source · handlers, binding usage and workflow steps

Observed TypeScript/JavaScript declarations from Worker entrypoints and resolved relative imports. Calls and workflow steps may run conditionally; their listed order is not a proven end-to-end request flow. Router declarations may be mounted under a prefix or may not be registered. This shows code wiring, not a successful deployment or runtime test. Dynamic wiring, aliases and generated code may not resolve.

functions/_mcp.ts ↗
  • L55 · asOptionalNumber calls (conditional paths may differ): Number.isFinite
  • L65 · callTool calls (conditional paths may differ): asString, asOptionalNumber, wrapApiResponse, apis.list, toolError, Object.prototype.hasOwnProperty.call, decodeUploadContent, Math.floor, path.replace, multipartUploadTool, asOptionalBoolean, apis.upload, downloadPartTool, apis.download, Number, response.headers.get, Number.isFinite, response.arrayBuffer, isUtf8Text, toolText
  • L456 · dispatchMcpRequest calls (conditional paths may differ): rpcResult, initializeResult, parseToolCall, rpcError, callTool
functions/_flags.ts ↗
  • L39 · normalizeFeatureFlags calls (conditional paths may differ): Array.isArray, pick
  • L55 · parseConfigPatch calls (conditional paths may differ): Array.isArray
  • L76 · loadFeatureFlags calls (conditional paths may differ): bucket.get, normalizeFeatureFlags, object.json
  • L86 · saveFeatureFlags calls (conditional paths may differ): bucket.put, JSON.stringify
  • L106 · isInternalWebIo calls (conditional paths may differ): trim, request.headers.get
  • L110 · isDriveWebDavPath calls (conditional paths may differ): pathname.startsWith
  • L114 · isDriveMcpPath calls (conditional paths may differ): pathname.startsWith
  • L123 · gateDriveProductRoute calls (conditional paths may differ): isDriveWebDavPath, isInternalWebIo, featureDisabledResponse, isDriveMcpPath
functions/_mcpAgent.ts ↗
  • L23 · isSiteSlug calls (conditional paths may differ): SITE_SLUG_RE.test
  • L27 · isAgentLayoutType calls (conditional paths may differ): includes
  • L32 · mcpJsonHasRawSecrets calls (conditional paths may differ): test, bearer.exec, replace
  • L45 · normalizeAgentSlug calls (conditional paths may differ): toLowerCase, raw.trim, AGENT_SLUG_RE.test
  • L57 · normalizeProjectName calls (conditional paths may differ): raw.trim, name.includes, includes
  • L75 · agentLayerPrefixes calls (conditional paths may differ): toLowerCase, opts.type.trim, isAgentLayoutType, normalizeAgentSlug, normalizeProjectName, layers.push
  • L112 · agentPushPrefix calls (conditional paths may differ): agentLayerPrefixes
  • L121 · sanitizeAgentRelPath calls (conditional paths may differ): replace, raw.trim, filter, trimmed.split, parts.some, part.includes, parts.join
  • L134 · listFolderPages calls (conditional paths may differ): apis.list, response.text, readJsonBody, Array.isArray, isPlainObject, items.push, item.key.replace
  • L169 · walkFolderFiles calls (conditional paths may differ): root.replace, listFolderPages, queue.push, files.push, queue.shift, seen.has, seen.add
  • L202 · readPulledFile calls (conditional paths may differ): apis.stat, readJsonBody, Number.isFinite, downloadPartTool, JSON.parse, apis.download, response.text, Number, response.headers.get, response.arrayBuffer, isUtf8Text, decode, encodeBase64
  • L271 · uploadBytes calls (conditional paths may differ): toolError, Math.floor, folder.replace, multipartUploadTool, wrapApiResponse, apis.upload
functions/_contentType.ts ↗
  • L7 · withUtf8Charset calls (conditional paths may differ): test
functions/_mcpBytes.ts ↗
  • L2 · decodeBase64 calls (conditional paths may differ): value.replace, atob, binary.charCodeAt
  • L11 · encodeBase64 calls (conditional paths may differ): String.fromCharCode.apply, Array.from, bytes.subarray, btoa
  • L23 · decodeUploadContent calls (conditional paths may differ): toLowerCase, trim, encode, decodeBase64
  • L41 · isUtf8Text calls (conditional paths may differ): decode, text.indexOf
functions/_images.ts ↗
  • L24 · createImageId calls (conditional paths may differ): crypto.getRandomValues, join, map, Array.from, padStart, b.toString
  • L32 · isImageId calls (conditional paths may differ): IMAGE_ID_RE.test
  • L37 · parseImagePath calls (conditional paths may differ): pathname.replace, filter, raw.split, IMAGE_ID_RE.test
  • L48 · isSvgContentType calls (conditional paths may differ): toLowerCase, ct.includes, endsWith, filename.toLowerCase
  • L58 · guessImageContentType calls (conditional paths may differ): toLowerCase, trim, split, ALLOWED_IMAGE_TYPES.has, name.endsWith
  • L76 · sanitizeFilename calls (conditional paths may differ): pop, split, name.replace, slice, cleaned.replace
  • L82 · imageResponseHeaders calls (conditional paths may differ): isSvgContentType, headers.set, sanitizeFilename
  • L115 · resolveSitesHostRoute calls (conditional paths may differ): parseImagePath, parseSitesPath
functions/_mcpRpc.ts ↗
  • L13 · isPlainObject calls (conditional paths may differ): Boolean, Array.isArray
  • L17 · parseJsonRpcBody calls (conditional paths may differ): JSON.parse, isPlainObject, Object.prototype.hasOwnProperty.call
  • L91 · wrapApiResponse calls (conditional paths may differ): response.text, response.headers.get, includes, contentType.toLowerCase, JSON.stringify, JSON.parse, toolText
  • L108 · readJsonBody calls (conditional paths may differ): response.json, isPlainObject
  • L117 · parseToolCall calls (conditional paths may differ): isPlainObject, JSON.parse
  • L138 · initializeResult calls (conditional paths may differ): isPlainObject
functions/_middleware.ts ↗
  • L99 · Cloudflare Pages ALL request handler exported · calls context.request.headers.get, context.request.method.toUpperCase, isSitesHost, loadFeatureFlags, resolveSitesHostRoute, sitesNotFound, serveImage, serveSlugSite, path.startsWith, loadSlugForHostname, parseSitesRootPath, url.pathname.startsWith, gateDriveProductRoute, context.next
  • L27 · serveImage calls (conditional paths may differ): bucket.get, imageObjectKey, sitesNotFound, imageResponseHeaders
  • L47 · serveSlugSite calls (conditional paths may differ): context.request.method.toUpperCase, loadSiteConfig, Boolean, sitePasswordAuthorized, sitesUnauthorized, context.env.BUCKET.get, indexFallbackKey, siteSpaKey, sitesResponse, sitesNotFound, siteNotFoundKey, sitesNotFoundPage

Environment references: context.env.BUCKET · context.env.SITES_HOST

functions/_mcpTransfer.ts ↗
  • L14 · multipartUploadTool calls (conditional paths may differ): apis.uploadStart, wrapApiResponse, readJsonBody, toolError, apis.uploadAbort, bytes.subarray, Math.min, apis.uploadPart, fail, parts.push, apis.uploadComplete
  • L76 · downloadPartTool calls (conditional paths may differ): apis.stat, wrapApiResponse, readJsonBody, Number.isFinite, toolError, Math.min, Math.max, Math.floor, Math.ceil, apis.downloadRange, response.arrayBuffer, toolText, JSON.stringify, encodeBase64
  • L124 · zipTool calls (conditional paths may differ): apis.zip, wrapApiResponse, response.arrayBuffer, response.headers.get, exec, decodeURIComponent, pop, filter, path.split, toolError, Math.floor, toolText, JSON.stringify, encodeBase64, Math.min, Math.max, Math.ceil, bytes.subarray
functions/_sites.ts ↗
  • L14 · isValidSlug calls (conditional paths may differ): SLUG_RE.test
  • L39 · hashSitePassword calls (conditional paths may differ): sha256Hex
  • L44 · sitePasswordAuthorized calls (conditional paths may differ): parseBasicAuthHeader, request.headers.get, sha256Hex, timingSafeEqual
  • L73 · siteHostnameKey calls (conditional paths may differ): normalizeHostname
  • L85 · loadSiteConfig calls (conditional paths may differ): bucket.get, siteConfigKey, object.json
  • L126 · normalizeSitesHost calls (conditional paths may differ): replace, toLowerCase, trim
  • L130 · isSitesHost calls (conditional paths may differ): normalizeSitesHost, requestHost.split
  • L138 · normalizeHostname calls (conditional paths may differ): toLowerCase, trim, value.replace, value.split
  • L151 · isValidHostname calls (conditional paths may differ): normalizeHostname, host.includes, test, host.split, labels.every, HOSTNAME_LABEL_RE.test
  • L162 · loadSlugForHostname calls (conditional paths may differ): normalizeHostname, isValidHostname, bucket.get, siteHostnameKey, toLowerCase, trim, object.text, isValidSlug
  • L179 · putHostnameIndex calls (conditional paths may differ): normalizeHostname, bucket.put, siteHostnameKey
  • L190 · deleteHostnameIndex calls (conditional paths may differ): normalizeHostname, bucket.delete, siteHostnameKey
  • L203 · parseSitesRootPath calls (conditional paths may differ): slug.toLowerCase, SLUG_RE.test, pathname.replace, filter, map, raw.split, parts.some, part.includes, parts.join, raw.endsWith, file.replace, includes
  • L244 · mimeForKey calls (conditional paths may differ): pop, key.split, base.lastIndexOf, toLowerCase, base.slice
  • L252 · decodeSegment calls (conditional paths may differ): decodeURIComponent
  • L260 · parseSitesPath calls (conditional paths may differ): pathname.replace, filter, map, raw.split, parts.some, part.includes, toLowerCase, SLUG_RE.test, parts.slice, raw.endsWith, rest.join, file.replace, includes
  • L295 · indexFallbackKey calls (conditional paths may differ): key.endsWith
  • L310 · sitesResponse calls (conditional paths may differ): headers.set, mimeForKey
  • L332 · sitesNotFoundPage calls (conditional paths may differ): headers.set
functions/api/_setup.ts ↗
  • L62 · setupDocsHref calls (conditional paths may differ): docsPath
  • L66 · buildMcpJsonSnippet calls (conditional paths may differ): origin.replace, JSON.stringify
  • L93 · probeR2 calls (conditional paths may differ): replace, crypto.randomUUID, toString, Date.now, slice, Math.random, bucket.put, bucket.get, check, got.text, bucket.delete
  • L155 · probeWebDav calls (conditional paths may differ): trim, check, utf8ToBase64, origin.replace, webdavOnRequest
  • L233 · probeFlags calls (conditional paths may differ): loadFeatureFlags, check
  • L244 · probeSitesHost calls (conditional paths may differ): normalizeSitesHost, check, requestHost.split, test, sitesHost.includes
  • L315 · writeProbeApiKey calls (conditional paths may differ): toString, Date.now, rawKey.slice, sha256Hex, toISOString, bucket.put, JSON.stringify
  • L336 · probeMcp calls (conditional paths may differ): check, listStoredKeys, crypto.getRandomValues, join, map, Array.from, padStart, b.toString, writeProbeApiKey, origin.replace, JSON.stringify, authorizeApiKey, dispatchMcpRequest, Array.isArray, bucket.delete
  • L467 · allApplicableGreen calls (conditional paths may differ): checks.every
  • L471 · runSetupChecks calls (conditional paths may differ): request.headers.get, probeR2, probeWebDav, probeFlags, probeSitesHost, probeMcp, allApplicableGreen, origin.replace, buildMcpJsonSnippet

Environment references: env.WEBDAV_USERNAME · env.WEBDAV_PASSWORD · env.BUCKET · env.WEBDAV_PUBLIC_READ · env.SITES_HOST

functions/api/_disposition.ts ↗
  • L7 · contentDisposition calls (conditional paths may differ): replace, name.replace, encodeURIComponent, toUpperCase, toString, ch.charCodeAt
functions/api/archive.ts ↗
  • L70 · Cloudflare Pages POST request handler exported · calls authorizeArchive, request.json, Array.isArray, isInternalKey, decodeRawPath, replace, zipResponse, basename
  • L114 · Cloudflare Pages GET request handler exported · calls authorizeArchive, searchParams.get, normalizeDirKey, env.BUCKET.head, env.BUCKET.list, isCollectionObject, endsWith, trim, textResponse, basename, zipResponse
  • L18 · basename calls (conditional paths may differ): pop, filter, key.split, name.replace
  • L23 · attachmentDisposition calls (conditional paths may differ): contentDisposition
  • L27 · authorizeArchive calls (conditional paths may differ): isSessionOrKeyAuthorized, textResponse
  • L44 · zipResponse calls (conditional paths may differ): buildZipStream, attachmentDisposition

Environment references: env.BUCKET · env.WEBDAV_USERNAME · env.WEBDAV_PASSWORD

functions/api/_zip.ts ↗
  • L21 · extendedTimestampExtra calls (conditional paths may differ): setUint32, Math.floor, mtime.getTime
  • L29 · entryTime calls (conditional paths may differ): date.getUTCFullYear, Number.isNaN, date.getTime
  • L45 · createZipEntry calls (conditional paths may differ): entryTime, name.endsWith, extendedTimestampExtra
  • L55 · listAllObjects calls (conditional paths may differ): bucket.list, objects.push
  • L74 · buildZipStream calls (conditional paths may differ): key.startsWith, key.slice, replace, decodeRawPath, bucket.head, listAllObjects, emptyDirNames.set, rel, fileKeys.add, object.key.startsWith, objectSet.set, some, objectSet.keys, candidate.startsWith, controller.error, controller.enqueue, controller.close, createZipEntry, zip.add, entry.push
functions/api/backup.ts ↗
  • L84 · Cloudflare Pages POST request handler exported · calls authorizeApiKey, readBackupPath, env.BUCKET.head, isCollectionObject, isPrefixOnlyFolder, textResponse, uniqueBackupKey, copyThenDelete, touchLastUsed, jsonResponse, from.lastIndexOf, from.slice, uniqueDirBackupKey, moveDirectory
  • L21 · readBackupPath calls (conditional paths may differ): request.headers.get, includes, contentType.toLowerCase, request.json, textResponse, url.searchParams.get, normalizeFileKey, isInternalKey
  • L42 · uniqueBackupKey calls (conditional paths may differ): conflictBackupKey, bucket.head, base.lastIndexOf, base.slice, splitNameExt, Date.now
  • L64 · uniqueDirBackupKey calls (conditional paths may differ): formatConflictStamp, bucket.head, Date.now

Environment references: env.BUCKET

functions/api/_apikey.ts ↗
  • L17 · jsonResponse calls (conditional paths may differ): JSON.stringify
  • L31 · extractApiKey calls (conditional paths may differ): trim, request.headers.get, authorization.startsWith, authorization.slice
  • L42 · hasApiKeyHeader calls (conditional paths may differ): Boolean, extractApiKey
  • L46 · sha256Hex calls (conditional paths may differ): crypto.subtle.digest, encode, join, map, Array.from, padStart, b.toString
  • L56 · timingSafeEqual calls (conditional paths may differ): a.charCodeAt, b.charCodeAt
  • L67 · utf8ToBase64 calls (conditional paths may differ): encode, String.fromCharCode, bytes.subarray, btoa
  • L78 · utf8FromBase64 calls (conditional paths may differ): atob, binary.charCodeAt, decode
  • L86 · parseBasicAuthHeader calls (conditional paths may differ): exec, authorization.trim, utf8FromBase64, trim, decoded.indexOf, decoded.slice
  • L106 · verifyBasicAuth calls (conditional paths may differ): request.headers.get, utf8ToBase64, timingSafeEqual
  • L119 · isExpired calls (conditional paths may differ): Date.parse, Number.isFinite, Date.now
  • L125 · listStoredKeys calls (conditional paths may differ): bucket.list, object.key.endsWith, jsonKeys.push, Promise.all, jsonKeys.map, bucket.get, data.json, settled.filter
  • L154 · authorizeApiKey calls (conditional paths may differ): loadFeatureFlags, textResponse, extractApiKey, sha256Hex, listStoredKeys, timingSafeEqual, isExpired
  • L187 · touchLastUsed calls (conditional paths may differ): Date.parse, Number.isFinite, Date.now, toISOString, bucket.put, JSON.stringify
  • L203 · isSessionOrKeyAuthorized calls (conditional paths may differ): verifyBasicAuth, authorizeApiKey
  • L214 · isInternalKey calls (conditional paths may differ): key.startsWith, key.includes, key.endsWith
  • L239 · decodeRawPath calls (conditional paths may differ): trim, decodeURIComponent, replace, path.replace
  • L249 · splitSafeParts calls (conditional paths may differ): filter, path.split, parts.some, textResponse
  • L257 · isTruthyParam calls (conditional paths may differ): toLowerCase, raw.trim
  • L264 · normalizeFileKey calls (conditional paths may differ): decodeRawPath, textResponse, splitSafeParts, parts.join, isInternalKey, decoded.endsWith
  • L277 · normalizeDirKey calls (conditional paths may differ): decodeRawPath, textResponse, splitSafeParts, parts.join, isInternalKey
  • L296 · listDescendants calls (conditional paths may differ): bucket.list, isInternalKey, objects.push, textResponse
  • L323 · resolveAsDirectory calls (conditional paths may differ): bucket.head, isCollectionObject, isPrefixOnlyFolder
  • L333 · moveDirectory calls (conditional paths may differ): listDescendants, object.key.slice, bucket.get, bucket.put, bucket.delete
  • L371 · deleteDirectory calls (conditional paths may differ): listDescendants, bucket.delete
  • L384 · splitNameExt calls (conditional paths may differ): name.lastIndexOf, name.slice
  • L390 · formatConflictStamp calls (conditional paths may differ): date.getUTCFullYear, padStart, String, date.getUTCMonth, date.getUTCDate, date.getUTCHours, date.getUTCMinutes, date.getUTCSeconds
  • L400 · conflictBackupKey calls (conditional paths may differ): fromKey.lastIndexOf, fromKey.slice, splitNameExt, formatConflictStamp
  • L408 · isPrefixOnlyFolder calls (conditional paths may differ): bucket.list, Boolean
  • L420 · ensureFolderMarkers calls (conditional paths may differ): filter, split, folder.replace, bucket.head, bucket.put
  • L441 · copyObject calls (conditional paths may differ): bucket.head, textResponse, bucket.get, isCollectionObject, bucket.put
  • L465 · copyThenDelete calls (conditional paths may differ): copyObject, bucket.delete
functions/api/counts.ts ↗
  • L50 · Cloudflare Pages POST request handler exported · calls verifyBasicAuth, textResponse, request.json, Array.isArray, slice, rawPaths.map, Promise.all, paths.map, normalizeDirKey, countDirectChildren, jsonResponse
  • L19 · countDirectChildren calls (conditional paths may differ): bucket.list, isInternalKey

Environment references: env.WEBDAV_USERNAME · env.WEBDAV_PASSWORD · env.BUCKET

functions/api/copy.ts ↗
  • L64 · Cloudflare Pages POST request handler exported · calls authorizeApiKey, readCopyInput, copyObject, touchLastUsed, jsonResponse
  • L16 · readCopyInput calls (conditional paths may differ): request.headers.get, includes, contentType.toLowerCase, request.json, textResponse, url.searchParams.get, isTruthyParam, normalizeFileKey, isInternalKey, to.startsWith

Environment references: env.BUCKET

functions/api/delete.ts ↗
  • L19 · Cloudflare Pages DELETE request handler exported · calls authorizeApiKey, isTruthyParam, url.searchParams.get, normalizeDirKey, isInternalKey, textResponse, env.BUCKET.head, isCollectionObject, resolveAsDirectory, softDeleteKeys, touchLastUsed, jsonResponse, env.BUCKET.delete, deleteDirectory

Environment references: env.BUCKET

functions/api/config.ts ↗
  • L48 · Cloudflare Pages GET request handler exported · calls verifyBasicAuth, textResponse, loadFeatureFlags, jsonResponse, configBody
  • L58 · Cloudflare Pages PATCH request handler exported · calls authorizeConfigWrite, textResponse, request.json, parseConfigPatch, loadFeatureFlags, normalizeFeatureFlags, saveFeatureFlags, jsonResponse, configBody
  • L26 · authorizeConfigWrite calls (conditional paths may differ): verifyBasicAuth, hasApiKeyHeader
  • L36 · configBody calls (conditional paths may differ): normalizeSitesHost

Environment references: env.WEBDAV_USERNAME · env.WEBDAV_PUBLIC_READ · env.SITES_HOST · env.WEBDAV_PASSWORD · env.BUCKET

functions/api/download.ts ↗
  • L71 · Cloudflare Pages GET request handler exported · calls authorizeApiKey, normalizeObjectKey, searchParams.get, request.headers.has, env.BUCKET.get, isPrefixOnlyFolder, textResponse, isCollectionObject, touchLastUsed, withUtf8Charset, headers.set, attachmentDisposition, basename, object.uploaded.toUTCString, calcContentRange, String, Number.isFinite
  • L17 · basename calls (conditional paths may differ): pop, filter, key.split, name.replace
  • L22 · attachmentDisposition calls (conditional paths may differ): contentDisposition
  • L26 · normalizeObjectKey calls (conditional paths may differ): decodeRawPath, textResponse, splitSafeParts, parts.join, isInternalKey, decoded.endsWith
  • L46 · isPrefixOnlyFolder calls (conditional paths may differ): bucket.list
  • L56 · calcContentRange calls (conditional paths may differ): Math.max, Math.min

Environment references: env.BUCKET

functions/api/list.ts ↗
  • L118 · Cloudflare Pages GET request handler exported · calls authorizeApiKey, normalizeFolder, url.searchParams.get, Number, Number.isFinite, Number.isInteger, textResponse, folder.replace, env.BUCKET.head, isCollectionObject, env.BUCKET.list, collectPage, touchLastUsed, sortItems, Array.from, itemsByKey.values, jsonResponse
  • L28 · normalizeFolder calls (conditional paths may differ): decodeRawPath, splitSafeParts, parts.join, isInternalKey, textResponse
  • L41 · fileUploaded calls (conditional paths may differ): Number.isNaN, raw.getTime, raw.toISOString, parsed.getTime, parsed.toISOString, toISOString
  • L61 · collectPage calls (conditional paths may differ): isInternalKey, object.key.slice, name.includes, isCollectionObject, fileUploaded, Number, fileEtag, itemsByKey.set, replace, prefix.slice, prefix.replace, itemsByKey.has, itemsByKey.get
  • L111 · sortItems calls (conditional paths may differ): items.sort, a.name.localeCompare

Environment references: env.BUCKET

functions/api/images.ts ↗
  • L95 · Cloudflare Pages GET request handler exported · calls isSessionOrKeyAuthorized, textResponse, loadFeatureFlags, normalizeSitesHost, listImages, jsonResponse
  • L114 · Cloudflare Pages POST request handler exported · calls isSessionOrKeyAuthorized, textResponse, loadFeatureFlags, request.headers.get, sanitizeName, trim, contentTypeHeader.split, includes, contentTypeHeader.toLowerCase, request.formData, form.get, file.arrayBuffer, request.arrayBuffer, guessImageContentType, createImageId, env.BUCKET.put, imageObjectKey, normalizeSitesHost, publicImageUrl, jsonResponse, toISOString, imageMarkdown
  • L182 · Cloudflare Pages DELETE request handler exported · calls isSessionOrKeyAuthorized, textResponse, loadFeatureFlags, trim, searchParams.get, isImageId, imageObjectKey, env.BUCKET.head, env.BUCKET.delete, jsonResponse
  • L27 · sanitizeName calls (conditional paths may differ): pop, split, name.replace, slice, trim, cleaned.replace
  • L42 · toRecord calls (conditional paths may differ): object.key.slice, isImageId, Number.isNaN, object.uploaded.getTime, object.uploaded.toISOString, toISOString, publicImageUrl, Number, imageMarkdown
  • L72 · listImages calls (conditional paths may differ): bucket.list, toRecord, items.push, items.sort, b.uploaded.localeCompare

Environment references: env.BUCKET · env.WEBDAV_USERNAME · env.WEBDAV_PASSWORD · env.SITES_HOST

functions/api/rename.ts ↗
  • L64 · Cloudflare Pages POST request handler exported · calls authorizeApiKey, readRenameInput, env.BUCKET.head, isCollectionObject, isPrefixOnlyFolder, textResponse, input.to.lastIndexOf, ensureFolderMarkers, input.to.slice, copyThenDelete, touchLastUsed, jsonResponse, input.to.startsWith, moveDirectory
  • L20 · readRenameInput calls (conditional paths may differ): request.headers.get, includes, contentType.toLowerCase, request.json, textResponse, url.searchParams.get, isTruthyParam, normalizeFileKey, isInternalKey

Environment references: env.BUCKET

functions/api/mkdir.ts ↗
  • L33 · Cloudflare Pages POST request handler exported · calls authorizeApiKey, context.request.headers.get, request.headers.get, request.json, url.searchParams.get, normalizeDirKey, env.BUCKET.head, isCollectionObject, touchLastUsed, jsonResponse, textResponse, isPrefixOnlyFolder, key.lastIndexOf, ensureFolderMarkers, key.slice, env.BUCKET.put
  • L22 · normalizeDirKey calls (conditional paths may differ): decodeRawPath, textResponse, splitSafeParts, parts.join, isInternalKey

Environment references: env.BUCKET

functions/api/keys.ts ↗
  • L68 · Cloudflare Pages GET request handler exported · calls verifyBasicAuth, textResponse, listKeysSorted, jsonResponse, keys.map
  • L77 · Cloudflare Pages POST request handler exported · calls verifyBasicAuth, textResponse, request.json, slice, trim, String, test, generateApiKey, Number, Number.isFinite, toISOString, Date.now, createId, keyPrefix, sha256Hex, usernameFromBasic, env.BUCKET.put, JSON.stringify, jsonResponse, publicKey
  • L135 · Cloudflare Pages DELETE request handler exported · calls verifyBasicAuth, textResponse, searchParams.get, env.BUCKET.delete
  • L17 · usernameFromBasic calls (conditional paths may differ): request.headers.get, authorization.startsWith, atob, authorization.slice, decoded.indexOf, decoded.slice
  • L29 · createId calls (conditional paths may differ): replace, crypto.randomUUID, toString, Date.now, slice, Math.random
  • L35 · generateApiKey calls (conditional paths may differ): crypto.getRandomValues, join, map, Array.from, padStart, b.toString
  • L44 · keyPrefix calls (conditional paths may differ): key.slice, Math.min
  • L60 · listKeysSorted calls (conditional paths may differ): listStoredKeys, records.sort, localeCompare, String

Environment references: env.WEBDAV_USERNAME · env.WEBDAV_PASSWORD · env.BUCKET

functions/api/search.ts ↗
  • L12 · Cloudflare Pages GET request handler exported · calls isSessionOrKeyAuthorized, textResponse, trim, url.searchParams.get, Number, Number.isFinite, Math.min, Math.max, JSON.stringify, query.toLowerCase, env.BUCKET.list, object.key.startsWith, includes, object.key.toLowerCase, items.push, object.uploaded.toISOString

Environment references: env.BUCKET · env.WEBDAV_USERNAME · env.WEBDAV_PASSWORD

functions/api/setup.ts ↗
  • L5 · Cloudflare Pages GET request handler exported · calls verifyBasicAuth, textResponse, runSetupChecks, jsonResponse

Environment references: env.WEBDAV_USERNAME · env.WEBDAV_PASSWORD

functions/api/shares.ts ↗
  • L66 · Cloudflare Pages GET request handler exported · calls isSessionOrKeyAuthorized, textResponse, JSON.stringify, readShares
  • L81 · Cloudflare Pages POST request handler exported · calls isSessionOrKeyAuthorized, textResponse, request.json, replace, trim, String, isInternalKey, env.BUCKET.head, isCollectionObject, env.BUCKET.list, crypto.randomUUID, slice, toString, Math.random, Date.now, Number, toISOString, basename, env.BUCKET.put, JSON.stringify, Boolean
  • L162 · Cloudflare Pages DELETE request handler exported · calls isSessionOrKeyAuthorized, textResponse, searchParams.get, env.BUCKET.delete
  • L16 · basename calls (conditional paths may differ): pop, split, key.replace
  • L20 · readShares calls (conditional paths may differ): bucket.list, object.key.endsWith, bucket.get, data.json, replace, object.key.slice, shares.push, basename, String, Boolean

Environment references: env.BUCKET · env.WEBDAV_USERNAME · env.WEBDAV_PASSWORD

functions/api/stat.ts ↗
  • L17 · Cloudflare Pages GET request handler exported · calls authorizeApiKey, normalizeDirKey, searchParams.get, isInternalKey, textResponse, env.BUCKET.head, isPrefixOnlyFolder, jsonResponse, isCollectionObject, touchLastUsed, head.uploaded.toISOString

Environment references: env.BUCKET

functions/api/sites.ts ↗
  • L272 · Cloudflare Pages GET request handler exported · calls isSessionOrKeyAuthorized, textResponse, url.searchParams.get, listSiteSlugs, loadSiteConfig, computeSiteStats, saveSiteConfig, sites.push, Boolean, jsonResponse, normalizeSitesHost
  • L314 · Cloudflare Pages POST request handler exported · calls isSessionOrKeyAuthorized, textResponse, request.json, toLowerCase, trim, String, isValidSlug, body.source.trim, loadFeatureFlags, featureDisabledResponse, normalizeDirKey, source.startsWith, resolveAsDirectory, listDescendants, isCollectionObject, object.key.slice, rel.includes, copyObject, jsonResponse, normalizeSitesHost, Object.prototype.hasOwnProperty.call, publishNav, publishAlbum, env.BUCKET.list, loadSiteConfig, hashSitePassword, deleteHostnameIndex, normalizeHostname, isValidHostname, loadSlugForHostname, putHostnameIndex, saveSiteConfig, Boolean
  • L461 · Cloudflare Pages DELETE request handler exported · calls isSessionOrKeyAuthorized, textResponse, toLowerCase, trim, searchParams.get, isValidSlug, env.BUCKET.list, listing.objects.map, env.BUCKET.delete, loadSiteConfig, deleteHostnameIndex, siteConfigKey, jsonResponse
  • L53 · listSiteSlugs calls (conditional paths may differ): bucket.list, replace, prefix.slice, slugs.push
  • L69 · computeSiteStats calls (conditional paths may differ): Date.now, getTime, bucket.list, toISOString
  • L99 · saveSiteConfig calls (conditional paths may differ): bucket.put, siteConfigKey, JSON.stringify
  • L106 · publishNav calls (conditional paths may differ): loadFeatureFlags, featureDisabledResponse, parseNavPayload, textResponse, renderNavPage, env.BUCKET.put, jsonResponse, normalizeSitesHost
  • L132 · publishAlbum calls (conditional paths may differ): loadFeatureFlags, featureDisabledResponse, Array.isArray, textResponse, pageLang, body.title.trim, slice, pageLabel, normalizeFileKey, seen.has, seen.add, pop, key.split, rasterExtension, rasters.push, checkAlbumLimits, limited.error.startsWith, env.BUCKET.head, isCollectionObject, sized.push

Environment references: env.BUCKET · env.SITES_HOST · env.WEBDAV_USERNAME · env.WEBDAV_PASSWORD

functions/api/trash.ts ↗
  • L115 · Cloudflare Pages GET request handler exported · calls isSessionOrKeyAuthorized, textResponse, purgeExpiredTrash, retentionDaysFrom, JSON.stringify, listTrashItems
  • L132 · Cloudflare Pages POST request handler exported · calls isSessionOrKeyAuthorized, textResponse, url.searchParams.get, handleRestore, handleSoftDelete
  • L150 · Cloudflare Pages DELETE request handler exported · calls isSessionOrKeyAuthorized, textResponse, request.json, listObjects, env.BUCKET.delete
  • L21 · purgeExpiredTrash calls (conditional paths may differ): Date.now, listObjects, object.key.slice, rest.endsWith, rest.includes, bucket.get, data.json, String, Date.parse, Number.isFinite, rest.replace, bucket.delete
  • L51 · retentionDaysFrom calls (conditional paths may differ): Number, Number.isFinite
  • L58 · basename calls (conditional paths may differ): pop, split, key.replace
  • L62 · listObjects calls (conditional paths may differ): bucket.list, objects.push
  • L78 · createTrashId calls (conditional paths may differ): replace, crypto.randomUUID, slice, toString, Math.random, Date.now
  • L86 · listTrashItems calls (conditional paths may differ): listObjects, object.key.slice, rest.endsWith, rest.includes, bucket.get, data.json, items.push, rest.replace, basename, String, Number
  • L191 · softDeleteKeys calls (conditional paths may differ): replace, String, bucket.head, isInternalKey, filter, listObjects, object.key.startsWith, createTrashId, items.push, basename, object.key.slice, bucket.get, bucket.put, bucket.delete, JSON.stringify, toISOString, items.map, results.push
  • L276 · handleSoftDelete calls (conditional paths may differ): request.json, softDeleteKeys, JSON.stringify
  • L294 · handleRestore calls (conditional paths may differ): request.json, env.BUCKET.get, results.push, metadataObject.json, env.BUCKET.head, env.BUCKET.put, env.BUCKET.delete, originalKey.includes, originalKey.slice, originalKey.lastIndexOf, ensureFolderMarkers, JSON.stringify

Environment references: env.TRASH_RETENTION_DAYS · env.BUCKET · env.WEBDAV_USERNAME · env.WEBDAV_PASSWORD

functions/mcp.ts ↗
  • L351 · Cloudflare Pages ALL request handler exported · calls loadFeatureFlags, featureDisabledResponse, request.method.toUpperCase, withCors, authorizeApiKey, request.text, parseJsonRpcBody, rpcResponse, dispatchMcpRequest, makeApis
  • L58 · withCors calls (conditional paths may differ): Object.entries, headers.set
  • L68 · jsonResponse calls (conditional paths may differ): withCors, JSON.stringify
  • L77 · rpcResponse calls (conditional paths may differ): jsonResponse
  • L81 · cloneApiRequest calls (conditional paths may differ): original.headers.forEach, key.toLowerCase, Object.entries, url.toString
  • L108 · withRequest calls (conditional paths may differ): Object.assign
  • L121 · makeApis calls (conditional paths may differ): url.searchParams.set, String, cloneApiRequest, listOnGet, withRequest, uploadOnPost, downloadOnGet, archiveOnGet, JSON.stringify, mkdirOnPost, deleteOnDelete, searchOnGet, renameOnPost, copyOnPost, statOnGet, uploadOnPut, uploadOnDelete, sharesOnPost, sharesOnGet, sharesOnDelete

Environment references: context.env.BUCKET · env.BUCKET

functions/api/upload.ts ↗
  • L183 · Cloudflare Pages POST request handler exported · calls authorizeApiKey, url.searchParams.has, multipartFileKey, url.searchParams.get, key.lastIndexOf, ensureFolders, key.slice, request.headers.get, env.BUCKET.createMultipartUpload, touchLastUsed, jsonResponse, request.json, textResponse, Array.isArray, parts.map, Number, String, parts.every, parts.some, Number.isInteger, env.BUCKET.resumeMultipartUpload, multipart.complete, normalizeFolder, readUpload, tooLarge, isTruthyParam, env.BUCKET.head, isCollectionObject, env.BUCKET.list, listTakenNames, uniqueName, key.startsWith, env.BUCKET.put
  • L316 · Cloudflare Pages PUT request handler exported · calls authorizeApiKey, multipartFileKey, url.searchParams.get, textResponse, parsePartNumber, env.BUCKET.resumeMultipartUpload, multipart.uploadPart, touchLastUsed, jsonResponse
  • L341 · Cloudflare Pages DELETE request handler exported · calls authorizeApiKey, multipartFileKey, url.searchParams.get, textResponse, env.BUCKET.resumeMultipartUpload, multipart.abort, touchLastUsed
  • L19 · tooLarge calls (conditional paths may differ): textResponse
  • L26 · normalizeFolder calls (conditional paths may differ): trim, decodeURIComponent, replace, path.replace, filter, path.split, parts.some, textResponse, parts.join, isInternalKey
  • L46 · sanitizeFileName calls (conditional paths may differ): pop, split, name.replace, trim, cleaned.replace
  • L51 · uniqueName calls (conditional paths may differ): taken.has, name.lastIndexOf, name.slice
  • L61 · listTakenNames calls (conditional paths may differ): bucket.list, object.key.slice, name.includes, taken.add, replace, prefix.slice
  • L88 · ensureFolders calls (conditional paths may differ): filter, split, folder.replace, bucket.head, bucket.put
  • L104 · readUpload calls (conditional paths may differ): Number, request.headers.get, Number.isFinite, tooLarge, includes, contentType.toLowerCase, request.formData, textResponse, form.get, sanitizeFileName, file.arrayBuffer, request.arrayBuffer
  • L149 · multipartFileKey calls (conditional paths may differ): trim, decodeURIComponent, textResponse, filter, split, path.replace, parts.some, parts.join, isInternalKey
  • L172 · parsePartNumber calls (conditional paths may differ): test, textResponse, parseInt

Environment references: env.BUCKET

functions/share/[[token]].ts ↗
  • L364 · Cloudflare Pages POST request handler exported · calls tokenFromParams, sharePath, loadMeta, getTime, Date.now, trim, String, loadFormCode, extractForm, acceptLanguage, timingSafeEqual, headers.append, sha256Hex
  • L404 · Cloudflare Pages GET request handler exported · calls tokenFromParams, sharePath, loadMeta, getTime, Date.now, gateExtractCode, url.searchParams.get, pop, metadata.key.split, actionHref, renderLandingPage, acceptLanguage, buildZipStream, headers.set, applyShareHardening, contentDisposition, env.BUCKET.head, env.BUCKET.get, object.writeHttpMetadata, withUtf8Charset, inlineContentType, request.headers.has, calcContentRange, String
  • L513 · Cloudflare Pages HEAD request handler exported · calls tokenFromParams, sharePath, loadMeta, getTime, Date.now, gateExtractCode, url.searchParams.get, env.BUCKET.head, object.writeHttpMetadata, headers.set, withUtf8Charset
  • L15 · inlineContentType calls (conditional paths may differ): contentType.startsWith
  • L28 · applyShareHardening calls (conditional paths may differ): headers.set
  • L33 · escapeHtml calls (conditional paths may differ): replaceAll, value.replaceAll
  • L42 · acceptLanguage calls (conditional paths may differ): includes, toLowerCase, request.headers.get
  • L50 · tokenFromParams calls (conditional paths may differ): Array.isArray
  • L57 · sharePath calls (conditional paths may differ): encodeURIComponent
  • L63 · actionHref calls (conditional paths may differ): searchParams.get, params.set, params.toString, sharePath
  • L156 · typeLabel calls (conditional paths may differ): contentType.toLowerCase, t.startsWith
  • L172 · previewKind calls (conditional paths may differ): contentType.toLowerCase, t.startsWith
  • L181 · formatSize calls (conditional paths may differ): Number.isFinite, value.toFixed
  • L194 · formatUtcDate calls (conditional paths may differ): Number.isNaN, date.getTime, padStart, String, date.getUTCFullYear, pad, date.getUTCMonth, date.getUTCDate, date.getUTCHours, date.getUTCMinutes
  • L201 · previewElement calls (conditional paths may differ): escapeHtml
  • L226 · renderLandingPage calls (conditional paths may differ): escapeHtml, typeLabel, formatUtcDate, previewKind, previewElement, formatSize, htmlResponse
  • L263 · extractForm calls (conditional paths may differ): escapeHtml, htmlResponse
  • L298 · loadMeta calls (conditional paths may differ): bucket.get, metadataObject.json, isInternalKey
  • L310 · calcContentRange calls (conditional paths may differ): Math.max, Math.min
  • L325 · getCookieValue calls (conditional paths may differ): cookieHeader.split, pair.indexOf, trim, pair.slice
  • L337 · gateExtractCode calls (conditional paths may differ): trim, String, searchParams.get, getCookieValue, request.headers.get, timingSafeEqual, sha256Hex, acceptLanguage, extractForm
  • L352 · loadFormCode calls (conditional paths may differ): request.headers.get, includes, contentType.toLowerCase, trim, get, request.text

Environment references: env.BUCKET

functions/sitePages.ts ↗
  • L25 · pageLabel calls (conditional paths may differ): text.replace, String
  • L38 · escapeHtml calls (conditional paths may differ): replace, value.replace
  • L49 · safeJson calls (conditional paths may differ): replace, JSON.stringify
  • L58 · isSafeNavHref calls (conditional paths may differ): href.trim, test
  • L76 · clip calls (conditional paths may differ): value.slice
  • L80 · parseNavPayload calls (conditional paths may differ): Array.isArray, pageLang, clip, link.href.trim, link.title.trim, links.push, group.name.trim, pageLabel, groups.push, body.title.trim
  • L136 · rasterExtension calls (conditional paths may differ): pop, filter, split, filename.replace, base.lastIndexOf, toLowerCase, base.slice, RASTER_EXTS.has
  • L144 · isRasterFileName calls (conditional paths may differ): rasterExtension
  • L148 · albumStem calls (conditional paths may differ): pop, filter, split, filename.replace, base.slice, Math.max, stem.replace, trim, replace, stem.slice
  • L160 · albumNameCandidate calls (conditional paths may differ): rasterExtension, Number.isInteger, albumStem, name.toLowerCase, name.includes
  • L179 · allocateAlbumNames calls (conditional paths may differ): used.add, blocked.toLowerCase, rasterExtension, albumNameCandidate, used.has, candidate.toLowerCase, chosen.toLowerCase, out.push
  • L203 · checkAlbumLimits calls (conditional paths may differ): Number.isFinite
  • L224 · isSafeManifestRel calls (conditional paths may differ): rel.startsWith, rel.includes, some, rel.split
  • L233 · parseAlbumManifest calls (conditional paths may differ): JSON.parse, Array.isArray, isSafeManifestRel, out.includes, out.push
  • L328 · docShell calls (conditional paths may differ): escapeHtml
  • L348 · renderNavPage calls (conditional paths may differ): countNavLinks, join, map, options.groups.filter, group.links.map, escapeHtml, isSafeNavHref, link.href.trim, pageLabel, docShell
  • L382 · renderAlbumPage calls (conditional paths may differ): options.images.filter, join, images.map, escapeHtml, safeJson, pageLabel, docShell
functions/webdav/davLock.ts ↗
  • L21 · getSupportedLock calls (conditional paths may differ): join
  • L38 · normalizeLockToken calls (conditional paths may differ): replace, lockToken.trim
  • L45 · normalizeLockDetails calls (conditional paths may differ): Number, Number.isFinite, Date.now
  • L67 · getLockDetails calls (conditional paths may differ): JSON.parse, Array.isArray, parsed.flatMap, normalizeLockDetails, Number
  • L111 · getLockDiscovery calls (conditional paths may differ): Array.isArray, join, lockDetailList.map, escapeXml
  • L131 · withLockMetadata calls (conditional paths may differ): Array.isArray, stripLockMetadata, JSON.stringify
  • L145 · getPreservedCustomMetadata calls (conditional paths may differ): getLockDetails, stripLockMetadata, withLockMetadata
  • L155 · isProtectedProperty calls (conditional paths may differ): pop, propName.split, LOCK_METADATA_KEYS.includes
  • L167 · parseTimeout calls (conditional paths may differ): Date.now, map, timeoutHeader.split, value.trim, item.toLowerCase, Number, item.match, Number.isFinite, Math.min
  • L202 · getRequestLockTokens calls (conditional paths may differ): request.headers.get, lockTokens.push, normalizeLockToken, ifHeader.matchAll
  • L222 · hasAlwaysFalseIfCondition calls (conditional paths may differ): request.headers.get, ifHeader.includes
  • L227 · extractLockOwner calls (conditional paths may differ): body.match, owner.trim
  • L238 · assertLockPermission calls (conditional paths may differ): hasAlwaysFalseIfCondition, getRequestLockTokens, join, slice, current.split, candidates.push, bucket.head, filter, getLockDetails, lockDetails.some, lockTokens.includes
  • L280 · assertRecursiveDeletePermission calls (conditional paths may differ): assertLockPermission, getRequestLockTokens, listAll, getLockDetails, lockDetails.some, lockTokens.includes
  • L305 · findMatchingLock calls (conditional paths may differ): getRequestLockTokens, join, slice, current.split, bucket.head, find, getLockDetails, lockTokens.includes
functions/webdav/davUtil.ts ↗
  • L13 · escapeXml calls (conditional paths may differ): replaceAll, value.replaceAll
  • L29 · isValidThumbnailDigest calls (conditional paths may differ): THUMBNAIL_DIGEST_RE.test
  • L41 · addThumbnailRef calls (conditional paths may differ): isValidThumbnailDigest, bucket.put, thumbnailRefKey
  • L51 · gcThumbnail calls (conditional paths may differ): isValidThumbnailDigest, bucket.list, thumbnailRefKey, bucket.delete, thumbnailObjectKey
  • L63 · releaseThumbnailRef calls (conditional paths may differ): isValidThumbnailDigest, bucket.delete, thumbnailRefKey, gcThumbnail
  • L73 · decodePathSegment calls (conditional paths may differ): decodeURIComponent
  • L81 · parseBucketPath calls (conditional paths may differ): pathname.startsWith, pathname.slice, remainder.endsWith, remainder.slice, join, map, remainder.split, url.hostname.replace
  • L103 · getResourceHref calls (conditional paths may differ): join, map, key.split
  • L111 · decodeResourcePath calls (conditional paths may differ): pathname.slice, resourcePath.endsWith, resourcePath.slice, join, map, resourcePath.split
  • L122 · getParentPath calls (conditional paths may differ): resourcePath.endsWith, resourcePath.slice, join, slice, normalizedPath.split
  • L140 · hasCollectionResource calls (conditional paths may differ): bucket.head, isCollectionObject, bucket.list
  • L164 · isCollectionPath calls (conditional paths may differ): bucket.head, isCollectionObject, bucket.list
  • L182 · parseDestinationPath calls (conditional paths may differ): pathname.startsWith, decodeResourcePath, pathname.slice
  • L202 · isSameOrDescendantPath calls (conditional paths may differ): destinationPath.startsWith
  • L215 · createdResponse calls (conditional paths may differ): headers.set, getResourceHref
  • L240 · getConditionalHeaders calls (conditional paths may differ): source.get, headers.set
  • L258 · listAll calls (conditional paths may differ): list, object.key.startsWith, entries.set, isCollectionObject, entries.keys, key.startsWith, key.slice, relativePath.split, join, parts.slice, entries.get, directory.startsWith, directory.endsWith, directory.slice, entries.values, seen.has, seen.add
  • L350 · deleteAll calls (conditional paths may differ): bucket.list, filter, objects.objects.map, key.startsWith, bucket.delete, object.key.startsWith, isValidThumbnailDigest, releasedDigests.add, thumbnailRefKey, gcThumbnail
  • L386 · calcContentRange calls (conditional paths may differ): Math.max, Math.min

Environment references: env.BUCKET

functions/webdav/davXml.ts ↗
  • L20 · renderDavProperty calls (conditional paths may differ): RAW_XML_DAV_PROPERTIES.has, escapeXml
  • L27 · serializeNodeChildren calls (conditional paths may differ): child.toString
  • L35 · getDeadPropertyKey calls (conditional paths may differ): encodeURIComponent
  • L39 · getDeadProperty calls (conditional paths may differ): getDeadPropertyKey, JSON.parse
  • L55 · getDeadProperties calls (conditional paths may differ): flatMap, Object.entries, key.startsWith, JSON.parse
  • L73 · renderPropertyElement calls (conditional paths may differ): escapeXml
  • L86 · renderEmptyPropertyElement calls (conditional paths may differ): escapeXml
  • L99 · getElementProperty calls (conditional paths may differ): serializeNodeChildren
  • L111 · parseXmlDocument calls (conditional paths may differ): parseFromString, errors.push
  • L123 · getChildElements calls (conditional paths may differ): children.push
  • L133 · parsePropfindRequest calls (conditional paths may differ): body.trim, parseXmlDocument, document.documentElement.localName.toLowerCase, getChildElements, propfindChildren.some, child.localName.toLowerCase, propfindChildren.find, map, properties.some
  • L164 · parseProppatchRequest calls (conditional paths may differ): parseXmlDocument, document.documentElement.localName.toLowerCase, getChildElements, actionElement.localName.toLowerCase, find, child.localName.toLowerCase, getElementProperty, operations.push
  • L194 · fromR2Object calls (conditional paths may differ): toUTCString, getSupportedLock, isCollectionObject, getLockDetails, object.uploaded.toUTCString, object.size.toString, getLockDiscovery, lockDetails.map, getResourceHref
  • L238 · getLivePropertyValue calls (conditional paths may differ): fromR2Object
  • L254 · renderPropstat calls (conditional paths may differ): properties.join
functions/webdav/listingPage.ts ↗
  • L23 · acceptListingLang calls (conditional paths may differ): startsWith, toLowerCase, trim, split, request.headers.get
  • L33 · escapeHtml calls (conditional paths may differ): replace, value.replace
  • L42 · formatSize calls (conditional paths may differ): Number.isFinite, value.toFixed
  • L55 · formatDate calls (conditional paths may differ): date.toISOString, iso.slice
  • L60 · iconKind calls (conditional paths may differ): entry.contentType.toLowerCase, type.startsWith
  • L162 · renderCrumbs calls (conditional paths may differ): path.split, escapeHtml, parts.forEach, nodes.push, encodeURIComponent, nodes.join
  • L177 · renderListingPage calls (conditional paths may differ): join, options.entries.map, iconKind, formatSize, formatDate, escapeHtml, renderCrumbs
functions/webdav/protocol.ts ↗
  • L1417 · Cloudflare Pages ALL request handler exported · calls handleRequest, addCorsHeaders
  • L93 · handleGet calls (conditional paths may differ): isCollectionPath, pathname.endsWith, listAll, entries.push, object.key.slice, getResourceHref, entries.sort, a.name.localeCompare, renderListingPage, acceptListingLang, Response.redirect, redirectUrl.toString, request.headers.get, filter, map, ifNoneMatch.split, replace, value.trim, bucket.head, strongEtag.startsWith
  • L232 · handleHead calls (conditional paths may differ): handleGet
  • L245 · handlePutMultipart calls (conditional paths may differ): url.searchParams.get, test, parseInt, Number.isInteger, bucket.resumeMultipartUpload, multipartUpload.uploadPart
  • L280 · handlePut calls (conditional paths may differ): url.searchParams.has, handlePutMultipart, Number, request.headers.get, Number.isFinite, pathname.endsWith, path.startsWith, assertLockPermission, isCollectionPath, hasCollectionResource, getParentPath, bucket.head, request.arrayBuffer, isValidThumbnailDigest, getPreservedCustomMetadata, addThumbnailRef, thumbnailObjectKey, bucket.delete, thumbnailRefKey, getConditionalHeaders
  • L376 · handleMkcol calls (conditional paths may differ): request.arrayBuffer, assertLockPermission, bucket.head, hasCollectionResource, getParentPath, bucket.put, createdResponse
  • L416 · handleDelete calls (conditional paths may differ): assertRecursiveDeletePermission, deleteAll, bucket.head, isCollectionPath, bucket.delete, releaseThumbnailRef
  • L456 · generatePropfindResponse calls (conditional paths may differ): getResourceHref, isCollectionObject, getDeadProperties, flatMap, Object.entries, fromR2Object, renderDavProperty, deadProperties.map, renderEmptyPropertyElement, getLivePropertyValue, okProperties.push, renderPropertyElement, escapeXml, getDeadProperty, missingProperties.push, renderPropstat
  • L525 · handlePropfind calls (conditional paths may differ): path.startsWith, parsePropfindRequest, request.text, generatePropfindResponse, bucket.head, isCollectionPath, request.headers.get, listAll, byteLength.toString, encode
  • L601 · handleProppatch calls (conditional paths may differ): assertLockPermission, bucket.head, parseProppatchRequest, request.text, getPreservedCustomMetadata, isProtectedProperty, failedSetProperties.push, failedRemoveProperties.push, getDeadPropertyKey, JSON.stringify, successfulSetProperties.push, successfulRemoveProperties.push, bucket.get, bucket.put, propstats.get, props.push, renderEmptyPropertyElement, propstats.set, appendPropstat, isCollectionObject
  • L714 · handleCopy calls (conditional paths may differ): request.headers.get, parseDestinationPath, destination.startsWith, isSameOrDescendantPath, assertLockPermission, hasCollectionResource, getParentPath, bucket.head, isCollectionObject, isCollectionPath, deleteDestination, bucket.get, bucket.put, addThumbnailRef, stripLockMetadata, releaseThumbnailRef, putObject, listAll, object.key.slice, promises.push
  • L841 · deleteDestination calls (conditional paths may differ): sourceRequest.headers.get, headers.set, toString, handleDelete
  • L865 · handleMove calls (conditional paths may differ): request.headers.get, parseDestinationPath, destination.startsWith, isSameOrDescendantPath, assertLockPermission, hasCollectionResource, getParentPath, bucket.head, isCollectionPath, deleteDestination, object.key.slice, bucket.get, isCollectionObject, bucket.put, addThumbnailRef, getPreservedCustomMetadata, bucket.delete, releaseThumbnailRef, moveObject, listAll
  • L985 · handleLock calls (conditional paths may differ): request.headers.get, VALID_LOCK_DEPTHS.includes, parseTimeout, request.text, test, getRequestLockTokens, extractLockOwner, assertLockPermission, findMatchingLock, bucket.head, getLockDetails, currentLocks.some, requestLockTokens.includes, hasCollectionResource, getParentPath, pathname.endsWith, isCollectionPath, bucket.put, isCollectionObject, determineLockDepth
  • L1136 · handleUnlock calls (conditional paths may differ): bucket.head, request.headers.get, assertLockPermission, getLockDetails, normalizeLockToken, lockDetails.some, bucket.get, bucket.put, withLockMetadata, lockDetails.filter
  • L1180 · handlePostCreateMultipart calls (conditional paths may differ): request.headers.get, isValidThumbnailDigest, addThumbnailRef, bucket.createMultipartUpload, JSON.stringify
  • L1203 · handlePostCompleteMultipart calls (conditional paths may differ): searchParams.get, bucket.resumeMultipartUpload, request.json, Array.isArray, multipartUpload.complete
  • L1243 · handlePost calls (conditional paths may differ): params.has, handlePostCreateMultipart, handlePostCompleteMultipart, SUPPORT_METHODS.join
  • L1265 · handleOptions calls (conditional paths may differ): SUPPORT_METHODS.join
  • L1275 · isAuthorized calls (conditional paths may differ): encoder.encode, utf8ToBase64, timingSafeEqual
  • L1285 · dispatchHandler calls (conditional paths may differ): path.startsWith, includes, handleOptions, handleHead, handleGet, handlePut, handleDelete, handleMkcol, handlePropfind, handleProppatch, handleCopy, handleMove, handleLock, handleUnlock, handlePost, SUPPORT_METHODS.join
  • L1334 · handleRequest calls (conditional paths may differ): parseBucketPath, requestUrl.toString, path.startsWith, includes, request.headers.get, isAuthorized, dispatchHandler
  • L1375 · addCorsHeaders calls (conditional paths may differ): response.headers.set, request.headers.get, SUPPORT_METHODS.join, join

Environment references: env.WEBDAV_PUBLIC_READ · env.WEBDAV_USERNAME · env.WEBDAV_PASSWORD

Build and deployment pipeline · 2 GitHub Actions workflows

Repository CI declarations, separate from runtime request processing. Job dependencies and conditions are shown as written; long commands are shortened with an ellipsis; a workflow file does not prove a recent successful run.

CI · .github/workflows/ci.yml ↗

Triggers: push, pull_request

Frontend (typecheck / test / build) · no job dependencies declared

  1. actions/checkout@v4actions/checkout@v4
  2. actions/setup-node@v4actions/setup-node@v4
  3. Install dependenciesnpm ci
  4. Typechecknpm run typecheck
  5. Unit testsnpm run test:ci
  6. Coverage thresholdsnpm run test:coverage
  7. Buildnpm run build

CLI (vitest) · no job dependencies declared

Working directory: cli

  1. actions/checkout@v4actions/checkout@v4
  2. actions/setup-node@v4actions/setup-node@v4
  3. Install dependenciesnpm ci
  4. Testnpm test

E2E (wrangler pages dev + api-e2e) · no job dependencies declared

  1. actions/checkout@v4actions/checkout@v4
  2. actions/setup-node@v4actions/setup-node@v4
  3. Install dependenciesnpm ci
  4. Install pinned wranglernpm install --no-save wrangler@4
  5. Build + run e2e suitenpm run test:e2e
Release extension · .github/workflows/release-extension.yml ↗

Triggers: push, workflow_dispatch

package · no job dependencies declared

  1. Checkoutactions/checkout@v4
  2. Setup Nodeactions/setup-node@v4
  3. Install dependenciesnpm ci
  4. Zip the extension packagebash scripts/package-extension.sh .
  5. Attach zips to GitHub Releasesoftprops/action-gh-release@v2
package.json ↗
  • build: tsc --noEmit && vite build
  • build:extension: vite build --config vite.extension.config.ts
cli/package.json ↗
  • build: tsc -p tsconfig.json
  • prepublishOnly: npm run build && npm test

Full upstream document by @fanchenggang · README.md · snapshot 77ef481

Davflare

English | 中文

Deploy to Cloudflare Pages · Deploy guide

Cloudflare R2 file manager on Cloudflare Pages (API via Pages Functions) — free 10 GB storage and 100,000 invocations per day. R2 pricing

Pages, not Workers. This repo sets pages_build_output_dir in wrangler.toml and has no Worker main. Do not use the Workers Deploy to Cloudflare button or wrangler deploy — that looks for a Worker entry point and fails with «entry point not configured».

Screenshots

Grid light:

Grid light

Grid dark:

Grid dark

Image preview:

Image preview

Share (expiry + extract code):

Share (expiry + extract code)

Features

  • Chunked web uploads, folders, search, drag-and-drop, image/video/PDF thumbnails
  • Share links with expiry or forever, extract code, folder zip, and a zero-JS landing page
  • Recycle bin with configurable retention (TRASH_RETENTION_DAYS)
  • WebDAV Class 1/2 at /webdav (toggleable without affecting the web UI)
  • API keys for scripted upload / download / sync, plus remote MCP at /mcp (25 tools)
  • Static sites and image host on a separate hostname (SITES_HOST), plus a GitHub Action to deploy from CI
  • Owner Settings with five persistent feature switches
  • davflare-cli, optional Chrome MV3 extension, and agent layouts on R2
  • Chinese / English UI

Quick start

  1. Open Workers & Pages → Create → Pages → Connect to Git, pick this repo (needs a Cloudflare account with R2 activated and a payment method on file).
  2. Framework preset None, build npm run build, output directory build (or rely on wrangler.toml's pages_build_output_dir).
  3. Bind your R2 bucket to BUCKET, set WEBDAV_USERNAME and WEBDAV_PASSWORD, then retry deploy.
  4. Optional: WEBDAV_PUBLIC_READ=1, TRASH_RETENTION_DAYS (default 30, -1 disables), and for public sites/images bind sites.<your-domain> and set SITES_HOST=sites.<your-domain>.
  5. Optional: add a custom domain for the drive UI.

Full Pages / Wrangler steps and the five feature switches: docs/deploy.md.

Documentation

Topic Link
Deploy, env vars, feature switches, post-deploy #/setup checklist; MCP playground #/mcp docs/deploy.md · docs/API.md
WebDAV clients & limits docs/webdav.md
Open API & MCP (incl. chat share / zip folder examples) docs/API.md
Static sites & image host docs/sites.md
GitHub Action — deploy a build dir to a site (uses: fanchenggang/Davflare@main) docs/sites.md#github-action-deploy-to-davflare-site
Agent layouts (pull / push) docs/agents.md
CLI (davflare-cli) cli/README.md
Chrome extension (install + bookmarks) extension/README.md
Bookmark portability docs/bookmarks-portability.md
Testing TESTING.md · TEST_CASES.md

Acknowledgments

License

MIT

Frequently asked about Davflare

What is Davflare?+

Davflare is a self-hosted Dropbox alternative built on the Cloudflare developer platform. An R2 file library with WebDAV, protected sharing and browser uploads.

What does Davflare replace?+

Davflare is listed as an alternative to Dropbox. Compare the features and tradeoffs before migrating.

What Cloudflare primitives does Davflare use?+

Davflare is built on Pages, R2.

How much does Davflare cost to run?+

The reviewed Cloudflare deployment is eligible for Free-plan allowances for the stated small workload and feature scope. Usage limits, CPU, required account setup and separate services apply. Activate R2 with a payment method and deploy the Pages application against your own BUCKET, credentials and resource names. Keep total Standard R2 storage within 10 GB-month, Class A operations within 1 million/month and Class B operations within 10 million/month. Keep dynamic Pages Functions traffic and CPU within Workers Free limits; large ZIP creation and large-file workloads may need a paid plan. The default recycle-bin retention is 30 days and still consumes storage; custom domains are optional and may cost separately. Dynamic Pages Functions requests share the Workers account allowance; only requests that do not invoke Functions count as free unlimited static asset requests. R2 Standard allowance: 10 GB-month storage, 1 million Class A and 10 million Class B operations/month; account activation may require billing setup, and other storage classes are excluded. Check current Cloudflare pricing before deploying.

Is Davflare open source?+

The upstream repository declares the MIT license. Read its terms at https://raw.githubusercontent.com/fanchenggang/Davflare/77ef48128670b7293c090e905c92a88992ee3adc/LICENSE. Source code and contributor credit are available at https://github.com/fanchenggang/Davflare.

Community rating

No ratings yet. Tried this project? Share your experience.

One rating per verified account. You can change or remove yours. Accounts are email verified; use of the software is self-reported.

Discuss your experience ↓
Sign in to rate

Discussion · 0

sign in to comment →
No comments yet — be the first.