mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-03-03 17:36:59 +01:00
Make sure BTCPAY_SSHKEYFILE is set when starting container
This commit is contained in:
parent
2e0abdbd06
commit
e763e9e41a
1 changed files with 2 additions and 2 deletions
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
echo "$(/sbin/ip route|awk '/default/ { print $3 }') host.docker.internal" >> /etc/hosts
|
echo "$(/sbin/ip route|awk '/default/ { print $3 }') host.docker.internal" >> /etc/hosts
|
||||||
|
|
||||||
if ! [ -f "$BTCPAY_SSHKEYFILE" ]; then
|
if [[ "$BTCPAY_SSHKEYFILE" ]] && ! [ -f "$BTCPAY_SSHKEYFILE" ]; then
|
||||||
echo "Creating BTCPay Server SSH key File..."
|
echo "Creating BTCPay Server SSH key File..."
|
||||||
ssh-keygen -t rsa -f "$BTCPAY_SSHKEYFILE" -q -P "" -m PEM -C btcpayserver > /dev/null
|
ssh-keygen -t rsa -f "$BTCPAY_SSHKEYFILE" -q -P "" -m PEM -C btcpayserver > /dev/null
|
||||||
if [ -f "$BTCPAY_SSHAUTHORIZEDKEYS" ]; then
|
if [ -f "$BTCPAY_SSHAUTHORIZEDKEYS" ]; then
|
||||||
|
@ -13,7 +13,7 @@ if ! [ -f "$BTCPAY_SSHKEYFILE" ]; then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f "$BTCPAY_SSHAUTHORIZEDKEYS" ] && ! grep -q "btcpayserver$" "$BTCPAY_SSHAUTHORIZEDKEYS"; then
|
if [[ "$BTCPAY_SSHKEYFILE" ]] && [ -f "$BTCPAY_SSHAUTHORIZEDKEYS" ] && ! grep -q "btcpayserver$" "$BTCPAY_SSHAUTHORIZEDKEYS"; then
|
||||||
echo "Adding BTCPay Server SSH key to authorized keys"
|
echo "Adding BTCPay Server SSH key to authorized keys"
|
||||||
cat "$BTCPAY_SSHKEYFILE.pub" >> "$BTCPAY_SSHAUTHORIZEDKEYS"
|
cat "$BTCPAY_SSHKEYFILE.pub" >> "$BTCPAY_SSHAUTHORIZEDKEYS"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Reference in a new issue