My changes
This commit is contained in:
parent
f87ac56252
commit
8aafdb5b99
9 changed files with 91 additions and 42 deletions
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
tokens.db
|
||||||
|
**/__pycache__/**
|
||||||
10
config.json
10
config.json
|
|
@ -1,10 +1,10 @@
|
||||||
{
|
{
|
||||||
"USERNAME" : "acore",
|
"USERNAME" : "root",
|
||||||
"PASSWORD" : "acore",
|
"PASSWORD" : "acore",
|
||||||
"SERVER_IP" : "127.0.0.1",
|
"SERVER_IP" : "192.168.210.224",
|
||||||
"MYSQL_PORT" : 3306,
|
"MYSQL_PORT" : 3306,
|
||||||
"DATABASE" : "acore_auth",
|
"DATABASE" : "acore_auth",
|
||||||
"SMTP_EMAIL_ADDRESS" : "email_address",
|
"SMTP_EMAIL_ADDRESS" : "davidnmitchell@gmail.com",
|
||||||
"SMTP_EMAIL_PASSWORD" : "email_app_password"
|
"SMTP_EMAIL_PASSWORD" : "kzwu wdwt gacr gsep"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
0
restart_website.sh
Normal file → Executable file
0
restart_website.sh
Normal file → Executable file
|
|
@ -26,7 +26,7 @@ def calculate_verifier(username, password, salt):
|
||||||
verifier = verifier_int.to_bytes((verifier_int.bit_length() + 7) // 8, 'little')
|
verifier = verifier_int.to_bytes((verifier_int.bit_length() + 7) // 8, 'little')
|
||||||
return verifier
|
return verifier
|
||||||
|
|
||||||
def create_account(account_name, email, passwd1, passwd2, expansion):
|
def create_account(account_name, email, passwd1, passwd2):
|
||||||
if passwd1 != passwd2:
|
if passwd1 != passwd2:
|
||||||
return "Passwords do not match."
|
return "Passwords do not match."
|
||||||
|
|
||||||
|
|
|
||||||
2
start_website.sh
Normal file → Executable file
2
start_website.sh
Normal file → Executable file
|
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Navigate to the project directory
|
# Navigate to the project directory
|
||||||
cd /home/wotlk_webserver/AzerothCore-website
|
cd /root/AzerothCore-website
|
||||||
|
|
||||||
# Activate the virtual environment
|
# Activate the virtual environment
|
||||||
source venv/bin/activate
|
source venv/bin/activate
|
||||||
|
|
|
||||||
|
|
@ -20,14 +20,6 @@
|
||||||
<label for="passwd2">Re-enter Password</label>
|
<label for="passwd2">Re-enter Password</label>
|
||||||
<input type="password" id="passwd2" minlength="8" required autocomplete="off" />
|
<input type="password" id="passwd2" minlength="8" required autocomplete="off" />
|
||||||
</div>
|
</div>
|
||||||
<div class="input-field">
|
|
||||||
<label for="exp">Expansion</label>
|
|
||||||
<select name="expansion" id="exp" required>
|
|
||||||
<option value="2">Wrath of the Lich King</option>
|
|
||||||
<option value="1">The Burning Crusade</option>
|
|
||||||
<option value="0">World of Warcraft (Classic)</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
<div class="btn-container">
|
<div class="btn-container">
|
||||||
<button type="submit" class="btn">Create Account</button>
|
<button type="submit" class="btn">Create Account</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -40,7 +32,6 @@
|
||||||
const email = document.getElementById('email').value;
|
const email = document.getElementById('email').value;
|
||||||
const passwd1 = document.getElementById('passwd1').value;
|
const passwd1 = document.getElementById('passwd1').value;
|
||||||
const passwd2 = document.getElementById('passwd2').value;
|
const passwd2 = document.getElementById('passwd2').value;
|
||||||
const expansion = document.getElementById('exp').value;
|
|
||||||
|
|
||||||
if (passwd1.length < 8) {
|
if (passwd1.length < 8) {
|
||||||
document.getElementById('result').innerText = 'Password must be at least 8 characters long.';
|
document.getElementById('result').innerText = 'Password must be at least 8 characters long.';
|
||||||
|
|
@ -62,7 +53,6 @@
|
||||||
email: email,
|
email: email,
|
||||||
passwd1: passwd1,
|
passwd1: passwd1,
|
||||||
passwd2: passwd2,
|
passwd2: passwd2,
|
||||||
expansion: expansion
|
|
||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Azerothcore</title>
|
<title>Angry Haircraft</title>
|
||||||
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
|
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
|
||||||
<style>
|
<style>
|
||||||
body {
|
body {
|
||||||
|
|
@ -34,6 +34,9 @@
|
||||||
nav ul li a:hover {
|
nav ul li a:hover {
|
||||||
background-color: #495057;
|
background-color: #495057;
|
||||||
}
|
}
|
||||||
|
p {
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
.content {
|
.content {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
@ -57,6 +60,11 @@
|
||||||
font-weight: bolder;
|
font-weight: bolder;
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
.text-block {
|
||||||
|
color: white;
|
||||||
|
text-align: left;
|
||||||
|
text-decoration: ;
|
||||||
|
}
|
||||||
.form {
|
.form {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
@ -101,8 +109,9 @@
|
||||||
<body>
|
<body>
|
||||||
<nav>
|
<nav>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="{{ url_for('home') }}">Account Creation</a></li>
|
<li><a href="{{ url_for('home') }}">Home</a></li>
|
||||||
<li><a href="https://drive.google.com/file/d/1W42A5Th1z470A-3Cz_CJVzKOTGhgjI01/view?usp=sharing">Download</a></li>
|
<li><a href="{{ url_for('account_creation') }}">Account Creation</a></li>
|
||||||
|
<li><a href="https://www.angry.hair/windows/World%20of%20Warcraft/AngryHaircraft_3.3.5a.zip">Download</a></li>
|
||||||
<li><a href="https://legacy-wow.com/wotlk-addons/">Add-ons</a></li>
|
<li><a href="https://legacy-wow.com/wotlk-addons/">Add-ons</a></li>
|
||||||
<li><a href="{{ url_for('reset_password') }}">Reset Password</a></li>
|
<li><a href="{{ url_for('reset_password') }}">Reset Password</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
||||||
52
templates/home.html
Normal file
52
templates/home.html
Normal file
|
|
@ -0,0 +1,52 @@
|
||||||
|
{% extends "base.html" %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="container" style="max-width: 800px;position: absolute;top: 7rem">
|
||||||
|
<div class="heading">Angry Haircraft</div>
|
||||||
|
|
||||||
|
<div class="text-block">
|
||||||
|
Welcome to our private World of Warcraft: Wrath of the Lich King server. This is our FAQ:<br/><br/><br/>
|
||||||
|
<strong style="font-size: 120%">How do I get access and play?</strong>
|
||||||
|
<div style="padding: 1rem;color: lightgray">
|
||||||
|
- Navigate to the 'Account Creation' tab above<br/>
|
||||||
|
- Fill out the form and submit it<br/>
|
||||||
|
- Your account will now be created and you will get an email with download instructions
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<strong style="font-size: 120%">Can my friend play too?</strong>
|
||||||
|
<div style="padding: 1rem;color: lightgray">
|
||||||
|
If they can follow the same instructions
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<strong style="font-size: 120%">How do I change my password?</strong>
|
||||||
|
<div style="padding: 1rem;color: lightgray">
|
||||||
|
- You can change it in-game<br/>
|
||||||
|
- Open chat<br/>
|
||||||
|
- Type: <code style="background-color: black">.account password [old-password] [new-password] [new-password]</code> and then enter<br/>
|
||||||
|
- That's new-password twice, and don't forget the . at the beginning
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<strong style="font-size: 120%">What if I forget my password?</strong>
|
||||||
|
<div style="padding: 1rem;color: lightgray">
|
||||||
|
- Navigate to the 'Reset Password' tab above<br/>
|
||||||
|
- Fill out the form and submit it<br/>
|
||||||
|
- You will get an email with a link to reset your password<br/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<strong style="font-size: 120%">In game, what's this button bar on the bottom right? Can I remove it?</strong>
|
||||||
|
<div style="padding: 1rem;color: lightgray">
|
||||||
|
This is an add-on to summon and control bots in your party/raid. If you want to hide it type '/mb' and then enter.
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<strong style="font-size: 120%">Wait, I can control bots in the game?</strong>
|
||||||
|
<div style="padding: 1rem;color: lightgray">
|
||||||
|
Yes. <a href="https://github.com/Macx-Lio/MultiBot">MultiBot</a> is an add-on that lets you do that. It is included with either client download. Here is a YouTube video that explains how to use it:
|
||||||
|
<iframe width="768" height="432" src="https://www.youtube.com/embed/7RPRRbDrs0A?si=_UaSloO4NVuZmb2n" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<script>
|
||||||
|
</script>
|
||||||
|
{% endblock %}
|
||||||
40
website.py
40
website.py
|
|
@ -63,6 +63,10 @@ def get_config():
|
||||||
|
|
||||||
@app.route('/')
|
@app.route('/')
|
||||||
def home():
|
def home():
|
||||||
|
return render_template('home.html')
|
||||||
|
|
||||||
|
@app.route('/accountcreation')
|
||||||
|
def account_creation():
|
||||||
return render_template('accountcreation.html')
|
return render_template('accountcreation.html')
|
||||||
|
|
||||||
@app.route('/resetpassword')
|
@app.route('/resetpassword')
|
||||||
|
|
@ -105,7 +109,6 @@ def handle_create_account():
|
||||||
email = data['email']
|
email = data['email']
|
||||||
passwd1 = data['passwd1']
|
passwd1 = data['passwd1']
|
||||||
passwd2 = data['passwd2']
|
passwd2 = data['passwd2']
|
||||||
expansion = data['expansion']
|
|
||||||
|
|
||||||
# Check if the email or account name already exists in the database
|
# Check if the email or account name already exists in the database
|
||||||
conn = get_db_connection()
|
conn = get_db_connection()
|
||||||
|
|
@ -127,10 +130,10 @@ def handle_create_account():
|
||||||
conn.close()
|
conn.close()
|
||||||
|
|
||||||
# Proceed with account creation if the email and account name are not already in use
|
# Proceed with account creation if the email and account name are not already in use
|
||||||
result = create_account(account_name, email, passwd1, passwd2, expansion)
|
result = create_account(account_name, email, passwd1, passwd2)
|
||||||
|
|
||||||
# Send a confirmation email after account creation
|
# Send a confirmation email after account creation
|
||||||
send_email('new_account', email, "", 'Account Created', 'Your account has been successfully created.')
|
send_email('new_account', email, "", 'Account Created', 'Your Angry Haircraft account has been successfully created.')
|
||||||
|
|
||||||
return jsonify({'message': result}), 201
|
return jsonify({'message': result}), 201
|
||||||
|
|
||||||
|
|
@ -178,7 +181,7 @@ def reset_password_request():
|
||||||
to_email=email,
|
to_email=email,
|
||||||
reset_link=reset_link,
|
reset_link=reset_link,
|
||||||
disable_link=disable_link,
|
disable_link=disable_link,
|
||||||
subject='AzerothCore Password Reset Request'
|
subject='Angry Haircraft Password Reset Request'
|
||||||
)
|
)
|
||||||
|
|
||||||
return jsonify({'message': 'Password reset link has been sent to your email.'}), 200
|
return jsonify({'message': 'Password reset link has been sent to your email.'}), 200
|
||||||
|
|
@ -344,31 +347,27 @@ def send_email(email_template, to_email, reset_link, disable_link, subject):
|
||||||
<a href="{reset_link}" style="display: inline-block; padding: 10px 20px; font-size: 16px; text-transform: uppercase; font-weight: bold; color: white; background-color: #007bff; text-decoration: none; border-radius: 5px;">Reset Password</a>
|
<a href="{reset_link}" style="display: inline-block; padding: 10px 20px; font-size: 16px; text-transform: uppercase; font-weight: bold; color: white; background-color: #007bff; text-decoration: none; border-radius: 5px;">Reset Password</a>
|
||||||
<p style="color: #fff;">If you did not request this email, click the button below to disable the token:</p>
|
<p style="color: #fff;">If you did not request this email, click the button below to disable the token:</p>
|
||||||
<a href="{disable_link}" style="display: inline-block; padding: 10px 20px; font-size: 16px; text-transform: uppercase; font-weight: bold; color: white; background-color: #ff0000; text-decoration: none; border-radius: 5px;">Disable Token</a>
|
<a href="{disable_link}" style="display: inline-block; padding: 10px 20px; font-size: 16px; text-transform: uppercase; font-weight: bold; color: white; background-color: #ff0000; text-decoration: none; border-radius: 5px;">Disable Token</a>
|
||||||
<p style="color: #ccc; margin-top: 20px;">If you have any questions, feel free to contact our support team.</p>
|
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
"""
|
"""
|
||||||
elif email_template == 'new_account':
|
elif email_template == 'new_account':
|
||||||
text_content = 'Welcome to the World of Warcraft adventure!'
|
text_content = 'Welcome to Angry Haircraft!'
|
||||||
html_content = f"""
|
html_content = f"""
|
||||||
<html>
|
<html>
|
||||||
<body style="font-family: Arial, sans-serif; background-image: url('cid:background'); background-size: cover; padding: 20px;">
|
<body style="font-family: Arial, sans-serif; background-image: url('cid:background'); background-size: cover; padding: 20px;">
|
||||||
<div style="max-width: 600px; margin: 0 auto; background: rgba(0, 0, 0, 0.8); padding: 20px; border-radius: 10px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);">
|
<div style="max-width: 600px; margin: 0 auto; background: rgba(0, 0, 0, 0.8); padding: 20px; border-radius: 10px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);">
|
||||||
<h2 style="color: #fff;">New Account Created</h2>
|
<h2 style="color: #fff;">New Account Created</h2>
|
||||||
<p style="color: #fff;">Your World of Warcraft account has been successfully created! Welcome to the adventure.</p>
|
<p style="color: #fff;">Your Angry Haircraft account has been successfully created!</p>
|
||||||
|
|
||||||
<p style="color: #fff;">To get started, we recommend installing some helpful addons:</p>
|
<p style="color: #fff; margin-top: 20px;">The username and password to download the game are private/supersecret. Click one of the clients below to get started:</p>
|
||||||
<a href="https://legacy-wow.com/wotlk-addons/" style="display: inline-block; padding: 10px 20px; font-size: 16px; text-transform: uppercase; font-weight: bold; color: white; background-color: #28a745; text-decoration: none; border-radius: 5px;">Install Addons</a>
|
<a href="https://www.angry.hair/windows/World%20of%20Warcraft/AngryHaircraft_3.3.5a.zip" style="display: inline-block; padding: 10px 20px; font-size: 16px; text-transform: uppercase; font-weight: bold; color: white; background-color: #ffc107; text-decoration: none; border-radius: 5px;">Download the Simple Client</a>
|
||||||
|
<a href="https://www.angry.hair/windows/World%20of%20Warcraft/AngryHaircraft_HD_3.3.5a.zip" style="display: inline-block; padding: 10px 20px; font-size: 16px; text-transform: uppercase; font-weight: bold; color: white; background-color: #ffc107; text-decoration: none; border-radius: 5px;">Download the HD Client</a>
|
||||||
|
|
||||||
<p style="color: #fff; margin-top: 20px;">Also, check out Wowhead for useful guides and tips:</p>
|
<p style="color: #fff; margin-top: 20px;">*Note: The HD client can benefit from an extra configuration step. It might also require manual editing of a config file to get resolutions over 1080p. If you don't want that, just get the Simple Client.</p>
|
||||||
<a href="https://www.wowhead.com/wotlk" style="display: inline-block; padding: 10px 20px; font-size: 16px; text-transform: uppercase; font-weight: bold; color: white; background-color: #007bff; text-decoration: none; border-radius: 5px;">Visit Wowhead</a>
|
|
||||||
|
|
||||||
<p style="color: #fff; margin-top: 20px;">Don't forget to download the game! Click below to get started:</p>
|
<p style="color: #fff; margin-top: 20px;">Be sure to read the FAQ on <a href="https://www.angry.hair">www.angry.hair</a></p>
|
||||||
<a href="https://drive.google.com/file/d/1W42A5Th1z470A-3Cz_CJVzKOTGhgjI01/view?usp=sharing" style="display: inline-block; padding: 10px 20px; font-size: 16px; text-transform: uppercase; font-weight: bold; color: white; background-color: #ffc107; text-decoration: none; border-radius: 5px;">Download the Game</a>
|
</div>
|
||||||
|
|
||||||
<p style="color: #ccc; margin-top: 20px;">If you have any questions, feel free to contact our support team.</p>
|
|
||||||
</div>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
"""
|
"""
|
||||||
|
|
@ -379,10 +378,7 @@ def send_email(email_template, to_email, reset_link, disable_link, subject):
|
||||||
<body style="font-family: Arial, sans-serif; background-image: url('cid:background'); background-size: cover; padding: 20px;">
|
<body style="font-family: Arial, sans-serif; background-image: url('cid:background'); background-size: cover; padding: 20px;">
|
||||||
<div style="max-width: 600px; margin: 0 auto; background: rgba(0, 0, 0, 0.8); padding: 20px; border-radius: 10px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);">
|
<div style="max-width: 600px; margin: 0 auto; background: rgba(0, 0, 0, 0.8); padding: 20px; border-radius: 10px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);">
|
||||||
<h2 style="color: #fff;">Password Successfully Changed</h2>
|
<h2 style="color: #fff;">Password Successfully Changed</h2>
|
||||||
<p style="color: #fff;">This is a confirmation that the password for your World of Warcraft account has been successfully updated.</p>
|
<p style="color: #fff;">This is a confirmation that the password for your Angry Haircraft account has been successfully updated.</p>
|
||||||
<p style="color: #fff;">If you did not make this change, please contact our support team immediately.</p>
|
|
||||||
<p style="color: #ccc; margin-top: 20px;">For any other inquiries or assistance, feel free to reach out to our support team.</p>
|
|
||||||
<p style="color: #ccc;">Thank you for playing, and have a great time in Azeroth!</p>
|
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
@ -433,7 +429,7 @@ def calculate_verifier(username, password, salt):
|
||||||
return verifier
|
return verifier
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
#app.run(host='0.0.0.0', port=5000, ssl_context=('/home/wotlk_webserver/cert/cert.pem', '/home/wotlk_webserver/cert/key.pem'))
|
app.run(host='0.0.0.0', port=5000)
|
||||||
app.run(host='127.0.0.1', port=10001, debug=True)
|
#app.run(host='127.0.0.1', port=10001, debug=True)
|
||||||
|
|
||||||
#app.run(debug=True)
|
#app.run(debug=True)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue