Skip to content

Commit 07bbda7

Browse files
committed
docs: simplify Quick Start Guide to 2 minutes with automated setup script
- Reduce Quick Start from 5 to 2 minutes by introducing setup.sh automation - Remove manual Git vs ZIP download options in favor of single git clone command - Replace manual docker compose command with ./setup.sh script execution - Add visual setup completion banner showing dashboard URL and credentials - Simplify docker-compose.yml by removing inline environment variables - Move environment configuration to .env file via
1 parent 2f51f80 commit 07bbda7

3 files changed

Lines changed: 128 additions & 44 deletions

File tree

README.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -69,35 +69,36 @@ sudo usermod -aG docker $USER
6969

7070
---
7171

72-
## 🚀 Quick Start Guide (5 Minutes)
72+
## 🚀 Quick Start Guide (2 Minutes)
7373

7474
### Step 1: Download the Project
7575

76-
**Option A - If you have Git:**
7776
```bash
7877
git clone https://github.com/SourceBox-LLC/OpenSentry-Command.git
7978
cd OpenSentry-Command
8079
```
8180

82-
**Option B - Download ZIP:**
83-
1. Click the green "Code" button on GitHub
84-
2. Click "Download ZIP"
85-
3. Unzip the folder
86-
4. Open a terminal/command prompt in that folder
87-
88-
### Step 2: Start the Command Center
89-
90-
Run this single command:
81+
### Step 2: Run the Setup Script
9182

9283
```bash
93-
docker compose up --build
84+
chmod +x setup.sh
85+
./setup.sh
9486
```
9587

96-
**What you'll see:**
88+
**That's it!** The script will:
89+
- Ask you for a username and password
90+
- Generate a security secret automatically
91+
- Start the Command Center
92+
93+
### What You'll See
94+
9795
```
98-
[+] Running 1/1
99-
✔ Container opensentry-command Started
100-
[Flask] Starting web server on http://0.0.0.0:5000
96+
╔═══════════════════════════════════════════════════════════════╗
97+
║ Setup Complete! ║
98+
╠═══════════════════════════════════════════════════════════════╣
99+
║ Dashboard: http://localhost:5000 ║
100+
║ Username: admin ║
101+
╚═══════════════════════════════════════════════════════════════╝
101102
[mDNS] Discovery started, listening for OpenSentry nodes...
102103
[MQTT] Client started
103104
```

docker-compose.yml

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,15 @@
1+
# OpenSentry Command Center
2+
# Quick Start: docker compose up --build
3+
# Dashboard: http://localhost:5000
4+
15
services:
26
opensentry-command:
3-
build:
4-
context: .
5-
dockerfile: Dockerfile
7+
build: .
68
container_name: opensentry-command-center
79
restart: unless-stopped
8-
9-
# Environment configuration
10-
environment:
11-
- OPENSENTRY_USERNAME=${OPENSENTRY_USERNAME:-admin}
12-
- OPENSENTRY_PASSWORD=${OPENSENTRY_PASSWORD:-opensentry}
13-
- SECRET_KEY=${SECRET_KEY:-}
14-
- SESSION_TIMEOUT=${SESSION_TIMEOUT:-30}
15-
- MQTT_BROKER=${MQTT_BROKER:-localhost}
16-
- MQTT_PORT=${MQTT_PORT:-1883}
17-
# Single secret for all credentials (recommended)
18-
- OPENSENTRY_SECRET=${OPENSENTRY_SECRET:-}
19-
# Legacy individual credentials (used if OPENSENTRY_SECRET not set)
20-
- MQTT_USERNAME=${MQTT_USERNAME:-opensentry}
21-
- MQTT_PASSWORD=${MQTT_PASSWORD:-opensentry}
22-
- RTSP_USERNAME=${RTSP_USERNAME:-opensentry}
23-
- RTSP_PASSWORD=${RTSP_PASSWORD:-opensentry}
24-
25-
# Port mapping
26-
ports:
27-
- "5000:5000"
28-
29-
# Host network mode required for mDNS discovery
30-
# This allows the container to discover camera nodes on the local network
3110
network_mode: host
32-
33-
# Volume for persistent data (optional)
11+
env_file:
12+
- .env
3413
volumes:
3514
- ./data:/app/data
15+
- ./logs:/app/logs

