Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docker/bitcoind/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ARG BITCOIN_VERSION
ENV PATH=/opt/bitcoin-${BITCOIN_VERSION}/bin:$PATH

RUN apt-get update -y \
&& apt-get install -y curl gosu \
&& apt-get install -y curl gosu tor\
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

Expand All @@ -26,7 +26,7 @@ RUN chmod a+x /entrypoint.sh

VOLUME ["/home/bitcoin/.bitcoin"]

EXPOSE 18443 18444 28334 28335
EXPOSE 18443 18444 28334 28335 9050 9051

ENTRYPOINT ["/entrypoint.sh"]

Expand Down
33 changes: 33 additions & 0 deletions docker/bitcoind/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,39 @@ if ! id bitcoin > /dev/null 2>&1; then
chown -R $USERID:$GROUPID /home/bitcoin
fi


if [ "${ENABLE_TOR}" = "true" ]; then
if getent group debian-tor > /dev/null 2>&1; then
usermod -a -G debian-tor bitcoin
fi

echo "Starting Tor service for Bitcoin..."
mkdir -p /var/lib/tor/bitcoin-service
chown -R debian-tor:debian-tor /var/lib/tor
chmod 700 /var/lib/tor
chmod 700 /var/lib/tor/bitcoin-service

# Generate torrc file
cat > /etc/tor/torrc <<EOF
# Tor configuration for Bitcoin
DataDirectory /var/lib/tor
Log notice stdout

SocksPort 127.0.0.1:9050
ControlPort 127.0.0.1:9051
CookieAuthentication 1
CookieAuthFile /var/lib/tor/control_auth_cookie
CookieAuthFileGroupReadable 1
DataDirectoryGroupReadable 1

HiddenServiceDir /var/lib/tor/bitcoin-service
HiddenServicePort 8333 127.0.0.1:8334
EOF
gosu debian-tor tor &
else
echo "Tor service disabled (ENABLE_TOR != 'true')"
fi

if [ $(echo "$1" | cut -c1) = "-" ]; then
echo "$0: assuming arguments for bitcoind"

Expand Down
4 changes: 2 additions & 2 deletions docker/clightning/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ARG CLN_VERSION

# install gosu
RUN apt-get update -y \
&& apt-get install -y curl gosu git \
&& apt-get install -y curl gosu git tor\
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

Expand All @@ -26,7 +26,7 @@ RUN chmod a+x /entrypoint.sh

VOLUME ["/home/clightning"]

EXPOSE 9735 9835 8080 10000
EXPOSE 9735 9835 8080 10000 9050 9051

ENTRYPOINT ["/entrypoint.sh"]

Expand Down
35 changes: 35 additions & 0 deletions docker/clightning/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,41 @@ if ! id clightning > /dev/null 2>&1; then
chown -R $USERID:$GROUPID /home/clightning
fi


if [ "${ENABLE_TOR}" = "true" ]; then
if getent group debian-tor > /dev/null 2>&1; then
usermod -a -G debian-tor clightning
fi

echo "Starting Tor service for Clightning..."
mkdir -p /var/lib/tor/clightning-service
chown -R debian-tor:debian-tor /var/lib/tor
chmod 700 /var/lib/tor
chmod 700 /var/lib/tor/clightning-service

# Generate torrc file
cat > /etc/tor/torrc <<EOF
# Tor configuration for Clightning
DataDirectory /var/lib/tor
Log notice stdout

SocksPort 127.0.0.1:9050
ControlPort 127.0.0.1:9051
CookieAuthentication 1
CookieAuthFile /var/lib/tor/control_auth_cookie
CookieAuthFileGroupReadable 1
DataDirectoryGroupReadable 1

HiddenServiceDir /var/lib/tor/clightning-service
HiddenServiceVersion 3
HiddenServicePort 9735 127.0.0.1:9735

EOF
gosu debian-tor tor &
else
echo "Tor service disabled (ENABLE_TOR != 'true')"
fi

if [ $(echo "$1" | cut -c1) = "-" ]; then
echo "$0: assuming arguments for lightningd"

Expand Down
6 changes: 3 additions & 3 deletions docker/eclair/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ FROM eclipse-temurin:25.0.1_8-jre-alpine
WORKDIR /app

