From 396fd2f3b4b9aa9815463ec545283c2c250b9f01 Mon Sep 17 00:00:00 2001 From: Simon Cloutier Date: Fri, 28 Mar 2025 16:13:38 -0400 Subject: [PATCH] lots of changes --- .vscode/settings.json | 3 + app/Dockerfile | 5 +- app/app.py | 558 +++++++++++++++++++++++ app/templates/add_user.html | 19 + app/templates/base.html | 35 ++ app/templates/edit_attribute.html | 22 + app/templates/edit_group.html | 26 ++ app/templates/edit_groupname.html | 16 + app/templates/edit_user.html | 20 + app/templates/group_list.html | 38 ++ app/templates/group_list_nested.html | 364 +++++++++++++++ app/templates/index.html | 43 ++ app/templates/user_list.html | 364 +++++++++++++++ app/templates/user_list_inline_edit.html | 316 +++++++++++++ db-data/aria_log.00000001 | Bin 18145280 -> 18145280 bytes db-data/aria_log_control | Bin 52 -> 52 bytes db-data/ddl_recovery-backup.log | Bin 0 -> 9 bytes db-data/ib_logfile0 | Bin 100663296 -> 100663296 bytes db-data/ibdata1 | Bin 12582912 -> 12582912 bytes docker-compose.yml | 16 +- nginx/nginx.conf | 2 +- 21 files changed, 1831 insertions(+), 16 deletions(-) create mode 100644 .vscode/settings.json create mode 100644 app/templates/base.html create mode 100644 app/templates/edit_attribute.html create mode 100644 app/templates/edit_group.html create mode 100644 app/templates/edit_groupname.html create mode 100644 app/templates/group_list.html create mode 100644 app/templates/group_list_nested.html create mode 100644 app/templates/index.html create mode 100644 app/templates/user_list_inline_edit.html create mode 100644 db-data/ddl_recovery-backup.log diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..457f44d --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "python.analysis.typeCheckingMode": "basic" +} \ No newline at end of file diff --git a/app/Dockerfile b/app/Dockerfile index 4e51849..0305a18 100644 --- a/app/Dockerfile +++ b/app/Dockerfile @@ -3,10 +3,11 @@ FROM python:3.9-slim WORKDIR /app 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 + COPY . . -EXPOSE 5000 - CMD ["python", "app.py"] \ No newline at end of file diff --git a/app/app.py b/app/app.py index e69de29..4316137 100644 --- a/app/app.py +++ b/app/app.py @@ -0,0 +1,558 @@ +from flask import Flask, render_template, request, redirect, url_for, jsonify +import mysql.connector +import json + +app = Flask(__name__) + +DB_CONFIG = { + 'host': '192.168.60.150', + 'user': 'user_92z0Kj', + 'password': '5B3UXZV8vyrB', + 'database': 'radius_NIaIuT' +} + +def get_db(): + try: + db = mysql.connector.connect(**DB_CONFIG) + return db + except mysql.connector.Error as err: + print(f"Database Connection Error: {err}") + return None + +@app.route('/', methods=['GET', 'POST']) +def index(): + sql_results = None + sql_error = None + total_users = 0 + total_groups = 0 + + db = get_db() + if db: + cursor = db.cursor(dictionary=True) + try: + # Count total users + cursor.execute("SELECT COUNT(DISTINCT username) as total FROM radcheck;") + total_users = cursor.fetchone()['total'] + + # Count total groups + cursor.execute("SELECT COUNT(DISTINCT groupname) as total FROM radgroupreply;") + total_groups = cursor.fetchone()['total'] + + except mysql.connector.Error as err: + print(f"Error fetching counts: {err}") + + cursor.close() + db.close() + + return render_template('index.html', total_users=total_users, total_groups=total_groups, sql_results=sql_results, sql_error=sql_error) + +@app.route('/sql', methods=['POST']) +def sql(): + sql_results = None + sql_error = None + sql_query = request.form['query'] + + db = get_db() + if db: + try: + cursor = db.cursor(dictionary=True) + cursor.execute(sql_query) + sql_results = cursor.fetchall() + cursor.close() + db.close() + except mysql.connector.Error as err: + sql_error = str(err) + except Exception as e: + sql_error = str(e) + + total_users = 0 + total_groups = 0 + + db = get_db() + if db: + cursor = db.cursor(dictionary=True) + try: + # Count total users + cursor.execute("SELECT COUNT(DISTINCT username) as total FROM radcheck;") + total_users = cursor.fetchone()['total'] + + # Count total groups + cursor.execute("SELECT COUNT(DISTINCT groupname) as total FROM radgroupreply;") + total_groups = cursor.fetchone()['total'] + + except mysql.connector.Error as err: + print(f"Error fetching counts: {err}") + + cursor.close() + db.close() + + return render_template('index.html', total_users=total_users, total_groups=total_groups, sql_results=sql_results, sql_error=sql_error) + +@app.route('/user_list') +def user_list(): + db = get_db() + if db: + cursor = db.cursor(dictionary=True) + cursor.execute(""" + SELECT + rc.username AS mac_address, + IFNULL((SELECT value FROM radgroupreply rgr + WHERE rgr.groupname = (SELECT groupname FROM radusergroup rug WHERE rug.username = rc.username LIMIT 1) + AND rgr.attribute = 'Tunnel-Private-Group-Id' LIMIT 1), 'N/A') AS vlan_id, + IFNULL((SELECT value FROM radcheck rch + WHERE rch.username = rc.username AND rch.attribute = 'User-Description' LIMIT 1), 'N/A') AS description + FROM radcheck rc + GROUP BY rc.username; + """) + results = cursor.fetchall() + cursor.close() + db.close() + return render_template('user_list_inline_edit.html', results=results) + return "Database Connection Failed" + +@app.route('/update_user', methods=['POST']) +def update_user(): + mac_address = request.form['mac_address'] + description = request.form['description'] + vlan_id = request.form['vlan_id'] + + db = get_db() + if db: + cursor = db.cursor() + try: + db.autocommit = False + + cursor.execute(""" + UPDATE radcheck + SET value = %s + WHERE username = %s AND attribute = 'User-Description' + """, (description, mac_address)) + + cursor.execute(""" + UPDATE radgroupreply rgr + SET value = %s + WHERE rgr.groupname = (SELECT groupname FROM radusergroup rug WHERE rug.username = %s LIMIT 1) + AND rgr.attribute = 'Tunnel-Private-Group-Id' + """, (vlan_id, mac_address)) + + db.commit() + db.autocommit = True + cursor.close() + return "success" + except mysql.connector.Error as err: + db.rollback() + db.autocommit = True + cursor.close() + return str(err) + except Exception as e: + db.rollback() + db.autocommit = True + cursor.close() + return str(e) + finally: + db.close() + return "Database Connection Failed" + +@app.route('/delete_user/') +def delete_user(mac_address): + db = get_db() + if db: + cursor = db.cursor() + try: + cursor.execute("DELETE FROM radcheck WHERE username = %s", (mac_address,)) + db.commit() + cursor.close() + db.close() + return redirect(url_for('user_list')) + except mysql.connector.Error as err: + print(f"Database Error: {err}") + db.rollback() + cursor.close() + db.close() + return redirect(url_for('user_list')) + return "Database Connection Failed" + +@app.route('/edit_user/', methods=['GET', 'POST']) +def edit_user(mac_address): + db = get_db() + if db: + cursor = db.cursor(dictionary=True) + + if request.method == 'POST': + description = request.form['description'] + vlan_id = request.form['vlan_id'] + + cursor.execute(""" + UPDATE radcheck + SET value = %s + WHERE username = %s AND attribute = 'User-Description' + """, (description, mac_address)) + + cursor.execute(""" + UPDATE radgroupreply rgr + SET value = %s + WHERE rgr.groupname = (SELECT groupname FROM radusergroup rug WHERE rug.username = %s LIMIT 1) + AND rgr.attribute = 'Tunnel-Private-Group-Id' + """, (vlan_id, mac_address)) + + db.commit() + cursor.close() + db.close() + return redirect(url_for('user_list')) + + else: + cursor.execute(""" + SELECT + rc.username AS mac_address, + IFNULL((SELECT value FROM radgroupreply rgr + WHERE rgr.groupname = (SELECT groupname FROM radusergroup rug WHERE rug.username = rc.username LIMIT 1) + AND rgr.attribute = 'Tunnel-Private-Group-Id' LIMIT 1), 'N/A') AS vlan_id, + IFNULL((SELECT value FROM radcheck rch + WHERE rch.username = rc.username AND rch.attribute = 'User-Description' LIMIT 1), 'N/A') AS description + FROM radcheck rc + WHERE rc.username = %s + GROUP BY rc.username; + """, (mac_address,)) + user = cursor.fetchone() + cursor.close() + db.close() + return render_template('edit_user.html', user=user) + return "Database Connection Failed" + +@app.route('/groups') +def groups(): + db = get_db() + if db: + cursor = db.cursor() + try: + # Fetch group names from radgroupcheck + cursor.execute("SELECT DISTINCT groupname FROM radgroupcheck") + group_names = [row[0] for row in cursor.fetchall()] + + grouped_results = {} + for groupname in group_names: + # Fetch attributes for each group from radgroupreply + cursor.execute("SELECT id, attribute, op, value FROM radgroupreply WHERE groupname = %s", (groupname,)) + attributes = cursor.fetchall() + grouped_results[groupname] = [{'id': row[0], 'attribute': row[1], 'op': row[2], 'value': row[3]} for row in attributes] + + cursor.close() + db.close() + return render_template('group_list_nested.html', grouped_results=grouped_results) + except mysql.connector.Error as err: + print(f"Database Error: {err}") + cursor.close() + db.close() + return render_template('group_list_nested.html', grouped_results={}) + return "Database Connection Failed" + +@app.route('/edit_groupname/', methods=['GET', 'POST']) +def edit_groupname(old_groupname): + db = get_db() + if db: + cursor = db.cursor(dictionary=True) + + if request.method == 'POST': + new_groupname = request.form['groupname'] + try: + db.autocommit = False + cursor.execute(""" + UPDATE radgroupreply + SET groupname = %s + WHERE groupname = %s + """, (new_groupname, old_groupname)) + + cursor.execute(""" + UPDATE radusergroup + SET groupname = %s + WHERE groupname = %s + """, (new_groupname, old_groupname)) + + db.commit() + db.autocommit = True + cursor.close() + db.close() + return redirect(url_for('groups')) + except mysql.connector.Error as err: + db.rollback() + db.autocommit = True + cursor.close() + db.close() + return f"Database Error: {err}" + else: + return render_template('edit_groupname.html', old_groupname=old_groupname) + return "Database Connection Failed" + +@app.route('/update_attribute', methods=['POST']) +def update_attribute(): + group_id = request.form['group_id'] + attribute = request.form['attribute'] + op = request.form['op'] + value = request.form['value'] + + db = get_db() + if db: + cursor = db.cursor() + try: + db.autocommit = False + cursor.execute(""" + UPDATE radgroupreply + SET attribute = %s, op = %s, value = %s + WHERE id = %s + """, (attribute, op, value, group_id)) + db.commit() + db.autocommit = True + cursor.close() + return "success" + except mysql.connector.Error as err: + db.rollback() + db.autocommit = True + cursor.close() + return str(err) + except Exception as e: + db.rollback() + db.autocommit = True + cursor.close() + return str(e) + finally: + db.close() + return "Database Connection Failed" + +@app.route('/add_attribute', methods=['POST']) +def add_attribute(): + groupname = request.form['groupname'] + attribute = request.form['attribute'] + op = request.form['op'] + value = request.form['value'] + + db = get_db() + if db: + cursor = db.cursor() + try: + cursor.execute(""" + INSERT INTO radgroupreply (groupname, attribute, op, value) + VALUES (%s, %s, %s, %s) + """, (groupname, attribute, op, value)) + db.commit() + cursor.close() + db.close() + return "success" + except mysql.connector.Error as err: + print(f"Database Error: {err}") + db.rollback() + cursor.close() + db.close() + return str(err) + return "Database Connection Failed" + +@app.route('/edit_attribute/', methods=['GET', 'POST']) +def edit_attribute(group_id): + db = get_db() + if db: + cursor = db.cursor(dictionary=True) + + if request.method == 'POST': + attribute = request.form['attribute'] + op = request.form['op'] + value = request.form['value'] + + try: + db.autocommit = False + cursor.execute(""" + UPDATE radgroupreply + SET attribute = %s, op = %s, value = %s + WHERE id = %s + """, (attribute, op, value, group_id)) + db.commit() + db.autocommit = True + cursor.close() + db.close() + return redirect(url_for('groups')) + except mysql.connector.Error as err: + db.rollback() + db.autocommit = True + cursor.close() + db.close() + return f"Database Error: {err}" + + else: + cursor.execute("SELECT * FROM radgroupreply WHERE id = %s", (group_id,)) + attribute_data = cursor.fetchone() + cursor.close() + db.close() + return render_template('edit_attribute.html', attribute_data=attribute_data) + return "Database Connection Failed" + +@app.route('/add_group', methods=['POST']) +def add_group(): + groupname = request.form['groupname'] + + db = get_db() + if db: + cursor = db.cursor() + try: + cursor.execute("INSERT INTO radgroupreply (groupname, attribute, op, value) VALUES (%s, '', '', '')", (groupname,)) + cursor.execute("INSERT INTO radusergroup (groupname, username) VALUES (%s, '')", (groupname,)) + # Add default values for radgroupcheck + cursor.execute("INSERT INTO radgroupcheck (groupname, attribute, op, value) VALUES (%s, 'Auth-Type', ':=', 'Accept')", (groupname,)) + db.commit() + cursor.close() + db.close() + return "success" + except mysql.connector.Error as err: + print(f"Database Error: {err}") + db.rollback() + cursor.close() + db.close() + return str(err) + return "Database Connection Failed" + +@app.route('/delete_group_rows/') +def delete_group_rows(groupname): + db = get_db() + if db: + cursor = db.cursor() + try: + cursor.execute("DELETE FROM radgroupreply WHERE groupname = %s", (groupname,)) + cursor.execute("DELETE FROM radusergroup WHERE groupname = %s", (groupname,)) + cursor.execute("DELETE FROM radgroupcheck WHERE groupname = %s", (groupname,)) + db.commit() + cursor.close() + db.close() + return redirect(url_for('groups')) + except mysql.connector.Error as err: + print(f"Database Error: {err}") + db.rollback() + cursor.close() + db.close() + return redirect(url_for('groups')) + return "Database Connection Failed" + +@app.route('/delete_group/') +def delete_group(group_id): + db = get_db() + if db: + cursor = db.cursor() + try: + cursor.execute("DELETE FROM radgroupreply WHERE id = %s", (group_id,)) + cursor.execute("DELETE FROM radgroupcheck WHERE id = %s", (group_id,)) # Delete from radgroupcheck + db.commit() + cursor.close() + db.close() + return redirect(url_for('groups')) + except mysql.connector.Error as err: + print(f"Database Error: {err}") + db.rollback() + cursor.close() + db.close() + return redirect(url_for('groups')) + return "Database Connection Failed" + +@app.route('/duplicate_group', methods=['POST']) +def duplicate_group(): + groupname = request.form['groupname'] + db = get_db() + if db: + cursor = db.cursor() + try: + cursor.execute("SELECT attribute, op, value FROM radgroupreply WHERE groupname = %s", (groupname,)) + attributes = [{'attribute': row[0], 'op': row[1], 'value': row[2]} for row in cursor.fetchall()] + cursor.close() + db.close() + return jsonify(attributes) + except mysql.connector.Error as err: + print(f"Database Error: {err}") + cursor.close() + db.close() + return jsonify([]) + return jsonify([]) + +@app.route('/save_duplicated_group', methods=['POST']) +def save_duplicated_group(): + data = json.loads(request.data) + groupname = data['groupname'] + attributes = data['attributes'] + db = get_db() + if db: + cursor = db.cursor() + try: + cursor.execute("INSERT INTO radgroupcheck (groupname, attribute, op, value) VALUES (%s, 'Auth-Type', ':=', 'Accept')", (groupname,)) + cursor.execute("INSERT INTO radusergroup (groupname, username) VALUES (%s, '')", (groupname,)) + for attribute in attributes: + cursor.execute("INSERT INTO radgroupreply (groupname, attribute, op, value) VALUES (%s, %s, %s, %s)", (groupname, attribute['attribute'], attribute['op'], attribute['value'])) + db.commit() + cursor.close() + db.close() + return "success" + except mysql.connector.Error as err: + print(f"Database Error: {err}") + db.rollback() + cursor.close() + db.close() + return str(err) + return "Database Connection Failed" + +@app.route('/add_user', methods=['POST']) +def add_user(): + """Adds a new user to the database.""" + try: + data = request.get_json() # Get the JSON data from the request + mac_address = data.get('mac_address') + description = data.get('description') + vlan_id = data.get('vlan_id') + + if not mac_address: + return jsonify({'success': False, 'message': 'MAC Address is required'}), 400 + + db = get_db() + if db is None: + return jsonify({'success': False, 'message': 'Database connection failed'}), 500 + + cursor = db.cursor() + try: + # Check if user already exists + cursor.execute("SELECT username FROM radcheck WHERE username = %s", (mac_address,)) + if cursor.fetchone(): + cursor.close() + db.close() + return jsonify({'success': False, 'message': 'User with this MAC Address already exists'}), 400 + + # Insert into radcheck, setting password to MAC address + cursor.execute(""" + INSERT INTO radcheck (username, attribute, op, value) + VALUES (%s, 'Cleartext-Password', ':=', %s), + (%s, 'User-Description', ':=', %s) + """, (mac_address, mac_address, mac_address, description)) # Use mac_address for both username and password + + # Insert into radusergroup with the selected group + cursor.execute(""" + INSERT INTO radusergroup (username, groupname) + VALUES (%s, %s) + """, (mac_address, vlan_id)) # Use vlan_id + + db.commit() + cursor.close() + db.close() + return jsonify({'success': True, 'message': 'User added successfully'}) + + except mysql.connector.Error as err: + print(f"Database Error: {err}") + db.rollback() + cursor.close() + db.close() + return jsonify({'success': False, 'message': f"Database error: {err}"}), 500 + + except Exception as e: + print(f"Error adding user: {e}") + db.rollback() + cursor.close() + db.close() + return jsonify({'success': False, 'message': str(e)}), 500 + finally: + db.close() + except Exception as e: + return jsonify({'success': False, 'message': 'Unknown error'}), 500 + + +if __name__ == '__main__': + app.run(debug=True, host='0.0.0.0', port=8080) diff --git a/app/templates/add_user.html b/app/templates/add_user.html index e69de29..7c032c0 100644 --- a/app/templates/add_user.html +++ b/app/templates/add_user.html @@ -0,0 +1,19 @@ + + + + Add User + + +

