Compare commits
No commits in common. "6616a748c0345b298a1f131f128e649d002cb757" and "719843e2b81ebb3831e3f8ef36634d0071e4824c" have entirely different histories.
6616a748c0
...
719843e2b8
7 changed files with 20 additions and 118 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
|||
__pycache__
|
||||
env/
|
||||
1
password
1
password
|
|
@ -1 +0,0 @@
|
|||
25uXB9R29rW9GK9mXPNU
|
||||
|
|
@ -1 +0,0 @@
|
|||
fastcgi==0.0.3
|
||||
Binary file not shown.
|
|
@ -1,63 +0,0 @@
|
|||
import sys
|
||||
import os
|
||||
from fastcgi import fastcgi
|
||||
from urllib.parse import parse_qs
|
||||
from pathlib import Path
|
||||
import pickle
|
||||
from dataclasses import dataclass
|
||||
|
||||
CACHE_PATH = Path(__file__).parent / "mentions.pickle"
|
||||
|
||||
print("FastCGI server starting... unix socket to be located at")
|
||||
print(Path.cwd()/"fcgi.sock")
|
||||
|
||||
@dataclass
|
||||
class Mention:
|
||||
source: str
|
||||
target: str
|
||||
|
||||
@staticmethod
|
||||
def load_past_mentions() -> list["Mention"]:
|
||||
if CACHE_PATH.exists():
|
||||
with open(CACHE_PATH, "rb") as fo:
|
||||
return pickle.load(fo)
|
||||
return []
|
||||
|
||||
@staticmethod
|
||||
def save_past_mentions(mentions: list["Mention"]):
|
||||
with open(CACHE_PATH, "wb") as fo:
|
||||
return pickle.dump(mentions, fo)
|
||||
|
||||
@classmethod
|
||||
def add_mention(cls, mention: "Mention"):
|
||||
cache = cls.load_past_mentions()
|
||||
if mention not in cache:
|
||||
cache.append(mention)
|
||||
cls.save_past_mentions(cache)
|
||||
|
||||
@fastcgi()
|
||||
def handler():
|
||||
try:
|
||||
url = os.environ["REQUEST_URL"]
|
||||
method = os.environ["REQUEST_METHOD"]
|
||||
if method == "POST":
|
||||
payload = sys.stdin.read()
|
||||
data = parse_qs(payload)
|
||||
source = data["source"][-1]
|
||||
target = data["target"][-1]
|
||||
Mention.add_mention(Mention(source, target))
|
||||
if source == target:
|
||||
raise Exception()
|
||||
print("Status: 202 Accepted\r")
|
||||
print("Content-Type: text/plain; charset=utf-8\r\n\r")
|
||||
print("Thanks for mentioning us!")
|
||||
print(source)
|
||||
elif method == "GET":
|
||||
print("Status: 200 OK\r")
|
||||
print("Content-Type: text/plain; charset=utf-8\r\n\r")
|
||||
for mention in Mention.load_past_mentions():
|
||||
print(f"<{mention.source}> mentioned <{mention.target}>")
|
||||
else:
|
||||
raise Exception()
|
||||
except Exception as e:
|
||||
print("Status: 400 Bad Request\r\n\r")
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
# A basic nginx configuration to test webmention.py
|
||||
# Update unix: path to be the correct file
|
||||
|
||||
server {
|
||||
listen 80 default_server;
|
||||
listen [::]:80 default_server;
|
||||
|
||||
location / {
|
||||
add_header Link "<https://webmention.libreinternet.club>; rel=\"webmention\"" always;
|
||||
fastcgi_pass unix:/home/gopher/libreinternet.club/services/fcgi.sock;
|
||||
fastcgi_param REQUEST_METHOD $request_method;
|
||||
fastcgi_param REQUEST_URL $request_uri;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,50 +1,33 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en-ca" typeof="Organization">
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title property="http://schema.org/name">Libre Internet Club</title>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<meta charset="utf-8" />
|
||||
<html lang="en-ca" />
|
||||
<title>Libre Internet Club</title>
|
||||
<link rel="stylesheet" href="style.css" />
|
||||
<script type="module" src="editor.js" defer></script>
|
||||
<script type="module" src="tictactoe.js" defer></script>
|
||||
<script type="module" src="crawler.js" defer></script>
|
||||
<link rel="stylesheet" href="tictactoe.css">
|
||||
<link vocab="https://www.w3.org/ns/webmention#" rel="webmention" href="https://webmention.libreinternet.club">
|
||||
<link rel="stylesheet" href="tictactoe.css" />
|
||||
</head>
|
||||
<body vocab="https://schema.org/">
|
||||
<div id="banner">
|
||||
<img property="logo" src="banner.gif" alt="Libre Internet Club" />
|
||||
<img src="banner.gif" />
|
||||
</div>
|
||||
<span property="location">@ <span typeof="CollegeOrUniversity" property="name">University of Alberta</span></span>
|
||||
<div><a href="https://www.w3.org/TR/webmention">Webmention</a> us at <a vocab="https://www.w3.org/ns/webmention#" rel="webmention" href="https://webmention.libreinternet.club">https://webmention.libreinternet.club</a></div>
|
||||
@ University of Alberta
|
||||
<ul>
|
||||
<li><a href="https://discord.gg/U9MQTv952">Join Discord</a></li>
|
||||
<li><a href="https://matrix.to/#/#Libre_Internet:matrix.org">Matrix</a></li>
|
||||
<li vocab="https://joinmastodon.org/verification#"><a rel="me" href="https://mstdn.ca/@LibreInternetClubUofA">Federate with us on Mastodon</a></li>
|
||||
<li><a rel="me" href="https://mstdn.ca/@LibreInternetClubUofA">Federate with us on Mastodon</a></li>
|
||||
</ul>
|
||||
|
||||
<h3>Resources:</h3>
|
||||
<ul>
|
||||
<li><a href="./pages/linux.html">Linux</a></li>
|
||||
</ul>
|
||||
|
||||
<h2><marquee>Upcoming Events</marquee></h2>
|
||||
|
||||
<i>To be updated here....</i>
|
||||
|
||||
<div class="infoblock" property="event">
|
||||
<h2><i>Most Recent Event:</i></h2>
|
||||
<h1>Meetup 2! (Linux Install Session)</h1>
|
||||
<p>Saturday, June 13, 2026. 1pm. Meet up at <a href="https://www.openstreetmap.org/search?lat=53.525347&lon=-113.524075&zoom=19#map=19/53.525348/-113.524075">The Daily Grind in University Commons</a>. <s>Where we go after that is TBA, but we will update it on here.</s> (Forgot to do that, oops. Can confirm the event happened, though, and some new people showed up!)</p>
|
||||
<p>Bring your laptop, and we can test or install Linux on it! It is recommended to bring the following:</p>
|
||||
<ul>
|
||||
<li>A USB, to boot Linux from (at least 4MB)</li>
|
||||
<li>An SSD or USB (or something similar) to back up your laptop's data, if needed. It's better to have your laptop files backed up before the meetup.</li>
|
||||
<li>Your ONEcard (if you're a UofA student). Might be convenient in case some places are ONEcard access-only during the weekend. Regardless, do feel free to send a message to the club Mastodon account to let us know if you get lost.</li>
|
||||
</ul>
|
||||
<div class="infoblock">
|
||||
<h1>Meetup 2!</h1>
|
||||
<p>To enter your availability: <a href="https://crab.fit/meetup-2-336168" target="_blank">https://crab.fit/meetup-2-336168</a></p>
|
||||
<hr>
|
||||
</div>
|
||||
<div class="infoblock" property="event">
|
||||
<div class="infoblock">
|
||||
<h1>Libre Local Event</h1>
|
||||
<h2><i>Most Recent Event:</i></h2>
|
||||
<img src="events/libre_local_1.png" style="text-align: center; display: block;" />
|
||||
<p>Thursday, May 21, 2026 from 12-4pm @ UoA North Campus ED 262 (Education South)</p>
|
||||
<p>This event will involve discussions, presentations, and the potential for software demos. However, we also aim for the comfort of attendees. Introverted or shy attendees may feel more comfortable simply listening in or reading some of the provided event materials, and that's OK! Attendees may move in and out of the room at any time.
|
||||
|
|
@ -55,11 +38,11 @@
|
|||
<h2>
|
||||
Members
|
||||
</h2>
|
||||
<ul rel="member">
|
||||
<li typeof="Person" about="https://sjkillen.ca"><a href="https://sjkillen.ca">Spencer</a></li>
|
||||
<li about="Mimi" typeof="Person"><span property="name">Mimi</span></li>
|
||||
<li typeof="Person" >PT118's Site (Outdated, as of 2024) <a href="https://periodictable118.wixsite.com/mycv"> PT118 </a> </li>
|
||||
<li typeof="Person" >You! (Add yourself here using the site editor below!)</li>
|
||||
<ul>
|
||||
<li><a href="https://sjkillen.ca">Spencer</a></li>
|
||||
<li>Mimi</li>
|
||||
<li>PT118's Site (Outdated, as of 2024) <a href="https://periodictable118.wixsite.com/mycv"> PT118 </a> </li>
|
||||
<li>You! (Add yourself here using the site editor below!</li>
|
||||
</ul>
|
||||
<div class="infoblock">
|
||||
<h2>Edit Site!</h2>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue