getting ready to public

This commit is contained in:
2025-04-01 10:52:59 -04:00
parent 1a51ded5fc
commit eb5d9bc3f9
9 changed files with 116 additions and 5 deletions

View File

@@ -1,13 +1,23 @@
FROM python:3.9-slim
# Set working directory
WORKDIR /app
COPY requirements.txt .
# Create logs directory
RUN mkdir -p /app/logs
# Install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
RUN apt-get update && apt-get install -y iputils-ping telnet # Add these lines
# Optional tools (useful for debugging)
RUN apt-get update && apt-get install -y iputils-ping telnet && apt-get clean
# Copy application code
COPY . .
CMD ["python", "app.py"]
# Expose port (optional, for documentation)
EXPOSE 8080
# Default command to run app with Gunicorn
CMD ["gunicorn", "--bind", "0.0.0.0:8080", "wsgi:app"]

Binary file not shown.

Binary file not shown.

View File

@@ -4,6 +4,19 @@ from views.user_views import user
from views.group_views import group
from config import app_config
from database import init_app
import 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)
handler.setLevel(logging.INFO)
app.logger.addHandler(handler)
app.logger.setLevel(logging.INFO)
app = Flask(__name__)
app.config.from_object(app_config)

View File

@@ -2,4 +2,5 @@ Flask
mysql-connector-python
requests
BeautifulSoup4
lxml
lxml
gunicorn

View File

@@ -1,6 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="icon" href="/static/favicon.ico" type="image/x-icon">
<meta name="description" content="FreeRADIUS Web Manager">
<meta name="author" content="Simon Cloutier">
<meta property="og:title" content="FreeRADIUS Manager">
<meta property="og:description" content="Manage FreeRADIUS MAC authentication visually">
<meta property="og:type" content="website">
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>{% block title %}FreeRADIUS Manager{% endblock %}</title>

4
app/wsgi.py Normal file
View File

@@ -0,0 +1,4 @@
from app import app
if __name__ == "__main__":
app.run()