chore: build
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
services:
|
||||
portabase-agent:
|
||||
image: portabase/agent:latest
|
||||
container_name: portabase-agent
|
||||
restart: always
|
||||
network_mode: host
|
||||
env_file: .env
|
||||
entrypoint: ["sh", "-c", "update-ca-certificates && exec /entrypoint.sh"]
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
- DATABASES_CONFIG_FILE=config.toml
|
||||
volumes:
|
||||
- ./databases.toml:/config/config.toml:ro
|
||||
- ./portabase-ca.pem:/usr/local/share/ca-certificates/portabase-ca.crt:ro
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
- agent-data:/data
|
||||
- agent-tmp:/tmp
|
||||
|
||||
volumes:
|
||||
agent-data:
|
||||
agent-tmp:
|
||||
@@ -0,0 +1,20 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIDMTCCAhmgAwIBAgIUB8Gk3zRJRK0QDqPNiZeRgkszE3gwDQYJKoZIhvcNAQEL
|
||||
BQAwIDEeMBwGA1UEAwwVUG9ydGFiYXNlIEludGVybmFsIENBMB4XDTI2MTAxNDE4
|
||||
MTIxNloXDTM2MTAxMTE4MTIxNlowIDEeMBwGA1UEAwwVUG9ydGFiYXNlIEludGVy
|
||||
bmFsIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAto+OO/LBNdM9
|
||||
Lp+JgkNZPQ3/u1nlXSvkz1OFwEM+EHxnAerGAY7zFykR7XKygMcVztKP38AIR779
|
||||
/QN0Lavc1wAEQ2Pf/wPrAa6sfshbiJdbkMsmmsRdBTdiw/jHtX9x73rlQgCqRhEI
|
||||
HPbv//abKpB3Z1F3idS1zoFcN2KgABQiR/g1VuSHLzYmrpvvxEOtNFW6dcldtdHH
|
||||
k0j8JiQWCehziOmdbe5dlrO5B/SzCbPKGvgZBE/RVP1sbYy/QhG273zekidYWp7r
|
||||
HgAOgEg5x7JjO+ID7T2ClDZG0CgIn5Qrs9/FaMHfzVYLR/+wnvn+DzRuez96d9Ol
|
||||
qt9SfzSH1QIDAQABo2MwYTAdBgNVHQ4EFgQU/D2ZdNhuSaZi80ch9BEYue3Deesw
|
||||
HwYDVR0jBBgwFoAU/D2ZdNhuSaZi80ch9BEYue3DeeswDwYDVR0TAQH/BAUwAwEB
|
||||
/zAOBgNVHQ8BAf8EBAMCAQYwDQYJKoZIhvcNAQELBQADggEBAI6yP69LA4shWw5I
|
||||
uUEOYkq3uHsawlb2XshPy9FAom1lXSyLsaiznwpN0R+aX1787dWAhJz169iH7kSx
|
||||
AAxMVq26o2+TwBAhvortB+Cel5iNB2Qi4fq3Abky/bla4br3+qNZ5JQkimcgK2OE
|
||||
PHGT1cJHLcG5fk6VK4mWpHZBJpRqDuF+21eOapywObBOjDoYl56iPp/vZSTnIvxn
|
||||
qniRJdFQf/itXVKlNeJl/H3q1DKrFZL96yFPkImxi+4O9lter/1l1Jp3RP5cx59K
|
||||
49X0qj91TiNG+v/P9TtjGzCzwlXojB0zeoJjjmB6BWaOfjLm7FvvZm3DMO6W7DyP
|
||||
xlh0tQs=
|
||||
-----END CERTIFICATE-----
|
||||
@@ -30,3 +30,6 @@ PRIVATE_KEY_MOBILE_PREPROD=LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tCk1JSUV2Z0lCQURBT
|
||||
ADMIN_PASSWORD_MOBILE_PREPROD=thxz419zFmNdh547A3vrQE1v
|
||||
UPLOAD_KEY_MOBILE_PREPROD=8f65a01120509b149f3a781b139391272519041b
|
||||
POSTGRES_PASS_MOBILE_PREPROD=uS6K8V54JeUHOYsbEDdbIt
|
||||
|
||||
RUSTFS_ACCESS_KEY=iBacJPHUHSf6SMTnxrr
|
||||
RUSTFS_SECRET_KEY=4jNzZhstv1WkwTwtvR4gHSbrx01m4sJl4LBBleeJ
|
||||
|
||||
@@ -168,6 +168,33 @@ services:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
|
||||
rustfs_perm:
|
||||
image: alpine:latest
|
||||
container_name: rustfs_perm
|
||||
volumes:
|
||||
- /mnt/data:/data
|
||||
command: chown -R 10001:10001 /data
|
||||
|
||||
rustfs:
|
||||
image: rustfs/rustfs:latest
|
||||
depends_on:
|
||||
rustfs_perm:
|
||||
condition: service_completed_successfully
|
||||
hostname: rustfs
|
||||
container_name: rustfs
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- /mnt/data:/data
|
||||
- /mnt/logs:/logs
|
||||
environment:
|
||||
- RUSTFS_ACCESS_KEY=${RUSTFS_ACCESS_KEY:-iBacJPHUHSf6SMTnxrr}
|
||||
- RUSTFS_SECRET_KEY=${RUSTFS_SECRET_KEY:-4jNzZhstv1WkwTwtvR4gHSbrx01m4sJl4LBBleeJ}
|
||||
- RUSTFS_SERVER_DOMAINS=rustfs.uber-stup.club
|
||||
- RUSTFS_CONSOLE_ENABLE=true
|
||||
- RUSTFS_ADDRESS=:9000
|
||||
- RUSTFS_CONSOLE_ADDRESS=:9001
|
||||
networks:
|
||||
- ota-net
|
||||
nginx:
|
||||
image: nginx:alpine
|
||||
container_name: ota-nginx
|
||||
@@ -188,6 +215,7 @@ services:
|
||||
- ota-omnex-admin
|
||||
- ota-mobile-prod
|
||||
- ota-mobile-preprod
|
||||
- rustfs
|
||||
|
||||
dozzle-agent:
|
||||
image: amir20/dozzle:latest
|
||||
@@ -210,3 +238,4 @@ volumes:
|
||||
ota_mobile_prod_releases:
|
||||
ota_mobile_preprod_releases:
|
||||
certbot_www:
|
||||
rustfs:
|
||||
|
||||
@@ -166,3 +166,61 @@ server {
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl;
|
||||
listen [::]:443 ssl;
|
||||
http2 on;
|
||||
server_name backup-omnex.uber-stup.club;
|
||||
|
||||
ssl_certificate /etc/nginx/certs/backup-omnex.uber-stup.club.crt;
|
||||
ssl_certificate_key /etc/nginx/certs/backup-omnex.uber-stup.club.key;
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
ssl_ciphers HIGH:!aNULL:!MD5;
|
||||
|
||||
access_log /var/log/nginx/rustfs_access.log;
|
||||
error_log /var/log/nginx/rustfs_error.log;
|
||||
|
||||
resolver 127.0.0.11 valid=30s;
|
||||
|
||||
location / {
|
||||
set $upstream http://rustfs:9001;
|
||||
proxy_pass $upstream;
|
||||
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 "upgrade";
|
||||
proxy_read_timeout 300s;
|
||||
client_max_body_size 500m;
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl;
|
||||
server_name backup-s3.uber-stup.club;
|
||||
|
||||
ssl_certificate /etc/nginx/certs/backup-s3.uber-stup.club.crt;
|
||||
ssl_certificate_key /etc/nginx/certs/backup-s3.uber-stup.club.key;
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
ssl_ciphers HIGH:!aNULL:!MD5;
|
||||
|
||||
access_log /var/log/nginx/rustfs_s3_access.log;
|
||||
error_log /var/log/nginx/rustfs_s3_error.log;
|
||||
|
||||
resolver 127.0.0.11 valid=30s;
|
||||
|
||||
location / {
|
||||
set $upstream http://rustfs:9000;
|
||||
proxy_pass $upstream;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $http_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_read_timeout 300s;
|
||||
client_max_body_size 2g;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ docker run --rm \
|
||||
certbot/certbot renew --webroot -w /var/www/certbot --quiet
|
||||
|
||||
changed=0
|
||||
for sub in ota-prod ota-preprod ota-omnex-cli ota-omnex-admin ota-mobile-prod ota-mobile-preprod; do
|
||||
for sub in ota-prod ota-preprod ota-omnex-cli ota-omnex-admin ota-mobile-prod ota-mobile-preprod backup-omnex backup-s3; do
|
||||
domain="${sub}.uber-stup.club"
|
||||
if ! docker run --rm -v ota_certbot_letsencrypt:/etc/letsencrypt -v /opt/ota/certs:/out alpine \
|
||||
sh -c "cmp -s /etc/letsencrypt/live/${domain}/fullchain.pem /out/${domain}.crt"; then
|
||||
|
||||
@@ -1,2 +1,15 @@
|
||||
RUSTFS_ACCESS_KEY=iBacJPHUHSf6SMTnxrr
|
||||
RUSTFS_SECRET_KEY=4jNzZhstv1WkwTwtvR4gHSbrx01m4sJl4LBBleeJ
|
||||
PROJECT_URL=https://10.0.0.4
|
||||
PROJECT_SECRET=dOkGZW0Iz+Ga8hBAttU+TlOf/RYwTe0txz7fyGzINzI=
|
||||
POSTGRES_USER=portabase
|
||||
POSTGRES_PASSWORD=8BIAtiI580SzvupmKWW
|
||||
POSTGRES_HOST=db
|
||||
POSTGRES_PORT=5432
|
||||
POSTGRES_DB=portabase
|
||||
DATABASE_URL=postgresql://portabase:8BIAtiI580SzvupmKWW@db:5432/portabase?schema=public
|
||||
SKIP_ONBOARDING=true
|
||||
API_ENABLED=true
|
||||
AUTH_DEFAULT_USER_NAME=admin
|
||||
AUTH_DEFAULT_USER=admin@portabase.local
|
||||
AUTH_DEFAULT_PASSWORD=Admin@Portabase2026!
|
||||
OPENAPI_ENABLED=true
|
||||
TRUSTED_DOMAINS=https://10.0.0.4
|
||||
|
||||
@@ -5,31 +5,54 @@ services:
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "10.0.0.4:80:80"
|
||||
- "10.0.0.4:8080:8080"
|
||||
- "10.0.0.4:9000:9000"
|
||||
- "10.0.0.4:9001:9001"
|
||||
- "10.0.0.4:443:443"
|
||||
volumes:
|
||||
- ./nginx.conf:/etc/nginx/nginx.conf:ro
|
||||
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
|
||||
- ./certs:/etc/nginx/certs:ro
|
||||
- nginx_logs:/var/log/nginx
|
||||
depends_on:
|
||||
- minio
|
||||
- portabase
|
||||
networks:
|
||||
- s3_net
|
||||
|
||||
minio:
|
||||
image: minio/minio:latest
|
||||
container_name: s3_minio
|
||||
restart: unless-stopped
|
||||
hostname: minio
|
||||
volumes:
|
||||
- /mnt/data:/data
|
||||
portabase:
|
||||
image: portabase/portabase:latest
|
||||
container_name: portabase-app
|
||||
restart: always
|
||||
env_file: .env
|
||||
environment:
|
||||
- MINIO_ROOT_USER=admin
|
||||
- MINIO_ROOT_PASSWORD=admin@12345
|
||||
- MINIO_ADDRESS=:9000
|
||||
- MINIO_CONSOLE_ADDRESS=:9001
|
||||
command: minio server /data --console-address :9001
|
||||
- TZ=Europe/Paris
|
||||
expose:
|
||||
- "80"
|
||||
volumes:
|
||||
- portabase-data:/data
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost/api/health"]
|
||||
interval: 30s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
start_period: 60s
|
||||
networks:
|
||||
- s3_net
|
||||
|
||||
db:
|
||||
image: postgres:17-alpine
|
||||
container_name: portabase-pg
|
||||
restart: always
|
||||
volumes:
|
||||
- postgres-data:/var/lib/postgresql/data
|
||||
environment:
|
||||
POSTGRES_DB: portabase
|
||||
POSTGRES_USER: portabase
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U portabase -d portabase"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
networks:
|
||||
- s3_net
|
||||
|
||||
@@ -102,3 +125,5 @@ volumes:
|
||||
clamav_db:
|
||||
clamav_logs:
|
||||
clamav_scan_logs:
|
||||
portabase-data:
|
||||
postgres-data:
|
||||
|
||||
@@ -7,9 +7,9 @@ events {
|
||||
http {
|
||||
resolver 127.0.0.11 valid=10s ipv6=off;
|
||||
|
||||
# ── MinIO Console GUI HTTPS (VPN: 10.0.0.4:8080) ────────
|
||||
# ── Portabase Dashboard HTTPS (VPN: 10.0.0.4:443) ───────
|
||||
server {
|
||||
listen 8080 ssl;
|
||||
listen 443 ssl;
|
||||
server_name 10.0.0.4 _;
|
||||
|
||||
ssl_certificate /etc/nginx/certs/cert.pem;
|
||||
@@ -17,11 +17,19 @@ http {
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
ssl_ciphers HIGH:!aNULL:!MD5;
|
||||
|
||||
access_log /var/log/nginx/minio_console_access.log;
|
||||
error_log /var/log/nginx/minio_console_error.log;
|
||||
access_log /var/log/nginx/portabase_access.log;
|
||||
error_log /var/log/nginx/portabase_error.log;
|
||||
|
||||
location /api/v1 {
|
||||
return 403;
|
||||
}
|
||||
|
||||
location /openapi {
|
||||
return 403;
|
||||
}
|
||||
|
||||
location / {
|
||||
proxy_pass http://minio:9001;
|
||||
proxy_pass http://portabase:80;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
@@ -31,7 +39,7 @@ http {
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_buffering off;
|
||||
proxy_read_timeout 300s;
|
||||
client_max_body_size 500m;
|
||||
client_max_body_size 50m;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,56 +48,7 @@ http {
|
||||
listen 80;
|
||||
server_name _;
|
||||
location / {
|
||||
return 301 https://$host:8080$request_uri;
|
||||
}
|
||||
}
|
||||
|
||||
# ── MinIO Console Direct HTTPS (VPN: 10.0.0.4:9001) ──────
|
||||
server {
|
||||
listen 9001 ssl;
|
||||
server_name 10.0.0.4 _;
|
||||
|
||||
ssl_certificate /etc/nginx/certs/cert.pem;
|
||||
ssl_certificate_key /etc/nginx/certs/key.pem;
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
ssl_ciphers HIGH:!aNULL:!MD5;
|
||||
|
||||
access_log /var/log/nginx/minio_console_direct_access.log;
|
||||
error_log /var/log/nginx/minio_console_direct_error.log;
|
||||
|
||||
location / {
|
||||
proxy_pass http://minio:9001;
|
||||
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 https;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_buffering off;
|
||||
proxy_read_timeout 300s;
|
||||
client_max_body_size 500m;
|
||||
}
|
||||
}
|
||||
|
||||
# ── MinIO S3 API HTTP (VPN: 10.0.0.4:9000) ────────────────
|
||||
server {
|
||||
listen 9000;
|
||||
server_name 10.0.0.4 _;
|
||||
|
||||
access_log /var/log/nginx/minio_s3_api_access.log;
|
||||
error_log /var/log/nginx/minio_s3_api_error.log;
|
||||
|
||||
location / {
|
||||
proxy_pass http://minio:9000;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $http_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 http;
|
||||
proxy_buffering off;
|
||||
proxy_read_timeout 300s;
|
||||
client_max_body_size 2g;
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,2 +1,6 @@
|
||||
# RustFS
|
||||
RUSTFS_ACCESS_KEY=JJg3uFeuKUUrdqq4oefQ8sIp6hnI
|
||||
RUSTFS_SECRET_KEY=7wPrOd1324t411q7VnuzfNkQXCch4U5qqOHx
|
||||
|
||||
# Portabase Agent
|
||||
EDGE_KEY=<A_REMPLIR>
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
[[databases]]
|
||||
name = "Production PostgreSQL - gestion_commande_db"
|
||||
database = "gestion_commande_db"
|
||||
type = "postgresql"
|
||||
username = "admin_gestion_commande_db"
|
||||
password = "1SWDxH20rV7K2Uc2PNlwCaCxfVZEtKomF0CK9OMh"
|
||||
port = 5432
|
||||
host = "127.0.0.1"
|
||||
generated_id = "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
|
||||
@@ -45,6 +45,21 @@ services:
|
||||
networks:
|
||||
- s3_net
|
||||
|
||||
portabase-agent:
|
||||
image: portabase/agent:latest
|
||||
container_name: portabase-agent
|
||||
restart: always
|
||||
network_mode: host
|
||||
env_file: .env
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
- DATABASES_CONFIG_FILE=config.toml
|
||||
volumes:
|
||||
- ./databases.toml:/config/config.toml:ro
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
- agent-data:/data
|
||||
- agent-tmp:/tmp
|
||||
|
||||
dozzle-agent:
|
||||
image: amir20/dozzle:latest
|
||||
command: agent
|
||||
@@ -60,3 +75,5 @@ networks:
|
||||
|
||||
volumes:
|
||||
nginx_logs:
|
||||
agent-data:
|
||||
agent-tmp:
|
||||
|
||||
@@ -1,52 +1,34 @@
|
||||
|
||||
worker_processes auto;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
resolver 127.0.0.11 valid=10s ipv6=off;
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name _;
|
||||
return 301 http://$host:9001$request_uri;
|
||||
}
|
||||
# ── RustFS Console ──────────────────────────────────────
|
||||
server {
|
||||
listen 9001;
|
||||
server_name _;
|
||||
access_log /var/log/nginx/rustfs_access.log;
|
||||
error_log /var/log/nginx/rustfs_error.log;
|
||||
location / {
|
||||
set $upstream http://rustfs:9001;
|
||||
proxy_pass $upstream;
|
||||
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 "upgrade";
|
||||
proxy_read_timeout 300s;
|
||||
client_max_body_size 500m;
|
||||
}
|
||||
}
|
||||
|
||||
# ── RustFS S3 API ───────────────────────────────────────
|
||||
server {
|
||||
listen 9000;
|
||||
server_name _;
|
||||
access_log /var/log/nginx/rustfs_s3_access.log;
|
||||
error_log /var/log/nginx/rustfs_s3_error.log;
|
||||
access_log /var/log/nginx/portabase_access.log;
|
||||
error_log /var/log/nginx/portabase_error.log;
|
||||
|
||||
location / {
|
||||
set $upstream http://rustfs:9000;
|
||||
proxy_pass $upstream;
|
||||
proxy_pass http://portabase:80;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_cache_convert_head off;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
|
||||
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 "upgrade";
|
||||
|
||||
proxy_read_timeout 300s;
|
||||
proxy_send_timeout 300s;
|
||||
client_max_body_size 2g;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,2 @@
|
||||
RUSTFS_ACCESS_KEY=iBacJPHUHSf6SMTnxrr
|
||||
RUSTFS_SECRET_KEY=4jNzZhstv1WkwTwtvR4gHSbrx01m4sJl4LBBleeJ
|
||||
|
||||
XAVIA_ADMIN_PASSWORD=2VYfheOweyMiP510GGfjNYmq3vJGJ
|
||||
XAVIA_UPLOAD_KEY=dNW2tiNXRR6w1cLwlmCOyKFIKvoTz8xQMSyd
|
||||
XAVIA_PRIVATE_KEY_BASE_64=MlRvcGlyNHpFRjhYOTlvUjMxbHFCVHRQdjYyelh4Wnc0MDM4TkZaVQ==
|
||||
XAVIA_POSTGRES_USER=xavia
|
||||
XAVIA_POSTGRES_PASSWORD=6DzLcsb5rgWukuGdrHtRBQ222f
|
||||
XAVIA_POSTGRES_DB=releases_db
|
||||
|
||||
@@ -12,8 +12,6 @@ services:
|
||||
- nginx_logs:/var/log/nginx
|
||||
depends_on:
|
||||
- rustfs
|
||||
- xavia
|
||||
- gitea
|
||||
networks:
|
||||
- s3_net
|
||||
|
||||
@@ -45,56 +43,6 @@ services:
|
||||
networks:
|
||||
- s3_net
|
||||
|
||||
xavia_db:
|
||||
image: postgres:16-alpine
|
||||
container_name: xavia_db
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- POSTGRES_USER=${XAVIA_POSTGRES_USER:-xavia}
|
||||
- POSTGRES_PASSWORD=${XAVIA_POSTGRES_PASSWORD}
|
||||
- POSTGRES_DB=${XAVIA_POSTGRES_DB:-releases_db}
|
||||
volumes:
|
||||
- xavia_db_data:/var/lib/postgresql/data
|
||||
- ./init-db:/docker-entrypoint-initdb.d:ro
|
||||
networks:
|
||||
- s3_net
|
||||
|
||||
xavia:
|
||||
image: xaviaio/xavia-ota:latest
|
||||
container_name: xavia
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- HOST=https://ota.uber-stup.club
|
||||
- BLOB_STORAGE_TYPE=local
|
||||
- DB_TYPE=postgres
|
||||
- ADMIN_PASSWORD=${XAVIA_ADMIN_PASSWORD}
|
||||
- UPLOAD_KEY=${XAVIA_UPLOAD_KEY}
|
||||
- PRIVATE_KEY_BASE_64=${XAVIA_PRIVATE_KEY_BASE_64}
|
||||
- POSTGRES_USER=${XAVIA_POSTGRES_USER:-xavia}
|
||||
- POSTGRES_PASSWORD=${XAVIA_POSTGRES_PASSWORD}
|
||||
- POSTGRES_DB=${XAVIA_POSTGRES_DB:-releases_db}
|
||||
- POSTGRES_HOST=xavia_db
|
||||
- POSTGRES_PORT=5432
|
||||
volumes:
|
||||
- xavia_blobs:/app/blobs
|
||||
depends_on:
|
||||
- xavia_db
|
||||
networks:
|
||||
- s3_net
|
||||
gitea:
|
||||
image: docker.gitea.com/gitea:latest
|
||||
container_name: gitea
|
||||
environment:
|
||||
- USER_UID=1000
|
||||
- USER_GID=1000
|
||||
restart: always
|
||||
volumes:
|
||||
- gitea:/data
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
networks:
|
||||
- s3_net
|
||||
|
||||
dozzle-agent:
|
||||
image: amir20/dozzle:latest
|
||||
command: agent
|
||||
@@ -110,6 +58,3 @@ networks:
|
||||
|
||||
volumes:
|
||||
nginx_logs:
|
||||
xavia_db_data:
|
||||
xavia_blobs:
|
||||
gitea:
|
||||
|
||||
@@ -95,31 +95,4 @@ http {
|
||||
client_max_body_size 500m;
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl;
|
||||
server_name gitea.uber-stup.club;
|
||||
|
||||
ssl_certificate /etc/nginx/certs/fullchain.pem;
|
||||
ssl_certificate_key /etc/nginx/certs/privkey.pem;
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
ssl_ciphers HIGH:!aNULL:!MD5;
|
||||
|
||||
access_log /var/log/nginx/gitea_access.log;
|
||||
error_log /var/log/nginx/gitea_error.log;
|
||||
|
||||
location / {
|
||||
set $upstream http://gitea:3000;
|
||||
proxy_pass $upstream;
|
||||
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 "upgrade";
|
||||
proxy_read_timeout 300s;
|
||||
client_max_body_size 500m;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,8 +23,9 @@ Firewall rules for monitoring stack with Wazuh, Dozzle, Beszel, and VPN infrastr
|
||||
| 51820 | UDP | Any | WireGuard VPN | ALLOW |
|
||||
| 443 | TCP | 10.0.0.0/24 | Wazuh Dashboard (VPN) | ALLOW |
|
||||
| 8080 | TCP | 10.0.0.0/24 | Dozzle logs (VPN) | ALLOW |
|
||||
| 8090 | TCP | 10.0.0.0/24 | Beszel monitoring (VPN) | ALLOW |
|
||||
| 8090 | TCP | 10.0.0.0/24 | Beszel dashboard (VPN only, never public) | ALLOW |
|
||||
| 9000-9001 | TCP | 10.0.0.0/24 | S3/RustFS (VPN) | ALLOW |
|
||||
| 10002 | TCP | 176.116.0.189, 93.185.167.134, 185.139.215.125, 5.252.20.74 (k3s-prod, hors VPN) | Beszel agents k3s — `/api/` uniquement, voir nginx.conf | ALLOW |
|
||||
|
||||
### Outbound Rules (OUTPUT)
|
||||
- **Default:** ACCEPT (all traffic allowed)
|
||||
@@ -138,6 +139,19 @@ Beszel agents installed on all infrastructure servers:
|
||||
|
||||
**Note:** vpn-uber agent is accessible **only from VPN** due to firewall rules.
|
||||
|
||||
### k3s cluster (reverse direction)
|
||||
|
||||
Unlike the servers above (Hub connects OUT to the agent), the k3s DaemonSet
|
||||
agents connect OUT to the Hub instead — cluster nodes aren't on the VPN mesh
|
||||
and there's no single stable "agent" endpoint per pod to dial into. Hub's
|
||||
reverse-connection port (10002, see nginx.conf) is exposed publicly but
|
||||
restricted to the 4 k3s-prod node IPs + `/api/` path only — the dashboard
|
||||
itself (8090) is never touched by this and stays VPN-only.
|
||||
|
||||
| Server | Type | Direction | Port | Access |
|
||||
|--------|------|-----------|------|--------|
|
||||
| k3s-prod (4 nodes) | Kubernetes DaemonSet | Agent → Hub | 10002 (Hub side) | Hub's public IP, restricted to the 4 node IPs (see `omnex/ansible/inventory/host.ini`) |
|
||||
|
||||
---
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
@@ -23,6 +23,7 @@ services:
|
||||
- "10.0.0.2:8080:8080"
|
||||
- "10.0.0.2:8090:8090"
|
||||
- "10.0.0.2:3001:3001"
|
||||
- "10002:10002"
|
||||
volumes:
|
||||
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
|
||||
- ./nginx/certs:/etc/nginx/certs:ro
|
||||
@@ -64,6 +65,11 @@ services:
|
||||
hostname: wazuh.manager
|
||||
container_name: wazuh_manager
|
||||
restart: unless-stopped
|
||||
logging:
|
||||
driver: json-file
|
||||
options:
|
||||
max-size: "20m"
|
||||
max-file: "5"
|
||||
ulimits:
|
||||
memlock:
|
||||
soft: -1
|
||||
@@ -123,7 +129,7 @@ services:
|
||||
soft: 65536
|
||||
hard: 65536
|
||||
environment:
|
||||
- "OPENSEARCH_JAVA_OPTS=-Xms1g -Xmx1g"
|
||||
- "OPENSEARCH_JAVA_OPTS=-Xms2g -Xmx2g"
|
||||
- INDEXER_PASSWORD=${WAZUH_INDEXER_PASSWORD}
|
||||
volumes:
|
||||
- wazuh_indexer_data:/var/lib/wazuh-indexer
|
||||
|
||||
@@ -70,6 +70,19 @@ iptables -A INPUT -p tcp --dport 8090 -s 10.0.0.0/24 -j ACCEPT
|
||||
iptables -A INPUT -p tcp --dport 9000 -s 10.0.0.0/24 -j ACCEPT
|
||||
iptables -A INPUT -p tcp --dport 9001 -s 10.0.0.0/24 -j ACCEPT
|
||||
|
||||
# ─── Agents Beszel k3s (10002, hors VPN) ───────────────────────
|
||||
# Nœuds k3s-prod : pas sur le VPN (voir omnex/ansible/inventory/host.ini),
|
||||
# seule voie possible = leur IP publique. Restreint à ces 4 IP précises
|
||||
# (pas 0.0.0.0/0) ; nginx filtre en plus par chemin (/api/ uniquement,
|
||||
# voir nginx.conf) — le dashboard Beszel (8090) reste VPN-only, inchangé.
|
||||
iptables -A INPUT -p tcp --dport 10002 -s 176.116.0.189 -j ACCEPT # master-k3s
|
||||
iptables -A INPUT -p tcp --dport 10002 -s 93.185.167.134 -j ACCEPT # slave-1-k3s
|
||||
iptables -A INPUT -p tcp --dport 10002 -s 185.139.215.125 -j ACCEPT # slave-2-k3s
|
||||
iptables -A INPUT -p tcp --dport 10002 -s 5.252.20.74 -j ACCEPT # slave-3-k3s
|
||||
iptables -A INPUT -p tcp --dport 1514 -s 176.116.0.189 -j ACCEPT # master-k3s
|
||||
iptables -A INPUT -p tcp --dport 1514 -s 93.185.167.134 -j ACCEPT # slave-1-k3s
|
||||
iptables -A INPUT -p tcp --dport 1514 -s 185.139.215.125 -j ACCEPT # slave-2-k3s
|
||||
iptables -A INPUT -p tcp --dport 1514 -s 5.252.20.74 -j ACCEPT # slave-3-k3s
|
||||
# ─── ICMP ─────────────────────────────────────────────────────
|
||||
iptables -A INPUT -p icmp --icmp-type echo-request -j ACCEPT
|
||||
iptables -A INPUT -p icmp --icmp-type destination-unreachable -j ACCEPT
|
||||
@@ -95,8 +108,9 @@ echo " • Wazuh 1514/tcp FROM pre-prod (185.103.166.112) — agents Wazuh"
|
||||
echo " • VPN 51820/udp — WireGuard"
|
||||
echo " • Wazuh Dashboard 443/tcp FROM 10.0.0.0/24 (VPN)"
|
||||
echo " • Dozzle 8080/tcp FROM 10.0.0.0/24 (VPN)"
|
||||
echo " • Beszel 8090/tcp FROM 10.0.0.0/24 (VPN)"
|
||||
echo " • Beszel 8090/tcp FROM 10.0.0.0/24 (VPN) — dashboard, jamais public"
|
||||
echo " • S3/RustFS 9000-9001/tcp FROM 10.0.0.0/24 (VPN)"
|
||||
echo " • Beszel agents k3s 10002/tcp FROM les 4 IP publiques des nœuds k3s-prod"
|
||||
echo " • OUTPUT (Internet/DNS)"
|
||||
echo ""
|
||||
echo "Règles appliquées (DENY) :"
|
||||
|
||||
@@ -59,6 +59,52 @@ http {
|
||||
}
|
||||
}
|
||||
|
||||
# ── Beszel agents k3s (10002, public) ────────────────────
|
||||
# Port DÉDIÉ aux agents Beszel du cluster k3s (hors VPN, pas d'autre
|
||||
# moyen de les joindre) — distinct du 8090 (dashboard, VPN uniquement).
|
||||
# Même backend (beszel:8090), mais restreint :
|
||||
# - IP source : uniquement les 4 nœuds k3s (pas 0.0.0.0/0)
|
||||
# - Chemin : uniquement /api/ (enregistrement + heartbeat des agents),
|
||||
# tout le reste (dashboard, admin PocketBase sous /_/) renvoie 403 —
|
||||
# à VÉRIFIER après coup (voir access_log) que les agents n'appellent
|
||||
# pas un chemin hors /api/ non couvert ici.
|
||||
server {
|
||||
listen 10002 ssl;
|
||||
server_name _;
|
||||
|
||||
ssl_certificate /etc/nginx/certs/fullchain.pem;
|
||||
ssl_certificate_key /etc/nginx/certs/privkey.pem;
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
ssl_ciphers HIGH:!aNULL:!MD5;
|
||||
|
||||
access_log /var/log/nginx/beszel_agents_access.log;
|
||||
error_log /var/log/nginx/beszel_agents_error.log;
|
||||
|
||||
# Nœuds k3s-prod (voir omnex/ansible/inventory/host.ini) — aucun
|
||||
# autre client de ce port.
|
||||
allow 176.116.0.189; # master-k3s
|
||||
allow 93.185.167.134; # slave-1-k3s
|
||||
allow 185.139.215.125; # slave-2-k3s
|
||||
allow 5.252.20.74; # slave-3-k3s
|
||||
deny all;
|
||||
|
||||
location /api/ {
|
||||
proxy_pass http://beszel:8090;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
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_read_timeout 3600s;
|
||||
}
|
||||
|
||||
location / {
|
||||
return 403;
|
||||
}
|
||||
}
|
||||
|
||||
# ── Wazuh (443) ──────────────────────────────────────────
|
||||
server {
|
||||
listen 443 ssl default_server;
|
||||
|
||||
Reference in New Issue
Block a user