-
-
Notifications
You must be signed in to change notification settings - Fork 829
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
feat: convert public ip to json #4332
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The code in `info_game.sh` has been refactored to enhance the process of retrieving and handling the public IP address. The changes include: - Using the API endpoint `http://ip-api.com/json/` instead of `https://api.ipify.org` - Storing the retrieved data in `publicip.txt` - Extracting additional information such as country and country code using `jq` These improvements aim to provide more accurate and detailed information about the public IP address.
…y, and country code The commit refactors the code by updating the API URL to remove a trailing slash. Additionally, it sets default values for the variables `publicip`, `country`, and `countrycode` when the file `${tmpdir}/publicip.txt` is not found.
This commit adds functionality to cache the public IP address for 24 hours. If the cached IP address is older than 24 hours or doesn't exist, a new request is made to retrieve the public IP address. The retrieved IP address is then stored in a file for future use. Additionally, if there are any errors during the retrieval process, appropriate warning messages are logged and default values are set for the IP address, country, and country code. Co-authored-by: AI Assistant <[email protected]>
This commit adds functionality to cache the public IP address for 24 hours. If the cached IP address is older than 24 hours or doesn't exist, a new request is made to retrieve the public IP address. The retrieved IP address is then stored in a file for future use. Additionally, if there are any errors during the retrieval process, appropriate warning messages are logged and default values are set for the IP address, country, and country code.
The code has been refactored to use a JSON file instead of a text file for caching the public IP address. The log messages have also been updated to provide more informative output.
This commit refactors the `info_messages.sh` module by removing the Mailgun (email) alert functionality. The code changes remove the corresponding section that displays the Mailgun alert status in the info message script. This change simplifies and streamlines the code by eliminating unused functionality.
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
updated the public ip provider to http://ip-api.com.json that can provide more detail about a servers public ip. This will allow alerts to in future provide more details
Fixes #[issue]
Type of change
Checklist
PR will not be merged until all steps are complete.
develop
branch as its base.Documentation
If documentation does need updating either update it by creating a PR (preferred) or request a documentation update.
Thank you for your Pull Request!