config file is web only

This commit is contained in:
msramalho
2025-02-11 19:13:33 +00:00
parent f24f88c44b
commit 606e69587b
12 changed files with 15 additions and 15 deletions

14
app/web/config.py Normal file
View File

@@ -0,0 +1,14 @@
VERSION = "0.9.0"
API_DESCRIPTION = """
#### API for the Auto-Archiver project, a tool to archive web pages and Google Sheets.
**Usage notes:**
- The API requires a Bearer token for most operations, which you can obtain by logging in with your Google account.
- You can use this API to archive single URLs or entire Google Sheets.
- Once you submit a URL or Sheet for archiving, the API will return a task_id that you can use to check the status of the archiving process. It works asynchronously.
"""
BREAKING_CHANGES = {"minVersion": "0.3.1", "message": "The latest update has breaking changes, please update the extension to the most recent version."}
# changing this will corrupt the database logic
ALLOW_ANY_EMAIL = "*"

View File

@@ -6,7 +6,7 @@ from loguru import logger
from datetime import datetime, timedelta
from sqlalchemy.ext.asyncio import AsyncSession
from app.shared.config import ALLOW_ANY_EMAIL
from app.web.config import ALLOW_ANY_EMAIL
from app.shared.db.database import get_db
from app.shared.db import models
from app.shared.settings import get_settings

View File

@@ -3,7 +3,7 @@ from typing import Dict
from fastapi import APIRouter, Depends, Request, HTTPException
from fastapi.responses import FileResponse, JSONResponse
from app.shared.config import VERSION, BREAKING_CHANGES
from app.web.config import VERSION, BREAKING_CHANGES
from app.shared.log import log_error
from app.web.db import crud
from app.shared.schemas import ActiveUser, UsageResponse

View File

@@ -7,7 +7,7 @@ from auto_archiver import Metadata
from sqlalchemy.orm import Session
from app.shared.aa_utils import get_all_urls
from app.shared.config import ALLOW_ANY_EMAIL
from app.web.config import ALLOW_ANY_EMAIL
from app.shared import business_logic, schemas
from app.shared.db import worker_crud
from app.shared.db.database import get_db_dependency

View File

@@ -5,7 +5,7 @@ from datetime import datetime
from loguru import logger
from sqlalchemy.orm import Session
from app.shared.config import ALLOW_ANY_EMAIL
from app.web.config import ALLOW_ANY_EMAIL
from app.shared import schemas
from app.shared.task_messaging import get_celery
from app.web.security import get_token_or_user_auth, get_user_state

View File

@@ -17,7 +17,7 @@ from app.shared.task_messaging import get_celery
from app.web.db import crud
from app.web.security import get_user_auth, token_api_key_auth, get_token_or_user_auth
from app.shared.config import VERSION, API_DESCRIPTION
from app.web.config import VERSION, API_DESCRIPTION
from app.shared.db.database import get_db_dependency
from app.web.events import lifespan
from app.shared.settings import get_settings

View File

@@ -3,7 +3,7 @@ import requests, secrets
from fastapi import HTTPException, status, Depends
from fastapi.security import HTTPBearer, HTTPAuthorizationCredentials
from app.shared.config import ALLOW_ANY_EMAIL
from app.web.config import ALLOW_ANY_EMAIL
from app.shared.settings import get_settings
from app.shared.db.database import get_db
from app.web.db.user_state import UserState