index beginnings

Signed-off-by: Ari Archer <ari@ari.lt>
This commit is contained in:
Arija A. 2024-06-05 08:03:32 +03:00
parent 0474b22a5b
commit eb044272e0
36 changed files with 1223 additions and 79 deletions

2
.gitignore vendored
View file

@ -165,3 +165,5 @@ cython_debug/
# Other
.ccls-cache/
!py.typed
*.env

146
LICENSE
View file

@ -1,5 +1,5 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
@ -7,17 +7,15 @@
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
software for all its users.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
@ -26,44 +24,34 @@ them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.
The precise terms and conditions for copying, distribution and
modification follow.
@ -72,7 +60,7 @@ modification follow.
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"This License" refers to version 3 of the GNU Affero General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
@ -549,35 +537,45 @@ to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
the GNU Affero General Public License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Program specifies that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
versions of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
@ -631,44 +629,34 @@ to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
ari.lt
Copyright (C) 2024 Ari Archer <ari@ari.lt>
Project "ari.lt"
Copyright (C) 2024 Ari Archer <ari@ari.lt>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
GNU Affero General Public License for more details.
You should have received a copy of the GNU General Public License
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
ari.lt Copyright (C) 2024 Ari Archer <ari@ari.lt>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
For more information on this, and how to apply and follow the GNU AGPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

2
ari-lt.env.example Normal file
View file

@ -0,0 +1,2 @@
# export DB='mysql+pymysql://user:password@127.0.0.1/arilt?charset=utf8mb4'
export DB='sqlite:///arilt.db'

View file

@ -0,0 +1,3 @@
flask
types-flask
flask-sqlalchemy

54
src/aw/__init__.py Normal file
View file

@ -0,0 +1,54 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""ari.lt"""
import datetime
import os
import sys
from typing import Any
import flask
def create_app(name: str) -> flask.Flask:
"""create ari.lt app"""
for var in ("DB",):
if var not in os.environ:
print(f"Environment variable {var} is unset.", file=sys.stderr)
sys.exit(1)
app: flask.Flask = flask.Flask(name)
app.config["PREFERRED_URL_SCHEME"] = "http" if app.debug else "https"
app.config["DOMAIN"] = "ari.lt"
app.config["SESSION_COOKIE_SAMESITE"] = "strict"
app.config["SESSION_COOKIE_SECURE"] = True
app.config["SESSION_COOKIE_HTTPONLY"] = True
app.config["SQLALCHEMY_DATABASE_URI"] = os.environ["DB"]
app.config["SQLALCHEMY_ENGINE_OPTIONS"] = {"pool_pre_ping": True}
app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False
app.config["USE_SESSION_FOR_NEXT"] = True
from .views import views
app.register_blueprint(views, url_prefix="/")
@app.context_processor # type: ignore
def _() -> Any:
"""Context processor"""
y: int = datetime.datetime.now(datetime.timezone.utc).year # type: ignore
return {
"current_year": y,
"ari_age": int((datetime.datetime.now() - datetime.datetime(2007, 9, 10)).days // 365.25), # type: ignore
"programming_exp": y - 2016,
"python_exp": y - 2016,
"c_exp": y - 2020,
}
return app

7
src/aw/const.py Normal file
View file

@ -0,0 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Constants"""
from typing import Final
HUGEINT_MAX: Final[int] = (10**65) - 1

60
src/aw/models.py Normal file
View file

