mirror of
https://github.com/DumbWareio/DumbDrop.git
synced 2025-10-23 07:41:58 +00:00
Chores & Configuration • Enhanced development setup: optimized Dockerfile, refined scripts, and improved .gitignore. • Updated docker-compose for better dev/prod separation. • Improved documentation in README and source files. Features & Enhancements • Refactored project structure with modular architecture. • Improved testing infrastructure and integration tests. • Enhanced file upload logic, client-side handling, and API routes. • Implemented robust server shutdown, rate limiting, and cleanup mechanisms. • Improved upload progress tracking with UI enhancements. • Strengthened security in PIN authentication and cookie handling. Refactors & Fixes • Cleaned up test infrastructure, logging, and error handling. • Simplified API route paths and improved middleware. • Fixed incorrect total storage size reporting. • Optimized logging verbosity based on environment. Documentation • Expanded project documentation and comments for clarity.
74 lines
2.3 KiB
Bash
Executable File
74 lines
2.3 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Set script to exit on error
|
|
set -e
|
|
|
|
# Enable Docker BuildKit
|
|
export DOCKER_BUILDKIT=1
|
|
|
|
# Colors for pretty output
|
|
GREEN='\033[0;32m'
|
|
BLUE='\033[0;34m'
|
|
RED='\033[0;31m'
|
|
NC='\033[0m' # No Color
|
|
|
|
# Helper function for pretty printing
|
|
print_message() {
|
|
echo -e "${BLUE}🔧 ${1}${NC}"
|
|
}
|
|
|
|
# Ensure we're in the right directory
|
|
cd "$(dirname "$0")"
|
|
|
|
case "$1" in
|
|
"up")
|
|
print_message "Starting DumbDrop in development mode..."
|
|
if [ ! -f .env.dev ]; then
|
|
print_message "No .env.dev found. Creating from example..."
|
|
cp .env.dev.example .env.dev
|
|
fi
|
|
docker compose -f docker-compose.dev.yml up -d --build
|
|
print_message "Container logs:"
|
|
docker compose -f docker-compose.dev.yml logs
|
|
;;
|
|
"down")
|
|
print_message "Stopping DumbDrop development environment..."
|
|
docker compose -f docker-compose.dev.yml down
|
|
;;
|
|
"logs")
|
|
print_message "Showing DumbDrop logs..."
|
|
docker compose -f docker-compose.dev.yml logs -f
|
|
;;
|
|
"rebuild")
|
|
print_message "Rebuilding DumbDrop..."
|
|
docker compose -f docker-compose.dev.yml build --no-cache
|
|
docker compose -f docker-compose.dev.yml up
|
|
;;
|
|
"clean")
|
|
print_message "Cleaning up development environment..."
|
|
docker compose -f docker-compose.dev.yml down -v --remove-orphans
|
|
rm -f .env.dev
|
|
print_message "Cleaned up containers, volumes, and env file"
|
|
;;
|
|
"shell")
|
|
print_message "Opening shell in container..."
|
|
docker compose -f docker-compose.dev.yml exec app sh
|
|
;;
|
|
"lint")
|
|
print_message "Running linter..."
|
|
docker compose -f docker-compose.dev.yml exec app npm run lint
|
|
;;
|
|
*)
|
|
echo -e "${GREEN}DumbDrop Development Helper${NC}"
|
|
echo "Usage: ./dev.sh [command]"
|
|
echo ""
|
|
echo "Commands:"
|
|
echo " up - Start development environment (creates .env.dev if missing)"
|
|
echo " down - Stop development environment"
|
|
echo " logs - Show container logs"
|
|
echo " rebuild - Rebuild container without cache and start"
|
|
echo " clean - Clean up everything (containers, volumes, env)"
|
|
echo " shell - Open shell in container"
|
|
echo " lint - Run linter"
|
|
;;
|
|
esac |