-
-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added timezone information to the available fields #33
base: master
Are you sure you want to change the base?
Changes from 4 commits
ec894c4
219b674
6ebdb16
8ca2ec0
ca436fc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,7 @@ A self-hosted, non-tracking, and ad-free solution to reveal client-side IP info | |
|
||
This project is also hosted publicly on https://ipinfo.tw, feel free to give it a try! | ||
|
||
Please note that for response integrity and privacy concerns, this demo is behind an reverse proxy with https enabled, which is not part of this project. http traffic will be redirected to use https to establish the connection, in case the plaintext data being sniffed/intercepted. | ||
Please note that for response integrity and privacy concerns, this demo is behind a reverse proxy with https enabled, which is not part of this project. HTTP traffic will be redirected to use https to establish the connection, in case the plaintext data being sniffed/intercepted. | ||
|
||
## Usage | ||
|
||
|
@@ -46,7 +46,7 @@ Run the server daemon via docker: | |
docker run -d --name ipinfo.tw -p 80:8080 peterdavehello/ipinfo.tw:latest | ||
``` | ||
|
||
If you want to put this container behind reverse proxy, set up an `X-Real-IP` header and pass the it to the container, so that it can use the header as the IP of the client. | ||
If you want to put this container behind reverse proxy, set up an `X-Real-IP` header and pass it to the container, so that it can use the header as the IP of the client. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not related to the changes in the PR, we should leave it alone. |
||
|
||
### Client side | ||
|
||
|
@@ -55,12 +55,12 @@ Use any http(s) client to explore the server, e.g. https://ipinfo.tw, | |
- `wget -qO- https://ipinfo.tw` | ||
- `curl https://ipinfo.tw` | ||
|
||
Without any specified URI, the server will return IP address, country, AS, and user agent. | ||
Without any specified URI, the server will return IP address, country, timezone, AS, and user agent. | ||
|
||
If you prefer to receive a machine-readable result, use path `/json` (without trailing slash), e.g. `https://ipinfo.tw/json`, the result will look like: | ||
|
||
```json | ||
{"ip":"3.115.123.234","country_code":"JP","country_name":"Japan","asn":"16509","as_desc":"Amazon.com, Inc.","user_agent":"curl/7.58.0"} | ||
{"ip":"3.115.123.234","country_code":"JP","country_name":"Japan","timezone":"Asia/Tokyo","asn":"16509","as_desc":"Amazon.com, Inc.","user_agent":"curl/7.58.0"} | ||
``` | ||
|
||
#### Endpoints | ||
Comment on lines
55
to
66
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The description of the demo setup mentions "an reverse proxy" which should be corrected to "a reverse proxy" for grammatical accuracy. - this demo is behind an reverse proxy with https enabled
+ this demo is behind a reverse proxy with https enabled
There's a minor typographical error with "http traffic" which should be capitalized as "HTTP traffic" for consistency with standard terminology. - http traffic will be redirected to use https
+ HTTP traffic will be redirected to use https
The phrase "pass the it to the container" seems to contain an extra word. It should be corrected for clarity. - set up an `X-Real-IP` header and pass the it to the container
+ set up an `X-Real-IP` header and pass it to the container |
||
|
@@ -75,6 +75,7 @@ You can also specify the following URI to retrieve certain info: | |
- `asn`: AS number | ||
- `as_desc`: AS description | ||
- `user_agent`: User agent string | ||
- `timezone`: Timezone based on the city (e.g Europe/Amsterdam) | ||
|
||
Examples: | ||
|
||
|
@@ -97,6 +98,9 @@ HK | |
$ curl https://ipinfo.tw/country_name | ||
South Korea | ||
|
||
$ curl https://ipinfo.tw/timezone | ||
Europe/Amsterdam | ||
|
||
$ curl https://ipinfo.tw/as | ||
AS16509 / Amazon.com, Inc. | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The steps for handling the GeoLite2-City database are correctly implemented, ensuring secure download, verification, and extraction. To optimize the Dockerfile and reduce the number of layers, consider combining these RUN commands into a single RUN command using
&&
to chain the commands together. This can improve the build performance and reduce the image size.Committable suggestion