@ -0,0 +1,60 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""DB Models"""
import typing as t
from decimal import Decimal
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy import DECIMAL, Dialect, TypeDecorator
from . import const
db: SQLAlchemy = SQLAlchemy()
class HugeUInt(TypeDecorator): # type: ignore
"""huge int type, 0 to (10**64)-1"""
impl: t.Any = DECIMAL
def load_dialect_impl(self, dialect: Dialect) -> t.Any:
"""load dialect impl"""
return dialect.type_descriptor(DECIMAL(65, 0)) # type: ignore
def process_bind_param(
self,
value: t.Optional[t.Any],
dialect: Dialect,
) -> t.Optional[int]:
"""process binding"""
assert dialect is dialect
if value is not None:
if value < 0 or value > const.HUGEINT_MAX:
raise ValueError("HugeUInt out of range [0;HUGEINT_MAX]")
else:
return int(value)
else:
return None
def process_result_value(
self,
value: t.Optional[t.Any],
dialect: Dialect,
) -> t.Optional[Decimal]:
"""process dialect"""
assert dialect is dialect
return Decimal(value) if value is not None else None
class Counter(db.Model):
"""Counter"""
id: int = db.Column(
db.Integer,
primary_key=True,
unique=True,
)
count: int = db.Column(HugeUInt())

17
src/aw/routing.py Normal file
View file

@ -0,0 +1,17 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""routing"""
from typing import Any
from flask import Blueprint
class Bp(Blueprint):
def get(self, rule: str, **kwargs: Any) -> Any:
"""wrapper for GET"""
return self.route(rule=rule, methods=("GET",), **kwargs)
def post(self, rule: str, **kwargs: Any) -> Any:
"""wrapper for POST"""
return self.route(rule=rule, methods=("POST",), **kwargs)

79
src/aw/views.py Normal file
View file

