{"id":16132893,"url":"https://github.com/vvbbnn00/goflet","last_synced_at":"2025-03-18T15:30:36.461Z","repository":{"id":226815652,"uuid":"767659850","full_name":"vvbbnn00/goflet","owner":"vvbbnn00","description":"Goflet is a lightweight file upload and download service written in Go, featuring authentication, resumable uploads, file integrity verification, image processing, and OnlyOffice integration for a comprehensive file management solution.","archived":false,"fork":false,"pushed_at":"2024-06-26T19:38:52.000Z","size":1116,"stargazers_count":5,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-28T10:18:24.660Z","etag":null,"topics":["file-download","file-management","file-upload","go","onlyoffice","resumable-uploads"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vvbbnn00.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-05T17:21:19.000Z","updated_at":"2024-07-03T11:36:58.000Z","dependencies_parsed_at":"2024-06-21T13:01:41.836Z","dependency_job_id":"0591ee08-5ba9-4f3a-9375-2d73f9595619","html_url":"https://github.com/vvbbnn00/goflet","commit_stats":null,"previous_names":["vvbbnn00/goflet"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vvbbnn00%2Fgoflet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vvbbnn00%2Fgoflet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vvbbnn00%2Fgoflet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vvbbnn00%2Fgoflet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vvbbnn00","download_url":"https://codeload.github.com/vvbbnn00/goflet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243933439,"owners_count":20370986,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["file-download","file-management","file-upload","go","onlyoffice","resumable-uploads"],"created_at":"2024-10-09T22:35:06.304Z","updated_at":"2025-03-18T15:30:36.117Z","avatar_url":"https://github.com/vvbbnn00.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/vvbbnn00/goflet\"\u003e\n        \u003cimg src=\"winres/icon.png\" width=\"200\" height=\"200\" alt=\"goflet\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cdiv align=\"center\"\u003e\n    \u003ch1\u003eGoflet\u003c/h1\u003e\n    \u003chr\u003e\n    \u003cp\u003e\n        Goflet is a lightweight file upload and download service written in Go.\n    \u003c/p\u003e\n\u003c/div\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/vvbbnn00/goflet/blob/master/LICENSE\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/license/vvbbnn00/goflet\" alt=\"license\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://app.codacy.com?utm_source=gh\u0026utm_medium=referral\u0026utm_content=\u0026utm_campaign=Badge_grade\"\u003e\n        \u003cimg src=\"https://app.codacy.com/project/badge/Grade/f8c9b87f2f7a4af2baf12ddd8d09c475\" alt=\"codacy-quality\"/\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://goreportcard.com/report/github.com/vvbbnn00/goflet\"\u003e\n        \u003cimg src=\"https://goreportcard.com/badge/github.com/vvbbnn00/goflet\" alt=\"go-report\"/\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cdiv align=\"center\"\u003e\n    \u003ca href=\"README.md\"\u003eEnglish\u003c/a\u003e\n    \u003cspan\u003e | \u003c/span\u003e\n    \u003ca href=\"README_zh.md\"\u003e简体中文\u003c/a\u003e\n\u003c/div\u003e\n\n## 🤔 What is Goflet?\n\nGoflet implements a lightweight file upload and download service. It is a web service based on the Go language and uses\nthe Gin framework. Although Goflet has simple functions, it supports features such as breakpoint resumption during\nupload and download, and multi-threaded downloading. Goflet's file download interface follows various HTTP standards, so\nif your service needs are relatively simple, Goflet can fully serve as your CDN service. In addition to file upload and\ndownload, Goflet also provides simple image processing, OnlyOffice synchronization, and other functions.\n\n## 🚀 Features\n\n- **Lightweight**: Only one binary file is needed to run Goflet.\n- **Easy to use**: Goflet's API interface follows HTTP standards, so you can easily use it.\n- **Breakpoint resumption**: Supports breakpoint resumption during upload and download, improving the stability and\n  efficiency of file transmission.\n- **Multi-threaded download**: Supports multi-threaded downloading to speed up the file download process.\n- **Image processing**: Provides simple image processing functions, such as image compression, scaling, etc.\n- **OnlyOffice synchronization**: Supports synchronization editing of OnlyOffice documents.\n- **JWT authentication**: Supports JWT authentication to ensure the security of your files.\n- **Docker support**: Supports Docker deployment for convenience and speed.\n- **Cross-platform**: Goflet supports operating systems such as Windows, Linux, macOS, etc.\n\n## 📦 Installation and Deployment\n\n### Docker / Docker Compose\n\nSome example Docker Compose files are already prepared in the `docker` directory. You can directly use them to deploy\nGoflet.\n\n```bash\ngit clone https://github.com/vvbbnn00/goflet.git\ncd goflet\ndocker-compose up -d\n```\n\n### Binary File\n\nYou can download the binary file of Goflet from the [Releases](https://github.com/vvbbnn00/goflet/releases) page and\nthen run it on your server.\n\n### Source Code Compilation\n\nYou can also install Goflet through source code compilation. First, you need to install the Go language runtime\nenvironment, and then execute the following commands:\n\n```bash\ngit clone https://github.com/vvbbnn00/goflet.git\ncd goflet\ngo build -o goflet\n```\n\n## 📄 Configuration File\n\n\u003e **Warning**\n\u003e\n\u003e Please be sure to modify the JWT signature key in goflet.json before deploying Goflet.\n\nThe configuration file of Goflet is goflet.json. When Goflet is run for the first time, it will be automatically\ngenerated. You can configure various parameters of Goflet in goflet.json, such as the listening port, file storage path,\netc. After you have finished modifying the configuration, you need to restart Goflet for the configuration to take\neffect.\n\nBelow is a detailed explanation of the goflet.json configuration file:\n\n```json5\n{\n  // Whether to enable debug mode\n  \"debug\": false,\n  // Log configuration\n  \"logConfig\": {\n    // Whether to enable logging\n    \"enabled\": true,\n    // Log level (debug, info, warn, error, fatal)\n    \"level\": \"info\"\n  },\n  // Whether to enable Swagger documentation\n  \"swaggerEnabled\": true,\n  // HTTP service configuration\n  \"httpConfig\": {\n    // Listening address\n    \"host\": \"0.0.0.0\",\n    // Listening port\n    \"port\": 8080,\n    // Whether to enable CORS\n    \"cors\": {\n      \"enabled\": true,\n      // Allowed origins\n      \"origins\": [\n        \"*\"\n      ],\n      // Allowed methods\n      \"methods\": [\n        \"HEAD\",\n        \"GET\",\n        \"POST\",\n        \"PUT\",\n        \"DELETE\",\n        \"OPTIONS\"\n      ],\n      // Allowed headers\n      \"headers\": [\n        \"Content-Type\",\n        \"Authorization\"\n      ]\n    },\n    // Browser cache configuration\n    \"clientCache\": {\n      // Whether to enable browser caching\n      \"enabled\": true,\n      // Cache time\n      \"maxAge\": 3600\n    },\n    // HTTPS configuration\n    \"httpsConfig\": {\n      \"enabled\": false,\n      // Certificate path\n      \"cert\": \"cert/cert.pem\",\n      // Private key path\n      \"key\": \"cert/key.pem\"\n    }\n  },\n  // File storage configuration\n  \"fileConfig\": {\n    // File storage path\n    \"baseFileStoragePath\": \"data\",\n    // Whether to allow folder creation\n    \"allowFolderCreation\": true,\n    // Whether to allow file upload\n    \"uploadPath\": \"upload\",\n    // Upload file size limit\n    \"uploadLimit\": 1073741824,\n    // Upload timeout\n    \"uploadTimeout\": 7200\n  },\n  // Cache configuration\n  \"cacheConfig\": {\n    // Cache type (Cache, ...)\n    \"cacheType\": \"Cache\",\n    // In-memory cache configuration\n    \"Cache\": {\n      // Maximum number of cache entries\n      \"maxEntries\": 1000,\n      // Default TTL\n      \"defaultTTL\": 60\n    }\n  },\n  // Image processing configuration\n  \"imageConfig\": {\n    // Default format (jpeg, png, gif)\n    \"defaultFormat\": \"jpeg\",\n    // Allowed formats (png, jpeg, gif)\n    \"allowedFormats\": [\n      \"png\",\n      \"jpeg\",\n      \"gif\"\n    ],\n    // Strict mode, if enabled, only allowed sizes are permitted\n    \"strictMode\": true,\n    // Allowed sizes\n    \"allowedSizes\": [\n      16,\n      32,\n      64,\n      128,\n      256,\n      512,\n      1024\n    ],\n    // Maximum file size\n    \"maxFileSize\": 20971520,\n    // Maximum width\n    \"maxWidth\": 4096,\n    // Maximum height\n    \"maxHeight\": 4096\n  },\n  // JWT configuration\n  \"jwtConfig\": {\n    // Whether to enable JWT (strongly recommended if you are deploying on the public network)\n    \"enabled\": true,\n    // JWT algorithm, supports HS256, HS384, HS512, RS256, RS384, RS512, ES256, ES384, ES512\n    \"algorithm\": \"HS256\",\n    // JWT security configuration\n    \"Security\": {\n      // JWT signing key, please be sure to modify it when deploying\n      \"signingKey\": \"goflet\",\n      // PKCS8 format public key\n      \"publicKey\": \"\",\n      // PKCS8 format private key (since this project does not actively distribute JWT at present, it can be left empty)\n      \"privateKey\": \"\"\n    },\n    // Trusted issuers, if empty, will not be verified\n    \"trustedIssuers\": null\n  },\n  // Automatic task configuration (if 0, then not enabled, in seconds)\n  \"cronConfig\": {\n    // Delete empty folders\n    \"deleteEmptyFolder\": 3600,\n    // Clean outdated upload files\n    \"cleanOutdatedFile\": 3600\n  }\n}\n\n```\n\n## 📝 API Documentation\n\nThe integrated Swagger documentation can be accessed at `http://\u003chost\u003e:\u003cport\u003e/swagger/index.html`. You can use it to\neasily understand and use Goflet's API.\n\nIf you want to disable the Swagger documentation, you can set `swaggerEnabled` to `false` in `goflet.json`.\n\n### Authentication Method\n\nGoflet's authentication method is JWT. You can configure the JWT-related parameters in `goflet.json`. If you are\ndeploying\non the public network, it is strongly recommended that you enable JWT.\n\n### JWT Format Explanation\n\nHere is an example of a JWT. You can use [JWT.io](https://jwt.io) to parse it. It uses the HS256 algorithm, and the\nsigning key is `goflet`\n\n```text\neyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnb2ZsZXQiLCJpYXQiOjE3MTAwMDgxNTk\nsImV4cCI6MTcxMDA5NDU1OSwibmJmIjoxNzEwMDA4MTU5LCJwZXJtaXNzaW9ucyI6W3sicGF0aCI6Ii9\nhcGkvaW1hZ2UvdGVzdC93YWxscGFwZXIucG5nIiwibWV0aG9kcyI6WyJHRVQiXSwicXVlcnkiOnsiaCI\n6IjY0IiwidyI6IjY0IiwiZiI6ImpwZWcifX0seyJwYXRoIjoiL2ZpbGUvaW1hZ2VzLyoiLCJtZXRob2R\nzIjpbIkdFVCJdfV19.DYSxViy895kjycdt3k0MRNV9UCPho4QsAlRbZ4D9Kik\n```\n\nPayload:\n\n```json5\n{\n  \"iss\": \"goflet\",\n  \"iat\": 1710008159,\n  \"exp\": 1710094559,\n  \"nbf\": 1710008159,\n  // Permission list, here you can configure the permissions of this JWT, multiple permissions can be configured\n  \"permissions\": [\n    {\n      // Allowed path, excluding domain and port, supports wildcard (paths after the wildcard will not be verified)\n      \"path\": \"/api/image/test/wallpaper.png\",\n      // Allowed methods (GET, POST, PUT, DELETE, HEAD)\n      \"methods\": [\n        \"GET\"\n      ],\n      // Allowed parameters, if empty, will not be verified, the parameters configured here need to be exactly matched in the request, other parameters will not be verified, wildcards are not supported\n      \"query\": {\n        \"h\": \"64\",\n        \"w\": \"64\",\n        \"f\": \"jpeg\"\n      }\n    },\n    // query is not mandatory, you can also not set parameters, this will allow all requests\n    {\n      \"path\": \"/file/images/*\",\n      // However, you need to set methods, otherwise, it will not be verified\n      \"methods\": [\n        \"GET\"\n      ]\n    }\n  ]\n}\n\n```\n\n## 📜 License\n\nGoflet is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvvbbnn00%2Fgoflet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvvbbnn00%2Fgoflet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvvbbnn00%2Fgoflet/lists"}