hermes-squid

This commit is contained in:
2026-08-01 23:18:20 +02:00
parent ea12d7e7f9
commit ea189f7cb9
5 changed files with 173 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 8087;
server_name _;
location / {
proxy_pass http://hermes-gateway:9119;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_read_timeout 3600s;
}
}
+1
View File
@@ -0,0 +1 @@
* * * * * root /usr/sbin/sarg -l /var/log/squid/access.log -o /www -x >/dev/null 2>&1
+4
View File
@@ -0,0 +1,4 @@
access_log /var/log/squid/access.log
output_dir /www
overwrite_report yes
index yes
+17
View File
@@ -0,0 +1,17 @@
acl hermes_network src 10.0.0.0/8
acl hermes_network src 172.16.0.0/12
acl hermes_network src 192.168.0.0/16
acl allowed_domains dstdomain .minimax.io .minimax.chat .minimax.com .githubusercontent.com deb.debian.org
acl CONNECT method CONNECT
acl SSL_ports port 443
acl Safe_ports port 80 443
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow hermes_network allowed_domains
http_access deny all
http_port 3128
access_log stdio:/var/log/squid/access.log
cache_dir ufs /var/spool/squid 100 16 256
coredump_dir /var/spool/squid
+130
View File
@@ -0,0 +1,130 @@
version: "3.9"
services:
squid:
image: ubuntu/squid:latest
hostname: squid
networks:
- hermes_proxy
- squid_egress
ports:
- target: 3128
published: 3128
protocol: tcp
volumes:
- ./squid.conf:/etc/squid/squid.conf:ro
- squid_cache:/var/spool/squid
- squid_logs:/var/log/squid
environment:
TZ: UTC
deploy:
replicas: 1
restart_policy:
condition: on-failure
sarg:
image: starina/squid-sarg-cron:latest
hostname: sarg
networks:
- admin
ports:
- target: 80
published: 8090
protocol: tcp
volumes:
- squid_logs:/var/log/squid:ro
- squid_reports:/www
- ./sarg.conf:/etc/sarg/sarg.conf:ro
deploy:
replicas: 1
placement:
constraints:
- node.hostname == rudolf-T
restart_policy:
condition: on-failure
hermes-gateway:
image: nousresearch/hermes-agent:latest
command: gateway run
networks:
- hermes_proxy
volumes:
- hermes_gateway_data:/opt/data
environment:
HERMES_DASHBOARD: "1"
HERMES_DASHBOARD_HOST: "0.0.0.0"
HERMES_DASHBOARD_BASIC_AUTH_USERNAME: admin
HERMES_DASHBOARD_BASIC_AUTH_PASSWORD: admin
HERMES_AGENT_URL: http://hermes-agent:8000
HTTP_PROXY: http://squid:3128
HTTPS_PROXY: http://squid:3128
http_proxy: http://squid:3128
https_proxy: http://squid:3128
NO_PROXY: localhost,127.0.0.1,squid,hermes-gateway,hermes-agent
no_proxy: localhost,127.0.0.1,squid,hermes-gateway,hermes-agent
depends_on:
- squid
deploy:
replicas: 1
restart_policy:
condition: on-failure
hermes-ui:
image: nginx:alpine
hostname: hermes-ui
networks:
- hermes_proxy
ports:
- target: 8087
published: 8087
protocol: tcp
volumes:
- ./nginx-hermes.conf:/etc/nginx/conf.d/default.conf:ro
depends_on:
- hermes-gateway
deploy:
replicas: 1
restart_policy:
condition: on-failure
# hermes-agent:
# image: nousresearch/hermes-agent:latest
# command: sleep infinity
# networks:
# - hermes_proxy
# volumes:
# - hermes_agent_data:/opt/data
# environment:
# TELEGRAM_HOME_CHANNEL_NAME: Default
# HERMES_GATEWAY_URL: http://hermes-gateway:8000
# HTTP_PROXY: http://squid:3128
# HTTPS_PROXY: http://squid:3128
# http_proxy: http://squid:3128
# https_proxy: http://squid:3128
# NO_PROXY: localhost,127.0.0.1,squid,hermes-gateway,hermes-agent
# no_proxy: localhost,127.0.0.1,squid,hermes-gateway,hermes-agent
# depends_on:
# - squid
# deploy:
# replicas: 1
# restart_policy:
# condition: on-failure
networks:
hermes_proxy:
driver: overlay
attachable: true
internal: true
squid_egress:
driver: overlay
admin:
driver: overlay
attachable: true
volumes:
squid_etc:
squid_cache:
squid_logs:
squid_reports:
hermes_gateway_data:
hermes_agent_data: