x
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
access_log /var/log/squid/access.log
|
||||
output_dir /www
|
||||
overwrite_report yes
|
||||
index yes
|
||||
@@ -0,0 +1,19 @@
|
||||
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 deny all
|
||||
cache_mem 0 MB
|
||||
cache_dir null /tmp
|
||||
coredump_dir /var/spool/squid
|
||||
@@ -11,22 +11,24 @@ services:
|
||||
- target: 3128
|
||||
published: 3128
|
||||
protocol: tcp
|
||||
volumes:
|
||||
- squid_cache:/var/spool/squid
|
||||
- squid_logs:/var/log/squid
|
||||
environment:
|
||||
TZ: UTC
|
||||
configs:
|
||||
- source: squid_conf
|
||||
target: /etc/squid/squid.conf
|
||||
mode: 0444
|
||||
volumes:
|
||||
- squid_logs:/var/log/squid
|
||||
environment:
|
||||
TZ: UTC
|
||||
deploy:
|
||||
placement:
|
||||
max_replicas_per_node: 1
|
||||
constraints:
|
||||
- node.hostname==odroid
|
||||
# - node.hostname==rudolf-T
|
||||
mode: replicated
|
||||
replicas: 1
|
||||
resources:
|
||||
limits:
|
||||
cpus: "0.50"
|
||||
memory: 128M
|
||||
pids: 256
|
||||
reservations:
|
||||
memory: 128M
|
||||
restart_policy:
|
||||
condition: on-failure
|
||||
|
||||
sarg:
|
||||
image: starina/squid-sarg-cron:latest
|
||||
@@ -37,20 +39,28 @@ services:
|
||||
- target: 80
|
||||
published: 8090
|
||||
protocol: tcp
|
||||
volumes:
|
||||
- squid_logs:/var/log/squid:ro
|
||||
- squid_reports:/www
|
||||
configs:
|
||||
- source: sarg_conf
|
||||
target: /etc/sarg/sarg.conf
|
||||
mode: 0444
|
||||
- source: sarg_minute_cron
|
||||
target: /etc/cron.d/sarg-minute
|
||||
volumes:
|
||||
- squid_logs:/var/log/squid:ro
|
||||
- squid_reports:/www
|
||||
deploy:
|
||||
replicas: 1
|
||||
resources:
|
||||
limits:
|
||||
cpus: "0.25"
|
||||
memory: 128M
|
||||
pids: 128
|
||||
reservations:
|
||||
memory: 128M
|
||||
placement:
|
||||
max_replicas_per_node: 1
|
||||
constraints:
|
||||
- node.hostname==odroid
|
||||
# - node.hostname==rudolf-T
|
||||
mode: replicated
|
||||
- node.hostname == rudolf-T
|
||||
restart_policy:
|
||||
condition: on-failure
|
||||
|
||||
hermes-gateway:
|
||||
image: nousresearch/hermes-agent:latest
|
||||
@@ -74,12 +84,16 @@ services:
|
||||
depends_on:
|
||||
- squid
|
||||
deploy:
|
||||
placement:
|
||||
max_replicas_per_node: 1
|
||||
constraints:
|
||||
- node.hostname==odroid
|
||||
# - node.hostname==rudolf-T
|
||||
mode: replicated
|
||||
replicas: 1
|
||||
resources:
|
||||
limits:
|
||||
cpus: "1.00"
|
||||
memory: 128M
|
||||
pids: 512
|
||||
reservations:
|
||||
memory: 128M
|
||||
restart_policy:
|
||||
condition: on-failure
|
||||
|
||||
hermes-ui:
|
||||
image: nginx:alpine
|
||||
@@ -93,16 +107,19 @@ services:
|
||||
configs:
|
||||
- source: nginx_hermes_conf
|
||||
target: /etc/nginx/conf.d/default.conf
|
||||
mode: 0444
|
||||
depends_on:
|
||||
- hermes-gateway
|
||||
deploy:
|
||||
placement:
|
||||
max_replicas_per_node: 1
|
||||
constraints:
|
||||
- node.hostname==odroid
|
||||
# - node.hostname==rudolf-T
|
||||
mode: replicated
|
||||
replicas: 1
|
||||
resources:
|
||||
limits:
|
||||
cpus: "0.25"
|
||||
memory: 16M
|
||||
pids: 128
|
||||
reservations:
|
||||
memory: 16M
|
||||
restart_policy:
|
||||
condition: on-failure
|
||||
|
||||
# hermes-agent:
|
||||
# image: nousresearch/hermes-agent:latest
|
||||
@@ -138,61 +155,19 @@ networks:
|
||||
driver: overlay
|
||||
attachable: true
|
||||
|
||||
configs:
|
||||
squid_conf:
|
||||
file: ./squid.conf
|
||||
sarg_conf:
|
||||
file: ./sarg.conf
|
||||
sarg_minute_cron:
|
||||
file: ./sarg-minute.cron
|
||||
nginx_hermes_conf:
|
||||
file: ./nginx-hermes.conf
|
||||
|
||||
volumes:
|
||||
squid_cache:
|
||||
squid_etc:
|
||||
squid_logs:
|
||||
squid_reports:
|
||||
hermes_gateway_data:
|
||||
hermes_agent_data:
|
||||
|
||||
configs:
|
||||
squid_conf:
|
||||
content: |
|
||||
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
|
||||
|
||||
sarg_conf:
|
||||
content: |
|
||||
access_log /var/log/squid/access.log
|
||||
output_dir /www
|
||||
overwrite_report yes
|
||||
index yes
|
||||
|
||||
nginx_hermes_conf:
|
||||
content: |
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user