44 lines
1.0 KiB
Bash
Executable File
44 lines
1.0 KiB
Bash
Executable File
#!/bin/bash
|
|
#
|
|
# Upload the Nostr Quantum Preparation web app to the server.
|
|
#
|
|
# Usage: ./upload.sh
|
|
#
|
|
# Uploads the contents of www/ to ubuntu@laantungir.net:html/quantum-prep/
|
|
# The site will be accessible at https://laantungir.net/quantum-prep/
|
|
#
|
|
|
|
set -e
|
|
|
|
SERVER="ubuntu@laantungir.net"
|
|
REMOTE_DIR="html/quantum-prep"
|
|
LOCAL_DIR="$(dirname "$0")/www"
|
|
|
|
echo "🔒 Nostr Quantum Preparation — Upload"
|
|
echo "=============================="
|
|
echo "Server: $SERVER"
|
|
echo "Remote: $REMOTE_DIR"
|
|
echo "Local: $LOCAL_DIR"
|
|
echo ""
|
|
|
|
# Ensure the bundle is up to date
|
|
echo "📦 Building PQ crypto bundle..."
|
|
node "$(dirname "$0")/build-pq-bundle.js"
|
|
echo ""
|
|
|
|
# Create the remote directory if it doesn't exist
|
|
echo "📁 Ensuring remote directory exists..."
|
|
ssh "$SERVER" "mkdir -p $REMOTE_DIR"
|
|
echo ""
|
|
|
|
# Upload files using rsync
|
|
echo "📤 Uploading files..."
|
|
rsync -avz --delete \
|
|
--exclude='*.map' \
|
|
"$LOCAL_DIR/" \
|
|
"$SERVER:$REMOTE_DIR/"
|
|
echo ""
|
|
|
|
echo "✅ Upload complete!"
|
|
echo "🌐 Site available at: https://laantungir.net/quantum-prep"
|