开源软件名称:codeskyblue/gohttpserver开源软件地址:https://github.com/codeskyblue/gohttpserver开源编程语言:JavaScript 54.5%开源软件介绍:gohttpserver
Binaries can be downloaded from this repo releases RequirementsTested with go-1.16 ScreenshotsFeatures
Installation$ go install github.com/codeskyblue/gohttpserver@latest Or download binaries from github releases If you are using Mac, simply run command $ brew install codeskyblue/tap/gohttpserver UsageListen on port 8000 of all interfaces, and enable file uploading.
Use command Docker Usageshare current directory $ docker run -it --rm -p 8000:8000 -v $PWD:/app/public --name gohttpserver codeskyblue/gohttpserver Share current directory with http basic auth $ docker run -it --rm -p 8000:8000 -v $PWD:/app/public --name gohttpserver \
codeskyblue/gohttpserver \
--auth-type http --auth-http username:password Share current directory with openid auth. (Works only in netease company.) $ docker run -it --rm -p 8000:8000 -v $PWD:/app/public --name gohttpserver \
codeskyblue/gohttpserver \
--auth-type openid To build image yourself, please change the PWD to the root of this repo. $ cd gohttpserver/
$ docker build -t codeskyblue/gohttpserver -f docker/Dockerfile . Authentication options
Advanced usageAdd access rule by creating a ---
upload: false
delete: false
users:
- email: "codeskyblue@codeskyblue.com"
delete: true
upload: true
token: 4567gf8asydhf293r23r In this case, if openid auth is enabled and user "codeskyblue@codeskyblue.com" has logged in, he/she can delete/upload files under the directory where the
For example, in the following directory hierarchy, users can delete/uploade files in directory
User can specify config file name with To specify which files is hidden and which file is visible, add the following lines to accessTables:
- regex: block.file
allow: false
- regex: visual.file
allow: true ipa plist proxyThis is used for server on which https is enabled. default use https://plistproxy.herokuapp.com/plist $ gohttpserver --plistproxy=https://someproxyhost.com/ Test if proxy works: $ http POST https://someproxyhost.com/plist < app.plist
{
"key": "18f99211"
}
$ http GET https://someproxyhost.com/plist/18f99211
# show the app.plist content If your ghs running behide nginx server and have https configed. plistproxy will be disabled automaticly. Upload with CURLFor example, upload a file named $ curl -F file=@foo.txt localhost:8000/somedir
{"destination":"somedir/foo.txt","success":true}
# upload with token
$ curl -F file=@foo.txt -F token=12312jlkjafs localhost:8000/somedir
{"destination":"somedir/foo.txt","success":true}
# upload and change filename
$ curl -F file=@foo.txt -F filename=hi.txt localhost:8000/somedir
{"destination":"somedir/hi.txt","success":true} Upload zip file and unzip it (zip file will be delete when finished unzip)
Note: Deploy with nginxRecommended configuration, assume your gohttpserver listening on
gohttpserver should started with Refs: http://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size gohttpserver also support Usage example: # for gohttpserver
$ gohttpserver --prefix /foo --addr :8200 --xheaders Nginx settigns
FAQHow the query is formatedThe search query follows common format rules just like Google. Keywords are seperated with space(s), keywords with prefix
Developer GuideDepdencies are managed by govendor
$ go build
$ ./gohttpserver
$ go build Theme are defined in assets/themes directory. Now only two themes are available, "black" and "green". Reference Web sites
Go Libraries
HistoryThe old version is hosted at https://github.com/codeskyblue/gohttp LICENSEThis project is licensed under MIT. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论