{"id":15651163,"url":"https://github.com/unknwon/go-import-server","last_synced_at":"2025-04-30T18:25:28.906Z","repository":{"id":65417275,"uuid":"219375369","full_name":"unknwon/go-import-server","owner":"unknwon","description":"HTTP server for canonical \"go get\" import path","archived":false,"fork":false,"pushed_at":"2021-12-06T04:58:30.000Z","size":84,"stargazers_count":33,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-30T18:44:01.321Z","etag":null,"topics":["go","go-get","http-server","lsif-enabled"],"latest_commit_sha":null,"homepage":"","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/unknwon.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}},"created_at":"2019-11-03T22:40:20.000Z","updated_at":"2023-11-20T02:19:40.000Z","dependencies_parsed_at":"2023-01-22T14:55:11.221Z","dependency_job_id":null,"html_url":"https://github.com/unknwon/go-import-server","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unknwon%2Fgo-import-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unknwon%2Fgo-import-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unknwon%2Fgo-import-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unknwon%2Fgo-import-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unknwon","download_url":"https://codeload.github.com/unknwon/go-import-server/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251759366,"owners_count":21639216,"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":["go","go-get","http-server","lsif-enabled"],"created_at":"2024-10-03T12:37:15.472Z","updated_at":"2025-04-30T18:25:28.848Z","avatar_url":"https://github.com/unknwon.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# go-import-server\n\nHTTP server for canonical \"go get\" import path. It supports all versions of `go get` regardless of if it's Go Modules aware.\n\n## Installation\n\nInstall from source or download binaries on [GitHub Releases](https://github.com/unknwon/go-import-server/releases).\n\nThe minimum requirement of Go is **1.16**, and 64-bit system is required because of [a bug in BadgerDB](https://github.com/dgraph-io/badger/issues/953).\n\n```sh\n$ go get unknwon.dev/go-import-server\n```\n\n### Configuration\n\nExample for this tool itself (save as `app.toml`):\n\n```toml\naddr = \"127.0.0.1:4333\"\ndb_path = \"app.db\"\n\n[[packages]]\nimport_path = \"unknwon.dev/go-import-server\"\nsubpath = \"/go-import-server\"\nrepo = \"https://github.com/unknwon/go-import-server\"\nbranch = \"main\"\n```\n\nAssuming `$GOPATH/bin` has been added to your `$PATH` environment variable.\n\n```sh\n$ go-import-server -config=./app.toml\nYYYY/MM/DD 12:34:56 [ INFO] Listening on http://127.0.0.1:4333...\n```\n\n## Reverse proxy and HTTPS\n\nI recommend use [Caddy](https://caddyserver.com) for automatic HTTPS in front of this tool:\n\n```caddyfile\n# Caddy 1\nunknwon.dev {\n    proxy / localhost:4333 {\n        transparent\n    }\n}\n\n# Caddy 2\nunknwon.dev {\n    reverse_proxy * localhost:4333 {\n        header_up Host {http.request.host}\n        header_up X-Real-IP {http.request.remote}\n        header_up X-Forwarded-For {http.request.remote}\n        header_up X-Forwarded-Port {http.request.port}\n        header_up X-Forwarded-Proto {http.request.scheme}\n    }\n}\n```\n\n## Metrics\n\nThis tool exposes [Prometheus](https://prometheus.io/) metrics via endpoint `/-/metrics`.\n\nYou can set HTTP Basic Authentication for this endpoint via your `app.toml`:\n\n```toml\n[prometheus]\nauth_username = \"superuser\"\nauth_password = \"supersecure\"\n```\n\nThe [BadgerDB](https://github.com/dgraph-io/badger) is used to store total page views and number of `go get`s.\n\nHere is an example dump:\n\n```\ngo_import_server_stats_view_total 20\ngo_import_server_stats_view_unknwon_dev_go_import_server 20\ngo_import_server_stats_get_total 16\ngo_import_server_stats_get_unknwon_dev_go_import_server 16\n```\n\n## Development\n\nThis project uses the [Task](https://taskfile.dev/) as the build tool, it is not required as all the commands are listed in the `Taskfile.yml` in plaintext.\n\nThe source files of templates are located in the `templates` directory but uses [Go embed](https://blog.jetbrains.com/go/2021/06/09/how-to-use-go-embed-in-go-1-16/) to embed into the binary. Due to the nature limitation of the Go embed, templates cannot be hot-reloaded after modifications, so the following command needs to be used for re-packing templates and re-compiling the binary:\n\n```sh\n$ task web --force\n```\n\n## Open-source, not open-contribution\n\n_Quote from [benbjohnson/litestream](https://github.com/benbjohnson/litestream#open-source-not-open-contribution):_\n\n\u003e I am grateful for community involvement, bug reports, \u0026 feature requests. I do not wish to come off as anything but welcoming, however, I've made the decision to keep this project closed to contributions for my own mental health and long term viability of the project.\n\n## License\n\nThis project is under MIT License. See the [LICENSE](LICENSE) file for the full license text.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funknwon%2Fgo-import-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funknwon%2Fgo-import-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funknwon%2Fgo-import-server/lists"}