This repository was archived by the owner on Mar 27, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
121 lines (98 loc) · 3.73 KB
/
Copy pathjustfile
File metadata and controls
121 lines (98 loc) · 3.73 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
default:
@just --list
# XMPP Service (Prosody)
mod xmpp './apps/prosody'
# IRC Services (UnrealIRCd, Atheme, WebPanel)
mod irc './apps/unrealircd'
# Web Application (Next.js)
mod web './apps/web'
# Bridge (Discord↔IRC↔XMPP)
mod bridge './apps/bridge'
# The Lounge (web IRC client)
mod lounge './apps/thelounge'
# ObsidianIRC (web IRC client)
mod obsidianirc './apps/obsidianirc'
set export := true
# Same compose project + env as `just dev` — use for down/logs/status/build so the
# merged stack matches (compose.dev-override.yaml is not applied by default).
dev_compose := '-f compose.yaml -f compose.dev-override.yaml --env-file .env --env-file .env.dev'
# Initialize project: create data/ dirs, generate config, dev certs
# Run before first docker compose up. data/ is gitignored.
[group('Orchestration')]
init:
@echo "Initializing project (data dirs, config, dev certs)..."
./scripts/init.sh dev
# Spin up the local development stack
[group('Orchestration')]
dev:
@if docker compose {{dev_compose}} ps --services --status running | rg -q "."; then \
echo "Error: atl.chat containers are already running."; \
echo "Run 'just down' (and/or 'just down-prod') before running 'just dev' again."; \
echo "Running services:"; \
docker compose {{dev_compose}} ps --services --status running | sed 's/^/ - /'; \
exit 1; \
fi
@echo "Initializing Development Environment..."
./scripts/init.sh dev
docker compose {{dev_compose}} --profile dev up -d
# Spin up the production stack
[group('Orchestration')]
prod:
@echo "Initializing Production Environment..."
./scripts/init.sh prod
docker compose -f compose.yaml -f compose.prod-override.yaml --env-file .env --env-file .env.prod up -d
# Stop all services
[group('Orchestration')]
down:
docker compose {{dev_compose}} --profile dev down
# Stop production services
[group('Orchestration')]
down-prod:
docker compose -f compose.yaml -f compose.prod-override.yaml --env-file .env --env-file .env.prod down
# View logs (follow)
[group('Orchestration')]
logs service="":
docker compose {{dev_compose}} logs -f ${service:+"$service"}
# Show status of all services
[group('Orchestration')]
status:
docker compose {{dev_compose}} ps
# Run all linters via pre-commit
[group('Verification')]
lint:
pre-commit run --all-files
# Ruff + basedpyright (bridge and other in-repo Python; excludes tests — see pyproject.toml)
[group('Verification')]
py-check:
uv run ruff check .
uv run ruff format --check .
uv run basedpyright
# Run security scans (Gitleaks, Trivy)
[group('Verification')]
scan:
@echo "Running security scans..."
# Placeholder for actual scan commands
just --groups Verification
# Build all services (same compose + env as `just dev` so build-time args match dev)
[group('Build')]
build:
docker compose {{dev_compose}} build
# Run tests (atl.chat root tests)
[group('Build')]
test:
uv run pytest tests/
# Run all tests (root + bridge)
[group('Build')]
test-all:
uv run pytest tests/
just bridge test
# Generate a non-expiring Prosody admin API token (mod_http_admin_api Bearer auth)
# Prints the token to stdout. Pipe to your portal .env as PROSODY_REST_TOKEN=<token>
[group('Maintenance')]
prosody-token:
@docker exec -i atl-xmpp-server prosodyctl shell <<< '>local tk = prosody.hosts["xmpp.localhost"].modules.tokenauth; local grant = tk.create_grant("admin@xmpp.localhost", "admin@xmpp.localhost", nil, {}); local token = tk.create_token("admin@xmpp.localhost", grant, "prosody:operator", nil, "portal-api"); print(token)' 2>&1 | grep -oP 'secret-token:\S+'
# Clean up unused Docker resources
[group('Maintenance')]
docker-system-clean:
docker system prune -f
docker volume prune -f