This commit is contained in:
Alie 2024-06-09 09:22:05 +02:00
parent b981c65d76
commit f899c18f0a
71 changed files with 475 additions and 95 deletions

1
.dockerignore Normal file
View File

@ -0,0 +1 @@
db.sqlite3

3
.gitignore vendored
View File

@ -11,6 +11,9 @@ db.sqlite3
media
migrations/
### TS
node_modules/
### Testing ###
.coverage
htmlcov/

15
README.md Normal file
View File

@ -0,0 +1,15 @@
# website
To install dependencies:
```bash
bun install
```
To run:
```bash
bun run index.ts
```
This project was created using `bun init` in bun v1.0.20. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.

BIN
bun.lockb Executable file

Binary file not shown.

View File

@ -1,9 +0,0 @@
#!/bin/sh
rsync -rv webpage django:/home/django/personalWebpage/
ssh django "bash -s" <<EOF
cd /home/django/personalWebpage/
python3 manage.py collectstatic --noinput
python3 manage.py makemigrations
python3 manage.py migrate
EOF

View File

@ -1,22 +0,0 @@
#!/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', 'personalWebpage.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()

17
package.json Normal file
View File

@ -0,0 +1,17 @@
{
"name": "website",
"module": "index.ts",
"type": "module",
"devDependencies": {
"@types/bun": "latest",
"@types/nunjucks": "^3.2.6",
"@types/express": "^4.17.21"
},
"peerDependencies": {
"typescript": "^5.0.0"
},
"dependencies": {
"express": "^4.19.2",
"nunjucks": "^3.2.4"
}
}

View File

@ -1,16 +0,0 @@
"""
ASGI config for personalWebpage 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/4.2/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'personalWebpage.settings')
application = get_asgi_application()

View File

@ -1,8 +0,0 @@
from django.contrib import admin
from django.urls import path, include
app_name = "personalWebsite"
urlpatterns = [
path('admin/', admin.site.urls),
path("", include("webpage.urls"))
]

View File

@ -1,16 +0,0 @@
"""
WSGI config for personalWebpage 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/4.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'personalWebpage.settings')
application = get_wsgi_application()

40
src/app.ts Normal file
View File

@ -0,0 +1,40 @@
import fs from "fs";
import type { Response, Request } from "express";
class App {
ad(req: Request, res: Response) {
const ad_list = fs.readdirSync("../static/ads/hor/");
const ad = ad_list[Math.floor(Math.random() * ad_list.length)];
res.render("ad.njk", { ad });
}
remove_extension(filename: string) {
return filename.substring(0, filename.lastIndexOf(".")) || filename;
}
image(req: Request, res: Response) {
const images_list = fs.readdirSync(`/static/icons/${req.url}/`);
const image_list = images_list.map((image) => ({
name: image,
url: this.remove_extension(image),
folder: req.url,
}));
res.render("ad.njk", { image_list });
}
index(req: Request, res: Response) {
res.render("index.njk", {
page: "index",
title: "THE INDEX",
});
}
about(req: Request, res: Response) {
res.render("about.njk", {
page: "about",
title: "About Me",
});
}
}
export default new App();

22
src/index.ts Normal file
View File

@ -0,0 +1,22 @@
import express from "express";
import nunjucks from "nunjucks";
import app from "src/app";
const site = express();
nunjucks.configure( "templates", {
autoescape: true,
express: site,
});
site.use(express.static("."));
site.get("/", app.index);
site.get("/about", app.about);
site.get("/ads", app.ad);
site.get("/8811", app.image);
site.get("/banner", app.image);
site.get("/gif", app.image);
site.get("/signbook", app.index);
site.listen(8080, () => console.log("app listening on 8080"));

6
static/ads/ads Executable file
View File

@ -0,0 +1,6 @@
<a href="ads.php"><img src="ads/hor/orb.gif" alt="Silly ad of engarging your orb"></a>
<a href="ads.php"><img src="ads/hor/ie.png" alt="Silly ad of internet explorer 3.0"></a>
<a href="ads.php"><img src="ads/hor/ram.png" alt="Download more RAM"></a>
<a href="ads.php"><img src="ads/hor/lies.jpg" alt="Insert lies here!"></a>
<a href="ads.php"><img src="ads/hor/catgirl.png" alt="Cute trans girls in my CS class?"></a>
<a href="ads.php"><img src="ads/hor/gay.jpg" alt="Little gay people on my machine?"></a>

BIN
static/ads/hor/buynow.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

BIN
static/ads/hor/catgirl.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 125 KiB

BIN
static/ads/hor/gay.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

BIN
static/ads/hor/ie.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

BIN
static/ads/hor/lies.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

BIN
static/ads/hor/orb.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 KiB

BIN
static/ads/hor/ram.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

BIN
static/background/about.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

BIN
static/background/index.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 696 KiB

BIN
static/icon.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

