ready for public

This commit is contained in:
2025-04-01 12:13:39 -04:00
parent eb5d9bc3f9
commit 0754f332c9
12 changed files with 36 additions and 31 deletions

View File

@@ -4,15 +4,11 @@ from views.user_views import user
from views.group_views import group
from config import app_config
from database import init_app
import logging
import os, logging
from logging.handlers import RotatingFileHandler
import os
log_to_file = os.getenv('LOG_TO_FILE', 'false').lower() == 'true'
log_file_path = os.getenv('LOG_FILE_PATH', '/app/logs/app.log')
if log_to_file:
handler = RotatingFileHandler(log_file_path, maxBytes=1000000, backupCount=3)
if app.config['LOG_TO_FILE']:
handler = RotatingFileHandler(app.config['LOG_FILE_PATH'], maxBytes=1000000, backupCount=3)
handler.setLevel(logging.INFO)
app.logger.addHandler(handler)

View File

@@ -1,15 +1,20 @@
import os
class Config:
"""Base configuration."""
DEBUG = False
TESTING = False
SQLALCHEMY_TRACK_MODIFICATIONS = False
SECRET_KEY = os.getenv('FLASK_SECRET_KEY', 'default-insecure-key')
# Logging
LOG_TO_FILE = os.getenv('LOG_TO_FILE', 'false').lower() == 'true'
LOG_FILE_PATH = os.getenv('LOG_FILE_PATH', '/app/logs/app.log')
# MAC Lookup API
OUI_API_URL = os.getenv('OUI_API_URL', 'https://api.maclookup.app/v2/macs/{}')
OUI_API_KEY = os.getenv('OUI_API_KEY', '')
OUI_API_LIMIT_PER_SEC = int(os.getenv('OUI_API_LIMIT_PER_SEC', '2'))
OUI_API_DAILY_LIMIT = int(os.getenv('OUI_API_DAILY_LIMIT', '10000'))
OUI_API_DAILY_LIMIT = int(os.getenv('OUI_API_DAILY_LIMIT', '10000'))
class DevelopmentConfig(Config):
"""Development configuration."""

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 262 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 728 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
app/static/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -228,9 +228,9 @@ def refresh_vendors():
db = get_db()
cursor = db.cursor(dictionary=True)
api_url = os.getenv('MACLOOKUP_API_URL', 'https://api.maclookup.app/v2/macs/{}').strip('"')
api_key = os.getenv('MACLOOKUP_API_KEY', '').strip('"')
limit = int(os.getenv('MACLOOKUP_RATE_LIMIT', 2))
api_url = os.getenv('OUI_API_API_URL', 'https://api.maclookup.app/v2/macs/{}').strip('"')
api_key = os.getenv('OUI_API_API_KEY', '').strip('"')
limit = int(os.getenv('OUI_API_RATE_LIMIT', 2))
headers = {'Authorization': f'Bearer {api_key}'} if api_key else {}
cursor.execute("""