diff --git a/.gitignore b/.gitignore index dd7fa0b..3d0a5c7 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,7 @@ # backend **/*/quickshare.db **/*/files/ -**/*/uploadings/ \ No newline at end of file +**/*/uploadings/ + +# misc +dist \ No newline at end of file diff --git a/README.md b/README.md index b34d06a..49094be 100644 --- a/README.md +++ b/README.md @@ -2,11 +2,11 @@ Quickshare

- Simple file sharing server built with Go/Golang, Typescript, Gin, React, Boltdb, etc. + Simple file sharing service built with Go/Golang, Typescript, Gin, React, Boltdb, etc.

- - + + @@ -16,29 +16,35 @@

-![Quickshare demo](./demo.jpg) +![Quickshare on desktop](./docs/imgs/desktop.jpeg) + +![Quickshare on mobile](./docs/imgs/mobile.jpeg) Choose Language: English | [简体中文](./docs/README_zh-cn.md) -## Download - -Visit [Release Page](https://github.com/ihexxa/quickshare/releases) to get Linux | Mac | Windows distribution(s). - ## Main Features -- Uploading and downloading in browser without client +- Sharing files among different devices (Adaptive UI) - Be compatible with Linux, Mac and Windows -- Sharing files among different devices (desktop & mobile) -- Stopping and resuming uploading/downloading +- Stopping and resuming uploading/downloading +- Do uploading and downloading in web browser -## Installation +## Quick Start -Coming soon. +**Downloading**: Download last distribution(s) in [Release Page](https://github.com/ihexxa/quickshare/releases). + +**Unzipping**: Unzip it and run following command `./quickshare`. (You may update its execution permission: e.g. run `chmod u+x quickshare` on Linux) + +**Starting**: At the first run, Quickshare will let you input your user name and generate a random password for you (here `quickshare` is the user name). It may output something like following (password is `2fdc98`): + +``` +Please input admin name: quickshare +password is generated: 2fdc98, please update it after login +user (quickshare) is created +``` + +**Accessing**: At last, open your browser and visit `http://127.0.0.1:8686`. ### FAQ -Please refer [FAQ document](./docs/FAQ_en-us.md) - -### Contribution - -TODO +Coming soon. diff --git a/cmd/quickshare b/cmd/quickshare new file mode 100755 index 0000000..92494e0 Binary files /dev/null and b/cmd/quickshare differ diff --git a/config.json b/config.json deleted file mode 100644 index 65a5dfb..0000000 --- a/config.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "AppName": "qs", - "AdminId": "admin", - "AdminPwd": "quicksh@re", - "SecretKey": "qs", - "Production": true, - "HostName": "", - "Port": 8888, - "MaxUpBytesPerSec": 10000000, - "MaxDownBytesPerSec": 10000000, - "MaxRangeLength": 10485760, - "Timeout": 7200000, - "ReadTimeout": 5000, - "WriteTimeout": 7200000, - "IdleTimeout": 10000, - "WorkerPoolSize": 16, - "TaskQueueSize": 16, - "QueueSize": 16, - "ParseFormBufSize": 5000000, - "MaxHeaderBytes": 1024, - "DownLimit": -1, - "MaxShares": 16384, - "LocalFileLimit": -1, - "CookieDomain": "", - "CookieHttpOnly": false, - "CookieMaxAge": 604800, - "CookiePath": "/", - "CookieSecure": false, - "KeyAdminId": "adminid", - "KeyAdminPwd": "adminpwd", - "KeyToken": "token", - "KeyFileName": "fname", - "KeyFileSize": "size", - "KeyShareId": "shareid", - "KeyStart": "start", - "KeyLen": "len", - "KeyChunk": "chunk", - "KeyAct": "act", - "KeyExpires": "expires", - "KeyDownLimit": "downlimit", - "ActStartUpload": "startupload", - "ActUpload": "upload", - "ActFinishUpload": "finishupload", - "ActLogin": "login", - "ActLogout": "logout", - "ActShadowId": "shadowid", - "ActPublishId": "publishid", - "ActSetDownLimit": "setdownlimit", - "ActAddLocalFiles": "addlocalfiles", - "AllUsers": "addlocalfiles", - "OpIdIpVisit": 0, - "OpIdUpload": 1, - "OpIdDownload": 2, - "OpIdLogin": 3, - "OpIdGetFInfo": 4, - "OpIdDelFInfo": 5, - "OpIdOpFInfo": 6, - "PathLocal": "files", - "PathLogin": "/login", - "PathDownloadLogin": "/download-login", - "PathDownload": "/download", - "PathUpload": "/upload", - "PathStartUpload": "/startupload", - "PathFinishUpload": "/finishupload", - "PathFileInfo": "/fileinfo", - "PathClient": "/", - "LimiterCap": 256, - "LimiterTtl": 3600, - "LimiterCyc": 1, - "BucketCap": 100, - "SpecialCapsStr": { - "0": 100, - "1": 100, - "2": 100, - "3": 1 - } -} diff --git a/demo.jpg b/demo.jpg deleted file mode 100644 index 5a1a1c7..0000000 Binary files a/demo.jpg and /dev/null differ diff --git a/docs/CONFIG_en-us.md b/docs/CONFIG_en-us.md deleted file mode 100644 index 7b43de2..0000000 --- a/docs/CONFIG_en-us.md +++ /dev/null @@ -1,82 +0,0 @@ -## Configuration - -```Javascript -{ - "AppName": "qs", - "AdminId": "admin", // login user name - "AdminPwd": "quicksh@re", // login password - "SecretKey": "qs", // key for hashing cookie (jwt) - "Production": true, - "HostName": "", // listening address - "Port": 8888, // listening port - "MaxUpBytesPerSec": 2000000, // upload speed limit - "MaxDownBytesPerSec": 1000000, // download speed limit - "MaxRangeLength": 10485760, // max length of chunk to upload at once - "Timeout": 7200000, // connection timeout - "ReadTimeout": 5000, // connection read request timeout - "WriteTimeout": 7200000, // connection write response timeout - "IdleTimeout": 10000, // connection idle timeout - "WorkerPoolSize": 16, // number of workers, it decides how many download connections are provided at same time - "TaskQueueSize": 16, // how many requests can be queued - "QueueSize": 16, - "ParseFormBufSize": 5000000, // buffer for parsing request - "MaxHeaderBytes": 1024, // max header size in byte - "DownLimit": -1, // default download limit - "MaxShares": 16384, // max number of sharing - "LocalFileLimit": -1, // max number of listing file at once - "CookieDomain": "", - "CookieHttpOnly": false, - "CookieMaxAge": 604800, - "CookiePath": "/", - "CookieSecure": false, - "KeyAdminId": "adminid", - "KeyAdminPwd": "adminpwd", - "KeyToken": "token", - "KeyFileName": "fname", - "KeyFileSize": "size", - "KeyShareId": "shareid", - "KeyStart": "start", - "KeyLen": "len", - "KeyChunk": "chunk", - "KeyAct": "act", - "KeyExpires": "expires", - "KeyDownLimit": "downlimit", - "ActStartUpload": "startupload", - "ActUpload": "upload", - "ActFinishUpload": "finishupload", - "ActLogin": "login", - "ActLogout": "logout", - "ActShadowId": "shadowid", - "ActPublishId": "publishid", - "ActSetDownLimit": "setdownlimit", - "ActAddLocalFiles": "addlocalfiles", - "AllUsers": "addlocalfiles", - "OpIdIpVisit": 0, - "OpIdUpload": 1, - "OpIdDownload": 2, - "OpIdLogin": 3, - "OpIdGetFInfo": 4, - "OpIdDelFInfo": 5, - "OpIdOpFInfo": 6, - "PathLocal": "files", - "PathLogin": "/login", - "PathDownloadLogin": "/download-login", - "PathDownload": "/download", - "PathUpload": "/upload", - "PathStartUpload": "/startupload", - "PathFinishUpload": "/finishupload", - "PathFileInfo": "/fileinfo", - "PathClient": "/", - "LimiterCap": 256, - "LimiterTtl": 3600, - "LimiterCyc": 1, - "BucketCap": 10, // operation is allowed at most 10 times per second, but SpecialCapsStr will override this value - "SpecialCapsStr": { - "0": 30, // IpVisit is allowed at most 30 times per second - "1": 10, // Uploading is allowed at most 10 times per second - "2": 10, // Downloading is allowed at most 10 times per second - "3": 1 // Login/Logout is allowed at most 1 time per second - // You can also add rate limits according to OpIdxxx above. - } -} -``` diff --git a/docs/FAQ_en-us.md b/docs/FAQ_en-us.md deleted file mode 100644 index 06b9522..0000000 --- a/docs/FAQ_en-us.md +++ /dev/null @@ -1,18 +0,0 @@ -## FAQ - -- How to change accound name and password? - - Go to quickshare folder - - Open config.json using text editor. (e.g. notpad++, sublime, vscode, etc...) - - Search for line `"AdminPwd": "quicksh@re",` - - Replace `quicksh@re` with your password, e.g. `"AdminPwd": "myPassword",` - - Then you can also update user name `"AdminId": "myUserName",` in above way. -- How to change listening address(or port)? - - Go to quickshare folder - - Open config.json using text editor. (e.g. notpad++, sublime, vscode, etc...) - - Search for line `"HostName": "",` - - Change the value of `HostName`, e.g. `"HostName": "192.168.0.6",` - - You can also change port value (`"Port": 8888,`) in above way -- How to change background? - - Go to `public` folder under quickshare folder - - Open style.css using text editor. (e.g. notpad++, sublime, vscode, etc...) - - Update `body`'s css. diff --git a/docs/FAQ_zh-cn.md b/docs/FAQ_zh-cn.md deleted file mode 100644 index c7694dd..0000000 --- a/docs/FAQ_zh-cn.md +++ /dev/null @@ -1,17 +0,0 @@ -## 常见问题 - -- 怎么改用户名和密码? - - 进入 quickshare 文件夹 - - 用文本编辑器打开 config.json. (比如 notpad++, sublime, vscode, 等等...) - - 查找行 `"AdminPwd": "quicksh@re",` - - 用你的密码替换 `quicksh@re`, 比如 `"AdminPwd": "你的密码",` -- 怎么改监听地址(端口)? - - 进入 quickshare 文件夹 - - 用文本编辑器打开 config.json. (比如 notpad++, sublime, vscode, 等等...) - - 查找行 `"HostName": "",` - - 更改`HostName`的值, 比如 `"HostName": "192.168.0.6",` - - 你可以用上面的方法更改端口值(`"Port": 8888,`) -- 怎么更改背景? - - 进入 quickshare 文件夹下的`public`文件夹 - - 使用文本编辑器打开 style.css. (比如 notpad++, sublime, vscode, 等等...) - - 更新 `body`'的 css diff --git a/docs/README_zh-cn.md b/docs/README_zh-cn.md index 622851e..bc6f5d3 100644 --- a/docs/README_zh-cn.md +++ b/docs/README_zh-cn.md @@ -1,12 +1,12 @@