# install jq for eclair-cli
RUN apk add bash jq curl unzip su-exec
RUN apk add bash jq curl unzip su-exec tor

# copy and install eclair-cli executable
COPY --from=BUILD /usr/src/eclair-core/eclair-cli .
Expand All @@ -81,7 +81,7 @@ RUN chmod -R a+x eclair-node/*
RUN ls -al eclair-node/bin

RUN curl -SLO https://raw.githubusercontent.com/ACINQ/eclair/master/contrib/eclair-cli.bash-completion \
&& mkdir /etc/bash_completion.d \
&& mkdir -p /etc/bash_completion.d \
&& mv eclair-cli.bash-completion /etc/bash_completion.d/ \
&& curl -SLO https://raw.githubusercontent.com/scop/bash-completion/master/bash_completion \
&& mkdir /usr/share/bash-completion/ \
Expand All @@ -94,7 +94,7 @@ RUN chmod a+x /entrypoint.sh

VOLUME ["/home/eclair"]

EXPOSE 9735 8080
EXPOSE 9735 8080 9050 9051

ENTRYPOINT ["/entrypoint.sh"]

Expand Down
45 changes: 41 additions & 4 deletions docker/eclair/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,53 @@ if ! id eclair > /dev/null 2>&1; then
chown -R $USERID:$GROUPID /home/eclair
fi


if [ "${ENABLE_TOR}" = "true" ]; then
if getent group tor > /dev/null; then
addgroup eclair tor
fi

echo "Starting Tor service..."
mkdir -p /var/lib/tor/eclair-service
if getent passwd tor > /dev/null; then
chown -R tor:tor /var/lib/tor
fi
chmod 700 /var/lib/tor
chmod 700 /var/lib/tor/eclair-service

# Generate torrc file
cat > /etc/tor/torrc <<EOF
# Tor configuration for Eclair
DataDirectory /var/lib/tor
Log notice stdout

SocksPort 127.0.0.1:9050
ControlPort 127.0.0.1:9051
CookieAuthentication 1
CookieAuthFile /var/lib/tor/control_auth_cookie
CookieAuthFileGroupReadable 1
DataDirectoryGroupReadable 1
ExitPolicy reject *:*

EOF
su-exec tor tor &
else
echo "Tor service disabled (ENABLE_TOR != 'true')"
fi

if [ "$1" = "polar-eclair" ]; then
# convert command line args to JAVA_OPTS
JAVA_OPTS=""
for arg in "$@"
do
if [ "${arg:0:21}" = "--server.public-ips.0" ]; then
# replace the hostname provided in this arg with the IP address of the containing
# because Eclair v8+ began including the DNS hostname in the NodeAnnouncements and
# LND throws an error when parsing these messages
JAVA_OPTS="$JAVA_OPTS -Declair.server.public-ips.0=$(hostname -i)"
# Skip adding public IP when Tor is enabled - let Eclair only announce the onion address
if [ "${ENABLE_TOR}" != "true" ]; then
# replace the hostname provided in this arg with the IP address of the containing
# because Eclair v8+ began including the DNS hostname in the NodeAnnouncements and
# LND throws an error when parsing these messages
JAVA_OPTS="$JAVA_OPTS -Declair.server.public-ips.0=$(hostname -i)"
fi
elif [ "${arg:0:2}" = "--" ]; then
JAVA_OPTS="$JAVA_OPTS -Declair.${arg:2}"
fi
Expand Down
4 changes: 2 additions & 2 deletions docker/litd/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ARG LITD_VERSION
ENV PATH=/opt/litd:$PATH

RUN apt-get update -y \
&& apt-get install -y curl gosu wait-for-it \
&& apt-get install -y curl gosu wait-for-it tor\
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

Expand All @@ -21,7 +21,7 @@ RUN chmod a+x /entrypoint.sh

VOLUME ["/home/litd/.litd"]

EXPOSE 9735 8080 10000
EXPOSE 9735 8080 10000 9050 9051

ENTRYPOINT ["/entrypoint.sh"]

Expand Down
35 changes: 35 additions & 0 deletions docker/litd/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,41 @@ if ! id litd > /dev/null 2>&1; then
chown -R $USERID:$GROUPID /home/litd
fi


if [ "${ENABLE_TOR}" = "true" ]; then
if getent group debian-tor > /dev/null 2>&1; then
usermod -a -G debian-tor litd
fi

echo "Starting Tor service..."
mkdir -p /var/lib/tor/litd-service
chown -R debian-tor:debian-tor /var/lib/tor
chmod 700 /var/lib/tor
chmod 700 /var/lib/tor/litd-service

# Generate torrc file
cat > /etc/tor/torrc <<EOF
# Tor configuration for LITD
DataDirectory /var/lib/tor
Log notice stdout

SocksPort 127.0.0.1:9050
ControlPort 127.0.0.1:9051
CookieAuthentication 1
CookieAuthFile /var/lib/tor/control_auth_cookie
CookieAuthFileGroupReadable 1
DataDirectoryGroupReadable 1

HiddenServiceDir /var/lib/tor/litd-service
HiddenServiceVersion 3
HiddenServicePort 9735 127.0.0.1:9735
HiddenServicePort 8080 127.0.0.1:8080
EOF
gosu debian-tor tor &
else
echo "Tor service disabled (ENABLE_TOR != 'true')"
fi

if [ $(echo "$1" | cut -c1) = "-" ]; then
echo "$0: assuming arguments for litd"

Expand Down
4 changes: 2 additions & 2 deletions docker/lnd/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ARG LND_VERSION
ENV PATH=/opt/lnd:$PATH

RUN apt-get update -y \
&& apt-get install -y curl gosu wait-for-it \
&& apt-get install -y curl gosu wait-for-it tor \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

Expand All @@ -28,7 +28,7 @@ RUN chmod a+x /entrypoint.sh

VOLUME ["/home/lnd/.lnd"]

EXPOSE 9735 8080 10000
EXPOSE 9735 8080 10000 9050 9051

ENTRYPOINT ["/entrypoint.sh"]

Expand Down
35 changes: 35 additions & 0 deletions docker/lnd/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,41 @@ if ! id lnd > /dev/null 2>&1; then
chown -R $USERID:$GROUPID /home/lnd
fi


if [ "${ENABLE_TOR}" = "true" ]; then
if getent group debian-tor > /dev/null 2>&1; then
usermod -a -G debian-tor lnd
fi

echo "Starting Tor service..."
mkdir -p /var/lib/tor/lnd-service
chown -R debian-tor:debian-tor /var/lib/tor
chmod 700 /var/lib/tor
chmod 700 /var/lib/tor/lnd-service

# Generate torrc
cat > /etc/tor/torrc <<EOF
# Tor configuration for LND
DataDirectory /var/lib/tor
Log notice stdout

SocksPort 127.0.0.1:9050
ControlPort 127.0.0.1:9051
CookieAuthentication 1
CookieAuthFile /var/lib/tor/control_auth_cookie
CookieAuthFileGroupReadable 1
DataDirectoryGroupReadable 1

HiddenServiceDir /var/lib/tor/lnd-service
HiddenServiceVersion 3
HiddenServicePort 9735 127.0.0.1:9735
HiddenServicePort 8080 127.0.0.1:8080
EOF
gosu debian-tor tor &
else
echo "Tor service disabled (ENABLE_TOR != 'true')"
fi

if [ $(echo "$1" | cut -c1) = "-" ]; then
echo "$0: assuming arguments for lnd"

Expand Down
4 changes: 2 additions & 2 deletions src/components/common/AdvancedOptionsButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Button, Form } from 'antd';
import { usePrefixedTranslation } from 'hooks';
import { AnyNode } from 'shared/types';
import { useStoreActions } from 'store';
import { getDefaultCommand } from 'utils/network';
import { getDefaultCommand, getEffectiveCommand } from 'utils/network';

interface Props {
node: AnyNode;
Expand All @@ -17,7 +17,7 @@ const AdvancedOptionsButton: React.FC<Props> = ({ node, type }) => {
const handleClick = () => {
showAdvancedOptions({
nodeName: node.name,
command: node.docker.command,
command: getEffectiveCommand(node),
defaultCommand: getDefaultCommand(node.implementation, node.version),
});
};
Expand Down
Loading