mirror of
https://github.com/aljazceru/btcpayserver-docker.git
synced 2026-02-08 06:44:20 +01:00
* Add tor relay fragment * remove extra , * use same tor container for relay * remove \ns * use own container for tor relay because of https://trac.torproject.org/projects/tor/ticket/8742 * be explicit with ports * fix container name * fix duplicate config * fix config clash * do not set daemon config item * add info about tor requirements and legal implications
34 lines
1.4 KiB
Cheetah
34 lines
1.4 KiB
Cheetah
{{ $CurrentContainer := where $ "ID" .Docker.CurrentContainerID | first }}
|
|
|
|
{{ range $name, $containers := groupByMulti $ "Env.HIDDENSERVICE_NAME" "," }}
|
|
{{ $firstServicePort := true }}
|
|
{{ range $container := $containers }}
|
|
{{ range $knownNetwork := $CurrentContainer.Networks }}
|
|
{{ range $containerNetwork := $container.Networks }}
|
|
{{ if eq $knownNetwork.Name $containerNetwork.Name }}
|
|
{{ $containerOrReverseProxyName := coalesce $container.Env.HIDDENSERVICE_REVERSEPROXY $container.Name }}
|
|
|
|
{{ range $reverseProxyContainer := where $ "Name" $containerOrReverseProxyName }}
|
|
{{ range $containerNetwork := where $reverseProxyContainer.Networks "Name" $knownNetwork.Name }}
|
|
{{ $port := coalesce $container.Env.HIDDENSERVICE_PORT "80" }}
|
|
{{ $virtualPort := coalesce $container.Env.HIDDENSERVICE_VIRTUAL_PORT $port }}
|
|
{{ if ne $containerNetwork.IP "" }}
|
|
{{ if $firstServicePort }}
|
|
# For the hidden service {{ $name }}
|
|
HiddenServiceDir /var/lib/tor/hidden_services/{{ $name }}
|
|
{{ $firstServicePort := false }}
|
|
{{ end }}
|
|
# Redirecting to {{ $containerOrReverseProxyName }}
|
|
HiddenServicePort {{ $virtualPort }} {{ $containerNetwork.IP }}:{{ $port }}
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ end }}
|
|
|
|
{{ if $.Env.ADDITIONAL_TORRC_CONFIG }}
|
|
{{ $.Env.ADDITIONAL_TORRC_CONFIG}}
|
|
{{ end }} |