ipinfo.tw icon indicating copy to clipboard operation
ipinfo.tw copied to clipboard

Added functionality to allow for looking up IP addresses

Open mitchellkellett opened this issue 2 years ago â€ĸ 5 comments

Moved existing functionality for looking up requesting IP address to use NGINX maps.

  • Updated ipinfo.conf to remove old location blocks that have been moved to map.conf.

Added functionality to allow for looking up IP addresses.

  • New map.conf that containing maps.
  • Updated nginx.conf to increase map_hash_bucket_size above default value.
  • Updated ipinfo.conf to include new location blocks to allow for looking up IP addresses.

Updated README to include details on added functionality.

Summary by CodeRabbit

  • New Features

    • Introduced new URI endpoints for retrieving detailed IP address information, including country code, country name, AS number, and AS description.
  • Documentation

    • Updated the README with examples on how to use the new IP information retrieval endpoints.
  • Refactor

    • Reorganized and consolidated response header configurations in the Nginx server block.
    • Simplified URI pattern handling in Nginx configurations for improved response mapping.
  • Style

    • Adjusted Nginx configuration for clarity and maintainability.
  • Chores

    • Configured Nginx performance settings with map_hash_max_size and map_hash_bucket_size directives.

mitchellkellett avatar Apr 10 '23 23:04 mitchellkellett

@coderabbitai review

PeterDaveHello avatar Dec 21 '23 11:12 PeterDaveHello

Walkthrough

The update introduces new API endpoints for IP information retrieval in the README.md, reconfigures Nginx to optimize header management and response delivery, and employs map.conf to translate IP addresses and URIs into specific outputs. These changes streamline the server's operation and enhance its capability to provide detailed IP data.

Changes

File Path Change Summary
README.md Added documentation for new URI endpoints to fetch IP address details.
nginx/conf.d/ipinfo.conf Reorganized add_header directives and updated location blocks for better header and response management.
nginx/conf.d/map.conf Introduced mapping of IP addresses and request URIs to specific responses.
nginx/nginx.conf Added map_hash_max_size and map_hash_bucket_size directives for improved mapping efficiency.

Poem

🐇đŸ’ģ In the web's vast prairie, updates hop along,
New paths are carved, and the server grows strong.
With each request, it leaps without fail,
Serving data swift, like the wind in its tail. đŸŒŦī¸đŸ“ˆ

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on X ?


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • You can reply to a review comment made by CodeRabbit.
  • You can tag CodeRabbit on specific lines of code or files in the PR by tagging @coderabbitai in a comment.
  • You can tag @coderabbitai in a PR comment and ask one-off questions about the PR and the codebase. Use quoted replies to pass the context for follow-up questions.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

coderabbitai[bot] avatar Dec 21 '23 11:12 coderabbitai[bot]

I really need this. Was the request merged?

I'm looking for a self hosted API that I can provide an IP address and it can provide back this kind of info.

benisai avatar Jan 30 '24 06:01 benisai

Hi @benisai I haven't had a chance to get back to reviewing the comments by @PeterDaveHello and making changes. So I don't believe it's been merged. You could always check out my fork if you need it.

mitchellkellett avatar Jan 30 '24 06:01 mitchellkellett

Hi @benisai I haven't had a chance to get back to reviewing the comments by @PeterDaveHello and making changes. So I don't believe it's been merged. You could always check out my fork if you need it.

I will indeed. I see you have a docker container as well.

benisai avatar Jan 30 '24 17:01 benisai

Hi @mitchellkellett,

Would you like to continue this PR? Thanks!

PeterDaveHello avatar Apr 19 '25 21:04 PeterDaveHello