-
-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·61 lines (52 loc) · 1.92 KB
/
Copy pathsetup.sh
File metadata and controls
executable file
·61 lines (52 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
set -e
RED='\033[0;31m'
GREEN='\033[0;32m'
NC='\033[0m'
echo "--- BookLogr Setup ---"
echo "Checking prerequisites..."
if ! command -v docker &> /dev/null; then
echo -e "${RED}Error: Docker is not installed.${NC}"
echo "Please install Docker first: https://docs.docker.com/get-docker/"
exit 1
fi
echo -e "${GREEN}✅ Prerequisites met.${NC}"
echo "Downloading configuration..."
curl -sL -o docker-compose.yml "https://raw.githubusercontent.com/Mozzo1000/booklogr/main/docker-compose.yml"
if [ ! -f .env ]; then
echo -e "\n${BLUE}How would you like to run Booklogr?${NC}"
echo "1) Single User Mode (No login required - best for local usage)"
echo "2) Multi-User Mode (Standard login with email/password - best for shared servers)"
while true; do
read -p "Select an option [1 or 2]: " mode_choice </dev/tty
case $mode_choice in
1)
{
echo "SINGLE_USER_MODE=true"
echo "BL_SINGLE_USER_MODE=true"
} > .env
echo -e "${GREEN}✅ Configured for Single User Mode.${NC}"
break
;;
2)
SEC_KEY=$(openssl rand -hex 32)
echo "SINGLE_USER_MODE=false" > .env
echo "AUTH_SECRET_KEY=$SEC_KEY" >> .env
echo -e "${GREEN}✅ Configured for Multi-User Mode (Secret Key generated).${NC}"
break
;;
*)
echo -e "${RED}Invalid selection. Please enter 1 or 2.${NC}"
;;
esac
done
else
echo -e "\n${BLUE}ℹ .env already exists. Skipping configuration.${NC}"
fi
echo "Starting Booklogr containers..."
if docker compose up -d; then
echo -e "\n${GREEN}Success! Booklogr is running at http://localhost:5150${NC}"
else
echo -e "\n${RED}Failed to start containers. Check 'docker compose logs' for details.${NC}"
exit 1
fi