Compare commits
1 Commits
fix/vpn-ip
...
03616e9e3d
| Author | SHA1 | Date | |
|---|---|---|---|
| 03616e9e3d |
@@ -31,9 +31,6 @@ services:
|
|||||||
ssh:
|
ssh:
|
||||||
- default
|
- default
|
||||||
container_name: hermes
|
container_name: hermes
|
||||||
entrypoint: ["/bin/bash", "-c",
|
|
||||||
"bash /opt/data/hermes-tools/install.sh && exec /usr/bin/tini -g -- /opt/hermes/docker/entrypoint.sh \"$@\"",
|
|
||||||
"hermes-entrypoint"]
|
|
||||||
restart: always
|
restart: always
|
||||||
# Gateway run enables the internal API server on port 8642
|
# Gateway run enables the internal API server on port 8642
|
||||||
command: gateway run
|
command: gateway run
|
||||||
|
|||||||
@@ -1,52 +1,34 @@
|
|||||||
# syntax=docker/dockerfile:1
|
# 1. On récupère la version la plus récente d'UV
|
||||||
# Hermes Agent -- custom fork build
|
FROM ghcr.io/astral-sh/uv:latest AS uv_source
|
||||||
# Builds on top of official image + overlays our forked source from Gitea.
|
|
||||||
# Requires Docker BuildKit. Pass SSH agent for git clone:
|
|
||||||
# docker compose build hermes
|
|
||||||
# Or manually:
|
|
||||||
# DOCKER_BUILDKIT=1 docker build --ssh default -t hermes-agent:custom .
|
|
||||||
|
|
||||||
# ---------- Base: official Hermes image (system deps, npm, uv, Playwright) ----------
|
# 2. Image officielle Hermes Agent de NousResearch
|
||||||
|
# Contient déjà: Python, Node.js, npm, Playwright/Chromium, venv, tts_tool.py, etc.
|
||||||
FROM nousresearch/hermes-agent:latest
|
FROM nousresearch/hermes-agent:latest
|
||||||
|
|
||||||
# ---------- Overlay our forked source ----------
|
# ---------- System dependencies ----------
|
||||||
# Uses SSH agent forwarding from the build host (no key baked into image).
|
# The official hermes-agent image already has: git, curl, ffmpeg, python3,
|
||||||
# --exclude node_modules/.venv keeps the base image's pre-built layers intact.
|
# gcc, build-essential, openssh-client, procps, tini, ripgrep, docker-cli,
|
||||||
# Only the Python source, web UI source, and config change.
|
# libportaudio2, ca-certificates, etc.
|
||||||
RUN --mount=type=ssh \
|
|
||||||
mkdir -p /root/.ssh && \
|
|
||||||
ssh-keyscan -p 2222 code.lazyworkhorse.net >> /root/.ssh/known_hosts 2>/dev/null && \
|
|
||||||
cd /tmp && \
|
|
||||||
GIT_SSH_COMMAND='ssh -p 2222 -o StrictHostKeyChecking=no' \
|
|
||||||
git clone --depth 1 --branch main \
|
|
||||||
git@code.lazyworkhorse.net:gortium/hermes-agent.git fork && \
|
|
||||||
rsync -a --delete fork/ /opt/hermes/ \
|
|
||||||
--exclude node_modules \
|
|
||||||
--exclude .venv \
|
|
||||||
--exclude .git && \
|
|
||||||
rm -rf /tmp/fork /root/.ssh/
|
|
||||||
|
|
||||||
# ---------- Rebuild web UI ----------
|
|
||||||
# Source files changed; node_modules (from base image) reused.
|
|
||||||
RUN cd /opt/hermes && npm run build
|
|
||||||
|
|
||||||
# ---------- Reinstall Python package (editable) ----------
|
|
||||||
# Picks up source changes from our fork.
|
|
||||||
RUN . /opt/hermes/.venv/bin/activate && \
|
|
||||||
uv pip install --no-cache-dir --no-deps -e /opt/hermes
|
|
||||||
|
|
||||||
# ---------- Extra system deps ----------
|
|
||||||
USER root
|
USER root
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get install -y --no-install-recommends \
|
apt-get install -y --no-install-recommends \
|
||||||
libportaudio2 ca-certificates poppler-utils imagemagick \
|
poppler-utils \
|
||||||
texlive-latex-base texlive-latex-extra texlive-fonts-recommended \
|
imagemagick \
|
||||||
texlive-xetex texlive-science \
|
texlive-latex-base \
|
||||||
qemu-user-static binfmt-support emacs-nox && \
|
texlive-latex-extra \
|
||||||
|
texlive-fonts-recommended \
|
||||||
|
texlive-xetex \
|
||||||
|
texlive-science && \
|
||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# ---------- UV ----------
|
# ---------- UV (hyperfast pip alternative) ----------
|
||||||
COPY --chmod=0755 --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/
|
COPY --chmod=0755 --from=uv_source /uv /usr/local/bin/
|
||||||
|
|
||||||
|
WORKDIR /opt/hermes
|
||||||
|
|
||||||
|
# ---------- Extra Python deps ----------
|
||||||
|
RUN . /opt/hermes/.venv/bin/activate && \
|
||||||
|
uv pip install --no-cache-dir httpx
|
||||||
|
|
||||||
# ---------- Piper TTS ----------
|
# ---------- Piper TTS ----------
|
||||||
RUN . /opt/hermes/.venv/bin/activate && \
|
RUN . /opt/hermes/.venv/bin/activate && \
|
||||||
@@ -59,6 +41,7 @@ base = '/opt/hermes/.venv/share/piper/voices'
|
|||||||
url = 'https://huggingface.co/rhasspy/piper-voices/resolve/main/en/en_US/ryan/high/en_US-ryan-high.onnx'
|
url = 'https://huggingface.co/rhasspy/piper-voices/resolve/main/en/en_US/ryan/high/en_US-ryan-high.onnx'
|
||||||
urllib.request.urlretrieve(url, base + '/en_US-ryan-high.onnx')
|
urllib.request.urlretrieve(url, base + '/en_US-ryan-high.onnx')
|
||||||
urllib.request.urlretrieve(url + '.json', base + '/en_US-ryan-high.onnx.json')
|
urllib.request.urlretrieve(url + '.json', base + '/en_US-ryan-high.onnx.json')
|
||||||
|
print('Piper voice downloaded')
|
||||||
PYEOF
|
PYEOF
|
||||||
|
|
||||||
# ---------- Install Himalaya email CLI ----------
|
# ---------- Install Himalaya email CLI ----------
|
||||||
@@ -78,6 +61,11 @@ PYEOF
|
|||||||
# ---------- Install himalaya-ro wrapper ----------
|
# ---------- Install himalaya-ro wrapper ----------
|
||||||
COPY --chmod=0755 himalaya-ro.sh /usr/local/bin/himalaya-ro
|
COPY --chmod=0755 himalaya-ro.sh /usr/local/bin/himalaya-ro
|
||||||
|
|
||||||
|
# ---------- Patch tts_tool.py: remplacer Edge TTS par Piper ----------
|
||||||
|
# Edge TTS appelle les serveurs Microsoft — on ne veut jamais ça.
|
||||||
|
# Piper roule localement sur CPU, aucun cloud, aucune donnée qui sort.
|
||||||
|
COPY patch_tts_tool.py /tmp/patch_tts_tool.py
|
||||||
|
RUN /opt/hermes/.venv/bin/python3 /tmp/patch_tts_tool.py && rm /tmp/patch_tts_tool.py
|
||||||
|
|
||||||
# ---------- Runtime ----------
|
# ---------- Runtime ----------
|
||||||
USER hermes
|
USER hermes
|
||||||
@@ -86,8 +74,9 @@ ENV PATH="/opt/data/.local/bin:${PATH}"
|
|||||||
# Point browser tool to Playwright's Chromium (already in base image)
|
# Point browser tool to Playwright's Chromium (already in base image)
|
||||||
ENV CHROME_EXECUTABLE=/opt/hermes/.playwright/chromium/chrome-linux/chrome
|
ENV CHROME_EXECUTABLE=/opt/hermes/.playwright/chromium/chrome-linux/chrome
|
||||||
|
|
||||||
# Ensure tools directory and toolsets.py are writable by the hermes runtime user
|
|
||||||
# so custom tools can be injected from the persistent volume at startup.
|
|
||||||
RUN chown -R hermes:hermes /opt/hermes/tools /opt/hermes/toolsets.py
|
|
||||||
|
|
||||||
VOLUME [ "/opt/data" ]
|
VOLUME [ "/opt/data" ]
|
||||||
|
|
||||||
|
# Startup permission fix + config generation + TTS patch
|
||||||
|
COPY --chmod=0755 fix-permissions.sh /opt/hermes/fix-permissions.sh
|
||||||
|
|
||||||
|
ENTRYPOINT [ "/usr/bin/tini", "-g", "--", "/opt/hermes/fix-permissions.sh" ]
|
||||||
|
|||||||
38
ai/hermes/fix-permissions.sh
Normal file
38
ai/hermes/fix-permissions.sh
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Startup permission fix + TTS patch.
|
||||||
|
# Runs as root before the entrypoint drops to the hermes user.
|
||||||
|
set -e
|
||||||
|
|
||||||
|
HERMES_HOME="${HERMES_HOME:-/opt/data}"
|
||||||
|
|
||||||
|
# Fix ownership on critical writable directories
|
||||||
|
chown -R hermes:hermes \
|
||||||
|
"$HERMES_HOME/sessions" \
|
||||||
|
"$HERMES_HOME/checkpoints" \
|
||||||
|
"$HERMES_HOME/skills" \
|
||||||
|
"$HERMES_HOME/memories" \
|
||||||
|
"$HERMES_HOME/workspace" \
|
||||||
|
"$HERMES_HOME/pastes" \
|
||||||
|
"$HERMES_HOME/logs" \
|
||||||
|
"$HERMES_HOME/cron" \
|
||||||
|
"$HERMES_HOME/plans" \
|
||||||
|
"$HERMES_HOME/hooks" \
|
||||||
|
"$HERMES_HOME/cache" \
|
||||||
|
2>/dev/null || true
|
||||||
|
|
||||||
|
# Fix data volume root ownership
|
||||||
|
if [ "$(stat -c %u "$HERMES_HOME" 2>/dev/null)" != "$(id -u hermes)" ]; then
|
||||||
|
chown hermes:hermes "$HERMES_HOME" 2>/dev/null || true
|
||||||
|
fi
|
||||||
|
|
||||||
|
# ---------- Patch tts_tool.py: replace Edge TTS with Piper ----------
|
||||||
|
# Fallback runtime patch in case the volume's site-packages differ from the image.
|
||||||
|
# Idempotent: if already patched, the script does nothing.
|
||||||
|
PATCH_SCRIPT="/opt/hermes/patch_tts_tool.py"
|
||||||
|
if [ -f "$PATCH_SCRIPT" ]; then
|
||||||
|
echo "Applying TTS patch (Piper only, no Edge fallback)..."
|
||||||
|
/opt/hermes/.venv/bin/python3 "$PATCH_SCRIPT" 2>&1 || true
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Chain to the official Hermes entrypoint
|
||||||
|
exec /opt/hermes/docker/entrypoint.sh "$@"
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
# Custom wg-easy with iptables-nft (nftables-backed iptables)
|
|
||||||
# Fixes crash-loop when host kernel lacks legacy iptable_nat module.
|
|
||||||
FROM ghcr.io/wg-easy/wg-easy:latest
|
|
||||||
|
|
||||||
# The upstream image defaults to iptables-legacy via update-alternatives.
|
|
||||||
# Switch iptables to the nftables backend (already provided by the 'iptables'
|
|
||||||
# package on Alpine 3.18+). No apk add needed — iptables-nft is built-in.
|
|
||||||
RUN update-alternatives --set iptables /usr/sbin/iptables-nft && \
|
|
||||||
update-alternatives --set ip6tables /usr/sbin/ip6tables-nft
|
|
||||||
@@ -2,10 +2,7 @@ version: "3.8"
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
wireguard:
|
wireguard:
|
||||||
build:
|
image: weejewel/wg-easy:latest
|
||||||
context: .
|
|
||||||
dockerfile: Dockerfile
|
|
||||||
image: wg-easy-iptables-nft:latest
|
|
||||||
container_name: wireguard
|
container_name: wireguard
|
||||||
cap_add:
|
cap_add:
|
||||||
- NET_ADMIN
|
- NET_ADMIN
|
||||||
|
|||||||
Reference in New Issue
Block a user