ready for public
This commit is contained in:
10
app/app.py
10
app/app.py
@@ -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)
|
||||
|
||||
|
||||
@@ -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."""
|
||||
|
||||
BIN
app/static/android-chrome-192x192.png
Normal file
BIN
app/static/android-chrome-192x192.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 29 KiB |
BIN
app/static/android-chrome-512x512.png
Normal file
BIN
app/static/android-chrome-512x512.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 262 KiB |
BIN
app/static/apple-touch-icon.png
Normal file
BIN
app/static/apple-touch-icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 26 KiB |
BIN
app/static/favicon-16x16.png
Normal file
BIN
app/static/favicon-16x16.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 728 B |
BIN
app/static/favicon-32x32.png
Normal file
BIN
app/static/favicon-32x32.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
BIN
app/static/favicon.ico
Normal file
BIN
app/static/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
@@ -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("""
|
||||
|
||||
Reference in New Issue
Block a user