Skip to content

Commit

Permalink
verify-fqdn: require user consent before performing HTTPS request
Browse files Browse the repository at this point in the history
  • Loading branch information
vilhelmprytz committed Jan 2, 2021
1 parent 9a7eebb commit 098d01a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ This project follows the [semantic versioning](https://semver.org) convention. C

- [#135](https://github.com/vilhelmprytz/pterodactyl-installer/issues/135) Fixed so that the automatic ufw firewall configuration no longer requires confirming for the enable operation (user interaction after initial configuration is not intended behavior).

### Added

- Add a prompt in `verify-fqdn` that requires user consent before performing HTTPS request against [https://checkip.pterodactyl-installer.se](https://checkip.pterodactyl-installer.se).

## v0.1.1 (released on 2021-01-01)

### Fixed
Expand Down
12 changes: 12 additions & 0 deletions lib/verify-fqdn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,17 @@ dep_install() {
return 0
}

confirm() {
output "This script will perform a HTTPS request to the endpoint $CHECKIP_URL"
output "The official check-IP service for this script, https://checkip.pterodactyl-installer.se"
output "- will not log or share any IP-information with any third-party."
output "If you would like to use another service, feel free to modify the script."

echo -e -n "* I agree that this HTTPS request is performed (y/N): "
read -r confirm
[[ "$confirm" =~ [Yy] ]] || (error "User did not agree" && exit 1)
}

dns_verify() {
output "Resolving DNS for $fqdn"
ip=$(curl -4 -s $CHECKIP_URL)
Expand All @@ -87,6 +98,7 @@ main() {
fqdn="$1"
os="$2"
dep_install
confirm
dns_verify
}

Expand Down

0 comments on commit 098d01a

Please sign in to comment.