{"id":23663787,"url":"https://github.com/daimaou92/geodb-server","last_synced_at":"2025-12-06T13:30:14.421Z","repository":{"id":63512752,"uuid":"566869622","full_name":"daimaou92/geodb-server","owner":"daimaou92","description":"A http based API for github.com/daimaou92/geodb","archived":false,"fork":false,"pushed_at":"2022-11-20T10:21:17.000Z","size":26,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-29T05:34:01.941Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/daimaou92.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":"2022-11-16T15:35:08.000Z","updated_at":"2022-11-16T15:37:22.000Z","dependencies_parsed_at":"2022-11-20T10:47:59.300Z","dependency_job_id":null,"html_url":"https://github.com/daimaou92/geodb-server","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daimaou92%2Fgeodb-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daimaou92%2Fgeodb-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daimaou92%2Fgeodb-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daimaou92%2Fgeodb-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daimaou92","download_url":"https://codeload.github.com/daimaou92/geodb-server/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239662729,"owners_count":19676435,"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":[],"created_at":"2024-12-29T05:33:21.540Z","updated_at":"2025-12-06T13:30:14.379Z","avatar_url":"https://github.com/daimaou92.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"## GeoDB Server\n\nA HTTP API for [geodb](https://github.com/daimaou92/geodb)\n\n### How to Run\n\n1. Create a new account with\n[Maxmind for Geolite2](https://www.maxmind.com/en/geolite2/signup?utm_source=kb\u0026utm_medium=kb-link\u0026utm_campaign=kb-create-account)\n2. Generate a Maxmind License key as instructed [here](https://support.maxmind.com/hc/en-us/articles/4407111582235-Generate-a-License-Key).\n3. Export the generated Key:\n```bash\nexport MAXMIND_KEY=\"abcdefghijklmnop\"\n```\n4. Databases are as defined [here](https://github.com/daimaou92/geodb)\n5. Determine a path at which these databases are going to be downloaded.\nThis app will require approx 85MiB of free space for DBs only\n6. Export above path:\n```bash\nexport GL2_DBDIR=\"/tmp/dbdir\"\n```\n7. This application can be run with or without auth.\n8. If auth is needed continue else jump to step 11\n9. Create a file with one secret key in each line. Something like this:\n```text\nCBOI7AIHQcAKhaHVol\n7toCW4ndOvNy0ssSot\nL44eRv07k2KwndvLQm\nEGwSQtwsPjzv1IO75Z\nh2UvAAs63ZjhYnISjn\n```\n10. Now export above file:\n```bash\nexport GEODB_AUTH_FILE=\"/tmp/geodb-server-auth.txt\"\n```\nAny of the keys, one per line, from this file can be used for auth\n\n11. Test the API (more in the API section below) out for an IP:\n#### Authorized:\n```bash\ncurl -H \"Authorization:CBOI7AIHQcAKhaHVol\" http://localhost:40000/country/ip/1.32.128.0\n```\n\n#### Unauthorized\n```bash\ncurl http://localhost:40000/country/ip/1.32.128.0\n```\n\n### How to Build\n\n1. This application uses protobufs and responds in protobufs only. The proto files are\navailable in `src/protos`. Naturally to build those you'll need to install\n[protoc](https://developers.google.com/protocol-buffers/docs/downloads).\n2. Once it's available in `PATH` - just do `cargo build` or `cargo build --release`\n\n\n### APIs\n\nThis application has 4 APIs. All of them are GET HTTP Requests and each returns one\nof the protobuf `Message`s defined in `src/protos/geo.proto`.\n\n1. **[GET]** `/country/ip/:ip`\n\nGiven some IP(v4|v6) this responds with the proto message `Country`.\nResponds with a 400 Bad Request in case no mapping is found\n\n2. **[GET]** `/country/iso/:iso`\n\nGiven the ISO2 code, as defined in [ISO 3166](https://www.iso.org/iso-3166-country-codes.html),\nof any country this route also responds with the proto message `Country`.\n400 Bad Request if the code is not found.\n\n3. **[GET]** `/city/:ip`\n\nGiven some IP(v4|v6) this responds with the proto message `City`.\n400 Bad Request if not found.\n\n4. **[GET]** `/asn/:ip`\n\nGiven some IP(v4|v6) this responds with the proto message `ASN`.\n400 Bad Request if not found.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaimaou92%2Fgeodb-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaimaou92%2Fgeodb-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaimaou92%2Fgeodb-server/lists"}