HUB
Sign inSign up

simthem/privcloud-sharing

By simthem

•Updated 5 days ago

A self-hosted file sharing platform and a secure alternative for WeTransfer.

Image
Security
Databases & storage
1

10K+

simthem/privcloud-sharing repository overview

For more informations -> https://github.com/Simthem/PrivCloud_Sharing⁠

PrivCloud Sharing is a self-hosted, end-to-end encrypted file sharing platform for private uploads as alternative for WeTransfer, reverse shares, team workspaces, WebDAV imports and eIDAS-oriented PDF signing.

This public edition is designed for open-source self-hosting. Collaboration limits are controlled by instance configuration, not by hard-coded tiers.

⁠What Is Included

  • Link-based file sharing with expiration dates, visitor limits and passwords.
  • Authenticated and anonymous reverse shares.
  • Client-side AES-256-GCM encryption before upload, in the E2EE content format v2 for every new file. Historical v1 files remain readable.
  • A random key per new personal E2E share, and encrypted file names, folder paths and share titles for new personal, team folder and reverse-share uploads.
  • E2E encrypted reverse-share uploads with per-link keys in URL fragments.
  • Team workspaces with shared folders, member management and access logs.
  • Granular team permissions for folders, files, downloads, deletes, E2E sharing and signature requests.
  • Team notification feed with unread counts, Web Push and encrypted metadata.
  • Per-member push preferences: all file events or direct shares only.
  • E2EE identity keys, access grants, enrollment tokens and ML-KEM public-key metadata for post-quantum-ready key exchange plumbing.
  • Electronic PDF signing with standard e-mail verification or reinforced WebAuthn confirmation, multi-signer order, approvers, CC recipients, tamper-evident audit trails and PAdES-B-B/PAdES-B-T signing support.
  • Public signing links for external recipients without account registration; OTP is required before previewing, signing, rejecting or downloading PDFs. The standard level therefore needs SMTP. Without it, only reinforced requests can be created. A link accepts five wrong codes per code and fifteen in total before the sender has to send a new invitation.
  • E2E signing links keep their decryption key in the URL fragment, including encrypted Team notification actions and final signed-file downloads.
  • WebDAV/Nextcloud import through local PrivCloud Companion.
  • Local PrivCloud Companion for managed WebDAV uploads and Native Messaging integrations.
  • Browser, Thunderbird, Outlook, Google Workspace and desktop integration scaffolds.
  • OIDC and LDAP authentication.
  • ClamAV integration for uploaded-file scanning.
  • Local filesystem and S3-compatible storage providers.
  • Progressive PDF, Office, OpenDocument, image, video and source-code previews, with local E2E decryption, document zoom and video fullscreen controls.
  • Temporary preview-only access for external contractors, with individually encrypted, watermarked copies and a verifiable issuance register.
  • Account passkeys for sign-in and confirmation of sensitive actions, plus linked-provider re-authentication for accounts without a local password.
  • Server-controlled adaptive upload windows with fair sharing between active files, bounded resource pressure, distributed idempotent finalization and S3-backed multipart recovery after an application restart or replacement.
  • Ordered parallel S3 range downloads with bounded memory and byte-accurate browser resume for individual files, including E2E streams.

See contractor access and evidence⁠ and document preview behavior⁠ for their security boundaries, configuration and limits.


⁠Security Model

⁠End-To-End Encryption

