From a4e7b96d29755ff10dff7d2d53f4bfcfc2e1837e Mon Sep 17 00:00:00 2001 From: John Howe <89397553+timerring@users.noreply.github.com> Date: Sun, 1 Mar 2026 10:16:42 +0800 Subject: [PATCH] fix: remove nginx, restore imagine_fast selects, clean up docker-compose - Remove nginx service and nginx/ directory (not in main branch) - Restore imagine_fast size/response_format select inputs - Revert grok2api to ports: 8000:8000 (direct expose) - Remove dev-testing source mounts from docker-compose - Restore warp port to 1080 --- app/static/admin/js/config.js | 16 ++++++++++++++++ docker-compose.yml | 29 +++++++++-------------------- nginx/conf/default.conf | 28 ---------------------------- 3 files changed, 25 insertions(+), 48 deletions(-) delete mode 100644 nginx/conf/default.conf diff --git a/app/static/admin/js/config.js b/app/static/admin/js/config.js index a8a960ba..d2a55c52 100644 --- a/app/static/admin/js/config.js +++ b/app/static/admin/js/config.js @@ -461,6 +461,22 @@ function buildFieldCard(section, key, val) { { val: 'url', text: 'URL' } ]); } + else if (section === 'imagine_fast' && key === 'size') { + built = buildSelectInput(section, key, val, [ + { val: '1024x1024', text: '1024x1024 (1:1)' }, + { val: '1280x720', text: '1280x720 (16:9)' }, + { val: '720x1280', text: '720x1280 (9:16)' }, + { val: '1792x1024', text: '1792x1024 (3:2)' }, + { val: '1024x1792', text: '1024x1792 (2:3)' } + ]); + } + else if (section === 'imagine_fast' && key === 'response_format') { + built = buildSelectInput(section, key, val, [ + { val: 'url', text: 'URL' }, + { val: 'b64_json', text: 'B64 JSON' }, + { val: 'base64', text: 'Base64' } + ]); + } else if (Array.isArray(val) || typeof val === 'object') { built = buildJsonInput(section, key, val); } diff --git a/docker-compose.yml b/docker-compose.yml index 472274e7..357ecb63 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,8 +2,8 @@ services: grok2api: container_name: grok2api image: ghcr.io/chenyme/grok2api:latest - expose: - - "8000" + ports: + - "8000:8000" environment: TZ: Asia/Shanghai LOG_LEVEL: INFO @@ -14,12 +14,15 @@ services: # FLARESOLVERR_URL: http://flaresolverr:8191 # CF_REFRESH_INTERVAL: "600" # CF_TIMEOUT: "60" + + # SERVER_STORAGE_TYPE: (local, redis, mysql, pgsql) default: local + # SERVER_STORAGE_URL: (local mode is empty) default: empty + # Redis: redis://localhost:6379/0 or redis://:password@localhost:6379/0 + # MySQL: mysql+aiomysql://user:pass@localhost/db + # PgSQL: postgresql+asyncpg://user:pass@localhost/db volumes: - ./data:/app/data - ./logs:/app/logs - - ./config.defaults.toml:/app/config.defaults.toml:ro - - ./main.py:/app/main.py:ro - - ./app:/app/app:ro restart: unless-stopped warp: @@ -27,26 +30,12 @@ services: image: caomingjun/warp:latest restart: unless-stopped ports: - - "127.0.0.1:1180:1080" + - "127.0.0.1:1080:1080" environment: - WARP_SLEEP=2 cap_add: - NET_ADMIN - nginx: - container_name: nginx-proxy - image: nginx:alpine - ports: - - "80:80" - - "443:443" - - "8000:8000" - volumes: - - ./nginx/conf/default.conf:/etc/nginx/conf.d/default.conf:ro - - ./nginx/certs:/etc/nginx/certs:ro - depends_on: - - grok2api - restart: unless-stopped - flaresolverr: container_name: flaresolverr image: ghcr.io/flaresolverr/flaresolverr:latest diff --git a/nginx/conf/default.conf b/nginx/conf/default.conf deleted file mode 100644 index 085c85c3..00000000 --- a/nginx/conf/default.conf +++ /dev/null @@ -1,28 +0,0 @@ -upstream grok2api { - server grok2api:8000; -} - -server { - listen 80; - listen 8000; - server_name _; - - client_max_body_size 50M; - - location / { - proxy_pass http://grok2api; - 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; - - # SSE / streaming support - proxy_buffering off; - proxy_cache off; - proxy_read_timeout 300s; - proxy_send_timeout 300s; - proxy_http_version 1.1; - proxy_set_header Connection ''; - chunked_transfer_encoding on; - } -}