Skip to content

Commit

Permalink
Fix CSP origin for different deployments (#2923)
Browse files Browse the repository at this point in the history
  • Loading branch information
raphjaph authored Dec 29, 2023
1 parent 12ed80e commit dc7ea66
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
2 changes: 1 addition & 1 deletion deploy/ord.service
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ExecStart=/usr/local/bin/ord \
--index-transactions \
server \
--acme-contact mailto:[email protected] \
--csp-origin https://ordinals.com \
--csp-origin https://${CSP_ORIGIN} \
--http \
--https
Group=ord
Expand Down
21 changes: 20 additions & 1 deletion deploy/setup
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,25 @@ BRANCH=$3
COMMIT=$4
REVISION="ord-$BRANCH-$COMMIT"

case $CHAIN in
main)
CSP_ORIGIN=ordinals.com
;;
regtest)
CSP_ORIGIN=regtest.ordinals.com
;;
signet)
CSP_ORIGIN=signet.ordinals.com
;;
test)
CSP_ORIGIN=testnet.ordinals.com
;;
*)
echo "Unknown chain: $CHAIN"
exit 1
;;
esac

touch ~/.hushlogin

sed -i -E 's/#?PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config
Expand All @@ -18,7 +37,7 @@ mkdir -p \
/etc/systemd/system/bitcoind.service.d \
/etc/systemd/system/ord.service.d

printf "[Service]\nEnvironment=CHAIN=%s\n" $CHAIN \
printf "[Service]\nEnvironment=CHAIN=%s\nEnvironment=CSP_ORIGIN=%s\n" $CHAIN $CSP_ORIGIN \
| tee /etc/systemd/system/bitcoind.service.d/override.conf \
> /etc/systemd/system/ord.service.d/override.conf

Expand Down

0 comments on commit dc7ea66

Please sign in to comment.