Compare commits
No commits in common. "050904dde57fdbe5c1fd6a70a473577f3c8a8180" and "125e42e501004957ca4b3a9977e1c84f17299f75" have entirely different histories.
050904dde5
...
125e42e501
@ -1,5 +1,5 @@
|
|||||||
[tool.bumpversion]
|
[tool.bumpversion]
|
||||||
current_version = "1.3.1"
|
current_version = "1.3.0"
|
||||||
commit = true
|
commit = true
|
||||||
tag = true
|
tag = true
|
||||||
tag_name = "{new_version}"
|
tag_name = "{new_version}"
|
||||||
|
@ -3,7 +3,6 @@ from flask import Flask, jsonify
|
|||||||
from dotenv import load_dotenv
|
from dotenv import load_dotenv
|
||||||
from ktvmanager.config import DevelopmentConfig, ProductionConfig
|
from ktvmanager.config import DevelopmentConfig, ProductionConfig
|
||||||
from routes.api import api_blueprint
|
from routes.api import api_blueprint
|
||||||
from routes.dns import dns_bp
|
|
||||||
from ktvmanager.lib.database import initialize_db_pool
|
from ktvmanager.lib.database import initialize_db_pool
|
||||||
from ktvmanager.account_checker import send_expiry_notifications
|
from ktvmanager.account_checker import send_expiry_notifications
|
||||||
from apscheduler.schedulers.background import BackgroundScheduler
|
from apscheduler.schedulers.background import BackgroundScheduler
|
||||||
@ -28,7 +27,6 @@ def create_app():
|
|||||||
|
|
||||||
# Register blueprints
|
# Register blueprints
|
||||||
app.register_blueprint(api_blueprint)
|
app.register_blueprint(api_blueprint)
|
||||||
app.register_blueprint(dns_bp)
|
|
||||||
|
|
||||||
@app.route('/check-expiry', methods=['POST'])
|
@app.route('/check-expiry', methods=['POST'])
|
||||||
def check_expiry():
|
def check_expiry():
|
||||||
|
@ -1,47 +0,0 @@
|
|||||||
from flask import Blueprint, render_template, request, redirect, url_for, flash
|
|
||||||
import os
|
|
||||||
|
|
||||||
dns_bp = Blueprint('dns', __name__)
|
|
||||||
|
|
||||||
DNS_FILE = os.path.join(os.path.dirname(__file__), '..', 'lib', 'DNS_list.txt')
|
|
||||||
|
|
||||||
def read_dns_list():
|
|
||||||
if not os.path.exists(DNS_FILE):
|
|
||||||
return []
|
|
||||||
with open(DNS_FILE, 'r') as f:
|
|
||||||
return [line.strip() for line in f.readlines()]
|
|
||||||
|
|
||||||
def write_dns_list(dns_list):
|
|
||||||
with open(DNS_FILE, 'w') as f:
|
|
||||||
for item in dns_list:
|
|
||||||
f.write(f"{item}\n")
|
|
||||||
|
|
||||||
@dns_bp.route('/add_dns', methods=['POST'])
|
|
||||||
def add_dns():
|
|
||||||
dns_entry = request.form.get('dns_entry')
|
|
||||||
if dns_entry:
|
|
||||||
dns_list = read_dns_list()
|
|
||||||
if dns_entry not in dns_list:
|
|
||||||
dns_list.append(dns_entry)
|
|
||||||
write_dns_list(dns_list)
|
|
||||||
flash('DNS entry added successfully.', 'success')
|
|
||||||
else:
|
|
||||||
flash('DNS entry already exists.', 'info')
|
|
||||||
else:
|
|
||||||
flash('DNS entry cannot be empty.', 'danger')
|
|
||||||
return redirect(url_for('config_dashboard'))
|
|
||||||
|
|
||||||
@dns_bp.route('/remove_dns', methods=['POST'])
|
|
||||||
def remove_dns():
|
|
||||||
dns_entry = request.form.get('dns_entry')
|
|
||||||
if dns_entry:
|
|
||||||
dns_list = read_dns_list()
|
|
||||||
if dns_entry in dns_list:
|
|
||||||
dns_list.remove(dns_entry)
|
|
||||||
write_dns_list(dns_list)
|
|
||||||
flash('DNS entry removed successfully.', 'success')
|
|
||||||
else:
|
|
||||||
flash('DNS entry not found.', 'info')
|
|
||||||
else:
|
|
||||||
flash('DNS entry cannot be empty.', 'danger')
|
|
||||||
return redirect(url_for('config_dashboard'))
|
|
Loading…
x
Reference in New Issue
Block a user