setup.sh

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
#!/bin/bash
2+
# OpenSentry Command Center - Quick Setup Script
3+
# Run: chmod +x setup.sh && ./setup.sh
4+
5+
set -e
6+
7+
echo "╔═══════════════════════════════════════════════════════════════╗"
8+
echo "║ OpenSentry Command Center - Quick Setup ║"
9+
echo "╚═══════════════════════════════════════════════════════════════╝"
10+
echo ""
11+
12+
# Check for Docker
13+
if ! command -v docker &> /dev/null; then
14+
echo "❌ Docker not found. Please install Docker first:"
15+
echo " curl -fsSL https://get.docker.com | sh"
16+
exit 1
17+
fi
18+
19+
echo "✅ Docker found"
20+
21+
# Check if .env exists
22+
if [ -f .env ]; then
23+
echo "✅ .env file already exists"
24+
read -p " Overwrite with new settings? (y/N): " overwrite
25+
if [ "$overwrite" != "y" ] && [ "$overwrite" != "Y" ]; then
26+
echo " Keeping existing .env"
27+
echo ""
28+
echo "🚀 Starting Command Center..."
29+
docker compose up --build -d
30+
echo ""
31+
echo "✅ Command Center is running!"
32+
echo " Dashboard: http://localhost:5000"
33+
echo " Logs: docker compose logs -f"
34+
exit 0
35+
fi
36+
fi
37+
38+
echo ""
39+
echo "📝 Let's configure your Command Center..."
40+
echo ""
41+
42+
# Get username
43+
read -p "Choose a username [admin]: " username
44+
username=${username:-admin}
45+
46+
# Get password
47+
while true; do
48+
read -s -p "Choose a password (min 8 chars): " password
49+
echo ""
50+
if [ ${#password} -lt 8 ]; then
51+
echo " ❌ Password too short, try again"
52+
else
53+
break
54+
fi
55+
done
56+
57+
# Generate secret
58+
echo ""
59+
echo "🔐 Generating security secret..."
60+
secret=$(python3 -c "import secrets; print(secrets.token_hex(32))" 2>/dev/null || openssl rand -hex 32)
61+
62+
# Create .env file
63+
cat > .env << EOF
64+
# OpenSentry Command Center Configuration
65+
# Generated by setup.sh on $(date)
66+
67+
# Login credentials
68+
OPENSENTRY_USERNAME=$username
69+
OPENSENTRY_PASSWORD=$password
70+
71+
# Security secret (share this with your Camera Nodes)
72+
OPENSENTRY_SECRET=$secret
73+
74+
# Session timeout in minutes
75+
SESSION_TIMEOUT=30
76+
EOF
77+
78+
echo "✅ Configuration saved to .env"
79+
echo ""
80+
echo "╔═══════════════════════════════════════════════════════════════╗"
81+
echo "║ IMPORTANT: Copy this secret to your Camera Nodes! ║"
82+
echo "╠═══════════════════════════════════════════════════════════════╣"
83+
echo "║ OPENSENTRY_SECRET=$secret"
84+
echo "╚═══════════════════════════════════════════════════════════════╝"
85+
echo ""
86+
87+
# Start the service
88+
echo "🚀 Starting Command Center..."
89+
docker compose up --build -d
90+
91+
echo ""
92+
echo "╔═══════════════════════════════════════════════════════════════╗"
93+
echo "║ Setup Complete! ║"
94+
echo "╠═══════════════════════════════════════════════════════════════╣"
95+
echo "║ Dashboard: http://localhost:5000 ║"
96+
echo "║ Username: $username"
97+
echo "║ Password: ******** ║"
98+
echo "╠═══════════════════════════════════════════════════════════════╣"
99+
echo "║ Commands: ║"
100+
echo "║ View logs: docker compose logs -f ║"
101+
echo "║ Stop: docker compose down ║"
102+
echo "║ Restart: docker compose restart ║"
103+
echo "╚═══════════════════════════════════════════════════════════════╝"

0 commit comments

Comments
 (0)