BIN
static/icons/8831/cronut.cafe.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
static/icons/8831/dendy.cat.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
static/icons/banner/discord.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
static/icons/banner/gay.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
static/icons/banner/html.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
static/icons/banner/ie.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

BIN
static/icons/banner/linux.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

BIN
static/icons/banner/nft.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 378 B

BIN
static/icons/banner/www.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
static/icons/bizcochito.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 616 B

BIN
static/icons/coconut.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 346 B

BIN
static/icons/fediring.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

BIN
static/icons/gif/banana.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

BIN
static/icons/gif/blobcat.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
static/icons/gif/cassette.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
static/icons/gif/drancingmoe.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

BIN
static/icons/gif/enby.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 MiB

BIN
static/icons/gif/hatkid.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 438 KiB

BIN
static/icons/gif/milk.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 272 KiB

BIN
static/icons/gif/parrot.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

BIN
static/icons/gif/pumpum.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 933 KiB

BIN
static/icons/last.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
static/icons/next.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

15
static/stats/index.cgi Executable file
View File

@ -0,0 +1,15 @@
#!/bin/sh
echo "Content-Type: text/plain"
echo
echo "This is \"`hostname`\" server running `uname -srm` on `lscpu -J | jq -r '.lscpu[2].data'` * `lscpu -J | jq -r '.lscpu[7].data'` `lscpu -J | jq -r '.lscpu[9].data'` CPU @ `lscpu -J | jq -r '.lscpu[11].data'` MHz."
echo
uptime
echo "System stats"
echo "=================================="
echo "Processes:\t RUN: `ps -r | wc -l`, TOTAL: `ps -A | wc -l`"
head -n 2 /proc/meminfo
echo
echo "Generated on `date -R`."
echo
echo "https://yari.fai.st"

91
static/style.css Executable file
View File

@ -0,0 +1,91 @@
@media screen and (min-aspect-ratio: 2) {
.centercubeplease {
width: 50%;
}
}
body {
background-color: #ffffff;
color: #000000;
font-size: 16px;
}
#index {
background-image: url("background/index.png");
background-size: cover;
background-attachment: fixed;
}
#index .centercubeplease {
background-color: #5f8e76;
border: 3px solid #527c46;
margin: auto;
padding: 10px;
}
#index a {
color: #f0f0f0;
}
.centercubeplease img {
max-width: 95%;
}
#about {
background-image: url("background/about.png");
background-size: cover;
background-attachment: fixed;
}
#about a {
color: #fff0f0;
}
#about .centercubeplease {
color: #fff0f0;
background-color: #990033;
border: 3px solid #cc0066;
margin: auto;
padding: 10px;
}
h1 {
text-align: center;
}
ul {
text-align: left;
}
h1,
h2,
h3 {
margin-bottom: 0;
}
.centerade {
width: 50%;
margin: auto;
margin-top: 10px;
text-align: center;
}
.centerade img {
width: 99%;
}
.centercubeplease a {
color: #449494;
}
.disclosure-closed {
list-style: disclosure-closed;
}
.error {
color: red;
}
table {
margin: auto;
}

109
templates/about.njk Executable file
View File

