Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -24,7 +24,10 @@ BOT_TOKEN = os.environ.get("botvpntoken")
|
|
| 24 |
if not BOT_TOKEN:
|
| 25 |
raise SystemExit("❌ Не найден ENV botvpntoken")
|
| 26 |
|
| 27 |
-
|
|
|
|
|
|
|
|
|
|
| 28 |
PORT = int(os.environ.get("PORT", "7860"))
|
| 29 |
|
| 30 |
SUBSCRIPTION_URLS = [
|
|
@@ -47,7 +50,6 @@ PROTOCOL_URLS = {
|
|
| 47 |
}
|
| 48 |
|
| 49 |
# ====== SQLITE ======
|
| 50 |
-
os.makedirs("/data", exist_ok=True)
|
| 51 |
def db():
|
| 52 |
conn = sqlite3.connect(DB_PATH)
|
| 53 |
conn.row_factory = sqlite3.Row
|
|
|
|
| 24 |
if not BOT_TOKEN:
|
| 25 |
raise SystemExit("❌ Не найден ENV botvpntoken")
|
| 26 |
|
| 27 |
+
# База будет лежать внутри /app/data
|
| 28 |
+
DB_PATH = os.path.join(os.path.dirname(__file__), "data", "bot.db")
|
| 29 |
+
os.makedirs(os.path.dirname(DB_PATH), exist_ok=True)
|
| 30 |
+
|
| 31 |
PORT = int(os.environ.get("PORT", "7860"))
|
| 32 |
|
| 33 |
SUBSCRIPTION_URLS = [
|
|
|
|
| 50 |
}
|
| 51 |
|
| 52 |
# ====== SQLITE ======
|
|
|
|
| 53 |
def db():
|
| 54 |
conn = sqlite3.connect(DB_PATH)
|
| 55 |
conn.row_factory = sqlite3.Row
|