Uses Django now because Flask is insecure in prod

This commit is contained in:
2025-10-22 10:57:48 +01:00
parent ddf4caba62
commit 6c5453ad17
25 changed files with 112 additions and 204 deletions

View File

@@ -0,0 +1,21 @@
.-""-.
* /,..___\
() {_____} *
' \
* |,. ,-. |
|()L () \ |
|,' `".| | *
|.___.',| `
.j `--"' ` `.
/ ' ' \
/ / ` `.
* / / Merry ` . *
/ / Christmas l |
. , TuxCord! | |
_ ,"`. .| |
| ' ``. | [..-'l
/ `.`, | '--' `.
( `. __.j )
\_ |--""___| ,-'
`"--...,+"""" `._,.-' <a href="http://roysac.com/tutorial/diamondieasciiarttutorial.html">mh</a>

View File

@@ -0,0 +1,20 @@
.-J"L-. \--/
' \ /`-' '-`\
| /\ /\ | / \
| "" "" | /.'|/\ /\|'.\
| /\/W\ | \/
| \___/ ' `
.j ` `.
/ ' ' \
/ / ` `.
/ / Happy ` .
/ / Hallowe'en l |
. , TuxCord! | |
_ ,"`. . _| |
| ' ``. | _)[..-'
/ `.`, .'`" '--'.l
( `. / ^.^ \)
\_ |--""\ `===` /
`"--...,+"""" `--------`<a href="http://roysac.com/tutorial/diamondieasciiarttutorial.html">mh</a>

20
tuxcord/ascii/normal.html Normal file
View File

@@ -0,0 +1,20 @@
.-"""-.
' \
|,. ,-. |
|()L () \ |
|,' `".| |
|.___.',| `
.j `--"' ` `.
/ ' ' \
/ / ` `.
/ / ` .
/ / l |
. , TuxCord | |
_ ,"`. .| |
| ' ``. | [..-'l
/ `.`, | '--' `.
( `. __.j )
\_ |--""___| ,-'
`"--...,+"""" `._,.-' <a href="http://roysac.com/tutorial/diamondieasciiarttutorial.html">mh</a>

View File

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

22
tuxcord/manage.py Executable file
View File

@@ -0,0 +1,22 @@
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tuxcord.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from exc
execute_from_command_line(sys.argv)
if __name__ == '__main__':
main()

BIN
tuxcord/static/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

50
tuxcord/static/index.css Normal file
View File

@@ -0,0 +1,50 @@
:root {
--accent: #28ebb5
}
body {
background: #000000;
color: #ffffff;
padding-bottom: 100px;
}
footer {
position: fixed;
bottom: 0;
width: 100%;
background: black;
}
#footer-links {
margin: 10px;
}
hr {
color: #ffffff;
}
.tuxcord-image {
position: absolute;
top: 0;
left: 650px;
}
a {
text-decoration: none;
color: var(--accent);
}
a:hover not(.no-spin) {
animation: half-spin 1s linear infinite;
display: inline-block; /* Ensures the text spins around its center */
}
@keyframes half-spin {
0% {
transform: rotate(0deg);
}
25% {
transform: rotate(10deg);
}
50% {
transform: rotate(0deg);
}
75% {
transform: rotate(-10deg);
}
100% {
transform: rotate(0deg);
}
}

37
tuxcord/static/robots.txt Executable file
View File

@@ -0,0 +1,37 @@
User-agent: GPTBot
Disallow: /
User-agent: ChatGPT-User
Disallow: /
User-agent: Google-Extended
Disallow: /
User-agent: PerplexityBot
Disallow: /
User-agent: Amazonbot
Disallow: /
User-agent: ClaudeBot
Disallow: /
User-agent: Omgilibot
Disallow: /
User-Agent: FacebookBot
Disallow: /
User-Agent: Applebot
Disallow: /
User-agent: anthropic-ai
Disallow: /
User-agent: Bytespider
Disallow: /
User-agent: Claude-Web
Disallow: /
User-agent: Diffbot
Disallow: /
User-agent: ImagesiftBot
Disallow: /
User-agent: Omgilibot
Disallow: /
User-agent: Omgili
Disallow: /
User-agent: YouBot
Disallow: /
User-agent: *
Disallow: /irc_log

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>

View File

@@ -0,0 +1,5 @@
{% load static %}
<meta charset="UTF-8" />
<link rel="stylesheet" href="{% static 'index.css' %}">
<title>Tuxcord.NET</title>

View File

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

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
tuxcord/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>

16
tuxcord/tuxcord/asgi.py Normal file
View File

@@ -0,0 +1,16 @@
"""
ASGI config for tuxcord project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/5.2/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tuxcord.settings')
application = get_asgi_application()

32
tuxcord/tuxcord/urls.py Normal file
View File

@@ -0,0 +1,32 @@
from django.shortcuts import render
from django.urls import path
from django.http import HttpResponse
import os
from datetime import datetime
def decide_ascii():
day = datetime.today().strftime('%d')
month = datetime.today().strftime('%m')
if month == "12":
return open('./ascii/christmas.html', 'r').read()
if month == "10":
return open('./ascii/halloween.html', 'r').read()
else:
return open('./ascii/normal.html', 'r').read()
def index(request):
ascii_penguin = decide_ascii()
return render(request, 'index.html', {'ascii_penguin': ascii_penguin})
def mc(request):
ascii_penguin = decide_ascii()
return render(request, 'mc.html', {'ascii_penguin': ascii_penguin})
urlpatterns = [
path('', index, name='index'),
path('mc', mc, name='mc'),
]
# In your main file (e.g., manage.py or wsgi.py), set up the server to run.
# Django handles the server running automatically. Configure your settings as needed.

16
tuxcord/tuxcord/wsgi.py Normal file
View File

@@ -0,0 +1,16 @@
"""
WSGI config for tuxcord project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/5.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tuxcord.settings')
application = get_wsgi_application()