Complete LinkSyncServer and LinkSyncExtension implementation
LinkSyncServer: - Fix app.py imports, add CORS middleware, lifespan events - Create api/routes.py router aggregator - Create config/settings.py for centralized configuration - Rewrite models/base.py with proper relationships and serialization - Rewrite all API endpoints with real DB integration (auth, links, collections, sync, queries, tags) - Add admin endpoints (user management, stats, audit log) - Complete query parser with recursive descent and proper precedence - Complete query executor with set operations and field filters - Set up Alembic migrations with initial schema - Create web interface (templates, CSS, JS) - Add 42 passing tests (auth, links, collections, queries) - Add deploy.ps1 and deploy.sh scripts - Update README with deployment workflow LinkSyncExtension: - Create utils/api.js (REST client with retries, auth, error handling) - Create utils/sync.js (3 sync modes + conflict detection) - Create utils/collection.js (collection management) - Create utils/query-engine.js (client-side query parser) - Rewrite background.js (sync loop, bookmark events, message routing) - Rewrite popup.js (tabs, settings modal, notifications, CRUD) - Update popup.html (tabbed interface, query builder, modal) - Update popup.css (full redesign) - Create content/content.js (page metadata extraction) - Create options.html/js (dedicated settings page) - Generate icons (48x48, 96x96) - Update manifest.json (host permissions, content scripts, options) - Create AGENTS.md
This commit is contained in:
95
LinkSyncServer/deploy.sh
Normal file
95
LinkSyncServer/deploy.sh
Normal file
@@ -0,0 +1,95 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# LinkSyncServer - Deploy Script
|
||||
#
|
||||
# Prepares a deployment package by copying only production files,
|
||||
# excluding development artifacts, and creating a starter .env file.
|
||||
#
|
||||
# Usage: ./deploy.sh <deploy_path>
|
||||
#
|
||||
# After running, edit the .env file with production secrets
|
||||
# and run: docker-compose up -d --build
|
||||
#
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
SOURCE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
DEPLOY_PATH="${1:?Usage: $0 <deploy_path>}"
|
||||
|
||||
RED='\033[0;31m'
|
||||
CYAN='\033[0;36m'
|
||||
YELLOW='\033[1;33m'
|
||||
GRAY='\033[0;37m'
|
||||
GREEN='\033[0;32m'
|
||||
NC='\033[0m'
|
||||
|
||||
echo -e "${CYAN}LinkSyncServer - Deploy Script${NC}"
|
||||
echo -e "${GRAY} Source: $SOURCE_DIR${NC}"
|
||||
echo -e "${GRAY} Deploy to: $DEPLOY_PATH${NC}"
|
||||
echo ""
|
||||
|
||||
# Create target directory
|
||||
mkdir -p "$DEPLOY_PATH"
|
||||
|
||||
# Clean if existing content
|
||||
if [ "$(ls -A "$DEPLOY_PATH" 2>/dev/null)" ]; then
|
||||
read -p "Target folder already exists. Clear it? (y/N): " confirm
|
||||
if [ "$confirm" != "y" ]; then
|
||||
echo -e "${YELLOW}Aborted.${NC}"
|
||||
exit 1
|
||||
fi
|
||||
rm -rf "${DEPLOY_PATH:?}"/*
|
||||
fi
|
||||
|
||||
echo -e "${GRAY}Copying files...${NC}"
|
||||
|
||||
# Exclusion patterns
|
||||
EXCLUDE=(
|
||||
"__pycache__"
|
||||
".pytest_cache"
|
||||
".git"
|
||||
".vscode"
|
||||
".idea"
|
||||
".mypy_cache"
|
||||
".ruff_cache"
|
||||
"node_modules"
|
||||
"dist"
|
||||
"build"
|
||||
"tests"
|
||||
"*.egg-info"
|
||||
"deploy.sh"
|
||||
)
|
||||
|
||||
# Build rsync exclude arguments
|
||||
RSYNC_EXCLUDE=()
|
||||
for pattern in "${EXCLUDE[@]}"; do
|
||||
RSYNC_EXCLUDE+=(--exclude="$pattern")
|
||||
done
|
||||
|
||||
# Use rsync to copy, excluding dev artifacts
|
||||
rsync -a "${RSYNC_EXCLUDE[@]}" \
|
||||
--exclude="*.pyc" \
|
||||
--exclude="*.pyo" \
|
||||
--exclude="*.pyd" \
|
||||
--exclude="*.db" \
|
||||
--exclude="*.sqlite3" \
|
||||
--exclude="deploy.ps1" \
|
||||
"$SOURCE_DIR/" "$DEPLOY_PATH/"
|
||||
|
||||
# Copy .env.example as .env
|
||||
if [ -f "$SOURCE_DIR/.env.example" ]; then
|
||||
cp "$SOURCE_DIR/.env.example" "$DEPLOY_PATH/.env"
|
||||
echo -e "${GREEN} Created .env from .env.example${NC}"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo -e "${CYAN}Deployment package prepared at: $DEPLOY_PATH${NC}"
|
||||
echo ""
|
||||
echo -e "${YELLOW}Next steps:${NC}"
|
||||
echo -e "${GRAY} 1. Edit $DEPLOY_PATH/.env with production secrets${NC}"
|
||||
echo -e "${GRAY} - Set DATABASE_URL (PostgreSQL connection string)${NC}"
|
||||
echo -e "${GRAY} - Set SECRET_KEY (generate: openssl rand -base64 32)${NC}"
|
||||
echo -e "${GRAY} - Set ADMIN_PASSWORD (strong password)${NC}"
|
||||
echo -e "${GRAY} 2. cd $DEPLOY_PATH${NC}"
|
||||
echo -e "${GRAY} 3. docker-compose up -d --build${NC}"
|
||||
echo ""
|
||||
Reference in New Issue
Block a user