Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
87 lines (60 loc) 路 2.95 KB
/
Copy pathMakefile
File metadata and controls
87 lines (60 loc) 路 2.95 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
COMPOSE = docker compose
ENVFILE = .env
# Dynamically generate compose arguments based on enabled services and custom files
COMPOSE_ARGS := $(shell bash scripts/get_docker_compose_files.sh)
start: # Start all docker containers
@sudo $(COMPOSE) $(COMPOSE_ARGS) --env-file $(ENVFILE) up -d
restart: # Restart all docker containers
@sudo $(COMPOSE) $(COMPOSE_ARGS) --env-file $(ENVFILE) restart
logs: # View all docker containers logs
@sudo $(COMPOSE) $(COMPOSE_ARGS) --env-file $(ENVFILE) logs -f --tail=50
status: # View the status of the current ZeroTrust Your Home services
@sudo $(COMPOSE) $(COMPOSE_ARGS) --env-file $(ENVFILE) ps --format "table {{.Name}}\t{{.Status}}\t{{.Ports}}\t{{.Image}}"
stop: # Stop all docker containers
@sudo $(COMPOSE) $(COMPOSE_ARGS) --env-file $(ENVFILE) stop
view-backups: # View all backups
@bash scripts/backups/view-backups.sh
configure-backup: # Configure Rclone for Google Drive
@bash scripts/backups/configure-rclone.sh
backup: # Create a system backup
@bash scripts/backups/backup.sh
backup-export: # Export data only (Immich photos, DB dumps). Used by cronjob before restic's automatic run.
@bash scripts/backups/backup-export.sh
prune: # Prune old backups to free up space
@bash scripts/backups/prune.sh
check: # Verify backup integrity
@bash scripts/backups/check.sh
restore: # Restore from backup
@bash scripts/backups/restore.sh
backup-cron-enable: # Enable automatic daily backup export at 23:30
@bash scripts/backups/setup-backup-cron.sh enable
backup-cron-disable: # Disable automatic daily backup export
@bash scripts/backups/setup-backup-cron.sh disable
backup-cron-status: # Show backup cronjob status
@bash scripts/backups/setup-backup-cron.sh status
generate: # Regenerate configuration files for all services based on .env configuration
@sudo bash scripts/generate.sh --headless
update-security: # Update security posture (hardening + firewall) on existing instances
@sudo bash scripts/update-security.sh
update-security-headless: # Update security posture without prompts
@sudo bash scripts/update-security.sh -y
update-firewall: # Update only firewall rules
@sudo bash scripts/update-security.sh -y --firewall-only
update-hardening: # Update only system hardening settings
@sudo bash scripts/update-security.sh -y --hardening-only
# Specific commands to control each part of the system
start-%:
@echo "Starting $* service..."
@sudo $(COMPOSE) --file composes/$*.docker-compose.yaml --env-file $(ENVFILE) up -d
down-%:
@echo "Downing $* service..."
@sudo $(COMPOSE) --file composes/$*.docker-compose.yaml --env-file $(ENVFILE) down
stop-%:
@echo "Stopping $* service..."
@sudo $(COMPOSE) --file composes/$*.docker-compose.yaml --env-file $(ENVFILE) stop
logs-%:
@echo "Logs $* service..."
@sudo $(COMPOSE) --file composes/$*.docker-compose.yaml --env-file $(ENVFILE) logs
restart-%:
@echo "Restarting $* service..."
@sudo $(COMPOSE) --file composes/$*.docker-compose.yaml --env-file $(ENVFILE) restart