Add User

+
+ +

+ +

+ +

+ +
+ Back to User List + + \ No newline at end of file diff --git a/app/templates/base.html b/app/templates/base.html new file mode 100644 index 0000000..946c9ec --- /dev/null +++ b/app/templates/base.html @@ -0,0 +1,35 @@ + + + + {% block title %}{% endblock %} + + + + + +
+ {% block content %}{% endblock %} +
+ + \ No newline at end of file diff --git a/app/templates/edit_attribute.html b/app/templates/edit_attribute.html new file mode 100644 index 0000000..509de04 --- /dev/null +++ b/app/templates/edit_attribute.html @@ -0,0 +1,22 @@ + + + + Edit Attribute + + +

Edit Attribute

+ +
+
+

+ +
+

+ +
+

+ + +
+ + \ No newline at end of file diff --git a/app/templates/edit_group.html b/app/templates/edit_group.html new file mode 100644 index 0000000..1567d02 --- /dev/null +++ b/app/templates/edit_group.html @@ -0,0 +1,26 @@ + + + + Edit Group + + +

Edit Group: {{ group.id }}

+ +
+
+

+ +
+

+ +
+

+ +
+

+ + +
+ + + \ No newline at end of file diff --git a/app/templates/edit_groupname.html b/app/templates/edit_groupname.html new file mode 100644 index 0000000..8a04ccf --- /dev/null +++ b/app/templates/edit_groupname.html @@ -0,0 +1,16 @@ + + + + Edit Group Name + + +