- [未完成!!!] Quickshare + Quickshare

- 简约的文件共享服务, 使用Go/Golang, Typescript, Gin, React, Boltdb等构建. + 简单的文件共享服务, 使用Go/Golang, Typescript, Gin, React, Boltdb等构建.

- - + + @@ -16,58 +16,35 @@

-![Quickshare 演示](../demo.jpg) +![Quickshare on desktop](./imgs/desktop.jpeg) + +![Quickshare on mobile](./imgs/mobile.jpeg) 选择语言: [English](../README.md) | 简体中文 -## 下载 +## 主要功能 -访问 [发布页](https://github.com/ihexxa/quickshare/releases) 获取 Linux | Mac | Windows 版本. +- 在多个设备之间共享文件 (自适应 UI) +- 兼容 Linux, Mac 和 Windows +- 上传下载都支持断点续传 +- 在 Web 浏览器 中完成上传下载 -## 特点 +## 快速开始 -- 在浏览器中上传下载, 无需安装任何客户端 -- 在桌面电脑和移动设备件间共享文件 -- 绿色软件 -- 支持添加本地文件 -- 支持添加文件下载次数上限 -- 支持断点续传 +**下载**: 先下载最新版本 [发布页](https://github.com/ihexxa/quickshare/releases). -## 安装 +**解压**: 将其解压, 并在运行命令 `./quickshare`. (你可能需要为它更新执行权限: 比如在 linux 上执行 `chmod u+x quickshare`) -开始使用 quickshare 主要需要两步: 解压, 启动. +**运行**: 在第一次运行时, Quickshare 会让你输入你的用户名 (这里输入的用户名是 quickshare), 并会为你生成密码. 它可能会输出类似下面内容 (这里密码是`2fdc98`): -第一步, 解压下载包, 启动 quickshare. +``` +Please input admin name: quickshare +password is generated: 2fdc98, please update it after login +user (quickshare) is created +``` -### Linux - -- 解压包: `unzip [package].` (`[package]` 可以是`quickshare_0.0.8_linux_x86_6 4.zip`) -- 进入文件夹, 启动 quickshare `./quickshare` - -### Mac - -- 解压包: `unzip [package].` (`[package]` 可以是`quickshare_0.0.8_macos_x86_6 4.zip`) -- 进入文件夹, 启动 quickshare `./quickshare` - -### Windows - -- 解压包 -- 进入文件夹, 双击 `quickshare.exe` 启动 quickshare - -最后一步, 在浏览器中面基 quickshare. - -- Quickshare 会在启动后, 在命令中输出中显示 `quickshare starts @ [URL]` (举个栗子 `URL` 可以是 `192.168.0.1:8888`) -- 在浏览器中打开 `URL` 并使用 `admin` 和 `quicksh@re` 登入 -- 开耍(不过别忘改密码[常见问题文档](./FAQ_zh-cn.md)) +**访问**: 最后, 打开你的浏览器并访问 `http://127.0.0.1:8686`. ### 常见问题 -请参考[常见问题文档](./FAQ_zh-cn.md) - -### 配置 - -请参考[配置文档](./CONFIG_en-us.md) - -### 贡献代码 - -待添加... +敬请期待. diff --git a/docs/imgs/desktop.jpeg b/docs/imgs/desktop.jpeg new file mode 100644 index 0000000..9930462 Binary files /dev/null and b/docs/imgs/desktop.jpeg differ diff --git a/docs/imgs/mobile.jpeg b/docs/imgs/mobile.jpeg new file mode 100644 index 0000000..2263924 Binary files /dev/null and b/docs/imgs/mobile.jpeg differ diff --git a/package.json b/package.json index 8687228..91d25fd 100644 --- a/package.json +++ b/package.json @@ -4,13 +4,6 @@ "src/client/web" ], "scripts": { - "dev:setup": "yarn && yarn dev:copy-immutable && yarn dev:copy-react-dom && yarn dev:copy-react", - "dev:copy-immutable": "cp node_modules/immutable/dist/immutable.min.js public/static/js/", - "dev:copy-react-dom": "cp node_modules/react-dom/umd/react-dom.development.js public/static/js/", - "dev:copy-react": "cp node_modules/react/umd/react.development.js public/static/js/", - "prod:setup": "yarn && yarn prod:copy-immutable && yarn prod:copy-react-dom && yarn prod:copy-react", - "prod:copy-immutable": "cp node_modules/immutable/dist/immutable.min.js public/static/js/", - "prod:copy-react-dom": "cp node_modules/react-dom/umd/react-dom.production.min.js public/static/js/", - "prod:copy-react": "cp node_modules/react/umd/react.production.min.js public/static/js/" + "build": "scripts/build" } } diff --git a/scripts/build b/scripts/build new file mode 100755 index 0000000..3c65f95 --- /dev/null +++ b/scripts/build @@ -0,0 +1,8 @@ +export QSROOT=`pwd` +rm -r dist && mkdir dist +cd cmd +go build -o $QSROOT/dist/quickshare +cd $QSROOT/src/client/web +yarn build +cp -r $QSROOT/public $QSROOT/dist +cd $QSROOT diff --git a/src/client/web/build/template/index.template.html b/src/client/web/build/template/index.template.html index 8737a10..686a4f0 100644 --- a/src/client/web/build/template/index.template.html +++ b/src/client/web/build/template/index.template.html @@ -86,7 +86,7 @@ name="msapplication-TileImage" content="/static/fav/ms-icon-144x144.png" /> --> -