Skip to content

Commit 4d42026

Browse files
CopilotPol-Lanski
andcommitted
feat: add gohttpserver web-based file manager on port 8888
Co-authored-by: Pol-Lanski <19168735+Pol-Lanski@users.noreply.github.com>
1 parent 6ccf92e commit 4d42026

3 files changed

Lines changed: 37 additions & 2 deletions

File tree

Dockerfile

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,22 @@ COPY setup-wizard/ /app/setup-wizard/
4545
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
4646
RUN chmod +x /usr/local/bin/entrypoint.sh
4747

48-
# Expose gateway, bridge, terminal, and setup wizard ports
49-
EXPOSE 18789 18790 7681 8080
48+
# Install gohttpserver (web-based file manager) - static binary from GitHub releases
49+
RUN ARCH=$(dpkg --print-architecture) && \
50+
if [ "$ARCH" = "amd64" ]; then GHS_ARCH="amd64"; \
51+
elif [ "$ARCH" = "arm64" ]; then GHS_ARCH="arm64"; \
52+
else echo "Unsupported architecture: $ARCH" && exit 1; fi && \
53+
TARBALL="gohttpserver_1.3.0_linux_${GHS_ARCH}.tar.gz" && \
54+
curl -fsSL "https://github.com/codeskyblue/gohttpserver/releases/download/1.3.0/${TARBALL}" \
55+
-o "/tmp/${TARBALL}" && \
56+
curl -fsSL "https://github.com/codeskyblue/gohttpserver/releases/download/1.3.0/gohttpserver_1.3.0_checksums.txt" \
57+
| grep "${TARBALL}" | sha256sum --check --status && \
58+
tar -xz -C /usr/local/bin --strip-components=0 -f "/tmp/${TARBALL}" gohttpserver && \
59+
chmod +x /usr/local/bin/gohttpserver && \
60+
rm "/tmp/${TARBALL}"
61+
62+
# Expose gateway, bridge, terminal, setup wizard, and file manager ports
63+
EXPOSE 18789 18790 7681 8080 8888
5064

5165
# Health check for DappNode monitoring
5266
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \

dappnode_package.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"homepage": "https://openclaw.ai",
3737
"ui": "http://openclaw.dappnode:18789#token=openclaw",
3838
"terminal": "http://openclaw.dappnode:7681",
39+
"files": "http://openclaw.dappnode:8888",
3940
"setup-wizard": "http://openclaw.dappnode:8080",
4041
"docs": "https://docs.openclaw.ai"
4142
},
@@ -80,6 +81,12 @@
8081
"description": "Web-based setup wizard for easy configuration",
8182
"serviceName": "gateway",
8283
"port": 8080
84+
},
85+
{
86+
"name": "OpenClaw File Manager",
87+
"description": "Web-based file manager for browsing and managing OpenClaw data files",
88+
"serviceName": "gateway",
89+
"port": 8888
8390
}
8491
],
8592
"warnings": {

entrypoint.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,20 @@ ttyd \
7878
TTYD_PID=$!
7979
echo "ttyd started (PID: ${TTYD_PID})"
8080

81+
# ---------------------------------------------------------------------------
82+
# Start gohttpserver (web-based file manager) in the background on port 8888
83+
# No application-level auth: access is controlled at the DAppNode network level,
84+
# consistent with the ttyd terminal which also relies on DAppNode access control.
85+
# ---------------------------------------------------------------------------
86+
echo "Starting gohttpserver file manager on port 8888..."
87+
gohttpserver \
88+
--port 8888 \
89+
--root "$OPENCLAW_DIR" \
90+
--upload \
91+
--delete &
92+
GOHTTPSERVER_PID=$!
93+
echo "gohttpserver started (PID: ${GOHTTPSERVER_PID})"
94+
8195
# Execute the main command (runs as root; no-new-privileges prevents gosu/sudo)
8296
if [ -n "$EXTRA_OPTS" ]; then
8397
exec "$@" $EXTRA_OPTS

0 commit comments

Comments
 (0)