From dc91d70569bf027b92bc077acd445f38adc29134 Mon Sep 17 00:00:00 2001 From: Zikil Date: Fri, 1 Nov 2024 15:20:06 +0700 Subject: [PATCH] for aipmanager --- ecosystem.config.js | 9 +++++++++ app/main.py => main.py | 7 ++++++- passenger_wsgi.py | 11 +++++++++++ {app/static => static}/.DS_Store | Bin {app/static => static}/img/.DS_Store | Bin {app/static => static}/img/air-filter.jpg | Bin {app/static => static}/img/b1.jpg | Bin {app/static => static}/img/cabin-filter.jpg | Bin .../img/certificates/сертификат1.png | Bin .../img/certificates/сертификат2.png | Bin .../img/certificates/сертификат3.png | Bin .../img/certificates/сертификат4.png | Bin {app/static => static}/img/fuel-filter.jpg | Bin {app/static => static}/img/oil-filter.jpg | Bin {app/static => static}/img/pbanner.jpg | Bin {app/static => static}/img/salon-filter.jpg | Bin {app/static => static}/js/main.js | 0 {app/templates => templates}/.DS_Store | Bin {app/templates => templates}/about.html | 0 {app/templates => templates}/base.html | 0 {app/templates => templates}/catalog.html | 0 .../catalog_air-filters.html | 0 .../catalog_cabin-filters.html | 0 .../catalog_fuel-filters.html | 0 .../catalog_oil-filters.html | 0 {app/templates => templates}/certificates.html | 0 {app/templates => templates}/contacts.html | 0 {app/templates => templates}/index.html | 0 28 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 ecosystem.config.js rename app/main.py => main.py (95%) create mode 100644 passenger_wsgi.py rename {app/static => static}/.DS_Store (100%) rename {app/static => static}/img/.DS_Store (100%) rename {app/static => static}/img/air-filter.jpg (100%) rename {app/static => static}/img/b1.jpg (100%) rename {app/static => static}/img/cabin-filter.jpg (100%) rename {app/static => static}/img/certificates/сертификат1.png (100%) rename {app/static => static}/img/certificates/сертификат2.png (100%) rename {app/static => static}/img/certificates/сертификат3.png (100%) rename {app/static => static}/img/certificates/сертификат4.png (100%) rename {app/static => static}/img/fuel-filter.jpg (100%) rename {app/static => static}/img/oil-filter.jpg (100%) rename {app/static => static}/img/pbanner.jpg (100%) rename {app/static => static}/img/salon-filter.jpg (100%) rename {app/static => static}/js/main.js (100%) rename {app/templates => templates}/.DS_Store (100%) rename {app/templates => templates}/about.html (100%) rename {app/templates => templates}/base.html (100%) rename {app/templates => templates}/catalog.html (100%) rename {app/templates => templates}/catalog_air-filters.html (100%) rename {app/templates => templates}/catalog_cabin-filters.html (100%) rename {app/templates => templates}/catalog_fuel-filters.html (100%) rename {app/templates => templates}/catalog_oil-filters.html (100%) rename {app/templates => templates}/certificates.html (100%) rename {app/templates => templates}/contacts.html (100%) rename {app/templates => templates}/index.html (100%) diff --git a/ecosystem.config.js b/ecosystem.config.js new file mode 100644 index 0000000..7d5fee4 --- /dev/null +++ b/ecosystem.config.js @@ -0,0 +1,9 @@ +module.exports = { + "apps" : [ + { + "name" : "wanlanda.ru", + "script" : "main.py" + } + ] + } + \ No newline at end of file diff --git a/app/main.py b/main.py similarity index 95% rename from app/main.py rename to main.py index ed4693f..3b0d5a5 100644 --- a/app/main.py +++ b/main.py @@ -4,6 +4,8 @@ from fastapi.staticfiles import StaticFiles from fastapi.templating import Jinja2Templates from pydantic import BaseModel, EmailStr from aiogram import Bot, Dispatcher +from fastapi.middleware.wsgi import WSGIMiddleware +import uvicorn BOT_TOKEN = '7102060229:AAE4SWmgKXkCBC482l8Ble5lKzlCV2YIWnM' ID = '340394898' @@ -14,6 +16,9 @@ bot = Bot( # Образ Бота app = FastAPI() +# Для совместимости с WSGI +application = WSGIMiddleware(app) + # Монтирование статических файлов app.mount("/static", StaticFiles(directory="app/static"), name="static") @@ -102,4 +107,4 @@ Email: {form_data.email} if __name__ == "__main__": import uvicorn - uvicorn.run(app, host="0.0.0.0", port=8000) \ No newline at end of file + uvicorn.run(app, host="0.0.0.0", port=20001) \ No newline at end of file diff --git a/passenger_wsgi.py b/passenger_wsgi.py new file mode 100644 index 0000000..d0e0d61 --- /dev/null +++ b/passenger_wsgi.py @@ -0,0 +1,11 @@ +import sys + +import os + +INTERP = os.path.expanduser("/var/www/www-root/data/www/sybiko.ru/.venv/bin/python") +if sys.executable != INTERP: + os.execl(INTERP, INTERP, *sys.argv) + +sys.path.append(os.getcwd()) + +from main import application \ No newline at end of file diff --git a/app/static/.DS_Store b/static/.DS_Store similarity index 100% rename from app/static/.DS_Store rename to static/.DS_Store diff --git a/app/static/img/.DS_Store b/static/img/.DS_Store similarity index 100% rename from app/static/img/.DS_Store rename to static/img/.DS_Store diff --git a/app/static/img/air-filter.jpg b/static/img/air-filter.jpg similarity index 100% rename from app/static/img/air-filter.jpg rename to static/img/air-filter.jpg diff --git a/app/static/img/b1.jpg b/static/img/b1.jpg similarity index 100% rename from app/static/img/b1.jpg rename to static/img/b1.jpg diff --git a/app/static/img/cabin-filter.jpg b/static/img/cabin-filter.jpg similarity index 100% rename from app/static/img/cabin-filter.jpg rename to static/img/cabin-filter.jpg diff --git a/app/static/img/certificates/сертификат1.png b/static/img/certificates/сертификат1.png similarity index 100% rename from app/static/img/certificates/сертификат1.png rename to static/img/certificates/сертификат1.png diff --git a/app/static/img/certificates/сертификат2.png b/static/img/certificates/сертификат2.png similarity index 100% rename from app/static/img/certificates/сертификат2.png rename to static/img/certificates/сертификат2.png diff --git a/app/static/img/certificates/сертификат3.png b/static/img/certificates/сертификат3.png similarity index 100% rename from app/static/img/certificates/сертификат3.png rename to static/img/certificates/сертификат3.png diff --git a/app/static/img/certificates/сертификат4.png b/static/img/certificates/сертификат4.png similarity index 100% rename from app/static/img/certificates/сертификат4.png rename to static/img/certificates/сертификат4.png diff --git a/app/static/img/fuel-filter.jpg b/static/img/fuel-filter.jpg similarity index 100% rename from app/static/img/fuel-filter.jpg rename to static/img/fuel-filter.jpg diff --git a/app/static/img/oil-filter.jpg b/static/img/oil-filter.jpg similarity index 100% rename from app/static/img/oil-filter.jpg rename to static/img/oil-filter.jpg diff --git a/app/static/img/pbanner.jpg b/static/img/pbanner.jpg similarity index 100% rename from app/static/img/pbanner.jpg rename to static/img/pbanner.jpg diff --git a/app/static/img/salon-filter.jpg b/static/img/salon-filter.jpg similarity index 100% rename from app/static/img/salon-filter.jpg rename to static/img/salon-filter.jpg diff --git a/app/static/js/main.js b/static/js/main.js similarity index 100% rename from app/static/js/main.js rename to static/js/main.js diff --git a/app/templates/.DS_Store b/templates/.DS_Store similarity index 100% rename from app/templates/.DS_Store rename to templates/.DS_Store diff --git a/app/templates/about.html b/templates/about.html similarity index 100% rename from app/templates/about.html rename to templates/about.html diff --git a/app/templates/base.html b/templates/base.html similarity index 100% rename from app/templates/base.html rename to templates/base.html diff --git a/app/templates/catalog.html b/templates/catalog.html similarity index 100% rename from app/templates/catalog.html rename to templates/catalog.html diff --git a/app/templates/catalog_air-filters.html b/templates/catalog_air-filters.html similarity index 100% rename from app/templates/catalog_air-filters.html rename to templates/catalog_air-filters.html diff --git a/app/templates/catalog_cabin-filters.html b/templates/catalog_cabin-filters.html similarity index 100% rename from app/templates/catalog_cabin-filters.html rename to templates/catalog_cabin-filters.html diff --git a/app/templates/catalog_fuel-filters.html b/templates/catalog_fuel-filters.html similarity index 100% rename from app/templates/catalog_fuel-filters.html rename to templates/catalog_fuel-filters.html diff --git a/app/templates/catalog_oil-filters.html b/templates/catalog_oil-filters.html similarity index 100% rename from app/templates/catalog_oil-filters.html rename to templates/catalog_oil-filters.html diff --git a/app/templates/certificates.html b/templates/certificates.html similarity index 100% rename from app/templates/certificates.html rename to templates/certificates.html diff --git a/app/templates/contacts.html b/templates/contacts.html similarity index 100% rename from app/templates/contacts.html rename to templates/contacts.html diff --git a/app/templates/index.html b/templates/index.html similarity index 100% rename from app/templates/index.html rename to templates/index.html