Merge commit 'c6ac8a13ee10ef4caba1a4b7a3c986f72970f7de'
|
@ -0,0 +1,15 @@
|
||||||
|
node_modules
|
||||||
|
Dockerfile*
|
||||||
|
docker-compose*
|
||||||
|
.dockerignore
|
||||||
|
.git
|
||||||
|
.gitignore
|
||||||
|
README.md
|
||||||
|
LICENSE
|
||||||
|
.vscode
|
||||||
|
Makefile
|
||||||
|
helm-charts
|
||||||
|
.env
|
||||||
|
.editorconfig
|
||||||
|
.idea
|
||||||
|
coverage*
|
|
@ -0,0 +1,52 @@
|
||||||
|
name: Build image
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- build
|
||||||
|
tags:
|
||||||
|
- v*
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
container:
|
||||||
|
image: docker:dind
|
||||||
|
volumes:
|
||||||
|
- /data/.cache/act:/data/.cache/act
|
||||||
|
- /var/lib/docker/image:/var/lib/docker/image
|
||||||
|
- /var/lib/docker/overlay2:/var/lib/docker/overlay2
|
||||||
|
steps:
|
||||||
|
- name: Starting docker daemon
|
||||||
|
run: docker-init -- dockerd --host=unix:///var/run/docker.sock &
|
||||||
|
- name: Installing necessary packages
|
||||||
|
run: apk add nodejs git curl bash
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Docker meta
|
||||||
|
id: meta
|
||||||
|
uses: https://github.com/docker/metadata-action@v4
|
||||||
|
with:
|
||||||
|
# list of Docker images to use as base name for tags
|
||||||
|
images: |
|
||||||
|
git.fai.st/fedi-image-bot/bot-api
|
||||||
|
# generate Docker tags based on the following events/attributes
|
||||||
|
tags: |
|
||||||
|
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
|
||||||
|
type=ref,event=branch
|
||||||
|
type=semver,pattern={{raw}}
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
- name: Login to fai.st docker registry
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
registry: git.fai.st
|
||||||
|
username: ${{ secrets.DOCKER_USER }}
|
||||||
|
password: ${{ secrets.DOCKER_PASS }}
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v4
|
||||||
|
with:
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
context: .
|
||||||
|
push: true
|
||||||
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta.outputs.labels }}
|
|
@ -1,15 +1,5 @@
|
||||||
videos/
|
### TS
|
||||||
ftp/
|
node_modules/
|
||||||
|
|
||||||
### Django ###
|
|
||||||
*.log
|
|
||||||
*.pot
|
|
||||||
*.pyc
|
|
||||||
__pycache__/
|
|
||||||
local_settings.py
|
|
||||||
db.sqlite3
|
|
||||||
media
|
|
||||||
migrations/
|
|
||||||
|
|
||||||
### Testing ###
|
### Testing ###
|
||||||
.coverage
|
.coverage
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
FROM oven/bun:1 AS base
|
||||||
|
|
||||||
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
|
FROM base AS install
|
||||||
|
RUN mkdir -p /temp/prod
|
||||||
|
COPY package.json bun.lockb /temp/prod/
|
||||||
|
RUN cd /temp/prod && bun install --frozen-lockfile --production
|
||||||
|
|
||||||
|
FROM base AS release
|
||||||
|
COPY --from=install /temp/prod/node_modules node_modules
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
# run the app
|
||||||
|
USER bun
|
||||||
|
EXPOSE 8080/tcp
|
||||||
|
ENTRYPOINT [ "bun", "run", "src/index.ts" ]
|
|
@ -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.
|
|
@ -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
|
|
22
manage.py
|
@ -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()
|
|
|
@ -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"
|
||||||
|
}
|
||||||
|
}
|
|
@ -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()
|
|
|
@ -1,136 +0,0 @@
|
||||||
"""
|
|
||||||
Django settings for personalWebpage project.
|
|
||||||
|
|
||||||
Generated by 'django-admin startproject' using Django 4.2.
|
|
||||||
|
|
||||||
For more information on this file, see
|
|
||||||
https://docs.djangoproject.com/en/4.2/topics/settings/
|
|
||||||
|
|
||||||
For the full list of settings and their values, see
|
|
||||||
https://docs.djangoproject.com/en/4.2/ref/settings/
|
|
||||||
"""
|
|
||||||
|
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
|
||||||
BASE_DIR = Path(__file__).resolve().parent.parent
|
|
||||||
|
|
||||||
|
|
||||||
# Quick-start development settings - unsuitable for production
|
|
||||||
# See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/
|
|
||||||
|
|
||||||
# SECURITY WARNING: keep the secret key used in production secret!
|
|
||||||
SECRET_KEY = 'django-insecure-&az@!wa-x@+y6cs#q(0ak6ju+3t$46o#5u)i4dn%t9ftn5@dx%'
|
|
||||||
|
|
||||||
""" Prod
|
|
||||||
with open("/home/django/secret_key.txt") as f:
|
|
||||||
SECRET_KEY = f.read().strip()
|
|
||||||
"""
|
|
||||||
# SECURITY WARNING: don't run with debug turned on in production!
|
|
||||||
DEBUG = True
|
|
||||||
|
|
||||||
ALLOWED_HOSTS = ["yari.fai.st", "127.0.0.1"]
|
|
||||||
CSRF_COOKIE_SECURE = True
|
|
||||||
SESSION_COOKIE_SECURE = True
|
|
||||||
# Application definition
|
|
||||||
|
|
||||||
INSTALLED_APPS = [
|
|
||||||
"webpage.apps.ConfigWebpage",
|
|
||||||
'django.contrib.admin',
|
|
||||||
'django.contrib.auth',
|
|
||||||
'django.contrib.contenttypes',
|
|
||||||
'django.contrib.sessions',
|
|
||||||
'django.contrib.messages',
|
|
||||||
'django.contrib.staticfiles',
|
|
||||||
]
|
|
||||||
|
|
||||||
MIDDLEWARE = [
|
|
||||||
'django.middleware.security.SecurityMiddleware',
|
|
||||||
'django.contrib.sessions.middleware.SessionMiddleware',
|
|
||||||
'django.middleware.common.CommonMiddleware',
|
|
||||||
'django.middleware.csrf.CsrfViewMiddleware',
|
|
||||||
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
|
||||||
'django.contrib.messages.middleware.MessageMiddleware',
|
|
||||||
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
|
||||||
]
|
|
||||||
|
|
||||||
ROOT_URLCONF = 'personalWebpage.urls'
|
|
||||||
|
|
||||||
TEMPLATES = [
|
|
||||||
{
|
|
||||||
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
|
||||||
'DIRS': [],
|
|
||||||
'APP_DIRS': True,
|
|
||||||
'OPTIONS': {
|
|
||||||
'context_processors': [
|
|
||||||
'django.template.context_processors.debug',
|
|
||||||
'django.template.context_processors.request',
|
|
||||||
'django.contrib.auth.context_processors.auth',
|
|
||||||
'django.contrib.messages.context_processors.messages',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
]
|
|
||||||
|
|
||||||
WSGI_APPLICATION = 'personalWebpage.wsgi.application'
|
|
||||||
|
|
||||||
|
|
||||||
# Database
|
|
||||||
# https://docs.djangoproject.com/en/4.2/ref/settings/#databases
|
|
||||||
|
|
||||||
DATABASES = {
|
|
||||||
'default': {
|
|
||||||
'ENGINE': 'django.db.backends.sqlite3',
|
|
||||||
'NAME': BASE_DIR / 'db.sqlite3',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# Password validation
|
|
||||||
# https://docs.djangoproject.com/en/4.2/ref/settings/#auth-password-validators
|
|
||||||
|
|
||||||
AUTH_PASSWORD_VALIDATORS = [
|
|
||||||
{
|
|
||||||
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
|
|
||||||
},
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
# Internationalization
|
|
||||||
# https://docs.djangoproject.com/en/4.2/topics/i18n/
|
|
||||||
|
|
||||||
LANGUAGE_CODE = 'en-us'
|
|
||||||
|
|
||||||
TIME_ZONE = 'UTC'
|
|
||||||
|
|
||||||
USE_I18N = True
|
|
||||||
|
|
||||||
USE_TZ = True
|
|
||||||
|
|
||||||
|
|
||||||
# Static files (CSS, JavaScript, Images)
|
|
||||||
# https://docs.djangoproject.com/en/4.2/howto/static-files/
|
|
||||||
|
|
||||||
STATIC_URL = "static/"
|
|
||||||
STATIC_ROOT = "static/"
|
|
||||||
|
|
||||||
|
|
||||||
# Default primary key field type
|
|
||||||
# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field
|
|
||||||
|
|
||||||
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
|
||||||
|
|
||||||
# CSRF stuff
|
|
||||||
CSRF_TRUSTED_ORIGINS = [
|
|
||||||
'http://localhost:8000',
|
|
||||||
"https://yari.fai.st"
|
|
||||||
]
|
|
|
@ -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"))
|
|
||||||
]
|
|
|
@ -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()
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
import fs from "fs";
|
||||||
|
import type { Response, Request } from "express";
|
||||||
|
|
||||||
|
function ad() {
|
||||||
|
const ad_list = fs.readdirSync("static/ads/hor/");
|
||||||
|
const ad = ad_list[Math.floor(Math.random() * ad_list.length)];
|
||||||
|
return ad;
|
||||||
|
}
|
||||||
|
|
||||||
|
function remove_extension(filename: string) {
|
||||||
|
return filename.substring(0, filename.lastIndexOf(".")) || filename;
|
||||||
|
}
|
||||||
|
|
||||||
|
function image(type: string) {
|
||||||
|
const images_list = fs.readdirSync(`static/icons/${type}/`);
|
||||||
|
const image_list = images_list.map((image) => ({
|
||||||
|
name: image,
|
||||||
|
url: remove_extension(image),
|
||||||
|
folder: type,
|
||||||
|
}));
|
||||||
|
return image_list;
|
||||||
|
}
|
||||||
|
|
||||||
|
class App {
|
||||||
|
index(_req: Request, res: Response) {
|
||||||
|
res.render("index.njk", {
|
||||||
|
page: "index",
|
||||||
|
title: "THE INDEX",
|
||||||
|
image,
|
||||||
|
ad
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default new App();
|
|
@ -0,0 +1,16 @@
|
||||||
|
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.listen(8080, () => console.log("app listening on 8080"));
|
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 125 KiB After Width: | Height: | Size: 125 KiB |
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 79 KiB |
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 85 KiB After Width: | Height: | Size: 85 KiB |
Before Width: | Height: | Size: 246 KiB After Width: | Height: | Size: 246 KiB |
Before Width: | Height: | Size: 104 KiB After Width: | Height: | Size: 104 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 696 KiB After Width: | Height: | Size: 696 KiB |
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.2 KiB |
Before Width: | Height: | Size: 8.6 KiB After Width: | Height: | Size: 8.6 KiB |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 126 KiB After Width: | Height: | Size: 126 KiB |
0
webpage/static/icons/88x31/remiiiiii.online.png → static/icons/8831/remiiiiii.online.png
Executable file → Normal file
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 8.0 KiB After Width: | Height: | Size: 8.0 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 6.9 KiB |
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 378 B After Width: | Height: | Size: 378 B |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 616 B After Width: | Height: | Size: 616 B |
Before Width: | Height: | Size: 346 B After Width: | Height: | Size: 346 B |
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 58 KiB |
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 60 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 57 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 86 KiB After Width: | Height: | Size: 86 KiB |
Before Width: | Height: | Size: 7.2 MiB After Width: | Height: | Size: 7.2 MiB |
Before Width: | Height: | Size: 438 KiB After Width: | Height: | Size: 438 KiB |
Before Width: | Height: | Size: 272 KiB After Width: | Height: | Size: 272 KiB |
Before Width: | Height: | Size: 9.1 KiB After Width: | Height: | Size: 9.1 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 933 KiB After Width: | Height: | Size: 933 KiB |
|
@ -0,0 +1,7 @@
|
||||||
|
{% macro adimage(ad) %}
|
||||||
|
<div class="centerade">
|
||||||
|
<a>
|
||||||
|
<img src="/static/ads/hor/{{ ad }}" alt="ad" />
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
{% endmacro %}
|
|
@ -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>
|
|
@ -0,0 +1,12 @@
|
||||||
|
{% macro images_list(image_list) %}
|
||||||
|
<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>
|
||||||
|
{% endmacro %}
|
|
@ -0,0 +1,47 @@
|
||||||
|
{% extends "base.njk" %}
|
||||||
|
{% block body %}
|
||||||
|
<div class="centercubeplease">
|
||||||
|
<h1>
|
||||||
|
I'm bizcochito, hey!
|
||||||
|
</h1>
|
||||||
|
<h2>
|
||||||
|
Banners
|
||||||
|
</h2>
|
||||||
|
{% from "imagelist.njk" import images_list as il1 %}
|
||||||
|
{{ il1(image("banner") ) }}
|
||||||
|
<h2>
|
||||||
|
Funni gifs
|
||||||
|
</h2>
|
||||||
|
{% from "imagelist.njk" import images_list as il2 %}
|
||||||
|
{{ il2(image("gif") ) }}
|
||||||
|
<h2>
|
||||||
|
Frens
|
||||||
|
</h2>
|
||||||
|
{% from "imagelist.njk" import images_list as il3 %}
|
||||||
|
{{ il3(image("8831") ) }}
|
||||||
|
<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>
|
||||||
|
{% from "ad.njk" import adimage %}
|
||||||
|
{{ adimage(ad() ) }}
|
||||||
|
{% endblock body %}
|
|
@ -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": "./"
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,7 +0,0 @@
|
||||||
from django.contrib import admin
|
|
||||||
|
|
||||||
from .models import Booksigner
|
|
||||||
|
|
||||||
# Register your models here.
|
|
||||||
|
|
||||||
admin.site.register(Booksigner)
|
|
|
@ -1,4 +0,0 @@
|
||||||
from django.apps import AppConfig
|
|
||||||
|
|
||||||
class ConfigWebpage(AppConfig):
|
|
||||||
name = 'webpage'
|
|
|
@ -1,16 +0,0 @@
|
||||||
from re import Pattern
|
|
||||||
from django import forms
|
|
||||||
from django.core.exceptions import ValidationError
|
|
||||||
from django.utils.translation import gettext_lazy as txt
|
|
||||||
|
|
||||||
class SignbookForm(forms.Form):
|
|
||||||
name = forms.CharField(label="Name")
|
|
||||||
website = forms.CharField(label="Website", required=False)
|
|
||||||
email = forms.EmailField(label="Email", required=False)
|
|
||||||
comment = forms.CharField(label="Comment", required=False)
|
|
||||||
capcha = forms.CharField(label="Tell me that you love 'me'")
|
|
||||||
|
|
||||||
def validate_capcha(self):
|
|
||||||
if self.cleaned_data["capcha"].lower() != "i love me":
|
|
||||||
raise ValidationError(txt('Invalid captcha'), code="invalid")
|
|
||||||
return self
|
|
|
@ -1,8 +0,0 @@
|
||||||
from django.db import models
|
|
||||||
# Create your models here.
|
|
||||||
|
|
||||||
class Booksigner(models.Model):
|
|
||||||
name = models.CharField(max_length=50)
|
|
||||||
website = models.CharField(blank=True, max_length=200)
|
|
||||||
email = models.EmailField(blank=True, )
|
|
||||||
comment = models.CharField(blank=True, max_length=500)
|
|
Before Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 23 KiB |
|
@ -1,114 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
{% include "head.html" %}
|
|
||||||
<body id="about">
|
|
||||||
<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>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,26 +0,0 @@
|
||||||
{% load static %}
|
|
||||||
<div class="centerade">
|
|
||||||
<div>
|
|
||||||
<a href="https://fediring.net/previous?host=yari.fai.st">
|
|
||||||
<img style="height: 30px;
|
|
||||||
width: auto"
|
|
||||||
src="{% static 'icons/last.png' %}"
|
|
||||||
alt="LAST" />
|
|
||||||
</a>
|
|
||||||
<a href="https://fediring.net/">
|
|
||||||
<img style="height: 30px;
|
|
||||||
width: auto"
|
|
||||||
src="{% static 'icons/fediring.png' %}"
|
|
||||||
alt="FEDIRING" />
|
|
||||||
</a>
|
|
||||||
<a href="https://fediring.net/next?host=yari.fai.st">
|
|
||||||
<img style="height: 30px;
|
|
||||||
width: auto"
|
|
||||||
src="{% static 'icons/next.png' %}"
|
|
||||||
alt="NEXT" />
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<p>
|
|
||||||
Fediring links
|
|
||||||
</p>
|
|
||||||
</div>
|
|
|
@ -1,6 +0,0 @@
|
||||||
{% load static %}
|
|
||||||
<head>
|
|
||||||
<link rel="stylesheet" href="{% static 'style.css' %}" />
|
|
||||||
<link rel="icon" href="{% static 'icon.png' %}" />
|
|
||||||
<title>{{ title }}</title>
|
|
||||||
</head>
|
|
|
@ -1,86 +0,0 @@
|
||||||
{% load static %}
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
{% include "head.html" %}
|
|
||||||
<body id="index">
|
|
||||||
{% include "fediring.html" %}
|
|
||||||
<div id="noscript">
|
|
||||||
<div class="centercubeplease">
|
|
||||||
<h1>
|
|
||||||
I'm bizcochito, hey!
|
|
||||||
</h1>
|
|
||||||
<h2>
|
|
||||||
-Pages:
|
|
||||||
</h2>
|
|
||||||
<ul class="disclosure-closed">
|
|
||||||
<li>
|
|
||||||
<a href=" {% url 'webpage:signbook' %} ">Signbook</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<h2>
|
|
||||||
-Banners
|
|
||||||
</h2>
|
|
||||||
<div class="img">
|
|
||||||
{% for gif in banger_list %}
|
|
||||||
<img style="max-height:50px;width:auto" src="{% static "icons/banner/" %}{{ gif.name }}" alt="{{ gif.url }}" />
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
<h2>
|
|
||||||
-Funni gifs
|
|
||||||
</h2>
|
|
||||||
<div class="img">
|
|
||||||
{% for gif in gif_list %}
|
|
||||||
<img style="max-height:50px;width:auto" src="{% static "icons/gif/" %}{{ gif.name }}" alt="{{ gif.url }}" />
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
<h2>
|
|
||||||
-Frens:
|
|
||||||
</h2>
|
|
||||||
<div class="img">
|
|
||||||
{% for banner in banner_list %}
|
|
||||||
<a href="https://{{ banner.url }}">
|
|
||||||
<img style="height:31px; width:81px" src="{% static "icons/88x31/" %}{{ banner.name }}" alt="{{ banner.url }}" />
|
|
||||||
</a>
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
<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>
|
|
||||||
-NEW 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>
|
|
||||||
<div class="centerade">
|
|
||||||
<a>
|
|
||||||
<img src="{% static "ads/hor/" %}{{ ad }}" alt="ad" />
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<script>
|
|
||||||
function nojs() {
|
|
||||||
document.getElementById("noscript").style.display = "block";
|
|
||||||
document.getElementById("nojs").style.display = "none";
|
|
||||||
}
|
|
||||||
document.getElementById("noscript").style.display = "none";
|
|
||||||
document.write(
|
|
||||||
'<div id="nojs" class="centercubeplease"><p>To see the website please disable JS</p><p><a href="#" onclick="nojs()">I cant do that, daddy google does not LET me :(</a></p></div>'
|
|
||||||
);
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,58 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
{% include "head.html" %}
|
|
||||||
<body id="index">
|
|
||||||
<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>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,3 +0,0 @@
|
||||||
from django.test import TestCase
|
|
||||||
|
|
||||||
# Create your tests here.
|
|
|
@ -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"),
|
|
||||||
]
|
|
102
webpage/views.py
|
@ -1,102 +0,0 @@
|
||||||
import os
|
|
||||||
import random
|
|
||||||
|
|
||||||
from django.forms import ValidationError
|
|
||||||
from django.http import HttpResponseNotFound
|
|
||||||
from django.shortcuts import render
|
|
||||||
|
|
||||||
from .models import Booksigner
|
|
||||||
from .forms import SignbookForm
|
|
||||||
|
|
||||||
def image_dict_from_name_list(name_list: list[str]):
|
|
||||||
dict_list = []
|
|
||||||
for name in name_list:
|
|
||||||
url = name.split(".")
|
|
||||||
url.pop()
|
|
||||||
url = ".".join(url)
|
|
||||||
dict_list.append({
|
|
||||||
"name": name,
|
|
||||||
"url": url
|
|
||||||
}
|
|
||||||
)
|
|
||||||
return dict_list
|
|
||||||
|
|
||||||
def index(request):
|
|
||||||
# Get random ad from ad dir
|
|
||||||
ad_list = os.listdir(os.path.join(os.path.dirname(os.path.dirname(__file__)), "webpage", "static/ads/hor/"))
|
|
||||||
ad = random.choice(ad_list)
|
|
||||||
# Get list of 81x33 icons
|
|
||||||
banner_list = image_dict_from_name_list(os.listdir(os.path.join(os.path.dirname(os.path.dirname(__file__)), "webpage", "static/icons/88x31/")))
|
|
||||||
# Get list of funni gifs
|
|
||||||
gif_list = image_dict_from_name_list(os.listdir(os.path.join(os.path.dirname(os.path.dirname(__file__)), "webpage", "static/icons/gif/")))
|
|
||||||
# Get list of banners
|
|
||||||
banger_list = image_dict_from_name_list(os.listdir(os.path.join(os.path.dirname(os.path.dirname(__file__)), "webpage", "static/icons/banner/")))
|
|
||||||
if not ad or not banner_list or not gif_list:
|
|
||||||
return HttpResponseNotFound()
|
|
||||||
else:
|
|
||||||
context = {
|
|
||||||
"title": "THE INDEX",
|
|
||||||
"ad": ad,
|
|
||||||
"banner_list": banner_list,
|
|
||||||
"gif_list": gif_list,
|
|
||||||
"banger_list": banger_list,
|
|
||||||
}
|
|
||||||
return render(request,"index.html", context)
|
|
||||||
|
|
||||||
def about(request):
|
|
||||||
return render(request, "about.html", {"title": "About Me"})
|
|
||||||
|
|
||||||
def signbook(request):
|
|
||||||
signer_list = Booksigner.objects.all()
|
|
||||||
if request.method == 'POST':
|
|
||||||
form = SignbookForm(request.POST)
|
|
||||||
try:
|
|
||||||
if form.is_valid() and form.validate_capcha():
|
|
||||||
newsigner = {}
|
|
||||||
newsigner["name"] = form.cleaned_data['name']
|
|
||||||
newsigner["website"] = form.cleaned_data['website']
|
|
||||||
newsigner["email"] = form.cleaned_data['email']
|
|
||||||
newsigner["comment"] = form.cleaned_data['comment']
|
|
||||||
|
|
||||||
signer_list = Booksigner.objects.all()
|
|
||||||
if newsigner:
|
|
||||||
Booksigner.objects.create(
|
|
||||||
name=newsigner["name"],
|
|
||||||
email=newsigner["email"],
|
|
||||||
website=newsigner["website"],
|
|
||||||
comment=newsigner["comment"],
|
|
||||||
)
|
|
||||||
context = {
|
|
||||||
"title": "THE GUESTBOOK",
|
|
||||||
"signer_list": signer_list
|
|
||||||
}
|
|
||||||
return render(request, "signbook.html", context)
|
|
||||||
context = {
|
|
||||||
"title": "THE GUESTBOOK",
|
|
||||||
"signer_list": signer_list,
|
|
||||||
"error_message": "You didn't input a required input.",
|
|
||||||
}
|
|
||||||
return render(
|
|
||||||
request,
|
|
||||||
"signbook.html",
|
|
||||||
context
|
|
||||||
)
|
|
||||||
except ValidationError as e:
|
|
||||||
print("Error: ", e)
|
|
||||||
context = {
|
|
||||||
"title": "THE GUESTBOOK",
|
|
||||||
"signer_list": signer_list,
|
|
||||||
"error_message": "Invalid captcha.",
|
|
||||||
}
|
|
||||||
return render(
|
|
||||||
request,
|
|
||||||
"signbook.html",
|
|
||||||
context
|
|
||||||
)
|
|
||||||
else:
|
|
||||||
context = {
|
|
||||||
"title": "THE GUESTBOOK",
|
|
||||||
"signer_list": signer_list,
|
|
||||||
"form": SignbookForm()
|
|
||||||
}
|
|
||||||
return render(request, "signbook.html", context)
|
|