loki-mode 5.20.3 → 5.20.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Dockerfile +86 -0
- package/Dockerfile.sandbox +253 -0
- package/SKILL.md +2 -2
- package/VERSION +1 -1
- package/autonomy/loki +1 -1
- package/dashboard/Dockerfile +79 -0
- package/dashboard/docker-compose.yml +47 -0
- package/docker-compose.yml +37 -0
- package/package.json +5 -2
package/Dockerfile
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# Loki Mode Docker Image
|
|
2
|
+
# Build: docker build -t loki-mode .
|
|
3
|
+
# Run: docker run -it -v $(pwd):/workspace loki-mode
|
|
4
|
+
|
|
5
|
+
FROM ubuntu:24.04
|
|
6
|
+
|
|
7
|
+
LABEL maintainer="Lokesh Mure"
|
|
8
|
+
LABEL version="5.8.9"
|
|
9
|
+
LABEL description="Multi-agent autonomous startup system for Claude Code, Codex CLI, and Gemini CLI"
|
|
10
|
+
|
|
11
|
+
# Prevent interactive prompts during install
|
|
12
|
+
ENV DEBIAN_FRONTEND=noninteractive
|
|
13
|
+
|
|
14
|
+
# Install base dependencies
|
|
15
|
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
16
|
+
bash \
|
|
17
|
+
ca-certificates \
|
|
18
|
+
curl \
|
|
19
|
+
git \
|
|
20
|
+
gnupg \
|
|
21
|
+
jq \
|
|
22
|
+
python3 \
|
|
23
|
+
python3-pip \
|
|
24
|
+
python3-venv \
|
|
25
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
26
|
+
|
|
27
|
+
# Install Node.js 20 LTS from NodeSource (fixes nodejs/npm CVEs)
|
|
28
|
+
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
|
|
29
|
+
&& apt-get install -y --no-install-recommends nodejs \
|
|
30
|
+
&& rm -rf /var/lib/apt/lists/* \
|
|
31
|
+
&& npm cache clean --force
|
|
32
|
+
|
|
33
|
+
# Install GitHub CLI directly from releases (latest version, not from apt)
|
|
34
|
+
# This avoids CVE-2024-52308 in older Ubuntu-packaged versions
|
|
35
|
+
RUN ARCH=$(dpkg --print-architecture) && \
|
|
36
|
+
GH_VERSION=$(curl -s https://api.github.com/repos/cli/cli/releases/latest | jq -r .tag_name | sed 's/v//') && \
|
|
37
|
+
curl -fsSL "https://github.com/cli/cli/releases/download/v${GH_VERSION}/gh_${GH_VERSION}_linux_${ARCH}.tar.gz" -o /tmp/gh.tar.gz && \
|
|
38
|
+
tar -xzf /tmp/gh.tar.gz -C /tmp && \
|
|
39
|
+
mv /tmp/gh_${GH_VERSION}_linux_${ARCH}/bin/gh /usr/local/bin/gh && \
|
|
40
|
+
rm -rf /tmp/gh* && \
|
|
41
|
+
gh --version
|
|
42
|
+
|
|
43
|
+
# Upgrade Python packages to fix setuptools/wheel CVEs
|
|
44
|
+
# Remove old debian-managed packages first, then install fixed versions
|
|
45
|
+
RUN rm -rf /usr/lib/python3/dist-packages/setuptools* \
|
|
46
|
+
/usr/lib/python3/dist-packages/wheel* \
|
|
47
|
+
/usr/lib/python3/dist-packages/pkg_resources* \
|
|
48
|
+
&& pip3 install --no-cache-dir --break-system-packages \
|
|
49
|
+
"setuptools>=78.1.1" \
|
|
50
|
+
"wheel>=0.46.2"
|
|
51
|
+
|
|
52
|
+
# Update npm to get latest dependency fixes (tar, glob, cross-spawn)
|
|
53
|
+
RUN npm install -g npm@latest \
|
|
54
|
+
&& npm cache clean --force
|
|
55
|
+
|
|
56
|
+
# Create app directory
|
|
57
|
+
WORKDIR /opt/loki-mode
|
|
58
|
+
|
|
59
|
+
# Copy Loki Mode files
|
|
60
|
+
COPY SKILL.md VERSION ./
|
|
61
|
+
COPY autonomy/ ./autonomy/
|
|
62
|
+
COPY skills/ ./skills/
|
|
63
|
+
COPY references/ ./references/
|
|
64
|
+
COPY docs/ ./docs/
|
|
65
|
+
|
|
66
|
+
# Make scripts executable
|
|
67
|
+
RUN chmod +x autonomy/run.sh autonomy/loki
|
|
68
|
+
|
|
69
|
+
# Set up symlinks
|
|
70
|
+
RUN mkdir -p /root/.claude/skills && \
|
|
71
|
+
ln -sf /opt/loki-mode /root/.claude/skills/loki-mode && \
|
|
72
|
+
ln -sf /opt/loki-mode/autonomy/loki /usr/local/bin/loki
|
|
73
|
+
|
|
74
|
+
# Set workspace as working directory
|
|
75
|
+
WORKDIR /workspace
|
|
76
|
+
|
|
77
|
+
# Run as non-root user for security (optional, uncomment if needed)
|
|
78
|
+
# RUN useradd -m -s /bin/bash loki && chown -R loki:loki /opt/loki-mode
|
|
79
|
+
# USER loki
|
|
80
|
+
|
|
81
|
+
# Default command shows help
|
|
82
|
+
CMD ["loki", "help"]
|
|
83
|
+
|
|
84
|
+
# Health check
|
|
85
|
+
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
|
86
|
+
CMD loki version || exit 1
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
#===============================================================================
|
|
2
|
+
# Loki Mode Security-Hardened Sandbox Dockerfile
|
|
3
|
+
# Multi-stage build for minimal attack surface
|
|
4
|
+
#
|
|
5
|
+
# Build: docker build -t loki-mode:sandbox -f Dockerfile.sandbox .
|
|
6
|
+
# Run: ./autonomy/sandbox.sh start
|
|
7
|
+
#
|
|
8
|
+
# Security Features:
|
|
9
|
+
# - Multi-stage build (smaller final image, no build tools)
|
|
10
|
+
# - Non-root user execution (UID 1000)
|
|
11
|
+
# - Minimal base image (Debian slim)
|
|
12
|
+
# - No shell history persistence
|
|
13
|
+
# - Read-only root filesystem compatible
|
|
14
|
+
# - Health checks for container orchestration
|
|
15
|
+
# - Explicit capability requirements documented
|
|
16
|
+
#
|
|
17
|
+
# Note: Alpine was considered but rejected due to:
|
|
18
|
+
# - musl libc compatibility issues with Node.js native modules
|
|
19
|
+
# - Claude/Codex/Gemini CLI npm packages may have glibc dependencies
|
|
20
|
+
# - Debian slim provides good balance of size and compatibility
|
|
21
|
+
#===============================================================================
|
|
22
|
+
|
|
23
|
+
#-------------------------------------------------------------------------------
|
|
24
|
+
# Stage 1: Builder - Install CLIs and dependencies
|
|
25
|
+
#-------------------------------------------------------------------------------
|
|
26
|
+
FROM debian:bookworm-slim AS builder
|
|
27
|
+
|
|
28
|
+
# Security: Avoid caching sensitive data in apt lists
|
|
29
|
+
ENV DEBIAN_FRONTEND=noninteractive
|
|
30
|
+
|
|
31
|
+
# Install build dependencies
|
|
32
|
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
33
|
+
ca-certificates \
|
|
34
|
+
curl \
|
|
35
|
+
gnupg \
|
|
36
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
37
|
+
|
|
38
|
+
# Install Node.js 20 LTS (required for Claude CLI and npm packages)
|
|
39
|
+
# Security: Use official NodeSource repository with GPG verification
|
|
40
|
+
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /usr/share/keyrings/nodesource.gpg \
|
|
41
|
+
&& echo "deb [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" > /etc/apt/sources.list.d/nodesource.list \
|
|
42
|
+
&& apt-get update \
|
|
43
|
+
&& apt-get install -y --no-install-recommends nodejs \
|
|
44
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
45
|
+
|
|
46
|
+
# Install GitHub CLI
|
|
47
|
+
# Security: Use official GitHub repository with GPG verification
|
|
48
|
+
RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | gpg --dearmor -o /usr/share/keyrings/githubcli.gpg \
|
|
49
|
+
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli.gpg] https://cli.github.com/packages stable main" > /etc/apt/sources.list.d/github-cli.list \
|
|
50
|
+
&& apt-get update \
|
|
51
|
+
&& apt-get install -y --no-install-recommends gh \
|
|
52
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
53
|
+
|
|
54
|
+
# Install AI CLIs globally
|
|
55
|
+
# Security: npm install with --ignore-scripts prevents arbitrary code execution during install
|
|
56
|
+
# Note: These are placeholder package names - update when official packages are available
|
|
57
|
+
WORKDIR /opt/cli-install
|
|
58
|
+
|
|
59
|
+
# Claude CLI (Anthropic official)
|
|
60
|
+
RUN npm install -g @anthropic-ai/claude-code --ignore-scripts 2>/dev/null || \
|
|
61
|
+
echo "Claude CLI not available on npm, will need manual install"
|
|
62
|
+
|
|
63
|
+
# Codex CLI (OpenAI) - install if available
|
|
64
|
+
RUN npm install -g @openai/codex --ignore-scripts 2>/dev/null || \
|
|
65
|
+
echo "Codex CLI not available on npm, will need manual install"
|
|
66
|
+
|
|
67
|
+
# Gemini CLI (Google) - install if available
|
|
68
|
+
RUN npm install -g @google/gemini-cli --ignore-scripts 2>/dev/null || \
|
|
69
|
+
echo "Gemini CLI not available on npm, will need manual install"
|
|
70
|
+
|
|
71
|
+
#-------------------------------------------------------------------------------
|
|
72
|
+
# Stage 2: Runtime - Minimal production image
|
|
73
|
+
#-------------------------------------------------------------------------------
|
|
74
|
+
FROM debian:bookworm-slim AS runtime
|
|
75
|
+
|
|
76
|
+
LABEL maintainer="Lokesh Mure"
|
|
77
|
+
LABEL version="5.5.1"
|
|
78
|
+
LABEL description="Security-hardened sandbox for Loki Mode multi-agent system"
|
|
79
|
+
LABEL org.opencontainers.image.source="https://github.com/asklokesh/claudeskill-loki-mode"
|
|
80
|
+
|
|
81
|
+
# Security: Prevent interactive prompts and reduce image size
|
|
82
|
+
ENV DEBIAN_FRONTEND=noninteractive \
|
|
83
|
+
# Security: Disable npm update checks (reduces network exposure)
|
|
84
|
+
NPM_CONFIG_UPDATE_NOTIFIER=false \
|
|
85
|
+
# Security: Prevent shell history from persisting
|
|
86
|
+
HISTFILE=/dev/null \
|
|
87
|
+
# Runtime: Set proper locale
|
|
88
|
+
LANG=C.UTF-8 \
|
|
89
|
+
LC_ALL=C.UTF-8 \
|
|
90
|
+
# Loki: Default configuration
|
|
91
|
+
LOKI_SANDBOX_MODE=true
|
|
92
|
+
|
|
93
|
+
# Install minimal runtime dependencies
|
|
94
|
+
# Security: --no-install-recommends reduces attack surface
|
|
95
|
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
96
|
+
# Core utilities
|
|
97
|
+
bash \
|
|
98
|
+
ca-certificates \
|
|
99
|
+
curl \
|
|
100
|
+
# Version control
|
|
101
|
+
git \
|
|
102
|
+
# JSON processing (required by loki scripts)
|
|
103
|
+
jq \
|
|
104
|
+
# Python runtime (for some AI CLI dependencies)
|
|
105
|
+
python3-minimal \
|
|
106
|
+
# Process management
|
|
107
|
+
procps \
|
|
108
|
+
# Network utilities for health checks
|
|
109
|
+
netcat-openbsd \
|
|
110
|
+
# Timezone data (for log timestamps)
|
|
111
|
+
tzdata \
|
|
112
|
+
# Security: Clean up apt cache
|
|
113
|
+
&& rm -rf /var/lib/apt/lists/* \
|
|
114
|
+
&& apt-get clean \
|
|
115
|
+
&& rm -rf /var/cache/apt/archives/*
|
|
116
|
+
|
|
117
|
+
# Copy Node.js and npm from builder
|
|
118
|
+
# Security: Only copy runtime, not build tools
|
|
119
|
+
COPY --from=builder /usr/bin/node /usr/bin/node
|
|
120
|
+
COPY --from=builder /usr/lib/node_modules /usr/lib/node_modules
|
|
121
|
+
COPY --from=builder /usr/bin/npm /usr/bin/npm
|
|
122
|
+
COPY --from=builder /usr/bin/npx /usr/bin/npx
|
|
123
|
+
|
|
124
|
+
# Copy GitHub CLI from builder
|
|
125
|
+
COPY --from=builder /usr/bin/gh /usr/bin/gh
|
|
126
|
+
|
|
127
|
+
# Copy installed CLI tools from builder (global node_modules)
|
|
128
|
+
COPY --from=builder /usr/local/lib/node_modules /usr/local/lib/node_modules
|
|
129
|
+
COPY --from=builder /usr/local/bin /usr/local/bin
|
|
130
|
+
|
|
131
|
+
# Create symlinks for node binaries
|
|
132
|
+
RUN ln -sf /usr/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm 2>/dev/null || true \
|
|
133
|
+
&& ln -sf /usr/lib/node_modules/npm/bin/npx-cli.js /usr/local/bin/npx 2>/dev/null || true
|
|
134
|
+
|
|
135
|
+
#-------------------------------------------------------------------------------
|
|
136
|
+
# Security: Create non-root user
|
|
137
|
+
#-------------------------------------------------------------------------------
|
|
138
|
+
# Security: Use specific UID/GID for predictable permissions
|
|
139
|
+
# UID 1000 is commonly mapped to host user for volume mounts
|
|
140
|
+
ARG USER_UID=1000
|
|
141
|
+
ARG USER_GID=1000
|
|
142
|
+
|
|
143
|
+
RUN groupadd --gid ${USER_GID} loki \
|
|
144
|
+
&& useradd --uid ${USER_UID} --gid ${USER_GID} --shell /bin/bash --create-home loki \
|
|
145
|
+
# Security: Remove unnecessary SUID binaries
|
|
146
|
+
&& find / -perm /4000 -type f -exec chmod u-s {} \; 2>/dev/null || true \
|
|
147
|
+
&& find / -perm /2000 -type f -exec chmod g-s {} \; 2>/dev/null || true
|
|
148
|
+
|
|
149
|
+
#-------------------------------------------------------------------------------
|
|
150
|
+
# Install Loki Mode
|
|
151
|
+
#-------------------------------------------------------------------------------
|
|
152
|
+
# Create app directory with proper ownership
|
|
153
|
+
RUN mkdir -p /opt/loki-mode && chown loki:loki /opt/loki-mode
|
|
154
|
+
|
|
155
|
+
WORKDIR /opt/loki-mode
|
|
156
|
+
|
|
157
|
+
# Copy Loki Mode files with explicit ownership
|
|
158
|
+
# Security: Copy only necessary files, not entire repo
|
|
159
|
+
COPY --chown=loki:loki SKILL.md VERSION ./
|
|
160
|
+
COPY --chown=loki:loki autonomy/ ./autonomy/
|
|
161
|
+
COPY --chown=loki:loki providers/ ./providers/
|
|
162
|
+
COPY --chown=loki:loki skills/ ./skills/
|
|
163
|
+
COPY --chown=loki:loki references/ ./references/
|
|
164
|
+
|
|
165
|
+
# Copy docs if they exist (optional)
|
|
166
|
+
COPY --chown=loki:loki docs/ ./docs/ 2>/dev/null || true
|
|
167
|
+
|
|
168
|
+
# Make scripts executable
|
|
169
|
+
RUN chmod +x autonomy/run.sh autonomy/loki autonomy/sandbox.sh autonomy/serve.sh 2>/dev/null || true \
|
|
170
|
+
&& chmod +x providers/*.sh 2>/dev/null || true
|
|
171
|
+
|
|
172
|
+
# Create necessary directories with proper permissions
|
|
173
|
+
RUN mkdir -p /home/loki/.claude/skills \
|
|
174
|
+
&& mkdir -p /home/loki/.config/gh \
|
|
175
|
+
&& mkdir -p /home/loki/.ssh \
|
|
176
|
+
&& chown -R loki:loki /home/loki
|
|
177
|
+
|
|
178
|
+
# Set up symlinks for loki user
|
|
179
|
+
RUN ln -sf /opt/loki-mode /home/loki/.claude/skills/loki-mode \
|
|
180
|
+
&& ln -sf /opt/loki-mode/autonomy/loki /usr/local/bin/loki
|
|
181
|
+
|
|
182
|
+
#-------------------------------------------------------------------------------
|
|
183
|
+
# Configure workspace
|
|
184
|
+
#-------------------------------------------------------------------------------
|
|
185
|
+
# Create workspace directory
|
|
186
|
+
RUN mkdir -p /workspace && chown loki:loki /workspace
|
|
187
|
+
|
|
188
|
+
# Security: Create .loki directory for state (can be mounted as volume)
|
|
189
|
+
RUN mkdir -p /workspace/.loki && chown loki:loki /workspace/.loki
|
|
190
|
+
|
|
191
|
+
WORKDIR /workspace
|
|
192
|
+
|
|
193
|
+
#-------------------------------------------------------------------------------
|
|
194
|
+
# Health check
|
|
195
|
+
#-------------------------------------------------------------------------------
|
|
196
|
+
# Security: Health check runs as container user
|
|
197
|
+
# Checks: loki CLI accessible, workspace writable, node available
|
|
198
|
+
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
|
199
|
+
CMD loki version > /dev/null 2>&1 && \
|
|
200
|
+
test -w /workspace && \
|
|
201
|
+
node --version > /dev/null 2>&1 || exit 1
|
|
202
|
+
|
|
203
|
+
#-------------------------------------------------------------------------------
|
|
204
|
+
# Runtime configuration
|
|
205
|
+
#-------------------------------------------------------------------------------
|
|
206
|
+
# Security: Switch to non-root user
|
|
207
|
+
USER loki
|
|
208
|
+
|
|
209
|
+
# Expose ports for dashboard and API
|
|
210
|
+
# Security: Ports > 1024 don't require root
|
|
211
|
+
EXPOSE 9898 57374
|
|
212
|
+
|
|
213
|
+
# Security: Set restrictive umask
|
|
214
|
+
# New files will be created with 644 (files) and 755 (directories)
|
|
215
|
+
RUN echo "umask 022" >> /home/loki/.bashrc
|
|
216
|
+
|
|
217
|
+
#-------------------------------------------------------------------------------
|
|
218
|
+
# Entrypoint
|
|
219
|
+
#-------------------------------------------------------------------------------
|
|
220
|
+
# Security: Use exec form to avoid shell injection
|
|
221
|
+
# Default command shows help; sandbox.sh overrides with actual command
|
|
222
|
+
ENTRYPOINT ["/opt/loki-mode/autonomy/loki"]
|
|
223
|
+
CMD ["help"]
|
|
224
|
+
|
|
225
|
+
#===============================================================================
|
|
226
|
+
# Security Notes for Operators:
|
|
227
|
+
#
|
|
228
|
+
# 1. Run with --security-opt=no-new-privileges:true
|
|
229
|
+
# Prevents privilege escalation via setuid binaries
|
|
230
|
+
#
|
|
231
|
+
# 2. Run with --cap-drop=ALL --cap-add=<needed>
|
|
232
|
+
# Minimal capabilities: CHOWN, SETUID, SETGID, DAC_OVERRIDE
|
|
233
|
+
#
|
|
234
|
+
# 3. Resource limits (enforced by sandbox.sh):
|
|
235
|
+
# --cpus=2 --memory=4g --pids-limit=256
|
|
236
|
+
#
|
|
237
|
+
# 4. Network isolation options:
|
|
238
|
+
# --network=none (most secure, no network)
|
|
239
|
+
# --network=bridge (default, isolated network)
|
|
240
|
+
# --network=host (least secure, avoid)
|
|
241
|
+
#
|
|
242
|
+
# 5. Filesystem security:
|
|
243
|
+
# Mount project as read-only when possible: -v ./project:/workspace:ro
|
|
244
|
+
# Use named volume for .loki state: -v loki-state:/workspace/.loki:rw
|
|
245
|
+
#
|
|
246
|
+
# 6. API keys should be passed as environment variables, not mounted files:
|
|
247
|
+
# -e ANTHROPIC_API_KEY -e OPENAI_API_KEY -e GOOGLE_API_KEY
|
|
248
|
+
#
|
|
249
|
+
# 7. For production, consider:
|
|
250
|
+
# - Using seccomp profiles to restrict syscalls
|
|
251
|
+
# - AppArmor/SELinux profiles for additional isolation
|
|
252
|
+
# - Running in a VM or dedicated sandbox environment
|
|
253
|
+
#===============================================================================
|
package/SKILL.md
CHANGED
|
@@ -3,7 +3,7 @@ name: loki-mode
|
|
|
3
3
|
description: Multi-agent autonomous startup system. Triggers on "Loki Mode". Takes PRD to deployed product with zero human intervention. Requires --dangerously-skip-permissions flag.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Loki Mode v5.20.
|
|
6
|
+
# Loki Mode v5.20.5
|
|
7
7
|
|
|
8
8
|
**You are an autonomous agent. You make decisions. You do not ask questions. You do not stop.**
|
|
9
9
|
|
|
@@ -253,4 +253,4 @@ Auto-detected or force with `LOKI_COMPLEXITY`:
|
|
|
253
253
|
|
|
254
254
|
---
|
|
255
255
|
|
|
256
|
-
**v5.20.
|
|
256
|
+
**v5.20.5 | Dashboard Consolidation, Unified Web Components | ~250 lines core**
|
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
5.20.
|
|
1
|
+
5.20.5
|
package/autonomy/loki
CHANGED
|
@@ -1915,7 +1915,7 @@ EOF
|
|
|
1915
1915
|
if [[ "$start_loki" == "true" ]]; then
|
|
1916
1916
|
echo ""
|
|
1917
1917
|
echo -e "${GREEN}Starting Loki Mode with generated PRD...${NC}"
|
|
1918
|
-
cmd_start "$output_file" "${start_args[@]}"
|
|
1918
|
+
cmd_start "$output_file" ${start_args[@]+"${start_args[@]}"}
|
|
1919
1919
|
else
|
|
1920
1920
|
echo ""
|
|
1921
1921
|
echo "Next steps:"
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Loki Mode Dashboard - Docker Image
|
|
2
|
+
# Multi-stage build: frontend build + Python backend
|
|
3
|
+
#
|
|
4
|
+
# Build:
|
|
5
|
+
# docker build -t loki-dashboard ./dashboard
|
|
6
|
+
#
|
|
7
|
+
# Run:
|
|
8
|
+
# docker run -p 8420:8420 -v ~/.loki:/home/appuser/.loki loki-dashboard
|
|
9
|
+
#
|
|
10
|
+
# Enterprise mode:
|
|
11
|
+
# docker run -p 8420:8420 \
|
|
12
|
+
# -e LOKI_ENTERPRISE_AUTH=true \
|
|
13
|
+
# -e LOKI_ENTERPRISE_AUDIT=true \
|
|
14
|
+
# -v ~/.loki:/home/appuser/.loki \
|
|
15
|
+
# loki-dashboard
|
|
16
|
+
|
|
17
|
+
# Stage 1: Build frontend
|
|
18
|
+
FROM node:20-alpine AS frontend-builder
|
|
19
|
+
|
|
20
|
+
WORKDIR /app/frontend
|
|
21
|
+
|
|
22
|
+
# Install dependencies
|
|
23
|
+
COPY frontend/package*.json ./
|
|
24
|
+
RUN npm ci --ignore-scripts
|
|
25
|
+
|
|
26
|
+
# Build frontend
|
|
27
|
+
COPY frontend/ ./
|
|
28
|
+
RUN npm run build
|
|
29
|
+
|
|
30
|
+
# Stage 2: Python backend with built frontend
|
|
31
|
+
FROM python:3.11-slim-bookworm
|
|
32
|
+
|
|
33
|
+
# Set labels
|
|
34
|
+
LABEL org.opencontainers.image.title="Loki Mode Dashboard"
|
|
35
|
+
LABEL org.opencontainers.image.description="Multi-project task management dashboard for Loki Mode"
|
|
36
|
+
LABEL org.opencontainers.image.source="https://github.com/asklokesh/loki-mode"
|
|
37
|
+
|
|
38
|
+
# Environment
|
|
39
|
+
ENV PYTHONUNBUFFERED=1
|
|
40
|
+
ENV PYTHONDONTWRITEBYTECODE=1
|
|
41
|
+
ENV LOKI_DASHBOARD_HOST=0.0.0.0
|
|
42
|
+
ENV LOKI_DASHBOARD_PORT=8420
|
|
43
|
+
|
|
44
|
+
# Create non-root user for security
|
|
45
|
+
RUN useradd --create-home --shell /bin/bash appuser
|
|
46
|
+
|
|
47
|
+
WORKDIR /app
|
|
48
|
+
|
|
49
|
+
# Install Python dependencies
|
|
50
|
+
COPY requirements.txt ./
|
|
51
|
+
RUN pip install --no-cache-dir -r requirements.txt
|
|
52
|
+
|
|
53
|
+
# Copy backend code as a package (dashboard/)
|
|
54
|
+
# This preserves the package structure for relative imports
|
|
55
|
+
COPY __init__.py database.py models.py server.py registry.py auth.py audit.py ./dashboard/
|
|
56
|
+
|
|
57
|
+
# Copy built frontend to static directory inside package
|
|
58
|
+
COPY --from=frontend-builder /app/frontend/dist ./dashboard/static
|
|
59
|
+
|
|
60
|
+
# Create data directories with correct ownership
|
|
61
|
+
RUN mkdir -p /home/appuser/.loki/dashboard/audit && \
|
|
62
|
+
chown -R appuser:appuser /home/appuser/.loki && \
|
|
63
|
+
chown -R appuser:appuser /app
|
|
64
|
+
|
|
65
|
+
# Switch to non-root user
|
|
66
|
+
USER appuser
|
|
67
|
+
|
|
68
|
+
# Set HOME for the app user
|
|
69
|
+
ENV HOME=/home/appuser
|
|
70
|
+
|
|
71
|
+
# Health check using Python (curl not available in slim image)
|
|
72
|
+
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
|
73
|
+
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8420/health')" || exit 1
|
|
74
|
+
|
|
75
|
+
# Expose port
|
|
76
|
+
EXPOSE 8420
|
|
77
|
+
|
|
78
|
+
# Run server with correct module path
|
|
79
|
+
CMD ["python", "-m", "uvicorn", "dashboard.server:app", "--host", "0.0.0.0", "--port", "8420"]
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Loki Mode Dashboard - Docker Compose
|
|
2
|
+
#
|
|
3
|
+
# Usage:
|
|
4
|
+
# cd dashboard
|
|
5
|
+
# docker compose up -d
|
|
6
|
+
#
|
|
7
|
+
# Enterprise mode:
|
|
8
|
+
# LOKI_ENTERPRISE_AUTH=true LOKI_ENTERPRISE_AUDIT=true docker compose up -d
|
|
9
|
+
#
|
|
10
|
+
# View logs:
|
|
11
|
+
# docker compose logs -f
|
|
12
|
+
#
|
|
13
|
+
# Stop:
|
|
14
|
+
# docker compose down
|
|
15
|
+
|
|
16
|
+
services:
|
|
17
|
+
dashboard:
|
|
18
|
+
build:
|
|
19
|
+
context: .
|
|
20
|
+
dockerfile: Dockerfile
|
|
21
|
+
image: loki-dashboard:latest
|
|
22
|
+
container_name: loki-dashboard
|
|
23
|
+
ports:
|
|
24
|
+
- "${LOKI_DASHBOARD_PORT:-8420}:8420"
|
|
25
|
+
environment:
|
|
26
|
+
- LOKI_DASHBOARD_HOST=0.0.0.0
|
|
27
|
+
- LOKI_DASHBOARD_PORT=8420
|
|
28
|
+
- LOKI_ENTERPRISE_AUTH=${LOKI_ENTERPRISE_AUTH:-false}
|
|
29
|
+
- LOKI_ENTERPRISE_AUDIT=${LOKI_ENTERPRISE_AUDIT:-false}
|
|
30
|
+
- LOKI_AUDIT_MAX_SIZE_MB=${LOKI_AUDIT_MAX_SIZE_MB:-10}
|
|
31
|
+
- LOKI_AUDIT_MAX_FILES=${LOKI_AUDIT_MAX_FILES:-10}
|
|
32
|
+
volumes:
|
|
33
|
+
# Persist data directory
|
|
34
|
+
- loki-data:/home/appuser/.loki
|
|
35
|
+
# Optional: Mount host .loki directory for shared access
|
|
36
|
+
# - ~/.loki:/home/appuser/.loki
|
|
37
|
+
healthcheck:
|
|
38
|
+
test: ["CMD", "curl", "-f", "http://localhost:8420/health"]
|
|
39
|
+
interval: 30s
|
|
40
|
+
timeout: 10s
|
|
41
|
+
retries: 3
|
|
42
|
+
start_period: 10s
|
|
43
|
+
restart: unless-stopped
|
|
44
|
+
|
|
45
|
+
volumes:
|
|
46
|
+
loki-data:
|
|
47
|
+
driver: local
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Loki Mode Docker Compose (v5.0.0)
|
|
2
|
+
# Usage: docker-compose run loki start
|
|
3
|
+
# Note: version key removed - deprecated in Docker Compose v2+
|
|
4
|
+
|
|
5
|
+
services:
|
|
6
|
+
loki:
|
|
7
|
+
build: .
|
|
8
|
+
image: loki-mode:latest
|
|
9
|
+
volumes:
|
|
10
|
+
# Mount current directory as workspace
|
|
11
|
+
- .:/workspace:rw
|
|
12
|
+
# Persist .loki state between runs
|
|
13
|
+
- loki-state:/workspace/.loki
|
|
14
|
+
# Share git config for commits
|
|
15
|
+
- ~/.gitconfig:/root/.gitconfig:ro
|
|
16
|
+
# Share SSH keys for git operations
|
|
17
|
+
- ~/.ssh:/root/.ssh:ro
|
|
18
|
+
# Share GitHub CLI auth
|
|
19
|
+
- ~/.config/gh:/root/.config/gh:ro
|
|
20
|
+
environment:
|
|
21
|
+
# Loki Mode configuration
|
|
22
|
+
- LOKI_NOTIFICATIONS=false # No desktop notifications in container
|
|
23
|
+
- LOKI_DASHBOARD=true
|
|
24
|
+
- LOKI_DASHBOARD_PORT=57374
|
|
25
|
+
# Pass through GitHub token if set
|
|
26
|
+
- GITHUB_TOKEN
|
|
27
|
+
- GH_TOKEN
|
|
28
|
+
ports:
|
|
29
|
+
# Expose dashboard
|
|
30
|
+
- "57374:57374"
|
|
31
|
+
working_dir: /workspace
|
|
32
|
+
stdin_open: true
|
|
33
|
+
tty: true
|
|
34
|
+
|
|
35
|
+
volumes:
|
|
36
|
+
loki-state:
|
|
37
|
+
driver: local
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "loki-mode",
|
|
3
|
-
"version": "5.20.
|
|
3
|
+
"version": "5.20.5",
|
|
4
4
|
"description": "Multi-agent autonomous startup system for Claude Code, Codex CLI, and Gemini CLI",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"claude",
|
|
@@ -46,7 +46,10 @@
|
|
|
46
46
|
"dashboard/models.py",
|
|
47
47
|
"dashboard/registry.py",
|
|
48
48
|
"dashboard/run.py",
|
|
49
|
-
"dashboard/requirements.txt"
|
|
49
|
+
"dashboard/requirements.txt",
|
|
50
|
+
"Dockerfile",
|
|
51
|
+
"Dockerfile.sandbox",
|
|
52
|
+
"docker-compose.yml"
|
|
50
53
|
],
|
|
51
54
|
"scripts": {
|
|
52
55
|
"postinstall": "node bin/postinstall.js",
|