fix ftp ports e external ip per proxy (VIP)

This commit is contained in:
2025-11-01 21:27:59 +01:00
parent 648a3af73f
commit 6cfccbefd2
6 changed files with 124 additions and 19 deletions

View File

@@ -7,8 +7,11 @@ services:
environment:
DB_HOST: ${VIP:-192.168.1.210}
ORCHESTRATOR_ID: 4
TZ: Europe/Rome
volumes:
- app-logs:/app/logs
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
networks:
- app-network
labels:
@@ -21,8 +24,11 @@ services:
environment:
DB_HOST: ${VIP:-192.168.1.210}
ORCHESTRATOR_ID: 5
TZ: Europe/Rome
volumes:
- app-logs:/app/logs
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
networks:
- app-network
labels:
@@ -35,8 +41,11 @@ services:
environment:
DB_HOST: ${VIP:-192.168.1.210}
ORCHESTRATOR_ID: 6
TZ: Europe/Rome
volumes:
- app-logs:/app/logs
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
networks:
- app-network
labels:
@@ -49,12 +58,40 @@ services:
environment:
DB_HOST: ${VIP:-192.168.1.210}
FTP_INSTANCE_ID: 2
TZ: Europe/Rome
FTP_PASSIVE_PORT: "40000"
FTP_EXTERNAL_IP: ${VIP:-192.168.1.210}
volumes:
- app-logs:/app/logs
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
networks:
- app-network
expose:
- "21"
- "40000-40249"
labels:
logging: "promtail"
ftp-server-2b:
build: .
container_name: ftp-server-2b
restart: unless-stopped
command: ["python", "-m", "src.ftp_csv_receiver"]
environment:
DB_HOST: ${VIP:-192.168.1.210}
FTP_INSTANCE_ID: 8
TZ: Europe/Rome
FTP_PASSIVE_PORT: "40250"
FTP_EXTERNAL_IP: ${VIP:-192.168.1.210}
volumes:
- app-logs:/app/logs
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
networks:
- app-network
expose:
- "21"
- "40250-40499"
labels:
logging: "promtail"
haproxy:
@@ -67,8 +104,11 @@ services:
- app-network
ports:
- "21:21"
- "3306:3306"
- "40000-40499:40000-40499"
- "8404:8404"
labels:
logging: "promtail"
keepalived:
image: alpine:latest
container_name: keepalived
@@ -85,9 +125,13 @@ services:
image: grafana/promtail:2.9.3
container_name: promtail
restart: unless-stopped
environment:
TZ: Europe/Rome
volumes:
- ./promtail-config.yml:/etc/promtail/config.yml:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
networks:
- app-network
networks:

2
vm2/env/ftp.ini vendored
View File

@@ -2,7 +2,7 @@
# python3 -c 'from hashlib import sha256;print(sha256("????password???".encode("UTF-8")).hexdigest())'
[ftpserver]
service_port = 2121
service_port = 21
firstPort = 40000
proxyAddr = 0.0.0.0
portRangeWidth = 500

View File

@@ -30,17 +30,24 @@ frontend ftp_control
backend ftp_servers
mode tcp
balance source
server ftp1 192.168.1.201:21 check
balance roundrobin
server ftp2 ftp-server-2:21 check
server ftp2b ftp-server-2b:21 check
frontend ftp_passive
bind *:40000-40499
frontend ftp_passive_2
bind *:40000-40249
mode tcp
default_backend ftp_passive_servers
default_backend ftp_passive_2_backend
backend ftp_passive_servers
backend ftp_passive_2_backend
mode tcp
balance source
server ftp1 192.168.1.201:40000 check port 21
server ftp2 ftp-server-2:40000 check port 21
frontend ftp_passive_2b
bind *:40250-40499
mode tcp
default_backend ftp_passive_2b_backend
backend ftp_passive_2b_backend
mode tcp
server ftp2b ftp-server-2b:40250 check port 21