@ -0,0 +1,109 @@
{% extends "base.njk" %}
<div class="centercubeplease">
<h1>
So hey, you want to know more about me. Here u have!
</h1>
<div class="centerade">
<p>
A thing i need to say is that this page one day could be deprecated bc
of me just not remembering to change anything.
</p>
<h2>
Index
</h2>
<ul class="disclosure-closed">
<li>
<a href="#how">How to adress me</a>
</li>
<li>
<a href="#who">Who i am</a>
</li>
<li>
<a href="#what">What i am</a>
</li>
<li>
<a href="#where">Where to contact me</a>
</li>
</ul>
<h2 id="how">
How to adress me
</h2>
<p>
So first of all if you are not gonna adress me directly or you don't
know me yet just call me Bizcochito!
<br />
</p>
<h3>
You can call me:
</h3>
<ul class="disclosure-closed">
<li>
Yari
</li>
<li>
Alicia
</li>
<li>
Maria
</li>
<li>
Bizcochito
</li>
</ul>
<p>
Also if you are gonna "pronoun" me, please think before if u can just
use the name "Yari" that is literaly like "They" long.
</p>
<h3>
If you insist in using pronouns you can use this
<b> (in order of preference) </b> :
</h3>
<ul class="disclosure-closed">
<li>
<b>My names</b>
</li>
<li>
Literally anything but he
</li>
</ul>
<h2 id="who">
Who i am
</h2>
<p>
Existential question i have yet not answered
</p>
<h2 id="what">
What i am
</h2>
<p>
A silly colection of bytes
</p>
<h2 id="where">
Where to contact me
</h2>
<div class="centerade">
{# djlint: ignore D018 #}<a href="xmpp:bizcochito@fai.st">
<img style="border: 0px;
height: 36px;
width: auto"
src="https://xmpp.org/images/logos/xmpp-logo.svg"
alt="XMPP" />
</a>
<a href="mailto:bizcochito@anartist.org">
<img style="border: 0px;
height: 36px;
width: auto"
src="https://upload.wikimedia.org/wikipedia/commons/thumb/e/ee/%28at%29.svg/170px-%28at%29.svg.png"
alt="Personal Mail" />
</a>
<a href="https://awoo.fai.st/MeDueleLaTeta">
<img style="border: 0px;
height: 36px;
width: auto"
src="https://upload.wikimedia.org/wikipedia/commons/9/93/Fediverse_logo_proposal.svg"
alt="Pleroma" />
</a>
</div>
</div>
<a href="{% url "webpage:index" %}">IDK return back</a>
</div>

5
templates/ad.njk Normal file
View File

@ -0,0 +1,5 @@
<div class="centerade">
<a>
<img src="/static/ads/hor/{{ ad }}" alt="ad" />
</a>
</div>

12
templates/base.njk Normal file
View File

@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="/static/style.css" />
<link rel="icon" href="/static/icon.png" />
<title>{{ title }}</title>
</head>
<body id="{{ page }}">
{% block body %}
{% endblock body %}
</body>
</html>

10
templates/imagelist.njk Normal file
View File

@ -0,0 +1,10 @@
<div class="img">
{% for image in image_list %}
<a href="https://{{ image.url }}">
<img style="height:31px;
width:auto"
src="/static/icons/{{ image.folder }}/}{{ image.name }}"
alt="{{ image.url }}" />
</a>
{% endfor %}
</div>

52
templates/index.njk Executable file
View File

@ -0,0 +1,52 @@
{% extends "base.njk" %}
{% block body %}
<div class="centercubeplease">
<h1>
I'm bizcochito, hey!
</h1>
<h2>
Pages
</h2>
<ul class="disclosure-closed">
<li>
<a href="/about">About</a>
<a href="/signbook">Signbook</a>
</li>
</ul>
<h2>
Banners
</h2>
<!-- Add htmx request on load for banner list -->
<h2>
Funni gifs
</h2>
<!-- Add htmx request on load for gif list -->
<h2>
Frens
</h2>
<!-- Add htmx request on load for 8831 list -->
<h2>
Another banner that is unused
</h2>
<div class="img">
<a href="">
<img style="height:33px;
width:81px"
src="/static/icons/coconut.png"
alt="cronut.cafe/~bizcochito" />
</a>
</div>
<h2>
BANNER
</h2>
<div class="img">
<a href="https://yari.fai.st">
<img style="height:33px;
width:81px"
src="/static/icons/bizcochito.gif"
alt="yari.fai.st" />
</a>
</div>
</div>
<!-- Add htmx request on load for ad -->
{% endblock body %}

53
templates/signbook.njk Executable file
View File

@ -0,0 +1,53 @@
{% extends "base.njk" %}
<div class="centercubeplease">
<h1>
Cool signers:
</h1>
{% if signer_list %}
<p>
<ul>
{% for signer in signer_list %}
<li>
<a href="https://{{ signer.website }}">
<b>
{{ signer.name }}
</b>
</a> said:
<b>
{{ signer.comment }}.
</b>
{% if signer.email %}
Pester on:
<a href="mailto:{{ signer.email }}">{{ signer.email }}</a>
{% endif %}
</li>
{% endfor %}
</ul>
</p>
{% else %}
<p>
No one signed here :(
</p>
{% endif %}
</div>
<div class="centerade">
<h2>
Be part of this cuties!
</h2>
<p>
<p>
<form method="post" action="">
{% csrf_token %}
{% if error_message %}
<p>
<strong>{{ error_message }}</strong>
</p>
{% endif %}
<table>
{{ form.as_table }}
</table>
<input type="submit" />
</form>
</p>
</p>
</div>

24
tsconfig.json Normal file
View File

@ -0,0 +1,24 @@
{
"compilerOptions": {
"lib": ["ESNext"],
"target": "ESNext",
"module": "ESNext",
"moduleDetection": "force",
"jsx": "react-jsx",
"allowJs": true,
/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"verbatimModuleSyntax": true,
"noEmit": true,
/* Linting */
"skipLibCheck": true,
"strict": true,
"noFallthroughCasesInSwitch": true,
"forceConsistentCasingInFileNames": true,
"baseUrl": "./"
}
}

View File

View File

@ -1,7 +0,0 @@
from django.contrib import admin
from .models import Booksigner
# Register your models here.
admin.site.register(Booksigner)

View File

@ -1,4 +0,0 @@
from django.apps import AppConfig
class ConfigWebpage(AppConfig):
name = 'webpage'

View File

@ -1,3 +0,0 @@
from django.test import TestCase
# Create your tests here.

View File

@ -1,10 +0,0 @@
from django.urls import path
from . import views
app_name = "webpage"
urlpatterns = [
path("signbook/", views.signbook, name="signbook"),
path("about/", views.about, name="about"),
path("", views.index, name="index"),
]