diff options
author | Micah Anderson <micah@riseup.net> | 2017-09-19 15:36:06 -0400 |
---|---|---|
committer | Micah Anderson <micah@riseup.net> | 2017-10-05 19:24:50 -0400 |
commit | 5b10def43d134e5735bfcec1237c04cf66e8610b (patch) | |
tree | 72c1caf4facd3e2433b0dab8d46128f0ac2bf5c3 /provider_base/services | |
parent | fdb58381afa317ab9639dffa59f4155395b68718 (diff) |
Feat: Refactor tor services
In order to refactor the tor services, we need to split them out into three
different services. This adds the hidden service class that is necessary to
support the previous commits. Fixes #8864.
Diffstat (limited to 'provider_base/services')
-rw-r--r-- | provider_base/services/hidden_service.rb | 4 | ||||
-rw-r--r-- | provider_base/services/tor_exit.rb | 4 | ||||
-rw-r--r-- | provider_base/services/tor_hidden_service.json (renamed from provider_base/services/hidden_service.json) | 0 | ||||
-rw-r--r-- | provider_base/services/tor_hidden_service.rb | 4 | ||||
-rw-r--r-- | provider_base/services/tor_relay.rb | 4 |
5 files changed, 8 insertions, 8 deletions
diff --git a/provider_base/services/hidden_service.rb b/provider_base/services/hidden_service.rb deleted file mode 100644 index 50701681..00000000 --- a/provider_base/services/hidden_service.rb +++ /dev/null @@ -1,4 +0,0 @@ -if self.services.include?("tor_exit") || self.services.include?("tor_relay") - LeapCli.log :error, "service `hidden_service` is not compatible with tor_exit or tor_relay (node #{self.name})." -end -self.tor['type'] = "hidden_service"
\ No newline at end of file diff --git a/provider_base/services/tor_exit.rb b/provider_base/services/tor_exit.rb index 05c67438..bd801a3d 100644 --- a/provider_base/services/tor_exit.rb +++ b/provider_base/services/tor_exit.rb @@ -1,5 +1,5 @@ -if self.services.include?("hidden_service") || self.services.include?("tor_relay") - LeapCli.log :error, "service `tor_exit` is not compatible with tor_relay or hidden_service (node #{self.name})." +if self.services.include?("tor_hidden_service") || self.services.include?("tor_relay") + LeapCli.log :error, "service `tor_exit` is not compatible with tor_relay or tor_hidden_service (node #{self.name})." exit(1) end apply_partial("_tor_common") diff --git a/provider_base/services/hidden_service.json b/provider_base/services/tor_hidden_service.json index 137932fa..137932fa 100644 --- a/provider_base/services/hidden_service.json +++ b/provider_base/services/tor_hidden_service.json diff --git a/provider_base/services/tor_hidden_service.rb b/provider_base/services/tor_hidden_service.rb new file mode 100644 index 00000000..8b8eb24d --- /dev/null +++ b/provider_base/services/tor_hidden_service.rb @@ -0,0 +1,4 @@ +if self.services.include?("tor_exit") || self.services.include?("tor_relay") + LeapCli.log :error, "service `tor_hidden_service` is not compatible with tor_exit or tor_relay (node #{self.name})." +end +self.tor['type'] = "hidden_service" diff --git a/provider_base/services/tor_relay.rb b/provider_base/services/tor_relay.rb index 42bafb94..7fce6ae4 100644 --- a/provider_base/services/tor_relay.rb +++ b/provider_base/services/tor_relay.rb @@ -1,6 +1,6 @@ -if self.services.include?("tor_exit") || self.services.include?("hidden_service") - LeapCli.log :error, "service `tor_relay` is not compatible with tor_exit or hidden_service (node #{self.name})." +if self.services.include?("tor_exit") || self.services.include?("tor_hidden_service") + LeapCli.log :error, "service `tor_relay` is not compatible with tor_exit or tor_hidden_service (node #{self.name})." end apply_partial("_tor_common") self.tor['type'] = "relay" |