Edit Group Name: {{ old_groupname }}

+ +
+
+

+ + +
+ + \ No newline at end of file diff --git a/app/templates/edit_user.html b/app/templates/edit_user.html index e69de29..a2bc268 100644 --- a/app/templates/edit_user.html +++ b/app/templates/edit_user.html @@ -0,0 +1,20 @@ + + + + Edit User + + +

Edit User: {{ user.mac_address }}

+ +
+
+

+ +
+

+ + +
+ + + \ No newline at end of file diff --git a/app/templates/group_list.html b/app/templates/group_list.html new file mode 100644 index 0000000..b97c11d --- /dev/null +++ b/app/templates/group_list.html @@ -0,0 +1,38 @@ + + + + Group List + + +

Group List

+ + + + + + + + + + + + + + {% for group in results %} + + + + + + + + + {% endfor %} + +
IDGroup NameAttributeOpValueActions
{{ group.id }}{{ group.groupname }}{{ group.attribute }}{{ group.op }}{{ group.value }} + Edit | + Delete +
+ + + \ No newline at end of file diff --git a/app/templates/group_list_nested.html b/app/templates/group_list_nested.html new file mode 100644 index 0000000..1aeb72c --- /dev/null +++ b/app/templates/group_list_nested.html @@ -0,0 +1,364 @@ +{% extends 'base.html' %} + +{% block title %}Group List{% endblock %} + +{% block content %} +

