Skip to content

Commit

Permalink
Bugfix: default server name is "innisfree"
Browse files Browse the repository at this point in the history
Recent changes introduced a regression, where the default server name
would be "innisfree-innisfree" rather than just "innisfree" if no
`--name` arg was passed.
  • Loading branch information
conorsch committed Aug 20, 2021
1 parent b3ba342 commit 93db3f7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## 0.2.10

* Support multiple tunnels on same host
* Bugfix: default server name is `innisfree` again, (was briefly `innisfree-innisfree`)
* Dev only: more explicit typing for IP addresses throughout

## 0.2.9
Expand Down
1 change: 1 addition & 0 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,4 @@
* [x] Use std::net::IpAddr
* [x] Use std::net::SocketAddr
* [x] Support multiple tunnels on same host
* [x] Make default name simply "innisfree", not "innisfree-innisfree"
7 changes: 7 additions & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ pub fn clean_config_dir(service_name: &str) {
/// Adds a prefix "innisfree-" if it does not exist.
pub fn clean_name(name: &str) -> String {
let mut orig = String::from(name);
if orig == "innisfree" {
return orig;
}
orig = orig.replace("-innisfree", "");
orig = orig.replace("innisfree-", "");
let mut result = String::from("innisfree-");
Expand Down Expand Up @@ -125,5 +128,9 @@ mod tests {
let s_complex = "foo-innisfree";
let r_complex = clean_name(s_complex);
assert!(r_complex == *"innisfree-foo");

let s_default = "innisfree";
let r_default = clean_name(s_default);
assert!(r_default == *"innisfree");
}
}

0 comments on commit 93db3f7

Please sign in to comment.