Files are encrypted client-side using AES-256-GCM through the Web Crypto API.

  • Every new file is written in the E2EE content format v2, specified in docs/E2EE_CONTENT_V2.md⁠. Its key is derived with HKDF-SHA256 for that file alone, and its 1,000,000-byte records are bound to the file identifier, their position and the end of the content. A record that is altered, removed, reordered, truncated or appended fails to decrypt. New share, Team and reverse-share keys carry a v2 floor, so content under them is never read as v1. The format does not prove freshness: an older complete state of a file under the same key still reads.
  • Historical v1 files, shares, reverse links and Team keys are kept as they are. New files added to them are written in v2, nothing is re-encrypted or recreated.
  • User uploads create or reuse a per-user master key stored in the browser. The server stores only verification metadata, never the cleartext key.
  • Share links carry the decryption key in the URL fragment (#key=...), which browsers do not send to the server. The key only passes through the server when the owner chooses to include it in the recipient e-mail. The link e-mailed to a reverse-share owner after a deposit carries no key.
  • Each new personal E2E share gets its own random key (SHARE_DEK_V1). The browser generates a 256-bit key for the share, the recipient link carries that key only, and the server stores it wrapped by the owner's master key with the share id authenticated. A master key rotation only rewraps it, so files are never re-encrypted and recipient links keep working.
  • On top of that, file names and folder paths are encrypted with the share key before upload (FILE_META_V1), padded to 64-byte steps and bound to the share and file ids. The share title and description are then encrypted the same way. The server, its logs and its database only see a neutral encrypted-file-<id> name and no title, and database triggers refuse a readable name for such a file or a readable title next to an encrypted one. Recipients and owners get the real values back in the browser. For a signature request on such a PDF, the owner discloses its name for that request only.
  • The same encryption covers team folder uploads, with the team key, and uploads to an encrypted reverse share, with its key. A team key rotation re-encrypts each name together with its file.
  • Names stay readable for shares and uploads created before, or by an older client without these flags. The updated Companion encrypts names for FILE_META_V1 imports on direct S3 and relay routes. An older Companion is refused before the job.
  • Team and folder names remain readable. Reverse-link names can be encrypted with K_rs, and team request subjects and notes with K_team, using the same respective metadata flags. Existing readable labels are not converted.
  • Reverse shares generate a per-reverse-share key. The owner keeps an encrypted copy server-side and senders encrypt files with the key from the link fragment.
  • Access grants carry encrypted key material for the recipient, using X25519 and ML-KEM-768 when an active compatible recipient PQ key is available. Other recipients keep the classical X25519 format.
  • The public crypto layer stores X25519/Ed25519 identity keys and ML-KEM-768 public-key metadata. Team administrators can explicitly enable hybrid ML-KEM/X25519 encryption for notification actions.

The current web app uses per-share keys and encrypted names whatever the flags below say, and the backend accepts them from every client that writes v2. The flags still decide it for older clients, and select the accounts whose reverse-link names and team request subjects are encrypted. For every account:

- SHARE_DEK_V1_WRITE=true
- SHARE_DEK_V1_CANARY_USERS=*
- FILE_META_V1_WRITE=true
- FILE_META_V1_CANARY_USERS=*
- FILE_META_V1_TEAM_WRITE=true
- FILE_META_V1_REVERSE_SHARE_WRITE=true

Existing shares keep their key and their file names. Turning a flag off later only affects new shares: a share created with encrypted names keeps encrypting the names of the files added to it.

The share.contentV2Writes and share.contentV2Floor settings, with their deployment defaults E2EE_CONTENT_V2_WRITES and E2EE_CONTENT_V2_FLOOR (both false), only concern older clients. With writes on, the backend refuses their v1 uploads with e2ee_content_v2_required. Turning a setting off never makes v2 content unreadable and never lifts the floor of a key. Deployment order and rollback: docs/E2EE_CONTENT_V2_ROLLOUT.md⁠.

⁠Encrypted Metadata And Notifications

The current web app encrypts the file names of new E2E uploads, and the title and description of new personal shares, with the key of their share, Team (K_team) or reverse share (K_rs). Team file request subjects and notes use K_team when FILE_META_V1_TEAM_WRITE is selected for their creator. Upload link names use K_rs when FILE_META_V1_REVERSE_SHARE_WRITE is selected for the link owner. Existing readable metadata is not automatically converted.

The server still reads account and recipient addresses, team membership, team and team folder names, sizes, counts and dates, and document names explicitly submitted for signing. Server-generated team alerts, push messages and team audit emails use generic text and opaque navigation identifiers. Browser- encrypted notification details are opened only by their recipients. Team access logs do not record an IP address. Authentication and signature evidence retain their own IP handling.

Access grants combine X25519 and ML-KEM-768 when the recipient has an active ML-KEM-768 key. Recipients without that key keep the X25519 path. This grant choice is independent from the team's optional hybrid notification setting. Old grants remain readable. Team key rotation stages encrypted share titles and request subjects and commits them atomically with the new key. A failed or incomplete metadata rotation prevents completion and can be resumed.

Direct S3 download URLs are temporary authorizations to fetch an object. They are unrelated to electronic document signatures. For E2E files they contain a neutral file identifier and a generic content type, never a readable file name or decryption key. The storage provider still sees sizes and transfers.

Deploy migrations 20261002120000_extend_file_meta_v1 and 20261002140000_e2e_metadata_hardening before starting the updated backend. The latter also replaces names in older server-generated team notifications with generic text. Convert any legacy signing P12 as documented before deployment.

Signing URLs are public no-login recipient flows. Standard requests verify mailbox control with a short-lived e-mail code; reinforced requests bind the decision to an authenticated account and a fresh WebAuthn assertion over the exact displayed document, versioned consent and action. PrivCloud's reinforced profile implements an advanced electronic signature in accordance with the requirements of Article 26 of the eIDAS Regulation and produces an exportable, platform-signed evidence bundle. It is not a qualified electronic signature (QES). Signing API and PDF responses set no-store and noindex headers to reduce accidental indexing and caching.

⁠Direct WebDAV Transfers

Companion can upload file bytes directly to S3 using the existing direct-upload configuration and a share-scoped token. The API checks authorization, quotas, part lengths and finalization. It does not receive the WebDAV credentials or the E2E key. File names are encrypted locally when FILE_META_V1 is selected. Local storage and older or relay-only servers retain the established upload route. Small WebDAV download packets are combined into bounded native frames.

Install the updated Companion together with the updated API. Package builders and Linux installers include its new direct-upload.mjs runtime module.

⁠WebDAV And Companion

WebDAV imports run locally through PrivCloud Companion. The application server never contacts the WebDAV target and never receives its credentials.

PrivCloud Companion runs locally on the user's device. It receives a local browser token and a short-lived share-scoped Bridge upload token, never the web app cookies. WebDAV credentials are kept in memory for the active job.


⁠Quick Start

⁠Docker Compose

  1. Copy or edit docker-compose.yaml.
  2. Set APP_URL to the public URL of your instance.
  3. Set the signing certificate variables if you want PDF signing.
  4. Start the service:
docker compose up -d

By default the compose example binds the application to 127.0.0.1:3000. Put a reverse proxy such as Caddy, Nginx or Traefik in front of it for public HTTPS traffic.

Compose persists its SQLite database in the repository-level ./data/pingvin-share.db. A plain npx prisma migrate deploy launched from backend/ targets the separate development database at backend/data/pingvin-share.db. To migrate the Compose database explicitly, use the unambiguous root command:

npm run db:compose:migrate
⁠Local Development Build
docker compose build
docker compose up -d

The default Dockerfile uses OpenSSL/Node builder cache images pinned by registry manifest digest. The cache registry for this repository is simthem/privcloud-sharing. Refresh the caches from Dockerfile.full-build, whose exported stages contain verified OpenSSL 3.5.9 LTS and Node.js 24.22.2 builds and upgraded Debian packages:

docker buildx build --platform linux/amd64 --pull --no-cache \
  -f Dockerfile.full-build --target openssl-builder \
  --build-arg BUILD_JOBS=4 --provenance=false --load \
  -t simthem/privcloud-sharing:openssl-builder-cache .
docker buildx build --platform linux/amd64 \
  --no-cache-filter node-source-builder,node-builder \
  -f Dockerfile.full-build --target node-builder \
  --build-arg BUILD_JOBS=4 --provenance=false --load \
  -t simthem/privcloud-sharing:node-builder-cache .
trivy image --scanners vuln simthem/privcloud-sharing:openssl-builder-cache
trivy image --scanners vuln simthem/privcloud-sharing:node-builder-cache

BUILD_JOBS bounds parallel C/C++ compilation (default: 4). Both caches start from clean Debian stages, without the compiler dependencies. The Node cache includes its shared OpenSSL libraries and checks its version and linkage. Rebuild the exported stages without cache to refresh Debian security updates.

After reviewing the scans and publishing the two cache images, retrieve their registry manifest digests with docker buildx imagetools inspect. Update OPENSSL_BUILDER_SHA256 and NODE_BUILDER_SHA256 and the OpenSSL/Node version assertions in Dockerfile together. A local image ID is a configuration digest and cannot replace a registry manifest digest. Republishing a tag alone does not update a pinned build.

To build the complete application directly from source, use:

docker build -f Dockerfile.full-build -t privcloud-sharing:full-build .

Cache-stage validation does not replace building and testing the final application image after updating its cache references.

⁠Local release checks

Use Node.js 24.15 or later, Python 3, OpenSSL and Google Chrome. Install the locked dependencies before running checks:

npm ci
npm --prefix backend ci
npm --prefix frontend ci
npm --prefix docs ci
npm --prefix scripts ci
npm --prefix verification/contractor ci
npm run test:release
npm run security:audit
npm run lint
npm --prefix backend run build
npm --prefix frontend run build
npm --prefix docs run build
npm run build:client-tools -- --base-url https://files.example.org

The release suite creates disposable SQLite databases and synthetic HTTPS fixtures. The verification suite includes CPU-intensive measurements. It does not connect to an operator's application or publish release artifacts.

⁠Configuration

Common environment variables:

VariableDescriptionDefault
APP_URLPublic URL used in emails, signing links and integrations(required for production)
TRUST_PROXYSet to true when the container is behind a reverse proxyfalse
CADDY_DISABLEDDisable the built-in Caddy reverse proxyfalse
TEAM_MAX_MEMBERSMax members per team, 0 means unlimited30 in compose example
TEAM_MAX_OWNED_TEAMSMax teams a user can own, 0 means unlimited0
TEAM_MAX_FOLDERSMax shared folders per team, 0 means unlimited10 in compose example
TEAM_MAX_EXTERNAL_SEATSMax active or pending contractor accesses per team, 0 means unlimited0
TEAM_MAX_SHARE_SIZEMax bytes per team share, unset or 0 means unlimited(none)
TEAM_TOTAL_STORAGE_BYTESTotal bytes per team, unset or 0 means unlimited(none)
NODE_MAX_OLD_SPACE_SIZEBackend V8 heap size in MB3072
UPLOAD_MAX_CHUNK_BYTESProcess-wide upload chunk safety ceiling50000000
UPLOAD_ANONYMOUS_MAX_CHUNK_BYTESMax accepted upload chunk body size without an authenticated account35000000
UPLOAD_AUTHENTICATED_MAX_CHUNK_BYTESMax accepted upload chunk body size for authenticated users50000000
S3_PROXY_URLOptional dedicated proxy for public S3 endpoints; NO_PROXY remains authoritative(none)
S3_MAX_CONCURRENT_UPLOADSAdaptive global UploadPart ceiling6
S3_MIN_CONCURRENT_UPLOADSMinimum upload window under resource pressure2
S3_MAX_CONCURRENT_PER_FILEMaximum slots one otherwise-idle file can borrow6
S3_MAX_CONCURRENT_DOWNLOADSAdaptive global S3 range-read ceiling6
S3_MAX_CONCURRENT_PER_DOWNLOADMaximum range reads for one large download6
S3_HTTP_SOCKET_BUFFER_BYTESBounded high-water mark for the explicit production proxy transport1048576
AWS_REQUEST_CHECKSUM_CALCULATIONSDK request checksum policy; WHEN_REQUIRED avoids the optional single-threaded CRC32 transformWHEN_REQUIRED
AWS_RESPONSE_CHECKSUM_VALIDATIONSDK response checksum policy; required checks remain enabled without optional CRC validationWHEN_REQUIRED
S3_DIRECT_BROWSER_UPLOAD_ENABLEDAuthorize short-lived, exact-length browser UploadPart URLs and fall back idempotently to the Nest relay when the endpoint/CORS is unavailablefalse
S3_DIRECT_BROWSER_UPLOAD_ADDRESSING_MODEBrowser upload addressing: path, virtual-host or dualpath
S3_DIRECT_BROWSER_CONNECTIONS_PER_ORIGINMaximum HTTP/1.1 upload requests assigned to each browser-visible S3 origin6
S3_DIRECT_BROWSER_MAX_CONCURRENCYSafety ceiling across all direct upload parts in one browser page; the effective value is also bounded by the available origins32
S3_DIRECT_BROWSER_UPLOAD_ENDPOINTSUp to four optional comma-separated, browser-visible HTTPS S3 endpoints/CNAMEs that target the same account and bucket(none)
S3_DIRECT_BROWSER_URL_TTL_SECONDSLifetime of one exact-part signed URL (bounded to 60-900 seconds)300
S3_DIRECT_BROWSER_DOWNLOAD_ENABLEDAuthorize one-object direct browser GETs while keeping access checks, counters, notifications and Team audit in Nestfalse
S3_DIRECT_BROWSER_DOWNLOAD_MAX_CONCURRENCYMaximum direct S3 ranges fetched concurrently, bounded to six per signed origin and by the browser buffer24
S3_DIRECT_BROWSER_DOWNLOAD_PART_BYTESDirect-browser range size; E2E ranges are aligned to encryption records33554432
S3_DIRECT_BROWSER_DOWNLOAD_THRESHOLD_BYTESFile size from which the streaming direct-browser path uses parallel ranges67108864
S3_DIRECT_BROWSER_DOWNLOAD_MAX_BUFFER_BYTESHard cap for completed out-of-order ranges in browser memory201326592
S3_DIRECT_BROWSER_DOWNLOAD_URL_TTL_SECONDSLifetime of a resumable direct GET URL (bounded to 60-3600 seconds)900
S3_ALLOW_OPTIONAL_CHECKSUMSExplicit opt-in required before optional SDK checksums can be enabledfalse
S3_ADAPTIVE_PRESSURE_SAMPLESConsecutive CPU/event-loop pressure samples required before reducing the window3
S3_PARALLEL_DOWNLOAD_ENABLEDAggregate ordered S3 ranges for large full-file downloadstrue
S3_DOWNLOAD_PART_BYTESS3 download range size16777216
S3_HEALTH_TIMEOUT_MSTimeout for the readiness probe using the real S3 data-plane client10000
S3_DOWNLOAD_MAX_BUFFER_BYTESPer-flow download prefetch memory ceiling134217728
S3_MULTIPART_RECOVERY_ENABLEDRecover multipart state from S3 after an application restart or replacementtrue
S3_MULTIPART_STALE_ABORT_HOURSMinimum S3 age before a demonstrably orphaned multipart may be aborted48
SIGNING_CERTIFICATE_PATHPath to P12/PFX signing certificate(none)
SIGNING_CERTIFICATE_PASSWORDPassword for the signing certificate(none)
SIGNING_TSA_URLRFC 3161 timestamp authority URLoptional
SIGNING_TSA_TRUSTED_LIST_URLTrusted List checked every day for the pinned TSA certificate authority, trace e-mailed to the administrators(none, check disabled)
SIGNING_TSA_LOTL_URLEU List of Trusted Lists that must authorize the signer of that Trusted Listhttps://ec.europa.eu/tools/lotl/eu-lotl.xml
SIGNING_TSA_REQUIRE_QUALIFIED_STATUStrue refuses to timestamp unless a recent check confirmed the TSA as a granted qualified servicefalse
SIGNING_TSA_TRUSTED_LIST_MAX_AGE_DAYSMaximum age of that confirmation7
SIGNING_EVIDENCE_RETENTION_YEARSFinalized PDF/evidence retention after source deletion (1-30)10
SHARE_DEK_V1_WRITEtrue lets the selected accounts create personal E2E shares with their own random key from an older client. The current web app always doesfalse
SHARE_DEK_V1_CANARY_USERSAccounts selected for SHARE_DEK_V1_WRITE: comma-separated user ids or e-mail addresses, * for all(none)
SHARE_DEK_V1_ROLLOUT_PERCENTAdditional stable share of accounts (0-100), from a hash of their id0
SHARE_DEK_V1_READfalse stops serving wrapped share keys to owners, recipient links keep workingtrue
FILE_META_V1_WRITEtrue also encrypts file names and folder paths of those shares from an older client, for the selected accountsfalse
FILE_META_V1_CANARY_USERSAccounts selected for FILE_META_V1_WRITE, which must also be selected for SHARE_DEK_V1(none)
FILE_META_V1_ROLLOUT_PERCENTAdditional stable share of accounts, independent of the SHARE_DEK_V1 one0
FILE_META_V1_TEAM_WRITEtrue encrypts team file request subjects and notes, and the names of E2E team folder uploads from an older client, with the team key, when the creator is selected for FILE_META_V1_WRITEfalse
FILE_META_V1_REVERSE_SHARE_WRITEtrue encrypts upload link names, and the names of uploads to an E2E reverse share from an older client, with its key, when its owner is selected for FILE_META_V1_WRITEfalse
E2EE_CONTENT_V2_WRITESDefault of share.contentV2Writes: true refuses v1 uploads from older clients with e2ee_content_v2_requiredfalse
E2EE_CONTENT_V2_FLOORDefault of share.contentV2Floor: true makes intermediate clients create keys that only accept v2false
HTTP_PROXY / HTTPS_PROXYSystem proxy for outbound traffic(none)
GLOBAL_AGENT_HTTP_PROXYNode.js global-agent proxy URL(none)
GLOBAL_AGENT_NO_PROXY / NO_PROXYHosts that bypass the proxy(none)

⁠Documentation


⁠Credits

PrivCloud Sharing is a fork of Pingvin Share⁠. The original project is licensed under the BSD 2-Clause License⁠.



Don't want to have a self-hosted instance ? -> PrivCloud Sharing⁠


⁠Packages and Vulnerabilities (2026-11-25)

None found

Tag summary

Content type

Image

Digest

sha256:726f8cfdc…

Size

234.7 MB

Last updated

5 days ago

docker pull simthem/privcloud-sharing