Group List

+ + {% for groupname, attributes in grouped_results.items() %} + + + + + + + + + + + + + + + + + {% for attribute in attributes %} + + + + + + + + {% endfor %} + +
Group NameAttributesOpValueActions
+ + + + + + + 🗑️ + +
+ + + + + 🗑️ +
+ {% endfor %} + + + + + + + + + + + + + + + + + + +
Group NameAttributesOpValueActions
+ + + +
+ + +
+ + +
+ + + + +{% endblock %} \ No newline at end of file diff --git a/app/templates/index.html b/app/templates/index.html new file mode 100644 index 0000000..5c94a9d --- /dev/null +++ b/app/templates/index.html @@ -0,0 +1,43 @@ +{% extends 'base.html' %} + +{% block title %}FreeRADIUS Manager{% endblock %} + +{% block content %} +

FreeRADIUS Manager

+ +

Statistics:

+

Total Users: {{ total_users }}

+

Total Groups: {{ total_groups }}

+ +

SQL Query Tool:

+
+
+ +
+ + {% if sql_results %} +

Query Results:

+ + + + {% for key in sql_results[0].keys() %} + + {% endfor %} + + + + {% for row in sql_results %} + + {% for value in row.values() %} + + {% endfor %} + + {% endfor %} + +
{{ key }}
{{ value }}
+ {% endif %} + + {% if sql_error %} +