@ -0,0 +1,79 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""views"""
import typing as t
import flask
from werkzeug.wrappers import Response
from .routing import Bp
views: Bp = Bp("views", __name__)
@views.get("/index.html", alias=True)
@views.get("/")
def index() -> str:
"""Home page"""
return flask.render_template("index.j2")
@views.get("/manifest.json")
def manifest() -> t.Any:
"""Manifest file"""
return flask.jsonify( # type: ignore
{
"$schema": "https://json.schemastore.org/web-manifest-combined.json",
"short_name": "Ari::web -> Index",
"name": "Ari::web -> Index",
"description": "Personal website of Ari Archer. Providing free and open source services for everyone.",
"icons": [{"src": "/favicon.ico", "sizes": "128x128", "type": "image/png"}],
"start_url": ".",
"display": "standalone",
"theme_color": "#fbfbfb",
"background_color": "#000000",
}
)
@views.get("/page/<path:p>")
def page(p: str) -> str:
"""Page renderer"""
return p
@views.get("/LICENSE", alias=True)
@views.get("/license")
def license() -> flask.Response:
"""License: AGPL-3.0-or-later"""
try:
with open("../LICENSE", "r") as fp:
return flask.Response(fp.read(), mimetype="text/plain")
except Exception:
with open("LICENSE", "r") as fp:
return flask.Response(fp.read(), mimetype="text/plain")
@views.get("/git", defaults={"_": ""})
@views.get("/git/", defaults={"_": ""})
@views.get("/git/<path:_>")
def git(_: str) -> Response:
"""Git source code"""
return flask.redirect(
f"https://ari.lt/lh/us.ari.lt/{flask.request.full_path[4:]}",
code=302,
)
@views.get("/favicon.ico")
def favicon() -> Response:
"""Website icon"""
return flask.redirect(
flask.url_for(
"static",
filename="favicons/ari-web-lgbt.ico",
mimetype="image/vnd.microsoft.icon",
)
)

View file

@ -4,10 +4,18 @@
from warnings import filterwarnings as filter_warnings
from flask import Flask
from aw import create_app
app: Flask = create_app(__name__)
def main() -> int:
"""entry/main function"""
app.run("127.0.0.1", 8080, True)
return 0

131
src/static/css/base.css Normal file
View file

@ -0,0 +1,131 @@
:root {
color-scheme: dark;
--red: #ff5147;
--white: #fbfbfb;
}
*,
*::before,
*::after {
-webkit-box-sizing: border-box;
box-sizing: border-box;
word-wrap: break-word;
scroll-behavior: smooth;
color: var(--white);
}
code,
code *,
pre,
pre * {
white-space: pre-wrap;
white-space: -moz-pre-wrap;
white-space: -pre-wrap;
white-space: -o-pre-wrap;
}
html {
height: 100%;
min-height: 100%;
background-color: #090909;
}
body {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
height: auto;
min-height: 100%;
margin: auto;
padding: 0;
max-width: 1400px;
text-rendering: optimizeSpeed;
line-height: 1.5;
}
code {
white-space: pre-wrap !important;
}
h1 {
text-align: center;
}
article {
-webkit-box-flex: 1;
-ms-flex: 1;
flex: 1;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
padding: 2rem;
}
main {
-webkit-box-flex: 1;
-ms-flex: 1;
flex: 1;
padding: 1em;
}
footer, footer * {
text-align: center;
opacity: 0.8;
}
li {
margin: 0.5em 0;
}
p, table {
text-align: justify;
}
table {
border-spacing: 0.2em;
}
a {
color: var(--red);
font-style: italic;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
@media (prefers-reduced-motion: reduce) {
*,
*::before,
*::after {
-webkit-animation-duration: 0.01ms !important;
animation-duration: 0.01ms !important;
-webkit-animation-iteration-count: 1 !important;
animation-iteration-count: 1 !important;
-webkit-transition-duration: 0.01ms !important;
-o-transition-duration: 0.01ms !important;
transition-duration: 0.01ms !important;
scroll-behavior: auto !important;
}
}

101
src/static/css/index.css Normal file
View file

@ -0,0 +1,101 @@
*,
*::before,
*::after {
font-family: Hack, hack, sans-serif;
}
.split > * {
padding: 2em;
}
.split {
display: grid;
grid-gap: 0.5em;
grid-template-columns: 3fr 1fr;
}
.split > :first-child {
position: relative;
overflow: hidden;
}
.split > :first-child::before {
content: "";
position: absolute;
left: 0;
right: 0;
top: 50%;
bottom: 50%;
border-right: 2px solid var(--red);
animation: grow 0.5s forwards;
pointer-events: none;
}
@keyframes grow {
from {
top: 50%;
bottom: 50%;
}
to {
top: 0;
bottom: 0;
}
}
canvas#particles {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -1;
pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
*,
*::before,
*::after {
-webkit-animation-duration: 0.01ms !important;
animation-duration: 0.01ms !important;
-webkit-animation-iteration-count: 1 !important;
animation-iteration-count: 1 !important;
-webkit-transition-duration: 0.01ms !important;
-o-transition-duration: 0.01ms !important;
transition-duration: 0.01ms !important;
scroll-behavior: auto !important;
}
}
@media only screen and (max-width: 1000px) {
.split {
grid-template-columns: 1fr;
grid-template-rows: auto auto;
}
.split > :first-child {
order: 2;
}
.split > :last-child {
order: 1;
}
.split > :last-child > *:not(div),
.split > :first-child::before {
display: none;
}
.split {
grid-template-columns: 1fr;
border-bottom: 2px dashed gray;
}
.split > :last-child {
word-break: break-all;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

47
src/static/fonts/Hack.css Normal file
View file

@ -0,0 +1,47 @@
@font-face {
font-family: Hack;
font-weight: 400;
font-style: normal;
src:
local("Hack Nerd Font Regular"),
local("Hack Regular"),
url(/static/fonts/hack-regular.woff2) format("woff2"),
url(/static/fonts/hack-regular.woff) format("woff");
font-display: swap;
}
@font-face {
font-family: Hack;
font-weight: 700;
font-style: normal;
src:
local("Hack Nerd Font Bold"),
local("Hack Bold"),
url(/static/fonts/hack-bold.woff2) format("woff2"),
url(/static/fonts/hack-bold.woff) format("woff");
font-display: swap;
}
@font-face {
font-family: Hack;
font-weight: 400;
font-style: italic;
src:
local("Hack Nerd Font Italic"),
local("Hack Italic"),
url(/static/fonts/hack-italic.woff2) format("woff2"),
url(/static/fonts/hack-italic.woff) format("woff");
font-display: swap;
}
@font-face {
font-family: Hack;
font-weight: 700;
font-style: italic;
src:
local("Hack Nerd Font Bold Italic"),
local("Hack Bold Italic"),
url(/static/fonts/hack-bolditalic.woff2) format("woff2"),
url(/static/fonts/hack-bolditalic.woff) format("woff");
font-display: swap;
}

45
src/static/fonts/LICENSE Normal file
View file

@ -0,0 +1,45 @@
The work in the Hack project is Copyright 2018 Source Foundry Authors and licensed under the MIT License
The work in the DejaVu project was committed to the public domain.
Bitstream Vera Sans Mono Copyright 2003 Bitstream Inc. and licensed under the Bitstream Vera License with Reserved Font Names "Bitstream" and "Vera"
### MIT License
Copyright (c) 2018 Source Foundry Authors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
### BITSTREAM VERA LICENSE
Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is a trademark of Bitstream, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy of the fonts accompanying this license ("Fonts") and associated documentation files (the "Font Software"), to reproduce and distribute the Font Software, including without limitation the rights to use, copy, merge, publish, distribute, and/or sell copies of the Font Software, and to permit persons to whom the Font Software is furnished to do so, subject to the following conditions:
The above copyright and trademark notices and this permission notice shall be included in all copies of one or more of the Font Software typefaces.
The Font Software may be modified, altered, or added to, and in particular the designs of glyphs or characters in the Fonts may be modified and additional glyphs or characters may be added to the Fonts, only if the fonts are renamed to names not containing either the words "Bitstream" or the word "Vera".
This License becomes null and void to the extent applicable to Fonts or Font Software that has been modified and is distributed under the "Bitstream Vera" names.
The Font Software may be sold as part of a larger software package but no copy of one or more of the Font Software typefaces may be sold by itself.
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.
Except as contained in this notice, the names of Gnome, the Gnome Foundation, and Bitstream Inc., shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Font Software without prior written authorization from the Gnome Foundation or Bitstream Inc., respectively. For further information, contact: fonts at gnome dot org.

3
src/static/fonts/README Normal file
View file

@ -0,0 +1,3 @@
Hack typeface: https://github.com/source-foundry/Hack
License: https://github.com/source-foundry/Hack/blob/master/LICENSE.md
https://blog.ari.lt/content/fonts/LICENSE

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

175
src/static/js/index.js Normal file
View file

@ -0,0 +1,175 @@
/*
* @licstart The following is the entire license notice for the JavaScript code in this file.
*
* Copyright (C) 2024 Ari Archer
*
* This file is part of ari.lt.
*
* The JavaScript code in this file is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public License
* (AGPL) as published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. The code is distributed WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
*
* As additional permission under AGPL version 3 section 7, you may distribute non-source
* (e.g., minimized or compacted) forms of that code without the copy of the AGPL normally
* required by section 4, provided you include this license notice and a URL through which
* recipients can access the Corresponding Source.
*
* @licend The above is the entire license notice for the JavaScript code in this file.
*/
"use strict";
document.addEventListener("DOMContentLoaded", function () {
const canvas = document.createElement("canvas");
canvas.id = "particles";
document.body.prepend(canvas);
const ctx = canvas.getContext("2d");
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
let particles = [];
const num_particles = 512;
const particle_size = 2;
const avoidance_radius = 48;
let mouse = {
x: null,
y: null,
};
let animation_frame_id = null;
function update_pointer(e) {
if (e.touches) {
mouse.x = e.touches[0].clientX;
mouse.y = e.touches[0].clientY;
} else {
mouse.x = e.clientX;
mouse.y = e.clientY;
}
}
window.addEventListener("mousemove", update_pointer);
window.addEventListener("touchmove", update_pointer);
function debounce(func, wait, immediate) {
let timeout;
return function () {
let context = this,
args = arguments;
let later = function () {
timeout = null;
if (!immediate) func.apply(context, args);
};
let call_now = immediate && !timeout;
clearTimeout(timeout);
timeout = setTimeout(later, wait);
if (call_now) func.apply(context, args);
};
}
function handle_resize() {
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
cancelAnimationFrame(animation_frame_id);
init();
animate();
}
window.addEventListener("resize", debounce(handle_resize, 250));
class Particle {
constructor() {
this.x = Math.random() * canvas.width;
this.y = Math.random() * canvas.height;
this.velocity = {
x: (Math.random() - 0.5) * 2,
y: (Math.random() - 0.5) * 2,
};
}
update(particles) {
if (this.x < 0 || this.x > canvas.width) {
this.velocity.x *= -1;
}
if (this.y < 0 || this.y > canvas.height) {
this.velocity.y *= -1;
}
let dx = mouse.x - this.x;
let dy = mouse.y - this.y;
let distance = Math.sqrt(dx * dx + dy * dy);
if (distance < avoidance_radius) {
this.velocity.x += (dx / distance) * 0.5;
this.velocity.y += (dy / distance) * 0.5;
}
particles.forEach((p) => {
if (p !== this) {
let dx = p.x - this.x;
let dy = p.y - this.y;
let distance = Math.sqrt(dx * dx + dy * dy);
if (distance < 2 * particle_size && distance > 0) {
let collision_normal = {
x: dx / distance,
y: dy / distance,
};
let relative_velocity = {
x: this.velocity.x - p.velocity.x,
y: this.velocity.y - p.velocity.y,
};
let speed =
relative_velocity.x * collision_normal.x +
relative_velocity.y * collision_normal.y;
if (speed < 0) {
let impulse = (2 * speed) / 2;
this.velocity.x -= impulse * collision_normal.x;
this.velocity.y -= impulse * collision_normal.y;
p.velocity.x += impulse * collision_normal.x;
p.velocity.y += impulse * collision_normal.y;
}
}
}
});
this.x += this.velocity.x;
this.y += this.velocity.y;
}
draw() {
ctx.beginPath();
ctx.arc(this.x, this.y, particle_size, 0, Math.PI * 2);
ctx.fillStyle = "rgba(255, 81, 71, 0.2)";
ctx.fill();
}
}
function init() {
particles = [];
for (let i = 0; i < num_particles; i++) {
particles.push(new Particle());
}
}
function animate() {
ctx.clearRect(0, 0, canvas.width, canvas.height);
particles.forEach((particle) => {
particle.update(particles);
particle.draw();
});
animation_frame_id = requestAnimationFrame(animate);
}
init();
animate();
});

122
src/static/svg/ari.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 73 KiB

45
src/templates/base.j2 Normal file
View file

@ -0,0 +1,45 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Ari::web -&gt; {% block title %}Untitled{% endblock %}</title>
<link rel="icon" href="{{ url_for("views.favicon") }}" sizes="128x128" type="image/vnd.microsoft.icon" />
<meta name="description" content="{% block description %}Description of an untitled page.{% endblock %}" />
<meta
name="keywords"
content="ari archer, ari, archer, arija, arija a, ari-web, aw, open source, foss, developer, open source developer, website, python, c, blog, agpl, gpl, dev, lithuania, {% block keywords %}test{% endblock %}"
/>
<meta
name="robots"
content="follow, index, max-snippet:-1, max-video-preview:-1, max-image-preview:large"
/>
<meta property="og:type" content="{% block type %}website{% endblock %}" />
<meta name="color-scheme" content="dark" />
<meta name="theme-color" content="{% block colour %}#121212{% endblock %}" />
<meta name="foss:src" content="{{ url_for("views.git") }}" />
<meta name="license" content="AGPL-3.0-or-later" />
<link rel="manifest" href="{{ url_for("views.manifest") }}" />
<link rel="stylesheet" href="{{ url_for("static", filename="css/base.css") }}" type="text/css" referrerpolicy="no-referrer" />
{% block head %}{% endblock %}
</head>
<body>
{% block body %}{% endblock %}
<article>
<header>{% block header %}{% endblock %}</header>
<main>{% block main %}{% endblock %}</main>
<footer>
<i>The <a target="_blank" href="{{ url_for('views.git') }}">source code</a> and all content, except the Nerd Hack font (see <a target="_blank" href="{{ url_for("static", filename="fonts/LICENSE") }}">Nerd Hack font license</a>), are licensed under the <a target="_blank" href="https://www.gnu.org/licenses/agpl-3.0.en.html">AGPL-3.0-or-later</a> by Ari Archer &lt;<a target="_blank" href="mailto:ari@ari.lt">ari@ari.lt</a>&gt;. Copyright 2020-{{ current_year }}.</i>
</footer>
</article>
</body>
</html>

255
src/templates/index.j2 Normal file
View file

@ -0,0 +1,255 @@
{% extends "base.j2" %}
{% block title %}Index{% endblock %}
{% block description %}Ari-web: A personal website of a Lithuanian open source developer Ari Archer (Arija A.) who provides different free, private, and open source services for others.{% endblock %}
{% block keywords %}ari::web, services, foss services, homepage, portfolio{% endblock %}
{% block head %}
<link rel="stylesheet" href="{{ url_for("static", filename="fonts/Hack.css") }}" type="text/css" referrerpolicy="no-referrer" />
<link rel="stylesheet" href="{{ url_for("static", filename="css/index.css") }}" type="text/css" referrerpolicy="no-referrer" />
<script type="text/javascript">
<!--//--><![CDATA[//><!--
/**
* @licstart The following is the entire license notice for the JavaScript
* code in this page.
*
* Copyright (C) 2024 Ari Archer
*
* The JavaScript code in this page is free software: you can redistribute
* it and/or modify it under the terms of the GNU Affero General Public License
* (AGPL) as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version. The code is
* distributed WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the AGPL
* for more details.
*
* As additional permission under AGPL version 3 section 7, you may
* distribute non-source (e.g., minimized or compacted) forms of that code
* without the copy of the AGPL normally required by section 4, provided
* you include this license notice and a URL through which recipients can
* access the Corresponding Source.
*
* @licend The above is the entire license notice for the JavaScript code
* in this page.
*/
//--><!]]>
</script>
<script src="{{ url_for("static", filename="js/index.js") }}" referrerpolicy="no-referrer"></script>
{% endblock %}
{% block body %}
<canvas id="particles"></canvas>
{% endblock %}
{% block header %}
<h1>Ari.lt: Free and open source world of Ari Archer.</h1>
{% endblock %}
{% block main %}
<div class="split">
<div>
<p>Welcome to my website, visitor {{ visitor }}!</p>
<p>
My name is <b>Ari Archer</b> also known as <b>Arija A.</b>, but most commonly referred to as
<b>Ari</b>. I am a {{ ari_age }} year old, neurodivergent, transgender, open source developer from Lithuania who does
fun stuff in primarily <a target="_blank" href="https://en.wikipedia.org/wiki/Python_(programming_language)">Python</a> (~{{ python_exp }} years)
and <a target="_blank" href="https://en.wikipedia.org/wiki/C_(programming_language)">C (89, 99)</a> (~{{ c_exp }} years).
</p>
<p>
I've picked up programming at first in Python, writing various programs on my phone, and later on discovering a communty
where I could share my code. At the time I didn't have access to a computer, so I used to play around with
basic <a target="_blank" href="https://en.wikipedia.org/wiki/JavaScript">JavaScript</a> on my local library computers.
At around 2019 I got access to a personal computer, which is where my main <a target="_blank" href="https://en.wikipedia.org/wiki/Free_and_open-source_software">FOSS</a> journey started -
exploring more technologies and understanding them more in-depth, not being limited by a locked down phone.
</p>
<p>
I hated the limiting feeling of being on <a target="_blank" href="https://en.wikipedia.org/wiki/Microsoft_Windows">Microsoft Windows</a> 10
very limiting, so soon after getting a personal computer I installed a free and open source <a target="_blank" href="https://en.wikipedia.org/wiki/Linux">Linux</a>
kernel distribution - and I've never went back to Windows ever since then. Democracy, freedom, shareability
and customization ("hackability") are huge values for me.
</p>
<p>
Technology is a big part of my life, and I am way past the stage where I find <i>just</i> technology facinating -
I find various problems and their optimal solutions very interesting and I like to come up with my own - even if
it's "<a target="_blank" href="https://en.wikipedia.org/wiki/Reinventing_the_wheel">reinventing the wheel</a>" or "impractical" -
I like to dig deep into it and understand how it works at its core, rather than relying on high-level features of an
abstraction stack. I was always a person like this, not specifically in technology - I was always the nerdy science kid -
but everywhere.
</p>
<p>
Even though I'd consider technology, problem solving, and computer programming a big part of my life, I
also enjoy a couple of more things. Such as:
</p>
<ul>
<li>Exploring various social issues (wars, injustice, freedom of people, abuse, discrimination, environmental problems, ...)</li>
<li>Cooking - I really enjoy putting together a healthy, vegan dish, which's recipe I can share with others.</li>
<li>And also <a href="https://blog.ari.lt/">blogging</a>, as archiving things and <i>thoughts</i> has been a huge part of my life since forever.</li>
</ul>
</div>
<div>
<div align="center">
<img src="{{ url_for("static", filename="svg/ari.svg") }}" alt="A illustration (sketch) of Ari Archer with medium length red-black split dyed hair" width="196px" />
</div>
<ul>
<li>Name: Arija A. (Ari Archer)</li>
<li>Pronouns: She/Her</li>
<li>Age: {{ ari_age }} years old.</li>
<li>Country: Lithuania (Lietuva).</li>
<li>Languages: Lithuanian (native), English (B2), German (basic).</li>
<li>Programming Experience: {{ programming_exp }} years ({{python_exp }}y in Python, {{ c_exp }}y in C).</li>
<li>Skills: Backend web development in Python using Flask, basic front-end development (HTML, JS, CSS, SCSS) and SEO (search engine optimization), software and library development in C and Python, Linux and intermediate Linux systems administration, technical documentation and specifications, application of different mathematical methods.</li>
<li>
Contacts
<ul>
<li>GitHub: <a target="_blank" href="https://github.com/TruncatedDinoSour">TruncatedDinoSour</a></li>
<li>GitHub organization: <a target="_blank" href="https://github.com/ari-lt">ari-lt</a> (<a href="mailto:org@ari.lt">org@ari.lt</a>)</li>
<li>Matrix: <a target="_blank" href="https://matrix.to/#/@ari:ari.lt">@ari:ari.lt</a></li>
<li>Fediverse: <a target="_blank" href="https://ak.ari.lt/ari">@ari@ak.ari.lt</a></li>
<li>E-Mail: <a target="_blank" href="mailto:ari@ari.lt">ari@ari.lt</a> (GPG: <a target="_blank" href="https://keys.openpgp.org/vks/v1/by-fingerprint/4FAD63E936B305906A6C4894A50D5B4B599AF8A2">4FAD63E936B305906A6C4894A50D5B4B599AF8A2</a>)</li>
</ul>
</li>
</ul>
<blockquote>
"Talk is cheap. Show me the code."
</blockquote>
<pre>
- Linus Torvalds, creator of Linux
</pre>
</div>
</div>
<p>
That was a short introduction of who I am and what I do.
</p>
<h2 id="staff"><a href="#staff">#</a> Staff</h2>
<p>
This table lists active staff that works on different parts of ari.lt, that doesn't include me.
Feel free to visit their websites and show appriciation :).
</p>
<div align="center">
<table>
<tr>
<th>Name</th>
<th>Role</th>
<th>Website</th>
</tr>
<tr>
<td>LDA</td>
<td>Moderates Matrix.</td>
<td><a href="https://freetards.xyz/" target="_blank">freetards.xyz</a></td>
</tr>
<tr>
<td>Jjj (Joseph)</td>
<td>Moderates Matrix, helps with Email things.</td>
<td><a href="https://pain.agency/" target="_blank">pain.agency</a></td>
</tr>
<tr>
<td>Zayd</td>
<td>Administrates Akkoma.</td>
<td><a href="https://wanderer.envs.net/" target="_blank">wanderer.envs.net</a></td>
</tr>
<tr>
<td>Sulian/Morguldir</td>
<td>Moderates Matrix.</td>
<td><a href="https://sulian.eu/" target="_blank">sulian.eu</a></td>
</tr>
</table>
</div>
<h2 id="services"><a href="#services">#</a> Services</h2>
<p>
This table lists all self-hosted software (semi-)open for the public that people are welcome to use.
</p>
<div align="center">
<table>
<tr>
<th>Service</th>
<th>Description</th>
<th>Link</th>
</tr>
<tr>
<td>Matrix homeserver</td>
<td>Semi-open registration, follow the process described <a href="{{ url_for('views.page', p='matrix') }}" target="_blank">here</a>.</td>
<td><a href="https://matrix.ari.lt/" target="_blank">matrix.ari.lt</a></td>
</tr>
<tr>
<td>Forgejo git forge instance</td>
<td>Open registration.</td>
<td><a href="https://git.ari.lt/" target="_blank">git.ari.lt</a></td>
</tr>
<tr>
<td>SearXNG instance</td>
<td>SearXNG meta-search-engine instance.</td>
<td><a href="https://searx.ari.lt/" target="_blank">searx.ari.lt</a></td>
</tr>
<tr>
<td>CryptPad instance</td>
<td>Open registration, CryptPad: private office suite software.</td>
<td><a href="https://pad.ari.lt/" target="_blank">pad.ari.lt</a></td>
</tr>
<tr>
<td>Email server hosting <a href="https://mailcow.email/" target="_blank">Mailcow</a></td>
<td>Contact <a href="mailto:ari@ari.lt" target="_blank">ari@ari.lt</a> for custom domains (aggressive policy)</td>
<td><a href="https://mail.ari.lt/" target="_blank">mail.ari.lt</a> (<a href="https://mail.ari.lt/signup" target="_blank">register here</a>)</td>
</tr>
<tr>
<td>Roundcube webmail</td>
<td>Only for ari.lt users</td>
<td><a href="https://rc.ari.lt/" target="_blank">rc.ari.lt</a></td>
</tr>
<tr>
<td>Akkoma fediverse instance</td>
<td>Open registration.</td>
<td><a href="https://ak.ari.lt/" target="_blank">ak.ari.lt</a></td>
</tr>
<tr>
<td>Vikunja instance</td>
<td>Free and open source todo app. Open registration.</td>
<td><a href="https://vi.ari.lt/" target="_blank">vi.ari.lt</a></td>
</tr>
<tr>
<td>SchildiChat &amp; Cinny Matrix web clients</td>
<td>Web clients for Matrix.</td>
<td><a href="https://schildi.ari.lt/" target="_blank">schildi.ari.lt</a> &amp; <a href="https://cinny.ari.lt/" target="_blank">cinny.ari.lt</a></td>
</tr>
<tr>
<td>PrivateBin instance</td>
<td>Private public encrypted pastebin.</td>
<td><a href="https://pb.ari.lt/" target="_blank">pb.ari.lt</a></td>
</tr>
<tr>
<td>db.cubiq.dev</td>
<td>Private database storage for <a href="https://github.com/TheCubiq/" target="_blank">Github: TheCubiq</a></td>
<td><a href="https://db.cubiq.dev/" target="_blank">db.cubiq.dev</a></td>
</tr>
<tr>
<td>t1nklas.lt's email</td>
<td>Custom domain on ari-web email</td>
<td><a href="https://t1nklas.lt/" target="_blank">t1nklas.lt</a></td>
</tr>
<tr>
<td>git.kappach.at</td>
<td>Git forge instance of KappaChat - An extensible Matrix client written in C.</td>
<td><a href="https://git.kappach.at/" target="_blank">git.kappach.at</a></td>
</tr>
</table>
</div>
{% endblock %}