Made a flask server thing, gonna port it to django though ig.

This commit is contained in:
2025-10-21 23:28:37 +01:00
parent fb54dd37ff
commit ddf4caba62
15 changed files with 204 additions and 3 deletions

3
.gitignore vendored
View File

@@ -1,2 +1,5 @@
/chat/node_modules
mastodon-status/*
venv/
__pycache__/

BIN
.main.py.swp Normal file

Binary file not shown.

View File

@@ -1,3 +1,4 @@
.-""-.
* /,..___\
() {_____} *
@@ -17,4 +18,4 @@
/ `.`, | '--' `.
( `. __.j )
\_ |--""___| ,-'
`"--...,+"""" `._,.-' mh
`"--...,+"""" `._,.-' <a href="http://roysac.com/tutorial/diamondieasciiarttutorial.html">mh</a>

View File

@@ -1,3 +1,4 @@
.-J"L-. \--/
' \ /`-' '-`\
| /\ /\ | / \
@@ -15,4 +16,5 @@
/ `.`, .'`" '--'.l
( `. / ^.^ \)
\_ |--""\ `===` /
`"--...,+"""" `--------`mh
`"--...,+"""" `--------`<a href="http://roysac.com/tutorial/diamondieasciiarttutorial.html">mh</a>

View File

@@ -1,3 +1,4 @@
.-"""-.
' \
|,. ,-. |
@@ -15,4 +16,5 @@
/ `.`, | '--' `.
( `. __.j )
\_ |--""___| ,-'
`"--...,+"""" `._,.-' mh
`"--...,+"""" `._,.-' <a href="http://roysac.com/tutorial/diamondieasciiarttutorial.html">mh</a>

20
ascii/singles-day.html Normal file
View File

@@ -0,0 +1,20 @@
.-"""-.
' \
|,. ,-. |
|()L () \ |
| ___ |
| ` ` | `
.j ` `.
/ ' ' \
/ / ` `.
/ / Stay ` .
/ / Single l |
. , TuxCord | |
_ ,"`. .| |
| ' ``. | [..-'l
/ `.`, | '--' `.
( `. __.j )
\_ |--""___| ,-'
`"--...,+"""" `._,.-' mh

34
main.py Normal file
View File

@@ -0,0 +1,34 @@
from flask import Flask, render_template, request, redirect
from datetime import datetime
app = Flask(__name__)
def decide_ascii():
day = datetime.today().strftime('%d')
month = datetime.today().strftime('%m')
if month == "12":
return open(f'./ascii/christmas.html', 'r').read()
if month == "10":
return open(f'./ascii/halloween.html', 'r').read()
else:
return open(f'./ascii/normal.html', 'r').read()
@app.route('/')
def index():
ascii_penguin = decide_ascii()
return render_template('index.html', ascii_penguin = ascii_penguin)
@app.route('/mc')
def mc():
ascii_penguin = decide_ascii()
return render_template('mc.html', ascii_penguin = ascii_penguin)
if __name__ == '__main__':
app.run(
debug = True,
host = "0.0.0.0",
port = 8081
)

BIN
mc/.index.html.swp Normal file

Binary file not shown.

BIN
templates/.mc.html.swp Normal file

Binary file not shown.

9
templates/footer.html Normal file
View File

@@ -0,0 +1,9 @@
<hr/>
<div id="footer-links">
<a href="https://git.javalsai.tuxcord.net/deadvey/tuxcord.net">Source Code</a>
/
<a href="https://javalsai.tuxcord.net">Gitea, Hosted by Javalsai</a>
/
<a href="https://envs.net">Website inspired by envs.net</a>
</div>

3
templates/head.html Normal file
View File

@@ -0,0 +1,3 @@
<meta charset="UTF-8" />
<link rel="stylesheet" href="/static/index.css">

13
templates/header.html Normal file
View File

@@ -0,0 +1,13 @@
<pre>
<a href="/" class="no-spin">
__ __ __
---------/\ \__ /\ \ /\ \__
---------\ \ ,_\ __ __ __ _ ___ ___ _ __ \_\ \ ___ __\ \ ,_\
----------\ \ \/ /\ \/\ \/\ \/'\ /'___\ / __`\/\`'__\/'_` \ /'_ `\ /'__`\ \ \/
-----------\ \ \_\ \ \_\ \/> &lt;//\ \__//\ \L\ \ \ \//\ \L\ \ __/\ \/\ \/\ __/\ \ \_
------------\ \__\\ \____//\_/\_\ \____\ \____/\ \_\\ \___,_\/\_\ \_\ \_\ \____\\ \__\
-------------\/__/ \/___/ \//\/_/\/____/\/___/ \/_/ \/__,_ /\/_/\/_/\/_/\/____/ \/__/</a>
A friendly Linux community.
</pre>

68
templates/index.html Normal file
View File

@@ -0,0 +1,68 @@
<!DOCTYPE html>
<html>
<head>
{% include 'head.html' %}
</head>
<body>
<header>
{% include 'header.html'%}
</header>
<b><u>Services we provide:</u></b>
<ul>
<li>
<a href="https://mastodon.tuxcord.net">Mastodon</a> (<a href='/mastodon-status'>Status</a>)
</li>
<li>
<a href="https://git.javalsai.tuxcord.net">Gitea</a>
</li>
<li>
<a href="https://redlib.tuxcord.net">Redlib</a>
</li>
<li>
<a href="/mc">Minecraft</a>
</li>
<li>
Matrix server: matrix.tuxcord.net (please ask deadvey for access)
</li>
</ul>
<b><u>Join us:</u></b>
<ul>
Our Matrix and Discord are bridged, irc is not and is not very active.
<li>
<a href="https://matrix.to/#/#TuxCord:matrix.org">Matrix</a>
</li>
<li>
<a href="https://discord.gg/SPHymEDytw">Discord</a>
</li>
<li>
<a href="irc://irc.tuxcord.net">irc.tuxcord.net</a>
</li>
</ul>
<details>
<summary>
<u><b>Members:</b></u>
</summary>
<ul>
<li><u>pickzelle (Founder)</u></li>
<li>bruhhhhh😘</li>
<li><a href="https://git.javalsai.tuxcord.net/danmax">Danmax</a></li>
<li><a href="https://deadvey.tuxcord.net">DeaDvey</a></li>
<li><a href="https://github.com/ErrorNoInternet">ErrorNoInternet</a></li>
<li>grialion</li>
<li><a href="https://javalsai.tuxcord.net">Javalsai</a></li>
<li><a href="https://decompil.in/">Spamix</a></li>
</ul>
</details>
<div class="tuxcord-image">
<pre>
{{ ascii_penguin|safe }}
</pre>
</div>
</body>
<footer>
{% include 'footer.html' %}
</footer>
</html>

46
templates/mc.html Normal file
View File

@@ -0,0 +1,46 @@
<!DOCTYPE html>
<html>
<head>
{% include 'head.html' %}
</head>
<body>
<header>
{% include 'header.html'%}
</header>
Name: Tuxcord-MC<br/>
IP/Server Address: mc.tuxcord.net<br/>
Version: 1.12.8<br/>
The server has a whitelist, so join our <a href="https://discord.gg/SPHymEDytw">Discord</a>, <a href="https://matrix.to/#/!BEyFZOZpWRoRrhRJbp:matrix.org">Matrix</a> or <a href="irc://irc.tuxcord.net">irc.tuxcord.net</a> and ask<br/>if you can join in the #.minecraft channel.<br/>
The server is cracked, so as to prevent bots and spam, we also have a registration system.<br/>
</pre>
<br/>
Rules:<br/>
<ol>
<li>
Joking around is Ok, but no directed hate speech.
</li>
<li>
Greifing and killing others is permitted.
</li>
<li>
No attempting to crash server or disrupt other people's gameplay with lag machines and the like.
</li>
<li>
While greifing is permitted in most cases, do not greif the main end island
</li>
</ol>
<div class="tuxcord-image">
<pre>
{{ ascii_penguin|safe }}
</pre>
</div>
</body>
<footer>
{% include 'footer.html' %}
</footer>
</html>