{"id":36496981,"url":"https://github.com/eloylp/go-serve","last_synced_at":"2026-01-12T02:04:44.512Z","repository":{"id":41535598,"uuid":"205591822","full_name":"eloylp/go-serve","owner":"eloylp","description":"HTTP server for serving static files in a simple way","archived":false,"fork":false,"pushed_at":"2023-03-07T01:34:03.000Z","size":2045,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-07-23T11:34:31.806Z","etag":null,"topics":["auth","basic","binary","file","go","http","server","simple","static"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eloylp.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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":"2019-08-31T20:14:03.000Z","updated_at":"2022-07-03T17:17:14.000Z","dependencies_parsed_at":"2024-06-21T00:32:58.611Z","dependency_job_id":null,"html_url":"https://github.com/eloylp/go-serve","commit_stats":{"total_commits":262,"total_committers":2,"mean_commits":131.0,"dds":0.01908396946564883,"last_synced_commit":"70407d82d7d0850d14ca336697f1a8c7c2ba6807"},"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"purl":"pkg:github/eloylp/go-serve","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eloylp%2Fgo-serve","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eloylp%2Fgo-serve/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eloylp%2Fgo-serve/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eloylp%2Fgo-serve/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eloylp","download_url":"https://codeload.github.com/eloylp/go-serve/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eloylp%2Fgo-serve/sbom","scorecard":{"id":373760,"data":{"date":"2025-08-11","repo":{"name":"github.com/eloylp/go-serve","commit":"70407d82d7d0850d14ca336697f1a8c7c2ba6807"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.5,"checks":[{"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":"Code-Review","score":0,"reason":"Found 0/10 approved changesets -- score normalized to 0","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":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","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":"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/master.yml:1","Info: no jobLevel write permissions found"],"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":"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: The Unlicense: 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":"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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/master.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/eloylp/go-serve/master.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/master.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/eloylp/go-serve/master.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/master.yml:48: update your workflow using https://app.stepsecurity.io/secureworkflow/eloylp/go-serve/master.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/master.yml:51: update your workflow using https://app.stepsecurity.io/secureworkflow/eloylp/go-serve/master.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/master.yml:56: update your workflow using https://app.stepsecurity.io/secureworkflow/eloylp/go-serve/master.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/master.yml:69: update your workflow using https://app.stepsecurity.io/secureworkflow/eloylp/go-serve/master.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/master.yml:75: update your workflow using https://app.stepsecurity.io/secureworkflow/eloylp/go-serve/master.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/master.yml:88: update your workflow using https://app.stepsecurity.io/secureworkflow/eloylp/go-serve/master.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/master.yml:93: update your workflow using https://app.stepsecurity.io/secureworkflow/eloylp/go-serve/master.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/master.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/eloylp/go-serve/master.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/master.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/eloylp/go-serve/master.yml/master?enable=pin","Warn: containerImage not pinned by hash: Dockerfile:1","Info:   0 out of   6 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   5 third-party GitHubAction dependencies pinned","Info:   0 out of   1 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":"Vulnerabilities","score":2,"reason":"8 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2022-0322 / GHSA-cg3q-j54f-5p7p","Warn: Project is vulnerable to: GO-2022-0968 / GHSA-gwc9-m7rh-j2ww","Warn: Project is vulnerable to: GO-2021-0356 / GHSA-8c26-wmh5-6g9v","Warn: Project is vulnerable to: GO-2024-2961","Warn: Project is vulnerable to: GO-2023-2402 / GHSA-45x7-px36-x8w8","Warn: Project is vulnerable to: GO-2024-3321 / GHSA-v778-237x-gjrc","Warn: Project is vulnerable to: GO-2025-3487 / GHSA-hcg3-q754-cr77","Warn: Project is vulnerable to: GO-2022-0493 / GHSA-p782-xgp4-8hr8"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v2.0.0-rc19 not signed: https://api.github.com/repos/eloylp/go-serve/releases/44790039","Warn: release artifact v2.0.0 not signed: https://api.github.com/repos/eloylp/go-serve/releases/44811869","Warn: release artifact v2.0.0-rc16 not signed: https://api.github.com/repos/eloylp/go-serve/releases/44670582","Warn: release artifact v2.0.0-rc15 not signed: https://api.github.com/repos/eloylp/go-serve/releases/44669532","Warn: release artifact v2.0.0-rc14 not signed: https://api.github.com/repos/eloylp/go-serve/releases/44668485","Warn: release artifact v2.0.0-rc19 does not have provenance: https://api.github.com/repos/eloylp/go-serve/releases/44790039","Warn: release artifact v2.0.0 does not have provenance: https://api.github.com/repos/eloylp/go-serve/releases/44811869","Warn: release artifact v2.0.0-rc16 does not have provenance: https://api.github.com/repos/eloylp/go-serve/releases/44670582","Warn: release artifact v2.0.0-rc15 does not have provenance: https://api.github.com/repos/eloylp/go-serve/releases/44669532","Warn: release artifact v2.0.0-rc14 does not have provenance: https://api.github.com/repos/eloylp/go-serve/releases/44668485"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 21 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"}}]},"last_synced_at":"2025-08-18T13:39:18.491Z","repository_id":41535598,"created_at":"2025-08-18T13:39:18.491Z","updated_at":"2025-08-18T13:39:18.491Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28331533,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T00:36:25.062Z","status":"online","status_checked_at":"2026-01-12T02:00:08.677Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["auth","basic","binary","file","go","http","server","simple","static"],"created_at":"2026-01-12T02:03:03.285Z","updated_at":"2026-01-12T02:04:44.491Z","avatar_url":"https://github.com/eloylp.png","language":"Go","readme":"# Go Serve\n\nJust a static HTTP server with some vitamins.\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/lidiackr/gophers/main/eloylp/go-serve/head.png\" alt=\"go-serve\" width=\"300\"/\u003e\n\u003c/p\u003e\n\n\u003cp align=\"right\" style=\"color:silver\"\u003e\nGopher art by \u003ca href=\"https://github.com/lidiackr\"\u003e@lidiackr\u003c/a\u003e\n\u003c/p\u003e\n\n## Table of contents\n\n1. [Main features](#main-features)\n2. [Binary distributions](#binary-distributions)\n3. [Docker images](#docker-images)\n4. [Use cases](#use-cases)\n    1. [Upload](#upload-file)\n    2. [Download](#download-file)\n    3. [Upload tar.gz file](#upload-targz-archive)\n    4. [Download a directory](#download-a-directory)\n5. [Configuration](#configuration)\n    1. [Setting up authorization](#setting-up-authorization)\n6. [Prometheus metrics](#prometheus-metrics)\n7. [The status endpoint](#the-status-endpoint)\n8. [Security notes](#security-notes)\n9. [Contributing](./CONTRIBUTING.md)\n\n### Main features\n\n* Serve specified folder via the HTTP protocol. Serve the current working directory by default.\n* Configure auth for `READ` and `WRITE` operations independently.\n* Upload single files.\n* Upload an entire directory tree by using `tar.gz`  archive format and specify in server extraction point.\n* Download the desired directory tree by using `targ.gz`  archives.\n* Basic Prometheus metrics out of the box. Histograms for request duration, response size and upload size.\n* Option to serve metrics at an alternative port.\n* Status endpoint.\n* Cache. Natively provided by the the Go [fileserve](https://github.com/golang/go/blob/acb189ea59d7f47e5db075e502dcce5eac6571dc/src/net/http/fs.go#L838) handler. It uses [If-Modified-Since](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Modified-Since) header for caching.\n\n### Binary distributions\n\nThe [releases](https://github.com/eloylp/go-serve/releases/latest) page will host binaries for the different OS and architectures.\n\nHere is an example install for a Linux machine could be:\n\n```bash\nsudo curl -L \"https://github.com/eloylp/go-serve/releases/download/v2.0.0/go-serve_2.0.0_Linux_x86_64\" \\\n-o /usr/local/bin/go-serve \\\n\u0026\u0026 sudo chmod +x /usr/local/bin/go-serve\n```\n\nEnvironment variables are the chosen method for [configuration](#configuration). \n\n### Docker images\n\nThere's an available docker image at [eloylp/go-serve](https://hub.docker.com/r/eloylp/go-serve) docker hub repository. You can get a\nfunctional server, serving the specified content root just by:\n\n```bash\ndocker run --rm \\\n -e GOSERVE_DOC_ROOT=/mnt/data \\\n -p 8080:8080 \\\n -v $(pwd):/mnt/data \\\n  eloylp/go-serve\n```\n\nEnvironment variables are the chosen method for [configuration](#configuration).\n\n### Use cases\n\nThis section will explain some common use cases that are currently covered by Go Serve.\n\n#### Upload file\n\nThe file can simply be pushed to the **upload endpoint**. There is more information about  how to configure such endpoint in the [configuration](#configuration) section. Here is an example:\n\n```bash\ncurl -X POST --location \"http://localhost:8080/upload\" \\\n    -H \"GoServe-Deploy-Path: /notes.txt\" \\\n    -H \"Content-Type: application/octet-stream\" \\\n    --data-binary @tests/root/notes/notes.txt\n```\n\nThe `GoServe-Deploy-Path` value its always relative to the document root. It points the file in the serve where the bytes must be dropped.\n\n#### Download file\n\nOnce service is up and running, files can be fetched as usual:\n\n```bash\ncurl -X GET --location \"http://localhost:8080/v1.2.3/gnu.png\" \\\n    --output ./gnu.png\n```\n\n#### Upload tar.gz archive\n\nEntire file and folder trees can be uploaded by creating a `tar.gz` archive. That archive can be pushed the designated **upload\nendpoint**. Read how to configure such endpoint in the [configuration](#configuration) section.\n\n```bash\ncurl -X POST --location \"http://localhost:8080/upload\" \\\n    -H \"GoServe-Deploy-Path: /v1.2.3\" \\\n    -H \"Content-Type: application/tar+gzip\" \\\n    --data-binary @tests/doc-root.tar.gz\n```\n\nThe `GoServe-Deploy-Path` value its always relative to the document root. It points where the content of the `tar.gz` archive must be extracted.\n\n#### Download a directory\n\nEntire file and folder trees can be downloaded from the server. Fetching the **download endpoint** and requesting the server what type of archive you would like to get. Currently, only `tar.gz` is supported. Read how to configure such endpoint in the [configuration](#configuration) section:\n\n```bash\ncurl -X GET --location \"http://localhost:8080/download\" \\\n    -H \"GoServe-Download-Path: /v1.2.3\" \\\n    -H \"Accept: application/tar+gzip\" \\\n    --output ./v1.2.4.tar.gz\n```\n\nThe `GoServe-Download-Path` value its always relative to the document root.\n\n### Configuration\n\nGo serve uses environment variables to configure its internals. Here is a table of the current customizable parts of the server:\n\n| Variable                                 | Description                                                  | Default                                                      |\n| ---------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ |\n| GOSERVE_LISTEN_ADDR                      | The socket where the server will listen for connections.     | \"0.0.0.0:8080\"                                               |\n| GOSERVE_DOC_ROOT                         | Path to the  document root its going to be served.           | \".\"                                                          |\n| GOSERVE_PREFIX                           | The prefix path under all files will be served. Default value is \"/static\"  so all files will be served under such path i.e \"/static/notes.txt\" . This is mandatory and should not interfere with other configured paths. | \"/static\"                                                    |\n| GOSERVE_UPLOAD_ENDPOINT                  | The path in the server where all uploads will take place. If not defined, it will be disabled. By default is **disabled**. | \"\"                                                           |\n| GOSERVE_DOWNLOAD_ENDPOINT                | The path in the server where all downloads will take place. If not defined, it will be disabled. By default is **disabled**. | \"\"                                                           |\n| GOSERVE_SHUTDOWN_TIMEOUT                 | The number of seconds that the server will wait to terminate pending active connections before closing. | \"5s\"                                                         |\n| GOSERVE_READ_TIMEOUT                     | The maximum duration for reading the entire request, including the body. Default is **unlimited**. | \"0s\"                                                         |\n| GOSERVE_WRITE_TIMEOUT                    | The maximum duration before timing out writes of the response. Default is **unlimited**. | \"0s\"                                                         |\n| GOSERVE_READ_AUTHORIZATIONS              | Configures which users are allowed to make idempotent requests to the server. It expects a **base64** string containing a users table generated by the **htpasswd** utility. By default, read authorization is **disabled** so all users can read the entire server. See [authorization](#setting-up-authorization) for more details. | \"\"                                                           |\n| GOSERVE_WRITE_AUTHORIZATIONS             | Configures which users are allowed to make  **non** idempotent requests to the server. It expects a **base64** string containing a users table generated by the **htpasswd** utility. By default, write authorization is **disabled** so unauthorized users can upload files if the  **GOSERVE_UPLOAD_ENDPOINT** variable is defined. See [authorization](#setting-up-authorization) for more details. | \"\"                                                           |\n| GOSERVE_METRICS_ENABLED                  | Configures if the Prometheus metrics are enabled or disabled. | true                                                         |\n| GOSERVE_METRICS_PATH                     | Configures in which endpoint the metrics should be served. This can help to hide the metrics endpoint by introducing a more complicated path that only systems will know. | \"/metrics\"                                                   |\n| GOSERVE_METRICS_LISTEN_ADDR              | If configured, another sidecar server will be configured exclusively for serving metrics. This is **disabled** by default. An example of value could be: \"0.0.0.0:9091\" . | \"\"                                                           |\n| GOSERVE_METRICS_REQUEST_DURATION_BUCKETS | Define the buckets for the histogram of request duration. Expressed in seconds. | \"0.005,0.01,0.025, 0.05,0.1,0.25,0.5, 1,2.5,5,10\"            |\n| GOSERVE_METRICS_SIZE_BUCKETS             | Define the buckets for the histogram of response size and upload size. Expressed in bytes. | \"64,256,1024,4096,16384,65536,262144,1048576,4194304,16777216\" |\n\n#### Setting up authorization\n\nBoth type of authorizations, *GOSERVE_READ_AUTHORIZATIONS* and  *GOSERVE_WRITE_AUTHORIZATIONS* are configured in the same manner. Those variables expect a **base64** encoded file generated by the tool [**htpasswd**](https://httpd.apache.org/docs/2.4/programs/htpasswd.html) .\nThe passwords must be encrypted by using the **bcrypt** algorithm. The following is an example for creating such value for the user \"Alice\" with password \"password\":\n\n```bash\n$ htpasswd -B -c auth.txt alice\nNew password: password           ## note this is an interactive step\nRe-type new password: password   ## note this is an interactive step\nAdding password for user alice\n\n$ cat auth.txt  ## Check the content of the file\nalice:$2y$05$039J5egx9S9ayeGQTYQ5nex3SmMuXho7oXbIMInW9EX9UIywjIJJa\n\n## Create the needed value for GOSERVE_READAUTHORIZATIONS or GOSERVE_WRITEAUTHORIZATIONS\n$ cat auth.txt | base64\nYWxpY2U6JDJ5JDA1JDAzOUo1ZWd4OVM5YXllR1FUWVE1bmV4M1NtTXVYaG83b1hiSU1Jblc5RVg5\nVUl5d2pJSkphCg==\n```\n\nOnce the file is created following the above steps, we can also add more users with the following command and continue with the same\nprevious steps.\n\n```bash\nhtpasswd -B auth.txt bob\n```\n\nF.A.Q: In [Kubernetes secrets](https://kubernetes.io/es/docs/concepts/configuration/secret/) you need to double encode in base64 the value,\nas Kubernetes requires to wrap all the secrets in this encoding.\n\n#### Using authorization in requests\n\nThe authorization fronted in compatible with [rfc7617]( https://tools.ietf.org/html/rfc7617) basic authorization scheme. This is an example\nfrom a curl request:\n\n```bash\ncurl -X GET --location \"http://localhost:8080/v1.2.3/gnu.png\" \\\n    --basic --user alice:password \\\n    --output ./gnu.png\n```\n\n### Prometheus metrics\n\nBy default, this server provides various [histograms](https://prometheus.io/docs/practices/histograms/) that will provide a good global view of server operations. You can scrape this metrics at `/metrics` once the server was started. It is possible to have a sidecar HTTP server dedicated to metrics. See the [configuration](#configuration) section for more details. The following is an excerpt of the available metrics:\n\n```prometheus\n# HELP http_upload_size Histogram to represent the successful uploads to the server\n# TYPE http_upload_size histogram\nhttp_upload_size_bucket{le=\"64\"} 0\nhttp_upload_size_bucket{le=\"256\"} 0\nhttp_upload_size_bucket{le=\"1024\"} 0\nhttp_upload_size_bucket{le=\"4096\"} 0\nhttp_upload_size_bucket{le=\"16384\"} 0\nhttp_upload_size_bucket{le=\"65536\"} 0\nhttp_upload_size_bucket{le=\"262144\"} 0\nhttp_upload_size_bucket{le=\"1.048576e+06\"} 1\nhttp_upload_size_bucket{le=\"4.194304e+06\"} 1\nhttp_upload_size_bucket{le=\"1.6777216e+07\"} 1\nhttp_upload_size_bucket{le=\"+Inf\"} 1\nhttp_upload_size_sum 533766\nhttp_upload_size_count 1\n# HELP http_request_duration_seconds \n# TYPE http_request_duration_seconds histogram\nhttp_request_duration_seconds_bucket{code=\"200\",endpoint=\"/upload\",method=\"POST\",le=\"0.005\"} 0\nhttp_request_duration_seconds_bucket{code=\"200\",endpoint=\"/upload\",method=\"POST\",le=\"0.01\"} 0\nhttp_request_duration_seconds_bucket{code=\"200\",endpoint=\"/upload\",method=\"POST\",le=\"0.025\"} 0\nhttp_request_duration_seconds_bucket{code=\"200\",endpoint=\"/upload\",method=\"POST\",le=\"0.05\"} 1\nhttp_request_duration_seconds_bucket{code=\"200\",endpoint=\"/upload\",method=\"POST\",le=\"0.1\"} 1\nhttp_request_duration_seconds_bucket{code=\"200\",endpoint=\"/upload\",method=\"POST\",le=\"0.25\"} 1\nhttp_request_duration_seconds_bucket{code=\"200\",endpoint=\"/upload\",method=\"POST\",le=\"0.5\"} 1\nhttp_request_duration_seconds_bucket{code=\"200\",endpoint=\"/upload\",method=\"POST\",le=\"1\"} 1\nhttp_request_duration_seconds_bucket{code=\"200\",endpoint=\"/upload\",method=\"POST\",le=\"2.5\"} 1\nhttp_request_duration_seconds_bucket{code=\"200\",endpoint=\"/upload\",method=\"POST\",le=\"5\"} 1\nhttp_request_duration_seconds_bucket{code=\"200\",endpoint=\"/upload\",method=\"POST\",le=\"10\"} 1\nhttp_request_duration_seconds_bucket{code=\"200\",endpoint=\"/upload\",method=\"POST\",le=\"+Inf\"} 1\nhttp_request_duration_seconds_sum{code=\"200\",endpoint=\"/upload\",method=\"POST\"} 0.027193285\nhttp_request_duration_seconds_count{code=\"200\",endpoint=\"/upload\",method=\"POST\"} 1\nhttp_request_duration_seconds_bucket{code=\"304\",endpoint=\"/static\",method=\"GET\",le=\"0.005\"} 1\nhttp_request_duration_seconds_bucket{code=\"304\",endpoint=\"/static\",method=\"GET\",le=\"0.01\"} 1\nhttp_request_duration_seconds_bucket{code=\"304\",endpoint=\"/static\",method=\"GET\",le=\"0.025\"} 1\nhttp_request_duration_seconds_bucket{code=\"304\",endpoint=\"/static\",method=\"GET\",le=\"0.05\"} 1\nhttp_request_duration_seconds_bucket{code=\"304\",endpoint=\"/static\",method=\"GET\",le=\"0.1\"} 1\nhttp_request_duration_seconds_bucket{code=\"304\",endpoint=\"/static\",method=\"GET\",le=\"0.25\"} 1\nhttp_request_duration_seconds_bucket{code=\"304\",endpoint=\"/static\",method=\"GET\",le=\"0.5\"} 1\nhttp_request_duration_seconds_bucket{code=\"304\",endpoint=\"/static\",method=\"GET\",le=\"1\"} 1\nhttp_request_duration_seconds_bucket{code=\"304\",endpoint=\"/static\",method=\"GET\",le=\"2.5\"} 1\nhttp_request_duration_seconds_bucket{code=\"304\",endpoint=\"/static\",method=\"GET\",le=\"5\"} 1\nhttp_request_duration_seconds_bucket{code=\"304\",endpoint=\"/static\",method=\"GET\",le=\"10\"} 1\nhttp_request_duration_seconds_bucket{code=\"304\",endpoint=\"/static\",method=\"GET\",le=\"+Inf\"} 1\nhttp_request_duration_seconds_sum{code=\"304\",endpoint=\"/static\",method=\"GET\"} 0.00024055\nhttp_request_duration_seconds_count{code=\"304\",endpoint=\"/static\",method=\"GET\"} 1\nhttp_request_duration_seconds_bucket{code=\"404\",endpoint=\"/static\",method=\"GET\",le=\"0.005\"} 1\nhttp_request_duration_seconds_bucket{code=\"404\",endpoint=\"/static\",method=\"GET\",le=\"0.01\"} 1\nhttp_request_duration_seconds_bucket{code=\"404\",endpoint=\"/static\",method=\"GET\",le=\"0.025\"} 1\nhttp_request_duration_seconds_bucket{code=\"404\",endpoint=\"/static\",method=\"GET\",le=\"0.05\"} 1\nhttp_request_duration_seconds_bucket{code=\"404\",endpoint=\"/static\",method=\"GET\",le=\"0.1\"} 1\nhttp_request_duration_seconds_bucket{code=\"404\",endpoint=\"/static\",method=\"GET\",le=\"0.25\"} 1\nhttp_request_duration_seconds_bucket{code=\"404\",endpoint=\"/static\",method=\"GET\",le=\"0.5\"} 1\nhttp_request_duration_seconds_bucket{code=\"404\",endpoint=\"/static\",method=\"GET\",le=\"1\"} 1\nhttp_request_duration_seconds_bucket{code=\"404\",endpoint=\"/static\",method=\"GET\",le=\"2.5\"} 1\nhttp_request_duration_seconds_bucket{code=\"404\",endpoint=\"/static\",method=\"GET\",le=\"5\"} 1\nhttp_request_duration_seconds_bucket{code=\"404\",endpoint=\"/static\",method=\"GET\",le=\"10\"} 1\nhttp_request_duration_seconds_bucket{code=\"404\",endpoint=\"/static\",method=\"GET\",le=\"+Inf\"} 1\nhttp_request_duration_seconds_sum{code=\"404\",endpoint=\"/static\",method=\"GET\"} 0.000128526\nhttp_request_duration_seconds_count{code=\"404\",endpoint=\"/static\",method=\"GET\"} 1\n# HELP http_response_size \n# TYPE http_response_size histogram\nhttp_response_size_bucket{code=\"200\",endpoint=\"/upload\",method=\"POST\",le=\"64\"} 1\nhttp_response_size_bucket{code=\"200\",endpoint=\"/upload\",method=\"POST\",le=\"256\"} 1\nhttp_response_size_bucket{code=\"200\",endpoint=\"/upload\",method=\"POST\",le=\"1024\"} 1\nhttp_response_size_bucket{code=\"200\",endpoint=\"/upload\",method=\"POST\",le=\"4096\"} 1\nhttp_response_size_bucket{code=\"200\",endpoint=\"/upload\",method=\"POST\",le=\"16384\"} 1\nhttp_response_size_bucket{code=\"200\",endpoint=\"/upload\",method=\"POST\",le=\"65536\"} 1\nhttp_response_size_bucket{code=\"200\",endpoint=\"/upload\",method=\"POST\",le=\"262144\"} 1\nhttp_response_size_bucket{code=\"200\",endpoint=\"/upload\",method=\"POST\",le=\"1.048576e+06\"} 1\nhttp_response_size_bucket{code=\"200\",endpoint=\"/upload\",method=\"POST\",le=\"4.194304e+06\"} 1\nhttp_response_size_bucket{code=\"200\",endpoint=\"/upload\",method=\"POST\",le=\"1.6777216e+07\"} 1\nhttp_response_size_bucket{code=\"200\",endpoint=\"/upload\",method=\"POST\",le=\"+Inf\"} 1\nhttp_response_size_sum{code=\"200\",endpoint=\"/upload\",method=\"POST\"} 39\nhttp_response_size_count{code=\"200\",endpoint=\"/upload\",method=\"POST\"} 1\nhttp_response_size_bucket{code=\"304\",endpoint=\"/static\",method=\"GET\",le=\"64\"} 1\nhttp_response_size_bucket{code=\"304\",endpoint=\"/static\",method=\"GET\",le=\"256\"} 1\nhttp_response_size_bucket{code=\"304\",endpoint=\"/static\",method=\"GET\",le=\"1024\"} 1\nhttp_response_size_bucket{code=\"304\",endpoint=\"/static\",method=\"GET\",le=\"4096\"} 1\nhttp_response_size_bucket{code=\"304\",endpoint=\"/static\",method=\"GET\",le=\"16384\"} 1\nhttp_response_size_bucket{code=\"304\",endpoint=\"/static\",method=\"GET\",le=\"65536\"} 1\nhttp_response_size_bucket{code=\"304\",endpoint=\"/static\",method=\"GET\",le=\"262144\"} 1\nhttp_response_size_bucket{code=\"304\",endpoint=\"/static\",method=\"GET\",le=\"1.048576e+06\"} 1\nhttp_response_size_bucket{code=\"304\",endpoint=\"/static\",method=\"GET\",le=\"4.194304e+06\"} 1\nhttp_response_size_bucket{code=\"304\",endpoint=\"/static\",method=\"GET\",le=\"1.6777216e+07\"} 1\nhttp_response_size_bucket{code=\"304\",endpoint=\"/static\",method=\"GET\",le=\"+Inf\"} 1\nhttp_response_size_sum{code=\"304\",endpoint=\"/static\",method=\"GET\"} 0\nhttp_response_size_count{code=\"304\",endpoint=\"/static\",method=\"GET\"} 1\nhttp_response_size_bucket{code=\"404\",endpoint=\"/static\",method=\"GET\",le=\"64\"} 1\nhttp_response_size_bucket{code=\"404\",endpoint=\"/static\",method=\"GET\",le=\"256\"} 1\nhttp_response_size_bucket{code=\"404\",endpoint=\"/static\",method=\"GET\",le=\"1024\"} 1\nhttp_response_size_bucket{code=\"404\",endpoint=\"/static\",method=\"GET\",le=\"4096\"} 1\nhttp_response_size_bucket{code=\"404\",endpoint=\"/static\",method=\"GET\",le=\"16384\"} 1\nhttp_response_size_bucket{code=\"404\",endpoint=\"/static\",method=\"GET\",le=\"65536\"} 1\nhttp_response_size_bucket{code=\"404\",endpoint=\"/static\",method=\"GET\",le=\"262144\"} 1\nhttp_response_size_bucket{code=\"404\",endpoint=\"/static\",method=\"GET\",le=\"1.048576e+06\"} 1\nhttp_response_size_bucket{code=\"404\",endpoint=\"/static\",method=\"GET\",le=\"4.194304e+06\"} 1\nhttp_response_size_bucket{code=\"404\",endpoint=\"/static\",method=\"GET\",le=\"1.6777216e+07\"} 1\nhttp_response_size_bucket{code=\"404\",endpoint=\"/static\",method=\"GET\",le=\"+Inf\"} 1\nhttp_response_size_sum{code=\"404\",endpoint=\"/static\",method=\"GET\"} 19\nhttp_response_size_count{code=\"404\",endpoint=\"/static\",method=\"GET\"} 1\n```\n\n### The status endpoint\n\nThe most probably use of this server to place it behind a reverse proxy. In order to facilitate the readiness of the service a status endpoint under `/status` is provided. Here is an example of the information provided:\n\n```json\n{\n  \"status\": \"ok\",\n  \"info\": {\n    \"name\": \"go-serve\",\n    \"version\": \"v2.0.0-rc8\",\n    \"build\": \"5b7aaf3\",\n    \"build_time\": \"2021-05-15T17:07:03+0000\"\n  }\n}\n```\n### Security notes\n\nThis server assumes that users with write permissions are trusted ones. They will be able to upload any kind of file to the server document root. Please, if you enable uploads, be sure that you configure write [authorization](#setting-up-authorization) .\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feloylp%2Fgo-serve","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feloylp%2Fgo-serve","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feloylp%2Fgo-serve/lists"}