| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
ObjectShare is a small self-hosted file sharing service written in Go. Files are shared through unlisted UUID links; the uploading browser receives an HTTP-only owner token that permits rename and deletion.
ObjectShare does not provide user accounts or access-controlled downloads. Anyone with a file URL can download it. Put it behind an authentication-aware reverse proxy if private sharing is required.
HTMX is intentionally part of the frontend architecture. The native forms are accessibility and no-JavaScript fallbacks; planned login, account, permission, and user-management interactions will use HTMX progressive enhancement.
cp .env.example .env
# Edit .env and replace POSTGRES_PASSWORD.
docker compose up --build -dOpen http://localhost:8080. Compose uses PostgreSQL 18 and a persistent local object volume. Stop it with docker compose down; add --volumes only when you intentionally want to delete all stored data.
For HTTPS deployments, terminate TLS at a reverse proxy and set OBJECTSHARE_SECURE_COOKIES=true. Back up both named volumes together so metadata and objects remain consistent.
Requirements: Go 1.27 and PostgreSQL 18 (PostgreSQL 17 is also supported).
cp config.json.example config.json
# Edit database credentials and storage settings.
go run . -config config.jsonConfiguration is read from the optional JSON file and then overridden by OBJECTSHARE_* environment variables. A config file is not required when all settings are supplied through the environment. The most useful variables are:
| Variable | Default | Purpose |
|---|---|---|
| OBJECTSHARE_ADDRESS | :8080 | HTTP listen address |
| OBJECTSHARE_MAX_FILE_SIZE_MB | 100 | Per-file upload limit |
| OBJECTSHARE_STORAGE_SERVICE | filesystem | filesystem or r2 |
| OBJECTSHARE_STORAGE_PATH | data/objects | Filesystem object directory |
| OBJECTSHARE_DB_* | varies | PostgreSQL connection and pool settings |
| OBJECTSHARE_SECURE_COOKIES | false | Require HTTPS for owner cookies |
| OBJECTSHARE_ENCRYPTION_ENABLED | false | Enable encryption at rest |
| OBJECTSHARE_ENCRYPTION_KEY | empty | Base64/hex encoded 32-byte key |
Generate an encryption key with openssl rand -base64 32. Losing or changing this key makes existing encrypted files unrecoverable. Encrypted objects are authenticated before download and are held in memory during encryption/decryption. To bound memory use, encrypted mode limits files to 128 MiB and permits one cryptographic operation per application replica at a time.
Set OBJECTSHARE_STORAGE_SERVICE=r2 and provide:
The R2 token only needs object read/write permissions for the configured bucket. Downloads use short-lived presigned URLs unless server-side encryption is enabled.
When R2 is selected and server-side encryption is disabled, JavaScript-enabled browsers upload directly to a short-lived, content-type-bound R2 PUT URL. Only the authorization and completion requests pass through ObjectShare, so a Cloudflare-proxied deployment is not constrained by Cloudflare's 100 MB Free/Pro, 200 MB Business, or default 500 MB Enterprise request-body limits. ObjectShare verifies the uploaded object's key, size, content type, expiry, and one-time owner token before publishing its share page. Single-part direct uploads are limited to R2's 5 GiB PUT limit; larger R2 objects require multipart upload support.
These limits and the direct-upload pattern are documented in Cloudflare's 413 limit reference, R2 limits, and upload guidance.
Direct browser uploads require an R2 CORS policy. Replace the origin below with the exact public origin serving ObjectShare (and add a localhost origin separately for local development):
[
{
"AllowedOrigins": ["https://share.example.com"],
"AllowedMethods": ["PUT"],
"AllowedHeaders": ["Content-Type"],
"MaxAgeSeconds": 3600
}
]The direct path does not claim server-verified SHA checksums because the application never receives the file bytes. The details page labels those checksums as unavailable. Enable server-side encryption, or use filesystem storage, when application-side hashing is required; those modes stream the upload through ObjectShare and therefore remain subject to the front proxy's body-size limit.
Server-side encryption and direct-to-R2 upload are intentionally mutually exclusive: encryption keys remain on the server, so encrypted file bodies must pass through ObjectShare.
.github/workflows/release.yml builds downloadable Linux archives for AMD64 v1/v3, ARM64, and RISC-V. Builds are retained as workflow artifacts for pushes, pull requests, and manual runs; published GitHub Releases also receive the archives and SHA-256/SHA3-256 checksum files.
.github/workflows/container-publish.yml always publishes linux/amd64 and linux/arm64 images to GHCR on a GitHub Release and can also be run manually. Docker Hub publishing is optional; configure all three settings below to enable it:
If any Docker Hub setting is absent, that login and image target are skipped and the workflow publishes to GHCR only. GHCR uses the workflow-scoped GITHUB_TOKEN; no additional secret is needed. Published images include BuildKit provenance and an SBOM. Package visibility is managed from the repository's Packages settings.
.github/workflows/workflow_runs_clean_up.yml runs daily (or manually), deletes runs older than seven days, and always retains the newest run for each workflow.
go mod verify
go test -race ./...
go vet ./...
go run golang.org/x/vuln/cmd/govulncheck@v1.7.0 ./...CI also verifies formatting and builds the container. Dependency and action updates are proposed weekly by Dependabot.
| Back | FazBrowse Home | New Git URL |