-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
497 additions
and
247 deletions.
There are no files selected for viewing
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
127.0.0.1 localhost | ||
127.0.1.1 kali | ||
127.0.0.1 localhost | ||
127.0.1.1 kali # some snarky comment | ||
10.10.1.1 forge.htb admin.forge.htb | ||
10.10.1.2 fudge.htb admin.fudge.htb # The magnificent fudge machine | ||
|
||
# The following lines are desirable for IPv6 capable hosts | ||
::1 localhost ip6-localhost ip6-loopback | ||
ff02::1 ip6-allnodes | ||
ff02::2 ip6-allrouters | ||
::1 localhost ip6-localhost ip6-loopback | ||
ff02::1 ip6-allnodes | ||
ff02::2 ip6-allrouters |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
use thiserror::Error; | ||
|
||
#[derive(Error, Debug)] | ||
pub enum ApplicationError { | ||
/// Represents a failure to read the hosts file | ||
#[error("hostfile is not readable. Reason: {0}")] | ||
HostFileUnreadable(String), | ||
|
||
#[error("Failed to write the hostfile back to the file. Reason: {0}")] | ||
HostFileUnwritable(String), | ||
|
||
#[error("Failed to write backup file, refusing to overwrite original ({0})")] | ||
BackupFileWriteFailed(String), | ||
|
||
#[error("Failed to convert the IP address, this is normally due to a typo of perhaps you gave a hostname instead?")] | ||
IpAddressConversion(), | ||
|
||
#[error("No hostname was given to be added to the hosts file. You should not see this message, if you do, please log an bug report at https://github.com/credmp/hed")] | ||
NoHostnameGiven(), | ||
|
||
#[error("An ip address with this name already exists:\n{0}")] | ||
IpAlreadyInUse(String), | ||
|
||
#[error("An entry exists with the hostname, but with a different IP:\n{0}")] | ||
HostnameAlreadyInUse(String), | ||
|
||
#[error("Could not add host, no parent domain to resolve it. This means that no parent domain exists for the given hostname, try adding it with an IP address, it will be the first entry for this host.\n\nFor instance, if an entry exists called demo.example.com I can not add example.com, as the subdomain is not a parent domain, the other way around will work.")] | ||
NoParentDomain(), | ||
|
||
#[error("You should not see this message, if you do, please log an bug report at https://github.com/credmp/hed, it is very appreciated!")] | ||
FileABugReport(), | ||
|
||
/// Represents all other cases of `std::io::Error`. | ||
#[error(transparent)] | ||
IOError(#[from] std::io::Error), | ||
} |
Oops, something went wrong.