{"id":13471597,"url":"https://github.com/m3ng9i/ran","last_synced_at":"2026-01-18T11:44:59.050Z","repository":{"id":1759981,"uuid":"43506888","full_name":"m3ng9i/ran","owner":"m3ng9i","description":"a simple static web server written in Go","archived":false,"fork":false,"pushed_at":"2023-02-24T19:27:39.000Z","size":61,"stargazers_count":873,"open_issues_count":13,"forks_count":77,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-03-26T13:39:12.474Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/m3ng9i.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}},"created_at":"2015-10-01T16:15:00.000Z","updated_at":"2025-03-26T11:11:23.000Z","dependencies_parsed_at":"2022-09-02T00:02:15.732Z","dependency_job_id":"ec18821d-f6fc-41ca-b4f7-79c9fc9b7862","html_url":"https://github.com/m3ng9i/ran","commit_stats":{"total_commits":37,"total_committers":6,"mean_commits":6.166666666666667,"dds":"0.16216216216216217","last_synced_commit":"903da51a0ec54f4827c085a8971bc91fddb0336a"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/m3ng9i/ran","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m3ng9i%2Fran","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m3ng9i%2Fran/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m3ng9i%2Fran/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m3ng9i%2Fran/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/m3ng9i","download_url":"https://codeload.github.com/m3ng9i/ran/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m3ng9i%2Fran/sbom","scorecard":{"id":608428,"data":{"date":"2025-08-11","repo":{"name":"github.com/m3ng9i/ran","commit":"903da51a0ec54f4827c085a8971bc91fddb0336a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.5,"checks":[{"name":"Code-Review","score":1,"reason":"Found 3/26 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v0.1.6 not signed: https://api.github.com/repos/m3ng9i/ran/releases/48105557","Warn: release artifact v0.1.5 not signed: https://api.github.com/repos/m3ng9i/ran/releases/27982381","Warn: release artifact v0.1.4 not signed: https://api.github.com/repos/m3ng9i/ran/releases/16602233","Warn: release artifact v0.1.3 not signed: https://api.github.com/repos/m3ng9i/ran/releases/3835339","Warn: release artifact v0.1.2 not signed: https://api.github.com/repos/m3ng9i/ran/releases/2037604","Warn: release artifact v0.1.6 does not have provenance: https://api.github.com/repos/m3ng9i/ran/releases/48105557","Warn: release artifact v0.1.5 does not have provenance: https://api.github.com/repos/m3ng9i/ran/releases/27982381","Warn: release artifact v0.1.4 does not have provenance: https://api.github.com/repos/m3ng9i/ran/releases/16602233","Warn: release artifact v0.1.3 does not have provenance: https://api.github.com/repos/m3ng9i/ran/releases/3835339","Warn: release artifact v0.1.2 does not have provenance: https://api.github.com/repos/m3ng9i/ran/releases/2037604"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: containerImage not pinned by hash: Dockerfile:1","Warn: containerImage not pinned by hash: Dockerfile:6: pin your Docker image by updating alpine to alpine@sha256:4bcff63911fcb4448bd4fdacec207030997caf25e9bea4045fa6c8c44de311d1","Info:   0 out of   2 containerImage dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 7 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"14 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2022-0536 / GHSA-39qc-96h7-956f / GHSA-hgr8-6h9x-f7q9","Warn: Project is vulnerable to: GO-2022-0236 / GHSA-h86h-8ppg-mxmh","Warn: Project is vulnerable to: GO-2021-0238 / GHSA-83g2-8m93-v3w7","Warn: Project is vulnerable to: GO-2022-0288","Warn: Project is vulnerable to: GO-2022-0969 / GHSA-69cg-p879-7622","Warn: Project is vulnerable to: GO-2022-1144 / GHSA-xrjj-mj9h-534m","Warn: Project is vulnerable to: GO-2023-1571 / GHSA-vvpx-j8f3-3w6h","Warn: Project is vulnerable to: GO-2023-1988 / GHSA-2wrh-6pvc-2jm9","Warn: Project is vulnerable to: GO-2023-2102 / GHSA-4374-p667-p6c8","Warn: Project is vulnerable to: GHSA-qppj-fm5r-hxr3","Warn: Project is vulnerable to: GO-2024-2687 / GHSA-4v7x-pqxf-cx7m","Warn: Project is vulnerable to: GO-2024-3333","Warn: Project is vulnerable to: GO-2025-3503 / GHSA-qxp5-gwg8-xv66","Warn: Project is vulnerable to: GO-2025-3595 / GHSA-vvgc-356p-c3xw"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-21T02:07:17.118Z","repository_id":1759981,"created_at":"2025-08-21T02:07:17.118Z","updated_at":"2025-08-21T02:07:17.118Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28535177,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T10:13:46.436Z","status":"ssl_error","status_checked_at":"2026-01-18T10:13:11.045Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-07-31T16:00:47.147Z","updated_at":"2026-01-18T11:44:59.019Z","avatar_url":"https://github.com/m3ng9i.png","language":"Go","readme":"Ran: a simple static web server written in Go\n=============================================\n\n![Ran](https://raw.githubusercontent.com/m3ng9i/ran/master/ran.gif)\n\nRan is a simple web server for serving static files.\n\n- Github: \u003chttps://github.com/m3ng9i/ran\u003e\n- Docker Hub: \u003chttps://hub.docker.com/r/m3ng9i/ran\u003e\n\n## Features\n\n- Directory listing\n- Automatic gzip compression\n- Digest authentication\n- Access logging\n- Custom 401 and 404 error file\n- TLS encryption\n- Disable content caching\n- Write cross-origin resource sharing headers to the response\n\n## What is Ran for?\n\n- File sharing in LAN or home network\n- Web application testing\n- Personal web site hosting or demonstrating\n\n## Dependencies\n\n- [github.com/abbot/go-http-auth](https://github.com/abbot/go-http-auth)\n- [github.com/oxtoacart/bpool](https://github.com/oxtoacart/bpool)\n- [github.com/m3ng9i/go-utils/http](https://github.com/m3ng9i/go-utils)\n- [github.com/m3ng9i/go-utils/log](https://github.com/m3ng9i/go-utils)\n- [github.com/m3ng9i/go-utils/possible](https://github.com/m3ng9i/go-utils)\n- [golang.org/x/net/context](https://github.com/golang/net)\n\n## Installation\n\nUse the command below to install the dependencies mentioned above, and build the binary into $GOPATH/bin.\n\n```bash\ngo get -u github.com/m3ng9i/ran\n```\n\nFor convenience, you can move the ran binary to a directory in the PATH environment variable.\n\nYou can also call `./build.py` command under the Ran source directory to write version information into the binary, so that `ran -v` will give a significant result. Run `./build.py -h` for help.\n\n### Running with Docker\n\n```bash\ndocker run -d -p 8080:8080 -v /public:/web m3ng9i/ran\n```\n\nDirectory volume mounted to `/web` will be served by default.\n\nBelow is another example, the options `-l -404 /404page.html` are passed to the `ran` binary:\n\n```bash\ndocker run --name ran -d -p 8080:8080 -v /public:/web:ro m3ng9i/ran -l -404 /404page.html\n```\n\n## Download binary\n\nYou can also download the Ran binary without building it yourself.\n\n[Download Ran binary from the release page](https://github.com/m3ng9i/ran/releases).\n\n## Run Ran\n\nYou can start a web server without any options by typing `ran` and pressing return in terminal window. This will use the following default configuration:\n\nConfiguration               | Default value\n----------------------------|--------------------------------\nRoot directory              | the current working directory\nIP binding                  | 0.0.0.0\nPort                        | 8080\nIndex file                  | index.html, index.htm\nList files of directories   | false\nServe all path              | false\nGzip                        | true\nDisable caching             | false\nWrite cross-origin headers  | false\nDigest auth                 | false\nTLS encryption              | off\n\nOpen http://127.0.0.1:8080 in browser to see your website.\n\nYou can use the command line options to override the default configuration.\n\nOptions:\n\n```\n    -r,  -root=\u003cpath\u003e           Root path of the site. Default is current working directory.\n    -b,  -bind-ip=\u003cip\u003e          Bind one or more IP addresses to the ran web server.\n                                Multiple IP addresses should be separated by comma.\n                                If not provide this Option, ran will use 0.0.0.0.\n    -p,  -port=\u003cport\u003e           HTTP port. Default is 8080.\n         -404=\u003cpath\u003e            Path of a custom 404 file, relative to Root. Example: /404.html.\n    -i,  -index=\u003cpath\u003e          File name of index, priority depends on the order of values.\n                                Separate by colon. Example: -i \"index.html:index.htm\"\n                                If not provide, default is index.html and index.htm.\n    -l,  -listdir=\u003cbool\u003e        When request a directory and no index file found,\n                                if listdir is true, show file list of the directory,\n                                if listdir is false, return 404 not found error.\n                                Default is false.\n    -sa, -serve-all=\u003cbool\u003e      Serve all paths even if the path is start with dot. Default is false.\n    -g,  -gzip=\u003cbool\u003e           Turn on or off gzip compression. Default value is true (means turn on).\n\n    -nc, -no-cache=\u003cbool\u003e       If true, ran will remove Last-Modified header and write some no-cache headers to the response:\n                                    Cache-Control: no-cache, no-store, must-revalidate\n                                    Pragma: no-cache\n                                    Expires 0\n                                Default is false.\n\n         -cors=\u003cbool\u003e           If true, ran will write some cross-origin resource sharing headers to the response:\n                                    Access-Control-Allow-Origin: *\n                                    Access-Control-Allow-Credentials: true\n                                    Access-Control-Allow-Methods: *\n                                    Access-Control-Allow-Headers: *\n                                If the request header has a Origin field, then it's value is used in Access-Control-Allow-Origin.\n                                Default is false.\n\n    -am, -auth-method=\u003cauth\u003e    Set authentication method, valid values are basic and digest. Default is basic.\n    -a,  -auth=\u003cuser:pass\u003e      Turn on authentication and set username and password (separate by colon).\n                                After turn on authentication, all the page require authentication.\n         -401=\u003cpath\u003e            Path of a custom 401 file, relative to Root. Example: /401.html.\n                                If authentication fails and 401 file is set,\n                                the file content will be sent to the client.\n\n         -tls-port=\u003cport\u003e       HTTPS port. Default is 443.\n         -tls-policy=\u003cpol\u003e      This option indicates how to handle HTTP and HTTPS traffic.\n                                There are three option values: redirect, both and only.\n                                redirect: redirect HTTP to HTTPS\n                                both:     both HTTP and HTTPS are enabled\n                                only:     only HTTPS is enabled, HTTP is disabled\n                                The default value is: only.\n         -cert=\u003cpath\u003e           Load a file as a certificate.\n                                If use with -make-cert, will generate a certificate to the path.\n         -key=\u003cpath\u003e            Load a file as a private key.\n                                If use with -make-cert, will generate a private key to the path.\n```\n\nOther options:\n\n```\n         -make-cert             Generate a self-signed certificate and a private key used in TLS encryption.\n                                You should use -cert and -key to set the output paths.\n         -showconf              Show config info in the log.\n         -debug                 Turn on debug mode.\n    -v,  -version               Show version information.\n    -h,  -help                  Show help message.\n```\n\nIf you want to shutdown Ran, type `ctrl+c` in the terminal, or kill it in the task manager.\n\n### Examples\n\nExample 1: Start a server in the current directory and set port to 8888\n\n```bash\nran -p=8888\n```\n\nExample 2: Set root to /tmp, list files of directories and set a custom 404 page\n\n```bash\nran -r=/tmp -l=true -404=/404.html\n```\n\n`-l=true` can be shorted to `-l` for convenience.\n\nExample 3: Turn off gzip compression, set access username and password and set a custom 401 page\n\n```bash\nran -g=false -a=user:pass -401=/401.html\n```\n\nExample 4: Set custom index file\n\n```bash\nran -i default.html:index.html\n```\n\nExample 5: Turn on TLS encryption\n\nIf you want to turn on TLS encryption (https), you should use `-cert` to load a certificate and `-key` to load a private key.\n\nThe default TLS port is 443, you can use `-tls-port` to set it to another port.\n\nThe following command load a certificate and a private key, and set TLS port to 9999. It can be browsed at https://127.0.0.1:9999.\n\n```bash\nran -cert=/path/to/cert.pem -key=/path/to/key.pem -tls-port=9999\n```\n\nExample 6: Control HTTP and HTTPS traffic\n\nWhen you turn on TLS, you can choose to disable HTTP, redirect HTTP to HTTPS or let them work together.\n\nYou can use `-tls-policy` to control HTTP and HTTPS traffic:\n\n- If set to \"redirect\", all HTTP traffic will be redirect to HTTPS.\n- If set to \"both\", both HTTP and HTTPS are enabled.\n- If set to \"only\", only HTTPS is enabled, HTTP is disabled.\n\nIf not provide `-tls-policy`, the default value \"only\" will be used.\n\nAn example:\n\n```bash\nran -cert=cert.pem -key=key.pem -tls-policy=redirect\n```\n\nExample 7: Create a self-signed certificate and a private key\n\nFor testing purposes or internal usage, you can use `-make-cert` to create a self-signed certificate and a private key.\n\n```bash\nran -make-cert -cert=/path/to/cert.pem -key=/path/to/key.pem\n```\n\nExample 8: Custom IP binding\n\n```bash\nran -b=127.0.0.12,192.168.0.34\n```\n\n## Tips and tricks\n\n### Execute permission\n\nBefore running Ran binary or build.py, make sure they have execute permission. If don't, use `chmod u+x \u003cfilename\u003e` to set.\n\n### download parameter\n\nIf you add `download` as a query string parameter in the url, the browser will download the file instead of displaying it in the browser window. Example:\n\n```\nhttp://127.0.0.1:8080/readme.html?download\n```\n\n### gzip parameter\n\nGzip compression is enabled by default. Ran will gzip file automaticly according to the file extension. Example: a `.txt` file will be compressed and a `.jpg` file will not.\n\nIf you add `gzip=true` in the url, Ran will force compress the file even if the file should not be compressed. Example:\n\n```\nhttp://127.0.0.1:8080/picture.jpg?gzip=true\n```\n\nIf you add `gzip=false` in the url, Ran will not compress it even if it should be compressed. Example:\n\n```\nhttp://127.0.0.1:8080/large-file.txt?gzip=false\n```\n\nRead the source code of [CanBeCompressed()](https://github.com/m3ng9i/go-utils/blob/master/http/can_be_compressed.go) to learn more about automatic gzip compression.\n\n## Changelog\n\n- **v0.1.6**: Fix security issue under Windows\n\n- **v0.1.5**:\n\n    - Add `-b, -bind-ip` for custom IP binding\n    - URL for 404 page now return status 404\n\n- **v0.1.4**:\n\n    - Add `-no-cache` option to disable content caching\n    - Add `-cors` option to write cross-origin resource sharing headers to the response\n    - Record the X-Real-Ip field in the request header to the log\n    - Fix bug of file not being closed after opening\n    - Use HTML template for directory listing (thanks to @toby)\n\n- **v0.1.3**:\n\n    - Add trailing slash if the request path is a directory and the directory contains a index file.\n    - Add basic auth; add -am, -auth-method option.\n    - Add -sa, -serve-all option to set if skip paths that start with dot.\n    - Print the listening URLs after the server starts.\n\n- **v0.1.2**: Add TLS encryption; add custom 401 file.\n- **v0.1.1**: Fix bugs and typos.\n- **v0.1**: Initial release.\n\n## ToDo\n\nThe following functionalities will be added in the future:\n\n- Load config from file\n- IP filter\n- Custom log format\n- etc\n\n## What's the meaning of Ran\n\nIt's a Chinese PinYin and pronounce 燃, means flame burning.\n\n## Author\n\nmengqi \u003chttps://github.com/m3ng9i\u003e\n\nIf you like this project, please give me a star.\n\n","funding_links":[],"categories":["Go","Tools","Other"],"sub_categories":["Go"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm3ng9i%2Fran","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fm3ng9i%2Fran","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm3ng9i%2Fran/lists"}