Skip to content
Snippets Groups Projects
Commit 804e0222 authored by elijah's avatar elijah
Browse files

Bug: fix hidden service for static

hidden service should be activated iff tor is among the active services and
tor.hidden_service.active == true
parent 27ae2091
Branches
No related tags found
No related merge requests found
Pipeline #
...@@ -12,6 +12,11 @@ class site_static { ...@@ -12,6 +12,11 @@ class site_static {
$formats = $static['formats'] $formats = $static['formats']
$bootstrap = $static['bootstrap_files'] $bootstrap = $static['bootstrap_files']
$tor = hiera('tor', false) $tor = hiera('tor', false)
if $tor and member($services, 'tor') and $tor['hidden_service']['active'] == true {
$tor_active = true
} else {
$tor_active = false
}
file { file {
'/srv/static/': '/srv/static/':
...@@ -71,11 +76,13 @@ class site_static { ...@@ -71,11 +76,13 @@ class site_static {
} }
} }
if $tor { if $tor_active {
$hidden_service = $tor['hidden_service'] $hidden_service = $tor['hidden_service']
$tor_domain = "${hidden_service['address']}.onion" $tor_domain = "${hidden_service['address']}.onion"
class { 'site_static::hidden_service': single_hop => $hidden_service['single_hop'] class { 'site_static::hidden_service':
single_hop => $hidden_service['single_hop']
} }
# Currently, we only support a single hidden service address per server. # Currently, we only support a single hidden service address per server.
# So if there is more than one domain configured, then we need to make sure # So if there is more than one domain configured, then we need to make sure
# we don't enable the hidden service for every domain. # we don't enable the hidden service for every domain.
......
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
Require all granted Require all granted
</Directory> </Directory>
<%- if @tor && (@always_use_hidden_service || @use_hidden_service) -%> <%- if @tor_active && (@always_use_hidden_service || @use_hidden_service) -%>
## ##
## Tor ## Tor
## ##
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment