Skip to content

Commit

Permalink
Don't hardcode cookie file in deploy script (ordinals#367)
Browse files Browse the repository at this point in the history
  • Loading branch information
casey committed Aug 23, 2022
1 parent e82833f commit 25b5423
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
22 changes: 18 additions & 4 deletions deploy/setup
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,28 @@ systemctl daemon-reload
systemctl enable bitcoind
systemctl restart bitcoind

while [[ ! -f /var/lib/bitcoind/signet/.cookie ]]; do
echo Waiting for bitcoind…
case $CHAIN in
main)
COOKIE_FILE_DIR=/var/lib/bitcoind
;;
signet)
COOKIE_FILE_DIR=/var/lib/bitcoind/signet
;;
*)
echo "Unknown chain: $CHAIN"
exit 1
;;
esac

while [[ ! -f $COOKIE_FILE_DIR/.cookie ]]; do
echo "Waiting for bitcoind…"
sleep 1
done

setfacl -m ord:x /var/lib/bitcoind
setfacl -dm ord:r /var/lib/bitcoind
setfacl -m ord:r /var/lib/bitcoind/signet/.cookie
setfacl -m ord:x $COOKIE_FILE_DIR
setfacl -dm ord:r $COOKIE_FILE_DIR
setfacl -m ord:r $COOKIE_FILE_DIR/.cookie

cp deploy/ord.service /etc/systemd/system/
systemctl daemon-reload
Expand Down
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ deploy branch chain domain:
rsync -avz deploy/checkout root@{{domain}}:deploy/checkout
ssh root@{{domain}} 'cd deploy && ./checkout {{branch}} {{chain}} {{domain}}'

deploy-mainnet branch="master": (deploy branch "main" "ordinals.com")
deploy-mainnet: (deploy "master" "main" "ordinals.com")

deploy-signet branch="master": (deploy branch "signet" "signet.ordinals.com")

Expand Down

0 comments on commit 25b5423

Please sign in to comment.