fix(deploy): auto-generate JWT secret, include node/exit composes and helpers
Some checks are pending
Build & Release / Linux x86_64 (push) Waiting to run
Build & Release / macOS ARM64 (push) Waiting to run
Build & Release / Create Release (push) Blocked by required conditions

Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
Claude 2026-04-03 12:37:57 +01:00
parent 2ff53183c3
commit 9e3c6c2223
No known key found for this signature in database
GPG key ID: AF404715446AEB41

View file

@ -45,9 +45,21 @@ scp "$SCRIPT_DIR/.env.example" "$REMOTE:$INSTALL_DIR/"
scp "$SCRIPT_DIR/pool-config.json" "$REMOTE:$INSTALL_DIR/" scp "$SCRIPT_DIR/pool-config.json" "$REMOTE:$INSTALL_DIR/"
scp "$SCRIPT_DIR/health.sh" "$REMOTE:$INSTALL_DIR/" scp "$SCRIPT_DIR/health.sh" "$REMOTE:$INSTALL_DIR/"
scp "$SCRIPT_DIR/lethean-testnet.service" "$REMOTE:$INSTALL_DIR/" scp "$SCRIPT_DIR/lethean-testnet.service" "$REMOTE:$INSTALL_DIR/"
scp "$SCRIPT_DIR/docker-compose.node.yml" "$REMOTE:$INSTALL_DIR/"
scp "$SCRIPT_DIR/docker-compose.exit.yml" "$REMOTE:$INSTALL_DIR/"
scp -r "$SCRIPT_DIR/demos/helpers" "$REMOTE:$INSTALL_DIR/demos/"
# Create .env if it doesn't exist # Create .env if it doesn't exist — generate unique JWT secret
ssh "$REMOTE" "[ -f $INSTALL_DIR/.env ] || cp $INSTALL_DIR/.env.example $INSTALL_DIR/.env" ssh "$REMOTE" "
if [ ! -f $INSTALL_DIR/.env ]; then
cp $INSTALL_DIR/.env.example $INSTALL_DIR/.env
JWT=\$(openssl rand -hex 32 2>/dev/null || head -c 64 /dev/urandom | xxd -p | tr -d '\n' | head -c 64)
sed -i \"s/change-me-before-production/\$JWT/\" $INSTALL_DIR/.env
echo 'Generated unique JWT secret'
else
echo '.env already exists — skipping'
fi
"
echo "Transferring images (~$(du -h "$IMAGES" | cut -f1))... this may take a while" echo "Transferring images (~$(du -h "$IMAGES" | cut -f1))... this may take a while"
scp "$IMAGES" "$REMOTE:/tmp/lethean-testnet-images.tar.gz" scp "$IMAGES" "$REMOTE:/tmp/lethean-testnet-images.tar.gz"