From 20f327e2014ed8f7161fe2f54afcdc339b3931ef Mon Sep 17 00:00:00 2001 From: ddadmin Date: Sat, 19 Jul 2025 08:02:08 +0300 Subject: [PATCH] update --- .env | 8 +++--- configs/centrifugo/config.json | 10 +++++++ configs/nginx/conf.d/cabinet.conf | 8 ++++++ configs/nginx/conf.d/demo.conf | 7 +++++ configs/nginx/conf.d/demows.conf | 45 +++++++++++++++++++++++++++++++ configs/php/.env | 2 +- configs/php/.env.local | 33 ++++++++++++++--------- docker-compose.yml | 21 +++++++++++++++ 8 files changed, 116 insertions(+), 18 deletions(-) create mode 100644 configs/centrifugo/config.json create mode 100644 configs/nginx/conf.d/demows.conf diff --git a/.env b/.env index c65b763..235b6a4 100644 --- a/.env +++ b/.env @@ -1,12 +1,12 @@ -COMPOSE_PROJECT_NAME=spottorg +1COMPOSE_PROJECT_NAME=spottorg NETWORK=spottorg FRONT_TAG=develop -DOTDOT_TAG=DDB-1768-BACK -LMS_TAG=master +DOTDOT_TAG=develop +LMS_TAG=develop ADMIN_TAG=master LANDING_TAG=master -CABINET_TAG=DD-4000_TD-436 +CABINET_TAG=develop MYSQL_PORT=0.0.0.0:33063 MYSQL_ROOT_PASSWORD=root diff --git a/configs/centrifugo/config.json b/configs/centrifugo/config.json new file mode 100644 index 0000000..236584b --- /dev/null +++ b/configs/centrifugo/config.json @@ -0,0 +1,10 @@ +{ + "token_hmac_secret_key": "6085d43b-f55b-4387-9dff-3c9abf385dc8", + "admin_password": "bc24acd1-b885-4108-b3cf-971dffca6934", + "admin_secret": "ca0a7656-f589-42e6-9e49-98dd3c5beb46", + "api_key": "aa7443fb-e623-4363-91ac-ef25908b1403", + "admin": true, + "allowed_origins": ["http://dot-dot.local", "https://dot-dot.ru", "https://lms.dot-dot.ru", "https://demo.dot-dot.ru", "https://demo.spottorg.ru", "https://democabinet.spottorg.ru"], + "allow_subscribe_for_client": true, + "allow_user_limited_channels": true +} diff --git a/configs/nginx/conf.d/cabinet.conf b/configs/nginx/conf.d/cabinet.conf index 5929f04..5bf947d 100644 --- a/configs/nginx/conf.d/cabinet.conf +++ b/configs/nginx/conf.d/cabinet.conf @@ -91,8 +91,16 @@ server { location /robots.txt { proxy_pass http://static; + } + + location /connection/websocket { + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + proxy_pass http://centrifugo; } + location ~ ^/index\.php(/|$) { if ($request_method = 'OPTIONS') { add_header 'Access-Control-Allow-Origin' $http_origin; diff --git a/configs/nginx/conf.d/demo.conf b/configs/nginx/conf.d/demo.conf index ea1c28b..827bd9d 100755 --- a/configs/nginx/conf.d/demo.conf +++ b/configs/nginx/conf.d/demo.conf @@ -99,6 +99,13 @@ server { proxy_pass http://static; } + location /connection/websocket { + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + proxy_pass http://centrifugo; + } + location ~ ^/index\.php(/|$) { if ($request_method = 'OPTIONS') { add_header 'Access-Control-Allow-Origin' $http_origin; diff --git a/configs/nginx/conf.d/demows.conf b/configs/nginx/conf.d/demows.conf new file mode 100644 index 0000000..1ae205c --- /dev/null +++ b/configs/nginx/conf.d/demows.conf @@ -0,0 +1,45 @@ +server { + listen 80; + server_name demows.spottorg.ru; + return 301 https://$server_name$request_uri; +} + +upstream centrifugo { + server centrifugo:8000; +} + +server { + listen 443 ssl; + server_name demows.spottorg.ru; + + access_log /var/log/nginx/ws.spottorg.ru_access.log json; + error_log /var/log/nginx/ws.spottorg.ru_error.log; + + ssl_certificate /etc/letsencrypt/live/spottorg.ru/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/spottorg.ru/privkey.pem; + ssl_trusted_certificate /etc/letsencrypt/live/spottorg.ru/chain.pem; + + location / { + proxy_pass_header Server; + proxy_set_header Host $http_host; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_pass http://centrifugo; + } + location /socket { + proxy_buffering off; + proxy_set_header X-Real-IP $remote_addr; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection $connection_upgrade; + proxy_pass http://centrifugo; + } + location /connection { + proxy_buffering off; + proxy_set_header X-Real-IP $remote_addr; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection $connection_upgrade; + proxy_pass http://centrifugo; + } +} diff --git a/configs/php/.env b/configs/php/.env index c435f28..cf0b6c5 100755 --- a/configs/php/.env +++ b/configs/php/.env @@ -143,7 +143,7 @@ ACCOUNTING_AUDIT_URL=https://crm.spottorg.ru ACCOUNTING_AUDIT_LOGIN=secret ACCOUNTING_AUDIT_PASSWORD=secret -APP_LMS_HOST=demolms.spottorg.ru +APP_LMS_HOST=demo.spottorg.ru APP_CARGO_CARRIER_HOST=democabinet.spottorg.ru diff --git a/configs/php/.env.local b/configs/php/.env.local index 6d67af5..ec20e6b 100755 --- a/configs/php/.env.local +++ b/configs/php/.env.local @@ -1,4 +1,5 @@ CONTAINER_NAME=php + APP_ENV=dev NotificationBuildServicejSP_KEY=16e93b225c730920ac5741a8d8df788f @@ -36,7 +37,7 @@ VOICIA_CALL_ID=1949 ###< voicia ### ###> ml_calculator ### -ML_CALCULATOR_URL=https://ml.spottorg.ru/v2/classification/order/relevance +ML_CALCULATOR_URL=https://ml.dot-dot.ru/v2/classification/order/relevance ###< ml_calculator ### ###> comagic ### @@ -45,15 +46,15 @@ COMAGIC_KEY=j769gveux0brdq7wb6insegwtczvz7nsqmuntkqv ###< comagic ### ###> carrier_scoring ### -ML_CARRIER_SCORING=https://ml.spottorg.ru/v2/classification/carrier/scoring +ML_CARRIER_SCORING=https://ml.dot-dot.ru/v2/classification/carrier/scoring ###< carrier_scoring ### ###> direction_scoring ### -ML_DIRECTION_SCORING_URL=https://ml.spottorg.ru/v3/classification/direction/confidence +ML_DIRECTION_SCORING_URL=https://ml.dot-dot.ru/v3/classification/direction/confidence ###< direction_scoring ### ###> direction_recalculate ### -ML_DIRECTION_RECALCULATE_URL=https://ml.spottorg.ru/v2/schedule/calculate +ML_DIRECTION_RECALCULATE_URL=https://ml.dot-dot.ru/v2/schedule/calculate ###< direction_recalculate ### ###< Vozovoz ### @@ -113,11 +114,11 @@ SOVKOM_API_KEY=AAk6UcV88xCCC26654rM SOVKOM_API_URL=https://testout.sovcomins.ru ###< SOVKOMTEST### -ML_REGULAR_DIRECTION_RELEVANCE_CARRIERS_URL=https://ml.spottorg.ru/v2/schedule/carrier/scoring +ML_REGULAR_DIRECTION_RELEVANCE_CARRIERS_URL=https://ml.dot-dot.ru/v2/schedule/carrier/scoring -ML_REGULAR_DIRECTION_URL=https://ml.spottorg.ru/v2/schedule/transport +ML_REGULAR_DIRECTION_URL=https://ml.dot-dot.ru/v2/schedule/transport -ACCOUNTING_AUDIT_URL="https://crm.spottorg.ru/TTLBuhreport/hs/TT/reconciliationreport" +ACCOUNTING_AUDIT_URL="https://crm.dot-dot.ru/TTLBuhreport/hs/TT/reconciliationreport" ###> YandexTracker ### YTRACKER_API_TOKEN="y0_AgAEA7qkKFmeAAjF8AAAAADXovQd6htdkt7LTDW_sNHCz7qV9zdVHaQ" @@ -132,15 +133,17 @@ SENTRY_SERVER_NAME=pre-prod SENTRY_SERVER_USER_NAME=admin ###< sentry/sentry-symfony ### -ML_CALCULATOR_TRADE_ONLY_URL=https://ml.spottorg.ru/v1/tender/price +ML_CALCULATOR_TRADE_ONLY_URL=https://ml.dot-dot.ru/v1/tender/price -ML_REGULAR_DIRECTION_HISTORY_ORDER_URL=https://ml.spottorg.ru/v1/schedule/transport/orders +ML_REGULAR_DIRECTION_HISTORY_ORDER_URL=https://ml.dot-dot.ru/v1/schedule/transport/orders #QUEUE_DSN_OC_CARRIER_OFFERS=amqp://guest:guest@rabbitmq:5672/%2f/OC_CARRIER_OFFERS #QUEUE_DSN_STATISTIC_EXPORT=amqp://guest:guest@rabbitmq:5672/%2f/STATISTIC_EXPORT QUEUE_DSN_OC_CARRIER_OFFERS=amqp://ddadmin:Utahth9aeshahgh3saik@rabbitmq:5672/%2f/OC_CARRIER_OFFERS QUEUE_DSN_STATISTIC_EXPORT=amqp://ddadmin:Utahth9aeshahgh3saik@rabbitmq:5672/%2f/STATISTIC_EXPORT QUEUE_DSN_RELEVANT_CARRIER_EXPORT=amqp://ddadmin:Utahth9aeshahgh3saik@rabbitmq:5672/%2f/RELEVANT_CARRIER_EXPORT +QUEUE_DSN_ORDER_IMPORT=amqp://ddadmin:Utahth9aeshahgh3saik@rabbitmq:5672/%2f/ORDER_IMPORT +QUEUE_DSN_WS_ORDER_STATE_UPDATE=amqp://ddadmin:Utahth9aeshahgh3saik@rabbitmq:5672/%2f/WS_ORDER_STATE_UPDATE CRYPTOPRO_PATH='/opt/cprocsp/bin/amd64/cryptcp -sign -dn '"ООО ""ТОЧКА-ТОЧКА ЛОГИСТИКА"""' -der' SIGNED_DOC_PATH="/application/var/documents/signeddocs" @@ -167,16 +170,16 @@ OTK_API_TOKEN="Q5vBE9jusg38Rk7wHt2bzycT4K6pePFZ" ACCOUNTING_AUDIT_LOGIN=ReportServis ACCOUNTING_AUDIT_PASSWORD=fE7mubiv -ML_CALCULATOR_SPOT_URL=https://ml.spottorg.ru/v1/price_calculator/spot +ML_CALCULATOR_SPOT_URL=https://ml.dot-dot.ru/v1/price_calculator/spot ###DD-3705### -ML_CARRIER_SCORING=https://ml.spottorg.ru/v3/classification/carrier/scoring +ML_CARRIER_SCORING=https://ml.dot-dot.ru/v3/classification/carrier/scoring QUEUE_DSN_RELEVANT_CARRIER_EXPORT=amqp://ddadmin:Utahth9aeshahgh3saik@rabbitmq:5672/%2f/RELEVANT_CARRIER_EXPORT ###DD-3705### PLATFORM_NAME=СПОТТОРГ -APP_LMS_HOST=demolms.spottorg.ru +APP_LMS_HOST=demo.spottorg.ru APP_CARGO_CARRIER_HOST=democabinet.spottorg.ru @@ -188,5 +191,9 @@ SIGNER_DOCS_API_TOKEN='siofdhgt2349875t3iqhf1h2g*^&^%&^GHJGJCxgf' QUEUE_DSN_AUCTION_CARRIER_VERIFICATION=amqp://ddadmin:Utahth9aeshahgh3saik@rabbitmq:5672/%2f/AUCTION_CARRIER_VERIFICATION -AILER_DSN_YANDEX=smtp://no_reply@dot-dot.ru:gqwaofmeyvxefrqk@smtp.yandex.ru:587 +MAILER_DSN_YANDEX=smtp://no_reply@dot-dot.ru:gqwaofmeyvxefrqk@smtp.yandex.ru:587 MAILER_DSN=smtp://no_reply@dot-dot.ru:NRTk7rXhesHQpi3YWB92@smtp.mail.ru:465 + +CENTRIFUGAL_API_ENDPOINT_URL=http://centrifugo:8000/api +CENTRIFUGAL_API_KEY='aa7443fb-e623-4363-91ac-ef25908b1403' +CENTRIFUGAL_TOKEN_HMAC_SECRET_KEY='6085d43b-f55b-4387-9dff-3c9abf385dc8' diff --git a/docker-compose.yml b/docker-compose.yml index 29c32e2..8ea2f56 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -79,6 +79,14 @@ services: <<: *defaults-php command: sh -c 'while true; do echo run; ./bin/console app:auction:process; sleep 60;done' + import-order: + <<: *defaults-php + command: ./bin/console messenger:consume OrderImport + + update-order: + <<: *defaults-php + command: ./bin/console messenger:consume WSOrderStateUpdate + static: image: registry.dot-dot.ru/dot-dot-static:${DOTDOT_TAG} restart: unless-stopped @@ -201,3 +209,16 @@ services: restart: unless-stopped networks: - dd + + centrifugo: + image: centrifugo/centrifugo:v5 + volumes: + - ./configs/centrifugo/config.json:/centrifugo/config.json + command: centrifugo -c config.json + ulimits: + nofile: + soft: 65535 + hard: 65535 + restart: unless-stopped + networks: + - dd