{{ sql_error }}

+ {% endif %} +{% endblock %} \ No newline at end of file diff --git a/app/templates/user_list.html b/app/templates/user_list.html index e69de29..95ec148 100644 --- a/app/templates/user_list.html +++ b/app/templates/user_list.html @@ -0,0 +1,364 @@ +{% extends 'base.html' %} + +{% block title %}User List{% endblock %} + +{% block content %} +

User List

+ + {% for username, attributes in grouped_users.items() %} + + + + + + + + + + + + + + + + + {% for attribute in attributes %} + + + + + + + + {% endfor %} + +
User NameAttributesOpValueActions
+ + + + + + + 🗑️ + +
+ + + + + 🗑️ +
+ {% endfor %} + + + + + + + + + + + + + + + + + + +
User NameAttributesOpValueActions
+ + + +
+ + +
+ + +
+ + + + +{% endblock %} \ No newline at end of file diff --git a/app/templates/user_list_inline_edit.html b/app/templates/user_list_inline_edit.html new file mode 100644 index 0000000..b7dc45b --- /dev/null +++ b/app/templates/user_list_inline_edit.html @@ -0,0 +1,316 @@ +{% extends 'base.html' %} + +{% block title %}User List{% endblock %} + +{% block content %} +

User List

+ + + + + + + + + + + + {% for user in results %} + + + + + + + {% endfor %} + + + + +
MAC AddressDescriptionVLAN IDActions
+ + + 🗑️ + +
+ +
+ + +
+ + + + + + + + + + + + + + + +
MAC AddressDescriptionVLAN ID
+
+
+ + +
+
+ + +
+ + +
+ + + + +{% endblock %} diff --git a/db-data/aria_log.00000001 b/db-data/aria_log.00000001 index 1d17e89445a80fc25d5e46efdf9db7a1737bc563..c2d0dcec15c2f48566f2662af6a66e67a0a825b9 100644 GIT binary patch delta 1137 zcmYk&cT^5w6vy!%MI|NmW@blrvUizfmc3J382lN_I06V{JQJA6BqlS3AcC37G^PVHn8_?cn9UsKqM65h zLJ4C53t7Zsmar5f;Vff0D_F@YRujP**0PTEY+xgsh$M>5Y+)hdkmjPk72R(s<4bUh<09yx}eByyHC|_{b+d^Mwq)@{RBO;3vPx3{hGs zolR*|rOlMiu5=Ei&6T!L+EVG9N?R$NOKEGRZIsTfw5`&4l(tjaUd0+zY+^)MqCr{O z#QwP^CYk>ypHT&-IAlqhl%i4$Nh0Gc#a)Vv6hA37rG!gylM*k*LrS_7FDZ`6qFZMv zo>F|I_)GDXvPQ}XDG5>nq-0155@PL?BDxt}{TAiTdbPKNP!X}2B*iEtN=k&3%Tgkx Zn52pV(NZc%+5b2p|+ddqK>-isjq>CZgrbXw`=4M zjWy9!GtJ%UE-l>c9xb)fS{wIj>ptz=?*Z*~&`~E3ddR~%dqfvqb<?uPG^|WUU^Q`AQFH5%JMtA`ujq;)#qm40EG|qSvOf<<$UN+ej zub66@>0b4k8D@Ij8)lhpj=AP}(_7v)-vaMg=w0twWU==xvD7llt?+>ledJ>+t&-~# ztF5utr#`dJ=hoX`qfIvZ!k51CwJpA})i&Gh@U8EBZ>L>$`@tSR+H0Tv4mjwL!;U!W znB#u(vlC7_{O%8b`pe(`@vr~Y^SOk9k%2+yk_aP^V%QEM7#ILpLYvb<&nBLl;Pb0UmDih&z=DAR01_wyQUCw| literal 0 HcmV?d00001 diff --git a/db-data/ib_logfile0 b/db-data/ib_logfile0 index ced8752cbfe78c2473692bd18bd0ea2837ca264a..2ce432356aa0e88fc97c545c9506fb575faba231 100644 GIT binary patch delta 7820 zcmajfclgeA-^X!3n-FEELMkLAJ2Da>8KFW*A<9TX_LdcrO-4ppSt(^}Sd~@w427(Q z%IbbUuIs*z>-W!n+~;vTAK%ycJ-_E4=O5>%Z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~U<%NQ9eu@Wcok|5(`yiAZpnJANFvP_XANtUTHO;TjK%#fKf zOHyUF%#k#iE9o*%=F0+EC>hfAUnGkqQ@??#ym35LY z1+rc?$VS;Dg;FG&Ws7W;ZL(cuWsmHYeX?H;$U!NULvmP-NSPd!V^S^^ zQYpvfgq)O9a$2h7jGUEo63BU}mJ3oNwW3^_ diff --git a/docker-compose.yml b/docker-compose.yml index aff64bd..2226796 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,4 @@ -version: '3.8' +--- services: app: @@ -10,8 +10,7 @@ services: environment: - FLASK_APP=app.py - FLASK_ENV=development - depends_on: - - db + nginx: build: context: ./nginx @@ -19,13 +18,4 @@ services: ports: - "8080:80" depends_on: - - app - db: - image: mariadb:10.6 - environment: - MYSQL_ROOT_PASSWORD: your_root_password - MYSQL_DATABASE: radius - MYSQL_USER: radiususer - MYSQL_PASSWORD: radiuspassword - volumes: - - ./db-data:/var/lib/mysql # persistant data. \ No newline at end of file + - app \ No newline at end of file diff --git a/nginx/nginx.conf b/nginx/nginx.conf index 552c98f..3a61666 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -6,7 +6,7 @@ http { server_name localhost; location / { - proxy_pass http://app:5000; + proxy_pass http://app:8080; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;