[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-81129":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":12,"openIssues":13,"contributorsCount":14,"subscribersCount":14,"size":14,"stars1d":14,"stars7d":14,"stars30d":14,"stars90d":14,"forks30d":14,"starsTrendScore":14,"compositeScore":15,"rankGlobal":10,"rankLanguage":10,"license":16,"archived":17,"fork":17,"defaultBranch":18,"hasWiki":19,"hasPages":19,"topics":20,"createdAt":10,"pushedAt":10,"updatedAt":30,"readmeContent":31,"aiSummary":32,"trendingCount":14,"starSnapshotCount":14,"syncStatus":33,"lastSyncTime":34,"discoverSource":35},81129,"freedrive","abdullaabdullazade\u002Ffreedrive","abdullaabdullazade","FreeDrive is a self-hosted cloud drive you run as a single binary, delivering a full Google Drive–style experience with built-in admin controls, sharing, and privacy on your own server.","https:\u002F\u002Fabdullaabdullazade.github.io\u002Ffreedrive\u002F",null,"JavaScript",33,1,0,0.9,"MIT License",false,"master",true,[21,22,23,24,25,26,27,28,29],"cloud-storage","drive","file-manager","golang","google-drive-alternative","minimalist","privacy","selfhosted","single-binary","2026-06-12 02:04:11","\u003Cp align=\"center\">\n  \u003Cimg src=\"docs\u002Ffavicon.svg\" width=\"78\" alt=\"FreeDrive Logo\" \u002F>\n\u003C\u002Fp>\n\n\u003Ch1 align=\"center\">FreeDrive\u003C\u002Fh1>\n\n\u003Cp align=\"center\">\n  \u003Cstrong>Self-hosted cloud storage with a familiar Drive-like UX.\u003C\u002Fstrong>\u003Cbr\u002F>\n  Single Go binary, embedded SQLite, disk-backed storage, admin panel, and modern web UI.\n\u003C\u002Fp>\n\u003Cp align=\"center\">\u003Cstrong>Licensed under MIT\u003C\u002Fstrong>\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fabdullaabdullazade.github.io\u002Ffreedrive\u002F\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FWebsite-freedrive-blue?style=flat-square\" alt=\"Website\"\u002F>\u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fabdullaabdullazade\u002Ffreedrive\u002Freleases\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fv\u002Frelease\u002Fabdullaabdullazade\u002Ffreedrive?style=flat-square\" alt=\"Release\"\u002F>\u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fabdullaabdullazade\u002Ffreedrive\u002Fstargazers\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fstars\u002Fabdullaabdullazade\u002Ffreedrive?style=flat-square\" alt=\"Stars\"\u002F>\u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fabdullaabdullazade\u002Ffreedrive\u002Fblob\u002Fmain\u002FLICENSE\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Flicense\u002Fabdullaabdullazade\u002Ffreedrive?style=flat-square\" alt=\"License\"\u002F>\u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fabdullaabdullazade\u002Ffreedrive\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fgo-mod\u002Fgo-version\u002Fabdullaabdullazade\u002Ffreedrive?style=flat-square\" alt=\"Go version\"\u002F>\u003C\u002Fa>\n\u003C\u002Fp>\n\n---\n\n## Table of Contents\n\n- [Overview](#overview)\n- [Screenshots](#screenshots)\n- [Core Features](#core-features)\n- [Admin Capabilities](#admin-capabilities)\n- [Architecture](#architecture)\n- [Security Model](#security-model)\n- [Quick Start](#quick-start)\n- [Production Install (systemd)](#production-install-systemd)\n- [Configuration](#configuration)\n- [API Reference](#api-reference)\n- [Project Structure](#project-structure)\n- [Deployment Options](#deployment-options)\n- [Operations](#operations)\n- [Star History](#star-history)\n- [Troubleshooting](#troubleshooting)\n- [Contributing](#contributing)\n- [License](#license)\n\n---\n\n## Overview\n\nFreeDrive is an open-source, self-hosted storage platform designed to feel instantly familiar for users coming from mainstream cloud drives.\n\nWhat makes it practical:\n\n- Single binary backend (`Go`) with embedded web assets\n- Embedded SQLite database (no external DB required)\n- Local disk storage backend\n- JWT access + refresh-token authentication\n- User and admin workspaces in one application\n- Simple deployment with direct binary run or `systemd`\n\nFreeDrive is ideal for:\n\n- Developers wanting full ownership of files and auth\n- Small teams needing private internal storage\n- Self-hosting enthusiasts who want low operational overhead\n\n---\n\n## Screenshots\n\n### User Workspace\n\n![User Workspace](docs\u002Fscreenshots\u002Fuser.png)\n\n### Admin Workspace\n\n![Admin Workspace](docs\u002Fscreenshots\u002Fadmin.png)\n\n---\n\n## Core Features\n\n### 1. Drive-like File Management UX\n\n- Folder-based navigation and root view\n- Suggested\u002Frecent style listings\n- List\u002Fgrid view switching\n- Search and search filters\n- Context menus and keyboard shortcuts\n\n### 2. File Lifecycle\n\n- Upload files via web UI\n- Download encrypted blob payloads with metadata headers\n- Rename and move files between folders\n- Soft delete to Trash\n- Restore from Trash\n- Permanent delete\n\n### 3. Versioning Support\n\n- File version records are kept when content is updated\n- List versions per file\n- Restore an earlier version\n\n### 4. Sharing Model\n\n- User-to-user sharing data model (`user_shares`)\n- Share-link data model (`share_links`)\n- \"Shared with me\" and \"Shared by me\" listing paths\n\n### 5. Storage & Quota Awareness\n\n- Per-user quota enforcement during uploads\u002Fcontent updates\n- Used-bytes accounting on delete\u002Frestore\u002Fpermanent-delete paths\n- Disk usage endpoint for runtime visibility\n\n### 6. Activity Logging\n\n- File\u002Ffolder actions are recorded in activity logs\n- User and admin activity listing endpoints\n\n### 7. Embedded App Delivery\n\n- Frontend is embedded with `go:embed`\n- Single process serves API + SPA + static assets\n\n---\n\n## Admin Capabilities\n\nAdmin routes are role-protected and available under `\u002Fapi\u002Fv1\u002Fadmin\u002F*`.\n\n### User Management\n\n- List users\n- Create users\n- Update role\u002Fquota\u002Fusername\n- Delete users (with self-delete protection)\n- Trigger password reset email flow\n\n### Invite System\n\n- Create invite links with:\n  - role\n  - max uses\n  - quota bytes\n- List invites\n- Invite usage tracking and expiration checks\n\n### Operational Controls\n\n- View aggregate stats (`total_users`, `total_used`, `total_quota`)\n- View global activity feed\n- Save\u002Fretrieve admin settings\n- Run backup snapshot for admin settings\n\n### Email \u002F SMTP\n\n- SMTP test endpoint\n- Password reset email dispatch\n- Configurable sender and TLS behavior\n\n---\n\n## Architecture\n\nFreeDrive follows a clean layered structure:\n\n- `api` layer: HTTP routes, handlers, middleware\n- `service` layer: business logic (auth, file, folder)\n- `repository` layer: persistence interfaces + SQLite implementations\n- `storage` layer: disk blob IO\n\nRuntime flow summary:\n\n1. Request hits `chi` router\n2. Global middleware stack executes (CORS, rate-limit, recover, logger)\n3. Auth middleware validates JWT when required\n4. Handler validates input and calls service\u002Frepo\n5. Service applies policy (quota\u002Fownership\u002Fversioning\u002Factivity)\n6. Response serialized as JSON\n\n---\n\n## Security Model\n\n### Authentication\n\n- Access token: JWT\n- Refresh token: random token, stored hashed in DB\n- Token rotation on refresh\n- Logout revokes refresh token\n\n### Authorization\n\n- Protected API group requires valid access token\n- Admin routes use explicit admin-role middleware\n- User-scoped operations enforce ownership checks in services\n\n### Secrets\n\n- `FREEDRIVE_JWT_SECRET` can be provided via env\n- If omitted, it is generated and stored in `data\u002Fjwt_secret.key`\n\n### Rate Limiting\n\nGlobal limiter enabled in router:\n\n- `100 req\u002Fsec`\n- `burst 200`\n\n### Storage Note\n\nFrontend transmits encrypted payload metadata (`iv`, encrypted size), and backend stores encrypted blob data and file metadata. If your threat model requires strict end-to-end guarantees, review the current crypto\u002Fkey flow before production rollout.\n\n---\n\n## Quick Start\n\n### Prerequisites\n\n- Go (matching `go.mod` requirements)\n- Linux\u002FmacOS\u002FWSL recommended for local development\n\n### Run Locally\n\n```bash\ngo mod download\ngo run .\u002Fcmd\u002Ffreedrive\n```\n\nOpen:\n\n- `http:\u002F\u002Flocalhost:8080`\n\nDefault bootstrap admin (if first user is auto-created):\n\n- Email: `admin@freedrive.local`\n- Password: `admin123`\n\nImportant: change defaults immediately in non-dev environments.\n\n### Run Published Docker Image\n\n```bash\ndocker pull ghcr.io\u002Fabdullaabdullazade\u002Ffreedrive:latest\ndocker run -d \\\n  --name freedrive \\\n  -p 8080:8080 \\\n  -e FREEDRIVE_ADMIN_EMAIL=admin@freedrive.local \\\n  -e FREEDRIVE_ADMIN_PASSWORD=change-me-now \\\n  -v freedrive-data:\u002Fapp\u002Fdata \\\n  ghcr.io\u002Fabdullaabdullazade\u002Ffreedrive:latest\n```\n\nDocker Hub image tags are published as `docker.io\u002Fmetalninjasabdulla\u002Ffreedrive:\u003Ctag>`.\n\n### Run With Docker Compose\n\n```bash\ncp .env.example .env\ndocker compose up -d --build\n```\n\nOpen:\n\n- `http:\u002F\u002Flocalhost:8080`\n\nRuntime data is stored in the `freedrive-data` Docker volume. Update `.env` before first start to set a strong admin password and optional JWT secret.\n\n---\n\n## Production Install (systemd)\n\nThe repository includes `scripts\u002Finstall.sh` for Linux host installation.\n\n```bash\nchmod +x scripts\u002Finstall.sh\n.\u002Fscripts\u002Finstall.sh\n```\n\nWhat it does:\n\n- Prompts for admin credentials\n- Downloads the latest release binary\n- Installs binary to `\u002Fopt\u002Ffreedrive\u002Ffreedrive`\n- Writes env file at `\u002Fetc\u002Ffreedrive\u002Ffreedrive.env`\n- Creates\u002Fstarts `freedrive.service`\n\nTo update an existing systemd installation to the latest release:\n\n```bash\ncurl -fsSL https:\u002F\u002Fabdullaabdullazade.github.io\u002Ffreedrive\u002Fupdate.sh -o update.sh\nchmod +x update.sh\n.\u002Fupdate.sh\n```\n\nThe updater verifies the release checksum, keeps your existing data and `\u002Fetc\u002Ffreedrive\u002Ffreedrive.env`, backs up the current binary to `\u002Fopt\u002Ffreedrive\u002Ffreedrive.bak`, installs the new binary, and restarts `freedrive.service`.\n\nOperational commands:\n\n```bash\nsudo systemctl status freedrive\nsudo systemctl restart freedrive\nsudo journalctl -u freedrive -f\n```\n\nBrowser encryption note: uploads use WebCrypto when the browser allows it. Use `http:\u002F\u002Flocalhost:8080` or HTTPS for encrypted uploads; on plain HTTP server addresses, FreeDrive warns first and uploads without browser-side encryption.\n\nNote: current systemd template runs service as `root`. For hardened production setups, consider a dedicated system user and tighter filesystem permissions.\n\n---\n\n## Configuration\n\nEnvironment variables loaded by `internal\u002Fconfig\u002Fconfig.go`:\n\n| Variable | Description | Default |\n|---|---|---|\n| `FREEDRIVE_PORT` | HTTP port | `8080` |\n| `FREEDRIVE_DATA_DIR` | Data directory (DB, blobs, keys) | `.\u002Fdata` |\n| `FREEDRIVE_JWT_SECRET` | JWT signing secret | auto-generated if empty |\n| `FREEDRIVE_MAX_UPLOAD_MB` | Max upload size (MB) | `5120` |\n| `FREEDRIVE_ADMIN_EMAIL` | Initial admin email | `admin@freedrive.local` |\n| `FREEDRIVE_ADMIN_PASSWORD` | Initial admin password | `admin123` |\n\n---\n\n## API Reference\n\nBase path: `\u002Fapi\u002Fv1`\n\n### Public Auth\n\n- `POST \u002Fauth\u002Fregister`\n- `POST \u002Fauth\u002Flogin`\n- `POST \u002Fauth\u002Frefresh`\n- `POST \u002Fauth\u002Flogout`\n- `POST \u002Fauth\u002Freset-password`\n\n### Protected (Authenticated)\n\n- `GET \u002Fme\u002Fstorage`\n- `GET \u002Factivity`\n- `GET \u002Fdisk-stats`\n\n#### Files\n\n- `POST \u002Ffiles\u002Fupload`\n- `GET \u002Ffiles`\n- `GET \u002Ffiles\u002Ftrash`\n- `GET \u002Ffiles\u002F{id}`\n- `GET \u002Ffiles\u002F{id}\u002Fdownload`\n- `PATCH \u002Ffiles\u002F{id}`\n- `POST \u002Ffiles\u002F{id}\u002Fcontent`\n- `DELETE \u002Ffiles\u002F{id}`\n- `POST \u002Ffiles\u002F{id}\u002Frestore`\n- `DELETE \u002Ffiles\u002F{id}\u002Fpermanent`\n- `GET \u002Ffiles\u002F{id}\u002Fversions`\n- `POST \u002Ffiles\u002F{id}\u002Fversions\u002F{version}\u002Frestore`\n\n#### Folders\n\n- `POST \u002Ffolders`\n- `GET \u002Ffolders\u002Froot`\n- `GET \u002Ffolders\u002F{id}`\n- `PATCH \u002Ffolders\u002F{id}`\n- `DELETE \u002Ffolders\u002F{id}`\n- `GET \u002Ffolders\u002F{id}\u002Fbreadcrumb`\n\n### Admin (Requires `admin` role)\n\n- `GET \u002Fadmin\u002Fusers`\n- `POST \u002Fadmin\u002Fusers`\n- `PATCH \u002Fadmin\u002Fusers\u002F{id}`\n- `DELETE \u002Fadmin\u002Fusers\u002F{id}`\n- `POST \u002Fadmin\u002Fusers\u002F{id}\u002Freset-password`\n- `GET \u002Fadmin\u002Fstats`\n- `POST \u002Fadmin\u002Finvites`\n- `GET \u002Fadmin\u002Finvites`\n- `GET \u002Fadmin\u002Factivity`\n- `GET \u002Fadmin\u002Fsettings`\n- `POST \u002Fadmin\u002Fsettings`\n- `POST \u002Fadmin\u002Ftest-email`\n- `POST \u002Fadmin\u002Fbackup\u002Frun`\n\n### Health\n\n- `GET \u002Fhealth`\n\n---\n\n## Project Structure\n\n```text\ncmd\u002Ffreedrive\u002F\n  main.go                 # app bootstrap\n  web\u002F                    # embedded frontend (HTML\u002FCSS\u002FJS)\n\ninternal\u002F\n  api\u002F\n    router.go             # route graph + middleware wiring\n    handlers\u002F             # HTTP handlers\n    middleware\u002F           # auth, CORS, rate limit\n  config\u002F                 # env config + secret generation\n  domain\u002F                 # core entities\n  repository\u002F             # interfaces\n  repository\u002Fsqlite\u002F      # sqlite repos + migrations\n  service\u002F                # business logic\n  storage\u002F                # local disk blob storage\n\nscripts\u002F\n  install.sh              # systemd installation helper\n\ndocs\u002F\n  index.html              # project landing page\n  screenshots\u002F            # marketing screenshots\n```\n\n---\n\n## Deployment Options\n\nTypical demo\u002Fproduction options:\n\n- VPS (`Hetzner`, `DigitalOcean`, `AWS EC2`) with systemd\n- Containerized self-managed deployment (custom Dockerfile)\n- PaaS for demo environments (`Railway`, `Render`, `Fly.io`)\n\nRecommended production baseline:\n\n- Reverse proxy (`Caddy` or `Nginx`) with HTTPS\n- Periodic backup for `FREEDRIVE_DATA_DIR`\n- Strong admin password and rotated JWT secret policy\n- Non-root runtime user when possible\n\n---\n\n## Operations\n\n### Data You Should Back Up\n\nAt minimum:\n\n- SQLite DB (`$FREEDRIVE_DATA_DIR\u002F*.db`)\n- Blob storage (`$FREEDRIVE_DATA_DIR` file hierarchy)\n- JWT secret (`$FREEDRIVE_DATA_DIR\u002Fjwt_secret.key` if auto-generated)\n- Admin settings snapshot (`data\u002Fsettings.json` and optional backup output)\n\n### Upgrading\n\n1. Stop service\n2. Replace binary\n3. Start service\n4. Check logs and health endpoint\n\n```bash\nsudo systemctl stop freedrive\n# replace binary\nsudo systemctl start freedrive\ncurl -s http:\u002F\u002Flocalhost:8080\u002Fapi\u002Fv1\u002Fhealth\n```\n\n---\n\n## Star History\n\n[![Star History Chart](https:\u002F\u002Fapi.star-history.com\u002Fsvg?repos=abdullaabdullazade\u002Ffreedrive&type=Date&legend=top-left)](https:\u002F\u002Fwww.star-history.com\u002F?repos=abdullaabdullazade%2Ffreedrive&type=date&legend=top-left)\n\n---\n\n## Troubleshooting\n\n### Service starts but UI fails\n\n- Confirm process is running: `systemctl status freedrive`\n- Check logs: `journalctl -u freedrive -f`\n- Validate port mapping \u002F firewall\n\n### Login fails unexpectedly\n\n- Verify JWT secret consistency across restarts\n- Ensure system clock is correct\n- Confirm refresh token table integrity\n\n### Upload returns size\u002Fform errors\n\n- Check `FREEDRIVE_MAX_UPLOAD_MB`\n- Ensure reverse proxy request body limits are aligned\n\n### SMTP test\u002Freset mail fails\n\n- Re-check server\u002Fport\u002Fauth\u002FTLS settings\n- Verify sender domain policy (SPF\u002FDKIM\u002Frelay restrictions)\n\n---\n\n## Contributing\n\nContributions are welcome.\n\nSuggested workflow:\n\n1. Fork repository\n2. Create feature branch\n3. Add\u002Fadjust tests where applicable\n4. Submit focused PR with clear change summary\n\nIf you are proposing architecture-level changes, open an issue first for design alignment.\n\n---\n\n## License\n\nMIT License. See [LICENSE](LICENSE).\n","FreeDrive 是一个自托管的云存储解决方案，提供类似 Google Drive 的用户体验。其核心功能包括单一二进制文件部署、内置 SQLite 数据库、本地磁盘存储支持以及管理员控制面板等。技术上，FreeDrive 采用 Go 语言开发，具有简洁的架构和现代化的 Web 界面设计，并且通过 JWT 实现了安全的用户认证机制。适用于希望完全掌控自己数据的开发者、需要私有内部存储的小团队以及追求低运维成本的自托管爱好者。",2,"2026-06-11 04:03:38","CREATED_QUERY"]