{"id":15912413,"url":"https://github.com/andrewtyw/minidrive","last_synced_at":"2026-04-28T11:04:04.199Z","repository":{"id":163563886,"uuid":"596605581","full_name":"andrewtyw/MiniDrive","owner":"andrewtyw","description":"A web-based linux file server.","archived":false,"fork":false,"pushed_at":"2023-02-11T17:21:47.000Z","size":1751,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-08T16:41:32.997Z","etag":null,"topics":["cpp14","linux","socket","socket-programming"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andrewtyw.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2023-02-02T14:53:31.000Z","updated_at":"2024-09-19T03:34:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"ad62dceb-81dc-46f5-a51e-c7b990ed8cf9","html_url":"https://github.com/andrewtyw/MiniDrive","commit_stats":null,"previous_names":["andrewtyw/minidrive"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewtyw%2FMiniDrive","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewtyw%2FMiniDrive/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewtyw%2FMiniDrive/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewtyw%2FMiniDrive/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andrewtyw","download_url":"https://codeload.github.com/andrewtyw/MiniDrive/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246924311,"owners_count":20855708,"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":["cpp14","linux","socket","socket-programming"],"created_at":"2024-10-06T16:04:40.442Z","updated_at":"2026-04-28T11:04:03.984Z","avatar_url":"https://github.com/andrewtyw.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MiniDrive\nA web-based linux file server.\n\n## Features\n- 一个完全用`C++`实现的, 用于管理linux文件的Web服务。运行程序后, 用户登录成功用户即可看到其linux服务器某个文件夹下的所有文件; 用户可以删除/下载/上传文件;\n## System design\n- 使用`线程池`来调用线程处理工作队列中的事件, 比如连接事件, 信号事件, 读写事件。\n- 使用`epoll`系列系统调用来实现`Reactor`模式的`IO`复用\n- 使用有限状态机来解析`http request`, 构建`http response`和写入`http response`\n- 使用管道进行系统信号 (e.g., `SIGALRM`) 的传递\n- 基于升序链表, 设计了一个单例的定时器来**实现**了一个初级的`http session`\n- 使用`session`和`Cookie`做验证, 从而用户的每次文件操作(e.g., 删除/下载文件) 一定程度上保证了web后端接口的安全性\n- 实现了一个`半异步日志系统`, `写线程`从`队列`中取出内容，写入日志本地\n\n## Set-up\n- 推荐环境: Ubuntu 20.04, c++14, cmake: 3.24+\n```shell\ngit clone git@github.com:Andrew-wong-ty/MiniDrive.git\ncd MiniDrive/\nmkdir build\ncd build\ncmake ..\nmake\n\n# 运行主程序, 输入http:\u003c你的外网ip\u003e:8888/ 即可访问\n# username=admin, password=123456\n./main  \n```\n\n## In progress\n\n1. ~~日志系统~~\n2. 编码windows/Linux客户端来同步本地文件到远程Linux服务器\n\n## Showcase\n\n![](./utils/video.gif)\n\n## Ref. \u0026 Acknowledgement\n- 《Linux高性能服务器编程》游双\n- WebFileServer: https://github.com/shangguanyongshi/WebFileServer\n- TinyWebServer: https://github.com/qinguoyi/TinyWebServer\n- MyPoorWebServer: https://github.com/forthespada/MyPoorWebServer\n- linux-server: https://github.com/Hansimov/linux-server\n- LinuxServerCodes: https://github.com/raichen/LinuxServerCodes","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewtyw%2Fminidrive","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrewtyw%2Fminidrive","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewtyw%2Fminidrive/lists"}